diff --git a/lasp/device/lasp_cppdaq.h b/lasp/device/lasp_cppdaq.h index d0bc955..2264dad 100644 --- a/lasp/device/lasp_cppdaq.h +++ b/lasp/device/lasp_cppdaq.h @@ -173,9 +173,9 @@ class DeviceInfo { str << prefFramesPerBlockIndex << "\t"; str << availableInputRanges.size() << "\t"; - for(const double& fs: availableInputRanges) { + for(const double& ir: availableInputRanges) { // WARNING: THIS GOES COMPLETELY WRONG WHEN NAMES contain A TAB!!! - str << fs << "\t"; + str << ir << "\t"; } str << prefInputRangeIndex << "\t"; diff --git a/lasp/device/lasp_daqconfig.pyx b/lasp/device/lasp_daqconfig.pyx index 5ffea08..3c9c437 100644 --- a/lasp/device/lasp_daqconfig.pyx +++ b/lasp/device/lasp_daqconfig.pyx @@ -42,11 +42,11 @@ cdef class DaqConfigurations: output_config) @staticmethod - def loadConfigs(): + def loadAllConfigs(): """ - Returns a list of currently available configurations + Returns a dictionary of all configurations presets. The dictionary keys + are the names of the configurations - The first configuration is for input, the second for output """ with lasp_shelve() as sh: configs_json = sh.load('daqconfigs', {}) @@ -55,6 +55,16 @@ cdef class DaqConfigurations: configs[name] = DaqConfigurations.from_json(val) return configs + @staticmethod + def loadConfigs(name: str): + """ + Load a configuration preset, containing input config and output config + """ + + with lasp_shelve() as sh: + configs_json = sh.load('daqconfigs', {}) + return DaqConfigurations.from_json(configs_json[name]) + def saveConfigs(self, name): with lasp_shelve() as sh: configs_json = sh.load('daqconfigs', {}) @@ -62,7 +72,7 @@ cdef class DaqConfigurations: sh.store('daqconfigs', configs_json) @staticmethod - def deleteConfig(name): + def deleteConfigs(name): with lasp_shelve() as sh: configs_json = sh.load('daqconfigs', {}) del configs_json[name] diff --git a/scripts/lasp_record b/scripts/lasp_record index abf83dc..9d2edef 100755 --- a/scripts/lasp_record +++ b/scripts/lasp_record @@ -32,7 +32,7 @@ from lasp import AvType, StreamManager, Recording# configureLogging def main(args): try: streammgr = StreamManager() - configs = DaqConfigurations.loadConfigs() + configs = DaqConfigurations.loadAllConfigs() config_keys = [key for key in configs.keys()] for i, key in enumerate(config_keys): diff --git a/scripts/play_sine b/scripts/play_sine index 227ef37..ffda324 100755 --- a/scripts/play_sine +++ b/scripts/play_sine @@ -31,7 +31,7 @@ if __name__ == '__main__': multiprocessing.set_start_method('forkserver', force=True) logging.info(f'Playing frequency {args.freq} [Hz]') - configs = DaqConfigurations.loadConfigs() + configs = DaqConfigurations.loadAllConfigs() config_keys = [key for key in configs.keys()] for i, key in enumerate(config_keys):