Index: dialin/common/msg_defs.py =================================================================== diff -u -r287af45040e35882e001fb3ea835f304007870c4 -re6324506ed792e22dc419249a6e9225e602642c6 --- dialin/common/msg_defs.py (.../msg_defs.py) (revision 287af45040e35882e001fb3ea835f304007870c4) +++ dialin/common/msg_defs.py (.../msg_defs.py) (revision e6324506ed792e22dc419249a6e9225e602642c6) @@ -94,6 +94,7 @@ MSG_ID_DG_FANS_DATA = 0x48 # DG broadcast fans data MSG_ID_HD_CALIBRATION_DATA = 0x49 # HD broadcast calibration data MSG_ID_DG_CALIBRATION_DATA = 0x4A # DG broadcast calibration data + MSG_ID_HD_PRE_TREATMENT_UF_RESPONSE = 0x50 # HD response to user request to adjust the ultrafiltration in pre-treatment MSG_ID_CAN_ERROR_COUNT = 0x999 # test code in support of EMC testing Index: dialin/squish/denaliMessages.py =================================================================== diff -u -ra5e1daa9b42023d67184fd4da5bd04aa164c27dc -re6324506ed792e22dc419249a6e9225e602642c6 --- dialin/squish/denaliMessages.py (.../denaliMessages.py) (revision a5e1daa9b42023d67184fd4da5bd04aa164c27dc) +++ dialin/squish/denaliMessages.py (.../denaliMessages.py) (revision e6324506ed792e22dc419249a6e9225e602642c6) @@ -1451,4 +1451,31 @@ frames = messageBuilder.toCandumpFormat(frames) for frame in frames: subprocess.call(['cansend', 'can0', '001#{}'.format(frame)]) - waitForMessageToBeSent() \ No newline at end of file + waitForMessageToBeSent() + + +def buildAlarmClearedCondition(vAlarmID): + """ + the Alarm Condition Cleared message builder method + | MSG | CAN ID | Box | Type | Ack | Src | Dst | Description | #1:(U32) | + |:----:|:---------:|:---:|:------:|:---:|:---:|:---:|:-----------------------:|:--: | + |0x3F00| 0x001,2,4 | 1 | Event | Y | HD | All | Alarm Condition Cleared | \ref Data::mAlarmID | + :param vAlarmID: (int) Alarm ID + :return: (str) built message frame(s) + """ + msg = messageBuilder.buildMessage(63, 4, True, + utils.toI32(vAlarmID)) + return messageBuilder.toFrames(msg) + + +def setAlarmClearedCondition(vAlarmID): + """ + the Alarm Condition Cleared message setter/sender method + :param vAlarmID: (int) Alarm ID + :return: none + """ + frames = buildAlarmClearedCondition(vAlarmID) + frames = messageBuilder.toCandumpFormat(frames) + for frame in frames: + subprocess.call(['cansend', 'can0', '001#{}'.format(frame)]) + waitForMessageToBeSent() Index: dialin/ui/hd_simulator.py =================================================================== diff -u -r287af45040e35882e001fb3ea835f304007870c4 -re6324506ed792e22dc419249a6e9225e602642c6 --- dialin/ui/hd_simulator.py (.../hd_simulator.py) (revision 287af45040e35882e001fb3ea835f304007870c4) +++ dialin/ui/hd_simulator.py (.../hd_simulator.py) (revision e6324506ed792e22dc419249a6e9225e602642c6) @@ -25,7 +25,7 @@ DenaliCanMessenger, DenaliChannels) from ..utils.base import _AbstractSubSystem, _LogManager -from ..utils.conversions import integer_to_bytearray +from ..utils.conversions import integer_to_bytearray, float_to_bytearray YES = 1 NO = 0 @@ -293,6 +293,24 @@ self.can_interface.send(message, 0) + def cmd_send_uf_treatment_response(self, accepted, reason, volume): + """ + Sends the uf volume adjustment response message in pre-treatment + :param accepted: (bool) the acceptance + :param reason: (uint) the reason for rejection + :param volume: (float) the acceptable/accepted ultrafiltration volume + :return: none + """ + payload = integer_to_bytearray(accepted) + payload += integer_to_bytearray(reason) + payload += float_to_bytearray(volume) + + message = DenaliMessage.build_message(channel_id=DenaliChannels.hd_to_ui_ch_id, + message_id=MsgIds.MSG_ID_HD_PRE_TREATMENT_UF_RESPONSE.value, + payload=payload) + + self.can_interface.send(message, 0) + def cmd_send_end_treatment_response(self): """ Sends an end treatment response