Skip to content

Commit

Permalink
Merge branch 'master' into PR-update-version
Browse files Browse the repository at this point in the history
  • Loading branch information
xresende committed Feb 18, 2020
2 parents 392feb8 + d8c69c3 commit 73a763a
Showing 1 changed file with 32 additions and 22 deletions.
54 changes: 32 additions & 22 deletions siriuspy/siriuspy/csdevice/orbitcorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ class ConstRings(ConstTLines):

SOFBMode = _cutil.Const.register('SOFBMode', _et.ORB_MODE_RINGS)
StsLblsCorr = _cutil.Const.register('StsLblsCorr', _et.STS_LBLS_CORR_RINGS)
CorrSync = _cutil.Const.register('CorrSync', _et.OFF_ON)


class ConstSI(ConstRings):
"""Const class defining rings orbitcorr constants."""

ApplyDelta = _cutil.Const.register('ApplyDelta', _et.APPLY_CORR_SI)
StsLblsCorr = _cutil.Const.register('StsLblsCorr', _et.STS_LBLS_CORR_SI)
CorrSync = _cutil.Const.register('CorrSync', _et.OFF_ON)

# TODO: use correct name for the RF generator
RF_GEN_NAME = 'AS-Glob:RF-Gen'
Expand Down Expand Up @@ -147,7 +147,7 @@ def __init__(self, acc):
self.NR_CORRS = self.NR_CHCV + 1 if acc == 'SI' else self.NR_CHCV

self.TRIGGER_ACQ_NAME = self.acc + '-Fam:TI-BPM'
if self.isring:
if self.acc == 'SI':
self.TRIGGER_COR_NAME = self.acc + '-Glob:TI-Mags-Corrs'
self.EVT_COR_NAME = 'Orb' + self.acc

Expand Down Expand Up @@ -243,6 +243,18 @@ def get_sofb_database(self, prefix=''):
'MaxDeltaKickCV-RB': {
'type': 'float', 'value': 300, 'prec': 3, 'unit': 'urad',
'lolim': 0, 'hilim': 10000},
'DeltaKickCH-SP': {
'type': 'float', 'count': self.NR_CH, 'value': self.NR_CH*[0],
'unit': 'urad'},
'DeltaKickCH-RB': {
'type': 'float', 'count': self.NR_CH, 'value': self.NR_CH*[0],
'unit': 'urad'},
'DeltaKickCV-SP': {
'type': 'float', 'count': self.NR_CV, 'value': self.NR_CV*[0],
'unit': 'urad'},
'DeltaKickCV-RB': {
'type': 'float', 'count': self.NR_CV, 'value': self.NR_CV*[0],
'unit': 'urad'},
'ApplyDelta-Cmd': {
'type': 'enum', 'enums': self.ApplyDelta._fields, 'value': 0,
'unit': 'Apply last calculated kicks.'},
Expand Down Expand Up @@ -551,10 +563,6 @@ class SOFBRings(SOFBTLines, ConstRings):
def __init__(self, acc):
"""Init method."""
SOFBTLines.__init__(self, acc)
evts = _HLTISearch.get_hl_trigger_allowed_evts(self.TRIGGER_COR_NAME)
vals = _cstiming.get_hl_trigger_database(self.TRIGGER_COR_NAME)
vals = tuple([vals['Src-Sel']['enums'].index(evt) for evt in evts])
self.CorrExtEvtSrc = _get_namedtuple('CorrExtEvtSrc', evts, vals)
self.C0 = 496.8 # in meter
self.T0 = self.C0 / 299792458 # in seconds

Expand All @@ -574,20 +582,6 @@ def get_sofb_database(self, prefix=''):
db.update(self._add_prefix(db_ring, prefix))
return db

def get_corrs_database(self, prefix=''):
"""Return OpticsCorr-Chrom Soft IOC database."""
db_ring = {
'CorrSync-Sel': {
'type': 'enum', 'enums': self.CorrSync._fields,
'value': self.CorrSync.Off},
'CorrSync-Sts': {
'type': 'enum', 'enums': self.CorrSync._fields,
'value': self.CorrSync.Off},
}
db = super().get_corrs_database(prefix=prefix)
db.update(self._add_prefix(db_ring, prefix))
return db

def get_orbit_database(self, prefix=''):
"""Return Orbit database."""
nbpm = self.NR_BPMS
Expand Down Expand Up @@ -663,6 +657,10 @@ class SOFBSI(SOFBRings, ConstSI):
def __init__(self, acc):
"""Init method."""
SOFBRings.__init__(self, acc)
evts = _HLTISearch.get_hl_trigger_allowed_evts(self.TRIGGER_COR_NAME)
vals = _cstiming.get_hl_trigger_database(self.TRIGGER_COR_NAME)
vals = tuple([vals['Src-Sel']['enums'].index(evt) for evt in evts])
self.CorrExtEvtSrc = _get_namedtuple('CorrExtEvtSrc', evts, vals)
self.C0 = 518.396 # in meter
self.T0 = self.C0 / 299792458 # in seconds

Expand Down Expand Up @@ -692,15 +690,27 @@ def get_sofb_database(self, prefix=''):
'MaxDeltaKickRF-RB': {
'type': 'float', 'value': 500, 'prec': 2, 'unit': 'Hz',
'lolim': 0, 'hilim': 10000},
'DeltaKickRF-SP': {
'type': 'float', 'value': 0, 'prec': 2, 'unit': 'Hz'},
'DeltaKickRF-RB': {
'type': 'float', 'value': 0, 'prec': 2, 'unit': 'Hz'},
}
db = super().get_sofb_database(prefix=prefix)
db.update(self._add_prefix(db_ring, prefix))
return db

def get_corrs_database(self, prefix=''):
"""Return OpticsCorr-Chrom Soft IOC database."""
db_ring = {'KickRF-Mon': {
'type': 'float', 'value': 1, 'unit': 'Hz', 'prec': 2}}
db_ring = {
'CorrSync-Sel': {
'type': 'enum', 'enums': self.CorrSync._fields,
'value': self.CorrSync.Off},
'CorrSync-Sts': {
'type': 'enum', 'enums': self.CorrSync._fields,
'value': self.CorrSync.Off},
'KickRF-Mon': {
'type': 'float', 'value': 1, 'unit': 'Hz', 'prec': 2},
}
db = super().get_corrs_database(prefix=prefix)
db.update(self._add_prefix(db_ring, prefix))
return db
Expand Down

0 comments on commit 73a763a

Please sign in to comment.