we should use the functions defined in testsupport.c/h -> getU32OverrideValue, getF32OverrideValue based on data type. this needs to be fixed throughout the file.
The states that need .value come from the td_defs that inherit from DialinEnum, and the ones that don't have .value come from the ui_defs, which are simple classes, so they don't need .value since those do not support metadata. The UI_defs seem to be what I think aren't maintained anymore and last time updated was the 21 months ago.
Anything we want shall be available in the td_defs. as an example:
# TDTreatmentStates.TREATMENT_RINSEBACK_STATE sub states
@unique
class TDTreaRinsebackStates(DialinEnum):
RINSEBACK_STOP_INIT_STATE = 0 # Start state (stopped) of the rinseback sub-mode state machine
RINSEBACK_RUN_STATE = 1 # Rinseback running state of the rinseback sub-mode state machine
RINSEBACK_PAUSED_STATE = 2 # Rinseback paused state of the rinseback sub-mode state machine
RINSEBACK_STOP_STATE = 3 # Rinseback stopped (done) state of the rinseback sub-mode state machine
RINSEBACK_RUN_ADDITIONAL_STATE = 4 # Additional rinseback volume (10 mL) state of the rinseback sub-mode state machine
RINSEBACK_RECONNECT_PATIENT_STATE = 5 # Rinseback patient reconnect state of the rinseback sub-mode state machine
NUM_OF_RINSEBACK_STATES = 6 # Number of rinseback sub-mode states
We should follow the same rule in the simulators and plugins.
Nicholas Ramirez I still need your feedback and correct me if I am wrong.
I guess, you should use OnOff status as second argument, since isBalChamberSwitchingActive varirable set after this function, it won't have latest status.
Please provide an example of what the stepnames variable contains. How do you ensure that the requested index is always available and that the code does not fail?
I am happy to see that this old code is improving. I would recommend using the Conversion module instead of strings and DataTypes, as it handles everything automatically. Examples can be found in the following file in this CR: https://devapps.diality.us/cru/#LEAHI-DIALIN-LDT-4484-1CFR-84688
getBicarbConductivityPre() -> This function gets the target conductivity from the mixing algorithm. For testing, recommend using defined value and check the behavior.