diff --git a/siriuspy/siriuspy/idff/csdev.py b/siriuspy/siriuspy/idff/csdev.py index d83148d33..592c54ef4 100644 --- a/siriuspy/siriuspy/idff/csdev.py +++ b/siriuspy/siriuspy/idff/csdev.py @@ -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() @@ -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.""" @@ -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 diff --git a/siriuspy/siriuspy/search/id_search.py b/siriuspy/siriuspy/search/id_search.py index 88a406df8..6350bd4cb 100644 --- a/siriuspy/siriuspy/search/id_search.py +++ b/siriuspy/siriuspy/search/id_search.py @@ -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.