Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -r1efd9618ccdf0ffbf5ffc8c0e7c88a076c0709ea -ra6700586035c4818e70f8f3d0de9a708099b4cb7 --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 1efd9618ccdf0ffbf5ffc8c0e7c88a076c0709ea) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision a6700586035c4818e70f8f3d0de9a708099b4cb7) @@ -563,6 +563,50 @@ self.can_interface.send(message, 0) + + def td_water_sample( self, valve : int , + timeout : int ): + """ + Broadcasts the current TD Water Sample data (Msg ID: 0xAB) + Args: + @param valve (int) : water sample valve that is openend + @param timeout (int) : water sample timeout + @return: None + """ + if not self.can_enabled: + raise ValueError("CAN Interface is not enabled") + + + payload = conversions.unsigned_integer_to_bytearray (valve ) + payload += conversions.unsigned_integer_to_bytearray (timeout ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_sync_broadcast_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_WATER_SAMPLE_DATA.value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_water_sample_result_response(self, vAccepted : int , + vRejectionReason : int , + vValue : float ): + """ + the water sample result response message method(Msg ID: 0xXX, XXX) + Args: + None + @return: None + """ + payload = conversions.integer_to_bytearray (vAccepted ) + payload += conversions.integer_to_bytearray (vRejectionReason) + payload += conversions.float_to_bytearray (vValue ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_WATER_SAMPLE_RESULT_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_param_ranges(self, min_tx_time_s : int, max_tx_time_s : int, @@ -893,6 +937,7 @@ payload=payload) self.can_interface.send(message, 0) + def td_institutional_response(self, vRejectionReason : int, vBloodFlowMin : int, vBloodFlowMax : int, @@ -1594,13 +1639,14 @@ """ payload = conversions.integer_to_bytearray(vAccepted) payload += conversions.integer_to_bytearray(vRejectionReason) - + message = CAN.DenaliMessage.build_message( channel_id=CAN.DenaliChannels.td_to_ui_ch_id, message_id=msg_ids.MsgIds.MSG_ID_TD_ADJUST_PATIENT_DISCONNECT_CONFIRM_RESPONSE.value, payload=payload) self.can_interface.send(message, 0) + def td_Treatment_Parameters_CreateRx(self, vRejectionReason: int): """ TD response to in initiate Treatment and enter Create Rx (Msg ID: 0x46, 70) @@ -1621,6 +1667,149 @@ self.can_interface.send(message, 0) + def td_post_tx_logs_response( self, + vAccepted : int, + vRejectionReason : int, + vBloodFlowRate : int, + vBloodFlowRateActual : int, + vDialysateFlowRate : int, + vDialysateFlowRateActual : int, + vTreatmentDuration : int, + vTreatmentDurationActual : int, + vAcidConcentrateType : int, + vAcidConcentrateTypeActual : int, + vBicarbonateCartridgeSize : int, + vBicarbonateCartridgeSizeActual : int, + vPotassiumConcentration : int, + vPotassiumConcentrationActual : int, + vCalciumConcentration : int, + vCalciumConcentrationActual : int, + vBicarbonateConcentration : int, + vBicarbonateConcentrationActual : int, + vSodiumConcentration : int, + vSodiumConcentrationActual : int, + vVitalsInterval : int, + vVitalsIntervalActual : int, + vDialyzerType : int, + vTreatmentStartEpoch : int, + vTreatmentEndEpoch : int, + vFluidBolusVolume : int, + vFluidBolusVolumeActual : int, + vHeparinType : int, + vHeparinDeliveryDuration : int, + vHeparinDeliveryDurationActual : int, + vTreatmentModality : int, + vTreatmentModalityActual : int, + vHDFOperatingMode : int, + vHDFOperatingModeActual : int, + vHepatitisStatus : int, + vDialysateTemperature : float, + vDialysateTemperatureActual : float, + vDialysateVolumeUsed : float, + vHeparinBolusVolume : float, + vHeparinBolusVolumeActual : float, + vHeparinDispenseRate : float, + vHeparinDispenseRateActual : float, + vHeparinDeliveredVolume : float, + vUFVolume : float, + vUFVolumeActual : float, + vUFVolumeTarget : float, + vUFRate : float, + vUFRateActual : float, + vUFRateTarget : float, + vSubstitutionVolume : float, + vSubstitutionVolumeActual : float, + vSubstitutionVolumeTarget : float, + vSubstitutionRate : float, + vSubstitutionRateActual : float, + vSubstitutionRateTarget : float, + vIsoUfVolume : float, + vIsoUfVolumeActual : float, + vIsoUfVolumeTarget : float, + vIsoUfRate : float, + vIsoUfRateActual : float, + vIsoUfRateTarget : float, + vWaterSampleTestResult : float + ): + # """ + # the Post Treatment logs records response message method(Msg ID: 0xXX, XXX) + # Args: + # None + # @return: None + # """ + # if not self.can_enabled: + # raise ValueError("CAN Interface is not enabled") + + payload = conversions.integer_to_bytearray(vAccepted ) + payload += conversions.integer_to_bytearray(vRejectionReason ) + payload += conversions.integer_to_bytearray(vBloodFlowRate ) + payload += conversions.integer_to_bytearray(vBloodFlowRateActual ) + payload += conversions.integer_to_bytearray(vDialysateFlowRate ) + payload += conversions.integer_to_bytearray(vDialysateFlowRateActual ) + payload += conversions.integer_to_bytearray(vTreatmentDuration ) + payload += conversions.integer_to_bytearray(vTreatmentDurationActual ) + payload += conversions.integer_to_bytearray(vAcidConcentrateType ) + payload += conversions.integer_to_bytearray(vAcidConcentrateTypeActual ) + payload += conversions.integer_to_bytearray(vBicarbonateCartridgeSize ) + payload += conversions.integer_to_bytearray(vBicarbonateCartridgeSizeActual ) + payload += conversions.integer_to_bytearray(vPotassiumConcentration ) + payload += conversions.integer_to_bytearray(vPotassiumConcentrationActual ) + payload += conversions.integer_to_bytearray(vCalciumConcentration ) + payload += conversions.integer_to_bytearray(vCalciumConcentrationActual ) + payload += conversions.integer_to_bytearray(vBicarbonateConcentration ) + payload += conversions.integer_to_bytearray(vBicarbonateConcentrationActual ) + payload += conversions.integer_to_bytearray(vSodiumConcentration ) + payload += conversions.integer_to_bytearray(vSodiumConcentrationActual ) + payload += conversions.integer_to_bytearray(vVitalsInterval ) + payload += conversions.integer_to_bytearray(vVitalsIntervalActual ) + payload += conversions.integer_to_bytearray(vDialyzerType ) + payload += conversions.integer_to_bytearray(vTreatmentStartEpoch ) + payload += conversions.integer_to_bytearray(vTreatmentEndEpoch ) + payload += conversions.integer_to_bytearray(vFluidBolusVolume ) + payload += conversions.integer_to_bytearray(vFluidBolusVolumeActual ) + payload += conversions.integer_to_bytearray(vHeparinType ) + payload += conversions.integer_to_bytearray(vHeparinDeliveryDuration ) + payload += conversions.integer_to_bytearray(vHeparinDeliveryDurationActual ) + payload += conversions.integer_to_bytearray(vTreatmentModality ) + payload += conversions.integer_to_bytearray(vTreatmentModalityActual ) + payload += conversions.integer_to_bytearray(vHDFOperatingMode ) + payload += conversions.integer_to_bytearray(vHDFOperatingModeActual ) + payload += conversions.integer_to_bytearray(vHepatitisStatus ) + payload += conversions.float_to_bytearray( vDialysateTemperature ) + payload += conversions.float_to_bytearray( vDialysateTemperatureActual ) + payload += conversions.float_to_bytearray( vDialysateVolumeUsed ) + payload += conversions.float_to_bytearray( vHeparinBolusVolume ) + payload += conversions.float_to_bytearray( vHeparinBolusVolumeActual ) + payload += conversions.float_to_bytearray( vHeparinDispenseRate ) + payload += conversions.float_to_bytearray( vHeparinDispenseRateActual ) + payload += conversions.float_to_bytearray( vHeparinDeliveredVolume ) + payload += conversions.float_to_bytearray( vUFVolume ) + payload += conversions.float_to_bytearray( vUFVolumeActual ) + payload += conversions.float_to_bytearray( vUFVolumeTarget ) + payload += conversions.float_to_bytearray( vUFRate ) + payload += conversions.float_to_bytearray( vUFRateActual ) + payload += conversions.float_to_bytearray( vUFRateTarget ) + payload += conversions.float_to_bytearray( vSubstitutionVolume ) + payload += conversions.float_to_bytearray( vSubstitutionVolumeActual ) + payload += conversions.float_to_bytearray( vSubstitutionVolumeTarget ) + payload += conversions.float_to_bytearray( vSubstitutionRate ) + payload += conversions.float_to_bytearray( vSubstitutionRateActual ) + payload += conversions.float_to_bytearray( vSubstitutionRateTarget ) + payload += conversions.float_to_bytearray( vIsoUfVolume ) + payload += conversions.float_to_bytearray( vIsoUfVolumeActual ) + payload += conversions.float_to_bytearray( vIsoUfVolumeTarget ) + payload += conversions.float_to_bytearray( vIsoUfRate ) + payload += conversions.float_to_bytearray( vIsoUfRateActual ) + payload += conversions.float_to_bytearray( vIsoUfRateTarget ) + payload += conversions.float_to_bytearray( vWaterSampleTestResult ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_ADJUST_TREATMENT_LOGS_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_Treatment_Parameters_Validation( self, vAccepted : int = 1, vTreatmentModalityRejectReason : int = 0,