From 3ffedeedfa28b8af5767cb065cc2c69138c91f22 Mon Sep 17 00:00:00 2001
From: jkl <sagitta1618@gmail.com>
Date: Tue, 28 Nov 2023 15:51:13 +0100
Subject: [PATCH] Add settings/default.json

---
 ohmpi/ohmpi.py        | 16 ++--------------
 settings/default.json | 12 ++++++++++++
 2 files changed, 14 insertions(+), 14 deletions(-)
 create mode 100644 settings/default.json

diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py
index 7420e6ab..f98013cc 100644
--- a/ohmpi/ohmpi.py
+++ b/ohmpi/ohmpi.py
@@ -175,8 +175,7 @@ class OhmPi(object):
 
         last_measurement = deepcopy(last_measurement)
         
-        # TODO need to make all the full data of the same size (pre-populate
-        # readings with NaN in hardware_system.OhmPiHardware.read_values())
+        # save full waveform data in a long .csv file
         if fw_in_zip:
             fw_filename = filename.replace('.csv', '_fw.csv')
             if not os.path.exists(fw_filename):  # new file, write headers first
@@ -191,10 +190,9 @@ class OhmPi(object):
                 df['M'] = last_measurement['M']
                 df['N'] = last_measurement['N']
                 df.to_csv(f, index=False, header=False)
-            print('--------', fw_filename)
 
         if fw_in_csv:
-            d = last_measurement['fulldata']
+            d = last_measurement['full_waveform']
             n = d.shape[0]
             if n > 1:
                 idic = dict(zip(['i' + str(i) for i in range(n)], d[:, 0]))
@@ -398,16 +396,6 @@ class OhmPi(object):
         """
         self.exec_logger.debug('Getting hardware config')
         self.id = OHMPI_CONFIG['id']  # ID of the OhmPi
-        # self.r_shunt = OHMPI_CONFIG['R_shunt']  # reference resistance value in ohm
-        # self.Imax = OHMPI_CONFIG['Imax']  # maximum current
-        # self.exec_logger.debug(f'The maximum current cannot be higher than {self.Imax} mA')
-        # self.coef_p2 = OHMPI_CONFIG['coef_p2']  # slope for current conversion for ads.P2, measurement in V/V
-        # self.nb_samples = OHMPI_CONFIG['nb_samples']  # number of samples measured for each stack
-        # self.version = OHMPI_CONFIG['version']  # hardware version
-        # self.max_elec = OHMPI_CONFIG['max_elec']  # maximum number of electrodes
-        # self.board_addresses = OHMPI_CONFIG['board_addresses']
-        # self.board_version = OHMPI_CONFIG['board_version']
-        # self.mcp_board_address = OHMPI_CONFIG['mcp_board_address']
         self.exec_logger.debug(f'OHMPI_CONFIG = {str(OHMPI_CONFIG)}')
 
     def remove_data(self, cmd_id=None):
diff --git a/settings/default.json b/settings/default.json
new file mode 100644
index 00000000..8e0510fa
--- /dev/null
+++ b/settings/default.json
@@ -0,0 +1,12 @@
+{
+    "injection_duration": 0.2,
+    "nb_meas": 1,
+    "sequence_delay": 1,
+    "nb_stack": 1,
+    "sampling_interval": 2,
+    "tx_volt": 5,
+    "duty_cycle": 0.5,
+    "strategy": "constant",
+    "fulldata": false,
+    "export_path": "data/measurements.csv"
+}
\ No newline at end of file
-- 
GitLab