2from .lasp_cpp
import DaqConfiguration, LASP_VERSION_MAJOR
5Author: J.A. de Jong - ASCEE
9Data Acquistiion (DAQ) device descriptors, and the DAQ devices themselves
12__all__ = [
"DaqConfigurations"]
15from .lasp_common
import Qty, SIQtys, lasp_shelve
16from .lasp_cpp
import DaqChannel, DaqConfiguration
21 DaqConfigurations stores a set containing an input configuration and an
28 input_config: DaqConfiguration,
29 output_config: DaqConfiguration,
32 Initialize set of DaqConfigurations.
35 duplex_mode: If true, the input configuration is used for output as
36 well. This makes only sense when the device is capable of having
37 simultaneous input / output.
38 input_config: The configuration settings for the input
39 output_config: The configuration settoutgs for the output
49 Get a list of all names of DaqConfigurations sets.
56 configs_ser = sh.load(f
"daqconfigs_v{LASP_VERSION_MAJOR}", {})
57 return list(configs_ser.keys())
62 Returns a dictionary of all configurations presets. The dictionary keys
63 are the names of the configurations
66 all configurations, as a dictionary
70 configs_ser = sh.load(f
"daqconfigs_v{LASP_VERSION_MAJOR}", {})
72 for name, val
in configs_ser.items():
73 configs[name] = DaqConfigurations.load(name)
79 Load a single configuration preset, containing input config and output config
82 name: The name of the configuration to load.
87 configs_str = sh.load(f
"daqconfigs_v{LASP_VERSION_MAJOR}", {})
88 config_str = configs_str[name]
90 duplex_mode = config_str[0]
98 Returns configurations presets in the raw form they are stored.
101 all configurations, raw
104 configs_raw = sh.load(f
"daqconfigs_v{LASP_VERSION_MAJOR}", {})
109 Save the current set of configurations to the shelve store.
112 name: The name of the configuration set.
120 configs_str = sh.load(f
"daqconfigs_v{LASP_VERSION_MAJOR}", {})
121 configs_str[name] = [self.
duplex_mode, input_str, output_str]
122 sh.store(f
"daqconfigs_v{LASP_VERSION_MAJOR}", configs_str)
127 Save configurations presets, using already formatted data
130 all configurations, raw data format in form they are stored
133 sh.store(f
"daqconfigs_v{LASP_VERSION_MAJOR}", configs_raw)
138 Delete a DaqConfigurations set from the store.
142 configs_str = sh.load(f
"daqconfigs_v{LASP_VERSION_MAJOR}", {})
143 del configs_str[name]
144 sh.store(f
"daqconfigs_v{LASP_VERSION_MAJOR}", configs_str)
static DaqConfiguration fromTOML(const std::string &toml)
Load in a DAQConfiguration from TOML.
DaqConfigurations stores a set containing an input configuration and an output configuration.
__init__(self, bool duplex_mode, DaqConfiguration input_config, DaqConfiguration output_config)
Initialize set of DaqConfigurations.
loadAll()
Returns a dictionary of all configurations presets.
save(self, str name)
Save the current set of configurations to the shelve store.
load(str name)
Load a single configuration preset, containing input config and output config.
saveRaw(configs_raw)
Save configurations presets, using already formatted data.
loadRaw()
Returns configurations presets in the raw form they are stored.
delete(str name)
Delete a DaqConfigurations set from the store.
getNames()
Get a list of all names of DaqConfigurations sets.