Index: dialin/squish/denaliMessages.py =================================================================== diff -u -r404342de006f3c76a9a00e76017440954098999d -r75cb7fb23ee356dbcb2c2138a3d631684fe1e241 --- dialin/squish/denaliMessages.py (.../denaliMessages.py) (revision 404342de006f3c76a9a00e76017440954098999d) +++ dialin/squish/denaliMessages.py (.../denaliMessages.py) (revision 75cb7fb23ee356dbcb2c2138a3d631684fe1e241) @@ -22,7 +22,24 @@ from dialin.squish import messageBuilder +class txStates: + # Saline states + SALINE_BOLUS_STATE_IDLE = 0 # No saline bolus delivery is in progress + SALINE_BOLUS_STATE_WAIT_FOR_PUMPS_STOP = 1 # Wait for pumps to stop before starting bolus + SALINE_BOLUS_STATE_IN_PROGRESS = 2 # A saline bolus delivery is in progress + SALINE_BOLUS_STATE_MAX_DELIVERED = 3 # Maximum saline bolus volume reached - no more saline bolus deliveries allowed + + # UF states + # UI only cares about the actual state and _NOT could be any other state + UF_PAUSED_STATE_NOT = 0 + UF_PAUSED_STATE = 1 + + # Sub Mode + # UI only cares about the actual state and _NOT could be any other state + TREATMENT_DIALYSIS_STATE_NOT = 0 + TREATMENT_DIALYSIS_STATE = 1 + class EResponse: Rejected = 0 Accepted = 1 @@ -1068,6 +1085,13 @@ subprocess.call(['cansend', 'can0', '040#{}'.format(frame)]) waitForMessageToBeSent() +## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +def setTreatmentStartState(): + """ + starting the treatment for user convenience since Tx is not by default running + :return: none + """ + setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE, txStates.UF_PAUSED_STATE_NOT, txStates.SALINE_BOLUS_STATE_IDLE) ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~