Comp-490-SeniorProject / site

MIT License
0 stars 1 forks source link

Plan for Parameter Test Execution #48

Closed MarkKoz closed 2 years ago

MarkKoz commented 2 years ago

Note: some points mentioned do not reflect the current implementation; things would need to change to accomodate for this proposal.

Device

Sensor Data

Schema

Parameter

Each sensor is associated with a Parameter. There can also be manual ones that allow arbitrary user input.

For the user's convenience, when a Device is registered, a Parameter should automatically be created for each of the four sensors. It should use a predefined name, description, and unit name. The user should be able to change all of these later if they wish.

Test

A Test is a regularly scheduled event from collecting data from one or more sensors on a device.

TestHistory

A TestHistory is a specific instance of a Test. For example, there would be one TestHistory for the test ran at 20:30 and a separate one for the test ran at 21:00.

The test runs when the start time reaches the current time. Tests can not run in parallel. If two tests are scheduled at the same time, or close enough that one needs to start before the other has finished, then the later test will run late and wait until the previous test is done. This should be implemented using a queue for tests.

If the associated Test has automatic Parameters, the device is sent the TestHistory ID and the IDs of sensors in the Parameters. If it has manual Parameters, the user is prompted to enter values for them. I think it is better to store these in DynamoDB too for consistency, but these could be stored in PostgreSQL instead. It'd probably require more work though.

If it has semi-automatic Parameters, the user will be sent a notification when the device is ready for them to intervene and do any necessary set up. The test will wait until the user confirms that the device is ready to continue. The test will then be perform just like an atomic Parameter.

A TestHistory is not created until it is time to run the test. If the frontend needs to display tests scheduled in the future, it should dynamically calculate this based on the Tests start time and frequency. This is better since the future is indefinite, and we obviously cannot store an indefinite number of TestHistory objects in the database.