Skip to content
Draft
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions siriuspy/siriuspy/idff/csdev.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self, idname,
enbl_qncorrs=False, enbl_cccorrs=False):
"""Init."""
self.idname = _PVName(idname)
self.pols = _IDSearch.conv_idname_2_polarizations(idname)
self.idffname = 'SI-' + self.idname.sub + ':AP-IDFF'
cname = '_'.join([self.idname.sec, self.idname.sub, self.idname.dev])
self.configname = cname.lower()
Expand All @@ -64,6 +65,13 @@ def __init__(self, idname,
self.enbl_qncorrs = enbl_qncorrs and len(qnnames) > 0
ccnames = _IDSearch.conv_idname_2_idff_ccnames(idname)
self.enbl_cccorrs = enbl_cccorrs and len(ccnames) > 0
self.nr_corrs = 0
self.nr_corrs += len(chnames) if self.autosave_fname else 0
self.nr_corrs += len(cvnames) if self.autosave_fname else 0
self.nr_corrs += len(qsnames) if self.autosave_fname else 0
self.nr_corrs += len(lcnames) if self.autosave_fname else 0
self.nr_corrs += len(qnnames) if self.autosave_fname else 0
self.nr_corrs += len(ccnames) if self.autosave_fname else 0

def get_propty_database(self):
"""Return property database."""
Expand Down Expand Up @@ -223,5 +231,22 @@ def get_propty_database(self):
'type': 'float', 'value': 0,
'unit': 'A', 'prec': self.DEFAULT_CORR_PREC},
})
tablesize = _IDSearch.IDFF_TABLE_MAX_SIZE
tabledict = {
'type': 'float', 'count': tablesize,
'value': [0] * tablesize, 'unit': 'A',
'prec': self.DEFAULT_CORR_PREC,
}
if len(self.pols) < 2:
dbase.update({
'Table-SP': tabledict.copy(),
'Table-RB': tabledict.copy(),
})
else:
for idx in range(len(self.pols)):
dbase.update({
f'Table{idx+1}-SP': tabledict.copy(),
f'Table{idx+1}-RB': tabledict.copy(),
})
dbase = _csdev.add_pvslist_cte(dbase)
return dbase
6 changes: 5 additions & 1 deletion siriuspy/siriuspy/search/id_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ class IDSearch:
(POL_UNDEF_STR, None),
]

# define IDFF correctors labels aand ordering.
# [float] maximum size of IDFF table data in memory.
# each table is for one polarization state and 4 correctors
IDFF_TABLE_MAX_SIZE = 150_000

# define IDFF correctors labels and ordering.
# NOTE: the ordering between corr types in IDFF_CorrTypes and of
# correctors of a given corrector type in IDFF_CorrLabels has to be
# compatible with the ordering of correctors within rack cabinets.
Expand Down
Loading