Adding a new calibration type
Ideally, all calibrations, including od_calibration and pump_calibration, should behave similarly:
Interface should have the following:
pio run <x>_calibrationstarts the calibration and saves it keyed by a unique name (see 2. for storage)
pio run <x>_calibration listlists all saved calibrations, keyed by their unique name.
pio run <x>_calibration display ?name?displays information about the current calibration to be used, or the calibration ?name? if provided
pio run <x>_calibration change_current <name>changes the current calibration to
pio run <x>_calibration publish <name>publishes the calibration to the leader.
On disk, all run calibrations should be stored in local persistent storage under
<x>_calibrationskeyed by a unique name, and the current calibration should be stored in
<x>_current_calibration, with appropriate key (can use
<calibration_type>) that is not the unique name, but something consistent. Note: The name cannot be
A struct should be created / sub-classed from structs.Calibration that will encode / decode the calibration data blob.
When a new calibration is created, a PUT request to
/api/calibrations/should be sent. The body is the json-encoded Calibration struct.
When a new calibration is set as current (change_current), a PATCH request to
/api/calibrations/<pioreactor_unit>/<calibration_type>/<calibration_name>should be sent.
Creating a new calibration should both publish to leader and set as current.
For example, for
pump_calibration, the three default calibration types are: