From 50425173eb4d274786f3c6cc943bcff6629d2fca Mon Sep 17 00:00:00 2001 From: jkl <sagitta1618@gmail.com> Date: Tue, 28 Nov 2023 21:06:17 +0100 Subject: [PATCH] Add default check for fw_in_csv an fw_in_zip --- ohmpi/ohmpi.py | 12 ++++++++++++ settings/default.json | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py index ad45153b..e67269a3 100644 --- a/ohmpi/ohmpi.py +++ b/ohmpi/ohmpi.py @@ -169,6 +169,12 @@ class OhmPi(object): cmd_id : str, optional Unique command identifier. """ + # check arguments + if fw_in_csv is None: + fw_in_csv = self.settings['fw_in_csv'] + if fw_in_zip is None: + fw_in_zip = self.settings['fw_in_zip'] + # check if directory 'data' exists ddir = os.path.split(filename)[0] if os.path.exists(ddir) is not True: @@ -651,6 +657,12 @@ class OhmPi(object): cmd_id : str, optional Unique command identifier. """ + # check arguments + if fw_in_csv is None: + fw_in_csv = self.settings['fw_in_csv'] + if fw_in_zip is None: + fw_in_zip = self.settings['fw_in_zip'] + # switch power on self._hw.pwr_state = 'on' self.status = 'running' diff --git a/settings/default.json b/settings/default.json index 8e0510fa..89f24ac1 100644 --- a/settings/default.json +++ b/settings/default.json @@ -7,6 +7,7 @@ "tx_volt": 5, "duty_cycle": 0.5, "strategy": "constant", - "fulldata": false, + "fw_in_csv": false, + "fw_in_zip": true, "export_path": "data/measurements.csv" } \ No newline at end of file -- GitLab