Skip to content

Commit eab1160

Browse files
committed
[TASK] more custom pv names and customization added
1 parent 1d0e8d4 commit eab1160

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "dt4acc"
7-
version = "0.0.4"
7+
version = "0.0.1"
88
description = "digital twin for accelerators"
99
authors = [ "Waheedullah Sulaiman Khail", "Pierre Schnizer"]
1010
license = "GPL-3.0"

src/dt4acc/custom_epics/data/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Ringparameters:
1313

1414
special_pvs = {
1515
"bpm_pv": "MDIZ2T5G",
16-
"master_clock": "MCLKHX251C",
17-
"current": "MDIZ3T5G",
16+
"master_clock": "MCLKHGP",
17+
"current": "CUM1ZK3RP",
1818
}
1919

2020
@dataclass

src/dt4acc/custom_epics/ioc/pv_setup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def initialize_magnet_pvs(builder, magnet):
4040
LatticeElementPropertyID(element_name=magnet_name, property="main_strength")
4141
)
4242
builder.aOut(
43-
f"{magnet_name}:Cm:set",
43+
f"{magnet_name}:Cm:setCur",
4444
initial_value=magnet["k"] or 0
4545
# on_update=lambda val: handle_device_update(magnet_name, type_value, val),
4646
)
47-
rdbk = builder.aIn(f"{magnet_name}:Cm:rdbk", initial_value=val)
47+
rdbk = builder.aIn(f"{magnet_name}:Cm:rdCur", initial_value=val)
4848

4949
async def handle_magnet_update(device_id: str, property_id: str, value: float):
5050
r = await handle_device_update(
@@ -65,12 +65,12 @@ async def handle_magnet_update(device_id: str, property_id: str, value: float):
6565
),
6666
)
6767
builder.aOut(
68-
f"{magnet_name}:x:set",
68+
f"{magnet_name}:x:setCur",
6969
initial_value=0.0,
7070
on_update=lambda val: handle_device_update(magnet_name, "x", val),
7171
)
7272
builder.aOut(
73-
f"{magnet_name}:y:set",
73+
f"{magnet_name}:y:setCur",
7474
initial_value=0.0,
7575
on_update=lambda val: handle_device_update(magnet_name, "y", val),
7676
)
@@ -112,7 +112,7 @@ def add_pc_pvs(builder, pc_name, prefix):
112112
DevicePropertyID(device_name=pc_name, property="set_current")
113113
)
114114
start_val = np.asarray(vals).mean()
115-
rdbk = builder.aOut(f"{pc_name}:rdbk", initial_value=start_val, PREC=2)
115+
rdbk = builder.aOut(f"{pc_name}:rdCur", initial_value=start_val, PREC=2)
116116

117117
async def handle_pc_update(device_id: str, property_id: str, value: float):
118118
logger.debug("%s:%s updating setpoint val=%s", device_id, property_id, value)
@@ -124,7 +124,7 @@ async def handle_pc_update(device_id: str, property_id: str, value: float):
124124
return r
125125

126126
builder.aOut(
127-
f"{pc_name}:set",
127+
f"{pc_name}:setCur",
128128
initial_value=start_val,
129129
on_update=lambda val: handle_pc_update(pc_name, "set_current", val),
130130
PREC=2,
@@ -186,7 +186,7 @@ def initialize_master_clock_pvs(builder):
186186
)
187187
start_val = np.asarray(vals).mean()
188188
builder.aOut(
189-
f"{special_pvs['master_clock']}:freq",
189+
f"{special_pvs['master_clock']}:rdFrq",
190190
initial_value=start_val,
191191
always_update=True,
192192
EGU="kHz",
@@ -212,7 +212,7 @@ def initialize_other_pvs(builder, prefix):
212212
"""
213213
builder.aOut(f"dummy:x", initial_value=0)
214214
builder.aOut(f"dummy:y", initial_value=0)
215-
builder.aOut(f"{special_pvs['current']}:current", initial_value=0)
215+
builder.aOut(f"{special_pvs['current']}:rdCur", initial_value=0)
216216

217217

218218
def initialize_bpm_pvs(builder):
@@ -229,12 +229,12 @@ def initialize_orbit_object_pvs(builder):
229229
n_bpms = 128
230230
tmp = np.ravel(np.empty([n_bpms, 2], float))
231231
tmp.fill(np.nan)
232-
builder.WaveformOut("ORBITCC:rdPos", initial_value=tmp, length=len(tmp))
232+
builder.WaveformOut("ORBITCCP:rdPos", initial_value=tmp, length=len(tmp))
233233
tmp = np.ravel(np.empty([n_bpms, 4], float))
234234
tmp.fill(np.nan)
235-
builder.WaveformOut("ORBITCC:rdButtons", initial_value=tmp, length=len(tmp))
236-
builder.WaveformOut("ORBITCC:rdBpmNames", initial_value=[""], length=n_bpms)
237-
builder.longOut("ORBITCC:count", initial_value=0)
235+
builder.WaveformOut("ORBITCCP:rdButtons", initial_value=tmp, length=len(tmp))
236+
builder.WaveformOut("ORBITCCP:rdBpmNames", initial_value=[""], length=n_bpms)
237+
builder.longOut("ORBITCCP:count", initial_value=0)
238238

239239

240240
def initialize_cavity_pvs(builder):

src/dt4acc/custom_epics/views/calculation_result_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async def push_bpms(self, orbit_data):
150150

151151
async def push_orbit_object(self, bpm_data: pd.DataFrame):
152152
try:
153-
prefix = f"{self.prefix}:ORBITCC"
153+
prefix = f"{self.prefix}:ORBITCCP"
154154
# Todo: check that the dimensions are properly made
155155
pos = np.array(bpm_data.loc[:, ["x", "y"]]).ravel()
156156
await ctx.put(f"{prefix}:rdPos", pos)

0 commit comments

Comments
 (0)