Open hiyaryan opened 2 years ago
- Do we want to keep the structure of this little json object used to set sam-config values on the frontend?
- What key-value pairings do we need to include, at the minimum, for any live sensor run?
- Are these the key-value pairings we want or need in sam-config, in order for the dashboard to work?
Currently it seems that the only two panels that need the habitat volume are the AtmosphericMonitors
and InhabitantsStatus
panels (ctrl+f for total_capacity
). The latter also requires the number of humans.
Technically if you don't use these two panels and/or if you create new panels that only use the step data, then we don't even need an initial object.
The information that the SAM backend has (whether they are useful for the clients or not) are:
The object could eventually look like:
{
habitat: {
inhabitants: 4,
volume: 272
},
sensors: [
{id: "...", model: "adafruit_scd30", update_frequency: "3", location: "greenhouse",
units: {co2: "ppm", humidity: "%", temperature: "C"}},
{id: "...", model: "adafruit_scd30", update_frequency: "3", location: "crew quarters",
units: {co2: "ppm", humidity: "%", temperature: "C"}},
{id: "...", model: "vernier_xxx", update_frequency: "1", location: "crew quarters",
units: {co2: "ppm"}}
]
}
We could also create two events to retrieve these value and maybe avoid sending the initial object altogether.
Currently it seems that the only two panels that need the habitat volume are the AtmosphericMonitors and InhabitantsStatus panels (ctrl+f for total_capacity). The latter also requires the number of humans.
The latest commit in the capstone-ctrls branch associated with the PR into capstone on simoc-web can demonstrate this pretty easily. The state variables in step.js are all initially set to empty objects, 0's and nulls which are all grouped together in a step_data object. If none of these values are set using the mutators they stay their initial values and are passed to the dashboard. If a value is needed, the dashboard will throw an error and that indicates that that state variable needed to be updated using a mutator. I'm still working on step.js but it'll be even easier to determine the exact agent values that are required once I finish it.
The information that the SAM backend has (whether they are useful for the clients or not) are
The store step.js is set up so that there is only one place that needs to be updated when the structure of the sensor data sent from the backend is updated i.e. when the key names change. This place is in the function parseData at the end of the file. When the sensor data is passed to this function state variables are updated depending on the data collected. It does this by comparing keys. So if the names of any keys are changed or nested inside of an object, this is the location that needs to be updated.
This Issue is for determining what needs to be sent from simoc-sam (socketio server) in terms of default values and/or mission configurations to include its structure. Currently sam-config is loaded from a file (src/assets/sam-config.json) on the simoc-web repository. It takes the following form,
Currently, we have decided to keep the sam-config on the frontend. Initially, the simoc simulation would create a game-config from the backend using the configurations provided by the user and send it to the frontend. This step was bypassed since the configuration menu is not available in live mode.
The socketio server on simoc-sam, sends a little json object as follows,
We need to determine the following,