Skip to content

Commit

Permalink
adding functionality for default config creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Diana Antic committed Nov 23, 2023
1 parent af551a9 commit 9df487f
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
36 changes: 36 additions & 0 deletions python/integrationtest/daq_conf_json_gen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import json

dict = {
"boot": {
"use_connectivity_service": True,
"start_connectivity_service": False,
"connectivity_service_host": "localhost",
"connectivity_service_port": 16032
},
"daq_common": {
"data_rate_slowdown_factor": 1
},
"detector": {
"clock_speed_hz": 62500000
},
"readout": {
"use_fake_cards": True,
"default_data_file": "asset://?label=WIBEth&subsystem=readout"
},
"trigger": {
"trigger_window_before_ticks": 1000,
"trigger_window_after_ticks": 1000
},
"hsi": {
"random_trigger_rate_hz": 1.0
}
}

# this function creates the daq config json needed to run the fddaqconf_gen
# command for creating the daq conf files
def create_daq_conf_json(filename):
with open(filename, 'w+') as fp:
json.dump(dict, fp, indent=4)
fp.flush()
fp.close()
return filename
30 changes: 30 additions & 0 deletions python/integrationtest/timing_conf_json_gen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import json

dict = {
"boot": {
"use_connectivity_service": True,
"start_connectivity_service": True,
"connectivity_service_host": "localhost",
"connectivity_service_port": 16032
},
"timing_hardware_interface": {
"host_thi": "localhost",
"firmware_type": "pdii"
# "timing_hw_connections_file": "connections.xml"
},
"timing_master_controller": {
"host_tmc": "localhost",
"master_device_name": "MST"
}
}


# this function creates the daq config json needed to run the fddaqconf_gen
# command for creating the daq conf files
def create_timing_conf_json(filename, connections_file):
with open(filename, 'w+') as fp:
dict["timing_hardware_interface"]["timing_hw_connections_file"] = connections_file
json.dump(dict, fp, indent=4)
fp.flush()
fp.close()
return filename

0 comments on commit 9df487f

Please sign in to comment.