Skip to content

Commit

Permalink
Merge pull request #757 from lnls-sirius/sofb-add-methods
Browse files Browse the repository at this point in the history
Add SOFB methods to abort/stop/start triggered acquisitions
  • Loading branch information
xresende authored Nov 8, 2021
2 parents 93fa28b + 4a4d088 commit abbf274
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
10 changes: 5 additions & 5 deletions siriuspy/siriuspy/devices/pwrsupply.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ class DEVICES:
BO_EJE_KCKR = 'BO-48D:PU-EjeKckr'
TS_EJE_SEPTF = 'TS-01:PU-EjeSeptF'
TS_EJE_SEPTG = 'TS-01:PU-EjeSeptG'
TS_INJ_SPETG_1 = 'TS-04:PU-InjSeptG-1'
TS_INJ_SPETG_2 = 'TS-04:PU-InjSeptG-2'
TS_INJ_SPETF = 'TS-04:PU-InjSeptF'
TS_INJ_SEPTG_1 = 'TS-04:PU-InjSeptG-1'
TS_INJ_SEPTG_2 = 'TS-04:PU-InjSeptG-2'
TS_INJ_SEPTF = 'TS-04:PU-InjSeptF'
SI_INJ_DPKCKR = 'SI-01SA:PU-InjDpKckr'
SI_INJ_NLKCKR = 'SI-01SA:PU-InjNLKckr'
SI_PING_H = 'SI-01SA:PU-PingH'
Expand All @@ -443,8 +443,8 @@ class DEVICES:
TB_INJ_SEPT,
BO_INJ_KCKR, BO_EJE_KCKR,
TS_EJE_SEPTF, TS_EJE_SEPTG,
TS_INJ_SPETG_1, TS_INJ_SPETG_2,
TS_INJ_SPETF,
TS_INJ_SEPTG_1, TS_INJ_SEPTG_2,
TS_INJ_SEPTF,
SI_INJ_DPKCKR, SI_INJ_NLKCKR,
SI_PING_H, SI_PING_V,
)
Expand Down
43 changes: 42 additions & 1 deletion siriuspy/siriuspy/devices/sofb.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class TLSOFB(_Device):
'MeasRespMatKickCV-SP', 'MeasRespMatKickCV-RB',
'MeasRespMatWait-SP', 'MeasRespMatWait-RB',
'NrSingValues-Mon', 'MinSingValue-SP', 'MinSingValue-RB',
'TrigAcqCtrl-Sel', 'TrigAcqCtrl-Sts', 'TrigAcqConfig-Cmd',
)

_default_timeout = 10 # [s]
Expand Down Expand Up @@ -324,6 +325,11 @@ def singval_min(self, value):
"""."""
self['MinSingValue-SP'] = value

@property
def trigacq(self):
"""."""
return self['TrigAcqCtrl-Sts']

@property
def trigsamplepre(self):
"""."""
Expand Down Expand Up @@ -406,7 +412,42 @@ def cmd_change_opmode_to_sloworb(self, timeout=10):
ret = self._wait('SOFBMode-Sts', mode, timeout=timeout)
if not ret:
return False
_time.sleep(1) # Status PV updates at 2Hz
_time.sleep(0.6) # Status PV updates at 2Hz
return self.wait_orb_status_ok(timeout=timeout)

def cmd_trigacq_start(self, timeout=10):
"""."""
self['TrigAcqCtrl-Sel'] = 'Start'
ret = self._wait(
'TrigAcqCtrl-Sts', self.data.TrigAcqCtrl.Start, timeout=timeout)
if not ret:
return False
_time.sleep(0.6) # Status PV updates at 2Hz
return self.wait_orb_status_ok(timeout=timeout)

def cmd_trigacq_stop(self, timeout=10):
"""."""
self['TrigAcqCtrl-Sel'] = 'Stop'
ret = self._wait(
'TrigAcqCtrl-Sts', self.data.TrigAcqCtrl.Stop, timeout=timeout)
if not ret:
return False
_time.sleep(0.6) # Status PV updates at 2Hz
return self.wait_orb_status_ok(timeout=timeout)

def cmd_trigacq_abort(self, timeout=10):
"""."""
self['TrigAcqCtrl-Sel'] = 'Abort'
ret = self._wait(
'TrigAcqCtrl-Sts', self.data.TrigAcqCtrl.Abort, timeout=timeout)
if not ret:
return False
_time.sleep(0.6) # Status PV updates at 2Hz
return self.wait_orb_status_ok(timeout=timeout)

def cmd_trigacq_config(self, timeout=10):
"""."""
self['TrigAcqConfig-Cmd'] = 1
return self.wait_orb_status_ok(timeout=timeout)

@property
Expand Down

0 comments on commit abbf274

Please sign in to comment.