Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions simulation_server/beamdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def __init__(
self.virtual_accelerator = virtual_accelerator

self.server = server

self.omitted = []

# get list of pvs that should be updated every time we write to a PV
self.measurement_pvs = self.get_measurement_pvs()
Expand Down Expand Up @@ -307,7 +307,14 @@ def update_pvs(self, pv_list):
print("PVs updated.")

def read(self, reason):
value = self.virtual_accelerator.get_pvs([reason])[reason]
try:
value = self.virtual_accelerator.get_pvs([reason])[reason]
except AttributeError as e:
if reason not in self.omitted:
self.omitted.append(reason)
print(f"Error getting param for {reason}: {e}, do not use {reason}")
return 0
Comment on lines +310 to +316
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would error out when caget-ing SOMETHING.DRVL. It might be worthwhile to ignore PVs with a .XYZ suffix.


self.server.set_pv(reason, value)
try:
self.setParam(reason, value)
Expand Down