Skip to content
Snippets Groups Projects
Commit d687c114 authored by Sebastian's avatar Sebastian
Browse files

changed get_tm_id

added get_data_pool_items
parent d287c0ea
No related branches found
No related tags found
No related merge requests found
...@@ -2688,10 +2688,11 @@ def get_tc_calibration_and_parameters(ccf_descr=None): ...@@ -2688,10 +2688,11 @@ def get_tc_calibration_and_parameters(ccf_descr=None):
return calibrations_dict return calibrations_dict
def get_tm_id(ccf_descr=None): def get_tm_id(pcf_descr=None):
if ccf_descr is None: if pcf_descr is None:
tms = scoped_session_idb.execute('SELECT pid_type, pid_stype, pid_apid, pid_pi1_val, pid_descr, pid_tpsd, ' tms = scoped_session_idb.execute('SELECT pid_type, pid_stype, pid_apid, pid_pi1_val, pid_descr, pid_tpsd, '
'pid_spid, pcf_name, pcf_descr, pcf_curtx, txp_from, txp_altxt, plf_offby ' 'pid_spid, pcf_name, pcf_descr, pcf_curtx, txp_from, txp_altxt, plf_offby,'
'pcf_ptc, pcf_pfc '
'FROM pid ' 'FROM pid '
'LEFT JOIN plf ' 'LEFT JOIN plf '
'ON pid_spid = plf_spid AND pid_tpsd = -1 ' 'ON pid_spid = plf_spid AND pid_tpsd = -1 '
...@@ -2706,7 +2707,8 @@ def get_tm_id(ccf_descr=None): ...@@ -2706,7 +2707,8 @@ def get_tm_id(ccf_descr=None):
else: else:
tms = scoped_session_idb.execute('SELECT pid_type, pid_stype, pid_apid, pid_pi1_val, pid_descr , pid_tpsd, ' tms = scoped_session_idb.execute('SELECT pid_type, pid_stype, pid_apid, pid_pi1_val, pid_descr , pid_tpsd, '
'pid_spid, pcf_name, pcf_descr, pcf_curtx, txp_from, txp_altxt, plf_offby ' 'pid_spid, pcf_name, pcf_descr, pcf_curtx, txp_from, txp_altxt, plf_offby,'
'pcf_ptc, pcf_pfc '
'FROM pid ' 'FROM pid '
'LEFT JOIN plf ' 'LEFT JOIN plf '
'ON pid_spid = plf_spid AND pid_tpsd = -1 ' 'ON pid_spid = plf_spid AND pid_tpsd = -1 '
...@@ -2730,6 +2732,25 @@ def get_tm_id(ccf_descr=None): ...@@ -2730,6 +2732,25 @@ def get_tm_id(ccf_descr=None):
return tms_dict return tms_dict
def get_data_pool_items(pcf_descr = None):
if pcf_descr is None:
data_pool = scoped_session_idb.execute('SELECT pcf_pid, pcf_descr, pcf_ptc, pcf_pfc '
'FROM pcf').fetchall()
else:
data_pool = scoped_session_idb.execute('SELECT pcf_pid, pcf_descr, pcf_ptc, pcf_pfc '
'FROM pcf'.format(ccf_descr)).fetchall()
scoped_session_idb.close()
data_pool_dict = {}
for row in data_pool:
data_pool_dict.setdefault(row[0:4], []).append(row[5:])
return data_pool_dict
def make_tc_template(ccf_descr, pool_name='LIVE', preamble='cfl.Tcsend_DB', options='', comment=True, add_parcfg=False): def make_tc_template(ccf_descr, pool_name='LIVE', preamble='cfl.Tcsend_DB', options='', comment=True, add_parcfg=False):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment