mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-04 00:50:42 +02:00
updated compare script
This commit is contained in:
parent
b879a377ba
commit
c94dfde17c
@ -1,103 +0,0 @@
|
||||
import subprocess
|
||||
import locale
|
||||
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
||||
cmd = out.stdout.splitlines()
|
||||
cmd.pop(0)
|
||||
|
||||
from slsdet import Detector, Eiger, Ctb
|
||||
|
||||
pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
|
||||
|
||||
#Add commands that we should not expect as direct commands in python
|
||||
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
||||
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
|
||||
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',
|
||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||
|
||||
]
|
||||
|
||||
|
||||
# dacs are in general not included in the python commands and we expect to
|
||||
# set them from the specialized class or using an enum
|
||||
dacs = [
|
||||
'adcvpp',
|
||||
'vicin',
|
||||
'vcassh',
|
||||
'vcal_n',
|
||||
'vcal_p'
|
||||
'vipre_out',
|
||||
'vipre_cds',
|
||||
'vdd_prot',
|
||||
'vcmp_rl',
|
||||
'vcmp_rr',
|
||||
'vcal', 'vcas',
|
||||
'vipre',
|
||||
'vin_com',
|
||||
'vin_cm',
|
||||
'vrshaper',
|
||||
'vrshaper_n',
|
||||
'vrpreamp',
|
||||
'vishaper',
|
||||
'vipre_out',
|
||||
'vcom_adc1',
|
||||
'vcom_adc2',
|
||||
'vcom_cds',
|
||||
'vdcsh',
|
||||
'v_chip',
|
||||
'vb_comp',
|
||||
'vb_comp_adc',
|
||||
'vb_comp_fe',
|
||||
'vb_cs',
|
||||
'vb_ds',
|
||||
'vb_opa_1st',
|
||||
'vb_opa_fd',
|
||||
'vb_pixbuf',
|
||||
'vb_sda',
|
||||
'vbp_colbuf',
|
||||
'vcal_p',
|
||||
'vcasc_out',
|
||||
'vcasc_sfp',
|
||||
'vcascn_pb',
|
||||
'vcascp_pb',
|
||||
'vchip_comp_adc',
|
||||
'vchip_comp_fe',
|
||||
'vchip_cs',
|
||||
'vchip_opa_1st',
|
||||
'vchip_opa_fd',
|
||||
'vchip_ref_comp_fe',
|
||||
|
||||
]
|
||||
|
||||
intentionally_missing = [
|
||||
'activate', #use getActive and getRxPadDeactivatedMode syntax is not a good fit for python
|
||||
'temp_10ge', #temperatures already available from enum or specialized class
|
||||
'temp_adc',
|
||||
'temp_dcdc',
|
||||
'temp_fpga',
|
||||
'temp_fpgaext',
|
||||
'temp_fpgafl',
|
||||
'temp_fpgafr',
|
||||
'temp_slowadc',
|
||||
'temp_sodl',
|
||||
'temp_sodr',
|
||||
'trigger', #use sendSoftwareTrigger
|
||||
'update', #use updateServerAndFirmare
|
||||
'udp_validate', #use validateUdpConfiguration
|
||||
'udp_reconfigure', #use reconfigureUdpDestination
|
||||
'emin', #use rx_jsonpara
|
||||
'pulse', # use pulseChip pulsePixel pulsePixelNmove
|
||||
'pulsechip',
|
||||
'pulsenmove',
|
||||
]
|
||||
|
||||
pycmd += intentionally_missing
|
||||
pycmd += dacs
|
||||
missing = []
|
||||
for c in cmd:
|
||||
if c not in pycmd:
|
||||
print(c)
|
||||
missing.append(c)
|
||||
|
||||
print(f'Missing: {len(missing)} commands')
|
133
python/scripts/compare_with_commandline.py
Normal file
133
python/scripts/compare_with_commandline.py
Normal file
@ -0,0 +1,133 @@
|
||||
import subprocess
|
||||
import locale
|
||||
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
||||
cmd = out.stdout.splitlines()
|
||||
cmd.pop(0)
|
||||
|
||||
from slsdet import Detector
|
||||
|
||||
pycmd = dir(Detector)
|
||||
|
||||
#Add commands that we should not expect as direct commands in python
|
||||
|
||||
|
||||
# dacs are in general not included in the python commands and we expect to
|
||||
# set them from the specialized class or using an enum
|
||||
dacs = [
|
||||
'adcvpp',
|
||||
'iodelay',
|
||||
'list',
|
||||
'rxb_lb',
|
||||
'rxb_rb',
|
||||
'v_chip',
|
||||
'vb_comp',
|
||||
'vb_comp_adc',
|
||||
'vb_comp_fe',
|
||||
'vb_cs',
|
||||
'vb_ds',
|
||||
'vb_opa_1st',
|
||||
'vb_opa_fd',
|
||||
'vb_pixbuf',
|
||||
'vb_sda',
|
||||
'vbp_colbuf',
|
||||
'vcal',
|
||||
'vcal_n',
|
||||
'vcal_p',
|
||||
'vipre_out',
|
||||
'vcas',
|
||||
'vcasc_out',
|
||||
'vcasc_sfp',
|
||||
'vcascn_pb',
|
||||
'vcascp_pb',
|
||||
'vcassh',
|
||||
'vchip_comp_adc',
|
||||
'vchip_comp_fe',
|
||||
'vchip_cs',
|
||||
'vchip_opa_1st',
|
||||
'vchip_opa_fd',
|
||||
'vchip_ref_comp_fe',
|
||||
'vcmp_ll',
|
||||
'vcmp_lr',
|
||||
'vcmp_rl',
|
||||
'vcmp_rr',
|
||||
'vcn',
|
||||
'vcom_adc1',
|
||||
'vcom_adc2',
|
||||
'vcom_cds',
|
||||
'vcp',
|
||||
'vdcsh',
|
||||
'vdd_prot',
|
||||
'vicin',
|
||||
'vin_cm',
|
||||
'vin_com',
|
||||
'vipre',
|
||||
'vipre_cds',
|
||||
'vipre_out',
|
||||
'vishaper',
|
||||
'vout_cm',
|
||||
'vref_cds',
|
||||
'vref_comp',
|
||||
'vref_comp_fe',
|
||||
'vref_ds',
|
||||
'vref_h_adc',
|
||||
'vref_l_adc',
|
||||
'vref_prech',
|
||||
'vref_rstore',
|
||||
'vrpreamp',
|
||||
'vrshaper',
|
||||
'vrshaper_n',
|
||||
'vsvn',
|
||||
'vsvp',
|
||||
'vtgstv',
|
||||
'vth1',
|
||||
'vth2',
|
||||
'vth3',
|
||||
'vtrim'
|
||||
]
|
||||
|
||||
intentionally_missing = [
|
||||
'activate', #use getActive and getRxPadDeactivatedMode syntax is not a good fit for python
|
||||
'temp_10ge', #temperatures already available from enum or specialized class
|
||||
'temp_adc',
|
||||
'temp_dcdc',
|
||||
'temp_fpga',
|
||||
'temp_fpgaext',
|
||||
'temp_fpgafl',
|
||||
'temp_fpgafr',
|
||||
'temp_slowadc',
|
||||
'temp_sodl',
|
||||
'temp_sodr',
|
||||
'trigger', #use sendSoftwareTrigger
|
||||
'update', #use updateServerAndFirmare
|
||||
'udp_validate', #use validateUdpConfiguration
|
||||
'udp_reconfigure', #use reconfigureUdpDestination
|
||||
'pulse', # use pulseChip pulsePixel pulsePixelNmove
|
||||
'pulsechip',
|
||||
'pulsenmove',
|
||||
]
|
||||
|
||||
pycmd += intentionally_missing
|
||||
pycmd += dacs
|
||||
missing = []
|
||||
for c in cmd:
|
||||
if c not in pycmd:
|
||||
print(c)
|
||||
missing.append(c)
|
||||
|
||||
print(f'\nMissing: {len(missing)} commands')
|
||||
print(f'Excluded: {len(dacs)} dacs')
|
||||
print(f'Excluded: {len(intentionally_missing)} other commands')
|
||||
|
||||
|
||||
not_in_cmd = []
|
||||
for c in pycmd:
|
||||
if c.islower() and not c.startswith('_'):
|
||||
if c not in cmd:
|
||||
not_in_cmd.append(c)
|
||||
print(f'\nCommands in Python and NOT in command line: {len(not_in_cmd)}')
|
||||
for c in not_in_cmd:
|
||||
print(c)
|
||||
|
||||
|
||||
|
||||
# print(',\n'.join([f'\'{d}\'' for d in sorted(dacs)]))
|
Loading…
x
Reference in New Issue
Block a user