OPEnSLab-OSU / Spool

GNU General Public License v3.0
2 stars 1 forks source link

Display for New Sensor Configuration (data_run) #27

Open smitmad9 opened 4 years ago

smitmad9 commented 4 years ago

Describe the bug If the user adds or removes a sensor/module from a Device, the display is only correct for the columns before the change.

Expected behavior There should be a unique table for each unique configuration (data_run) for that Device.

Hardware in Use None, using Postman to test.

To Reproduce Steps to reproduce the behavior:

  1. Log data to Spool with at least one module.
  2. Add or remove a sensor/module.
  3. Log data to Spool with the new configuration
  4. Go to the appropriate Network -> Device

Screenshots Here, I first logged with all modules shown in the columns. I then deleted the TSL module and logged data again. Screen Shot 2020-08-16 at 6 01 24 PM

Desktop (please complete the following information):

Code In the Arduino IDE while editing the main.ino, goto 'Edit' -> 'Copy for HTML' and paste the output of that here. N/A

Config In the Arduino IDE while editing the config.json, goto 'Edit' -> 'Copy for HTML' and paste the output of that here. N/A

Additional context Fix: Default data_run for a Device is set to 0. Each attempt to log data, check if the configuration of modules is the same as any previous data_run. Loop through from 0 to the greatest data_run (need to track num_configs for each Device) to compare the current device's configuration with each configuration before it. If it matches with any prior data_run, set the current device's data_run. Otherwise, increment the data_run to one greater than the greatest data_run. For the data display, display a table for each data_run.

smitmad9 commented 4 years ago

Update: Goal is now to use the first data_run schema (plus any module-key pairs which correspond to other data_runs) to select the column headers, which will be constant/static and displayed for every data point for that device. Display "null" or "X" if sensors are removed/missing for any data point.