Open smitmad9 opened 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.
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:
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](https://user-images.githubusercontent.com/51467184/90351420-0f9ab480-dff5-11ea-9d37-00e802e1c178.png)
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.