Skip to content

Commit

Permalink
Merge branch 'bpm_iocs_updates' of github.com:lnls-sirius/dev-package…
Browse files Browse the repository at this point in the history
…s into bpm_iocs_updates
  • Loading branch information
anacso17 committed Jul 23, 2024
2 parents fcdb863 + 337fd37 commit 8603000
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
14 changes: 5 additions & 9 deletions siriuspy/siriuspy/devices/fofb_acq.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def trigger(self, val):
@property
def status(self):
"""Acquisition status."""
return self['Status-Sts']
return self['Status-Mon']

@property
def count(self):
Expand All @@ -148,13 +148,13 @@ def cmd_ctrl(self, val):
def wait_acq_finish(self, timeout=10):
"""Wait Acquisition to finish."""
return self._wait(
'Status-Sts', _FOFBCtrlAcqConst.STATES_FINISHED,
'Status-Mon', _FOFBCtrlAcqConst.STATES_FINISHED,
timeout=timeout, comp=lambda x, y: x in y)

def wait_acq_start(self, timeout=10):
"""Wait Acquisition to start."""
return self._wait(
'Status-Sts', _FOFBCtrlAcqConst.STATES_STARTED,
'Status-Mon', _FOFBCtrlAcqConst.STATES_STARTED,
timeout=timeout, comp=lambda x, y: x in y)


Expand Down Expand Up @@ -1142,9 +1142,7 @@ def cmd_stop(self, wait=True, timeout=10) -> int:
ctl.cmd_ctrl(_FOFBCtrlAcqConst.TrigEvt.stop)

if wait:
_time.sleep(2)
return 0
# return self.wait_acquisition_finish(timeout=timeout)
return self.wait_acquisition_finish(timeout=timeout)
return 0

def wait_acquisition_finish(self, timeout=10) -> int:
Expand Down Expand Up @@ -1186,9 +1184,7 @@ def cmd_start(self, wait=True, timeout=10) -> int:
ctl.cmd_ctrl(_FOFBCtrlAcqConst.TrigEvt.start)

if wait:
_time.sleep(2)
return 0
# return self.wait_acquisition_start(timeout=timeout)
return self.wait_acquisition_start(timeout=timeout)
return 0

def wait_acquisition_start(self, timeout=10) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion siriuspy/siriuspy/sofb/bpms.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def connected(self):
self._offsetx,
self._offsety,
self._polyx,
self._polyx,
self._polyy,
self._arraya,
self._arrayb,
self._arrayc,
Expand Down
4 changes: 2 additions & 2 deletions siriuspy/siriuspy/sofb/csdev.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,10 +1007,10 @@ def get_sofb_database(self, prefix=""):
'LoopState-Sts': {
'type': 'enum', 'enums': self.LoopState._fields, 'value': 0},
'LoopFreq-SP': {
'type': 'float', 'value': self.BPMsFreq, 'unit': 'Hz',
'type': 'float', 'value': self.BPMsFreq / 10, 'unit': 'Hz',
'prec': 3, 'lolim': 1e-3, 'hilim': 60},
'LoopFreq-RB': {
'type': 'float', 'value': self.BPMsFreq, 'unit': 'Hz',
'type': 'float', 'value': self.BPMsFreq / 10, 'unit': 'Hz',
'prec': 3, 'lolim': 1e-3, 'hilim': 60},
'LoopPIDKpCH-SP': {
'type': 'float', 'value': 0.0, 'unit': 'frac', 'prec': 3,
Expand Down
4 changes: 2 additions & 2 deletions siriuspy/siriuspy/sofb/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(
self._tests = tests
self._orbit = self._correctors = self._matrix = None
self._loop_state = self._csorb.LoopState.Open
self._loop_freq = self._csorb.BPMsFreq
self._loop_freq = self._csorb.BPMsFreq / 10
self._loop_print_every_num_iter = 200
self._loop_max_orb_distortion = self._csorb.DEF_MAX_ORB_DISTORTION
zer = _np.zeros(self._csorb.nr_corrs, dtype=float)
Expand Down Expand Up @@ -274,7 +274,7 @@ def set_fofb_download_perc(self, value: float):
bool: Whether property was set.
"""
value = min(max(value / 300, 0), 1)
value = min(max(value / 100, 0), 1)
self._download_fofb_kicks_perc = value
self.run_callbacks("FOFBDownloadKicksPerc-RB", value * 100)
return True
Expand Down

0 comments on commit 8603000

Please sign in to comment.