65 adc : DaphneV2ControllerModule.ADCConf,
66 pga : DaphneV2ControllerModule.PGAConf,
67 lna : DaphneV2ControllerModule.LNAConf,
72 Here the configuration for an entire daq_application instance using DAQModules from daphnemodules is generated.
74 The map file, will profvide details to override whatever comes from the inputs
87 afe_block = ext_conf[
'afes']
88 ext_afe_gains = unpack(afe_block,
'v_gains')
89 ext_biases = unpack(afe_block,
'v_biases')
90 ext_adcs = unpack(afe_block,
'adcs')
91 ext_pgas = unpack(afe_block,
'pgas')
92 ext_lnas = unpack(afe_block,
'lnas')
94 for afe
in range(n_afe) :
95 afes.append( DaphneV2ControllerModule.AFE(
97 v_gain=afe_gain
if afe
not in ext_afe_gains
else ext_afe_gains[afe],
98 v_bias = 0
if afe
not in ext_biases
else ext_biases[afe],
99 adc = adc
if afe
not in ext_adcs
else to_adc(ext_adcs[afe]),
100 pga = pga
if afe
not in ext_pgas
else to_pga(ext_pgas[afe]),
101 lna = lna
if afe
not in ext_lnas
else to_lna(ext_lnas[afe])
109 channel_block = ext_conf[
'channels']
110 ext_gains = unpack(channel_block,
'gains')
111 ext_offsets = unpack(channel_block,
'offsets')
112 ext_trims = unpack(channel_block,
'trims')
114 for ch
in range(n_channels) :
117 gain = channel_gain
if ch
not in ext_gains
else ext_gains[ch]
118 offset = channel_offset
if ch
not in ext_offsets
else ext_offsets[ch]
120 conf = DaphneV2ControllerModule.ChannelConf(
123 trim = ext_trims[ch] )
125 conf = DaphneV2ControllerModule.ChannelConf(
129 channels.append( DaphneV2ControllerModule.Channel( id = ch, conf = conf ) )
131 conf = DaphneV2ControllerModule.Conf(
134 timeout_ms=timeout_ms,
138 self_trigger_threshold = 0
if not ext_conf
else ext_conf[
'self_trigger_threshold'],
139 full_stream_channels = []
if not ext_conf
else ext_conf[
'full_stream_channels']
142 modules = [DAQModule(name =
"controller",
143 plugin =
"DaphneV2ControllerModule",
147 mgraph = ModuleGraph(modules)
148 daphnemodules_app = App(modulegraph = mgraph, host = host, name = nickname)
150 return daphnemodules_app
get_daphnemodules_app(int slot, str ip, int timeout_ms, int biasctrl, int afe_gain, int channel_gain, int channel_offset, DaphneV2ControllerModule.ADCConf adc, DaphneV2ControllerModule.PGAConf pga, DaphneV2ControllerModule.LNAConf lna, details, nickname="daphne", host="localhost")