Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -reefd61a5d338590b9ea89ef87d3a2c181e045cf5 --- shared/scripts/configuration/config.py (.../config.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/config.py (.../config.py) (revision eefd61a5d338590b9ea89ef87d3a2c181e045cf5) @@ -14,6 +14,7 @@ ############################################################################ import os +from configuration.strings import * AUT_NAME = "denaliSquish" @@ -29,6 +30,20 @@ GOODMORNING_START_TIME_SEC = 0 GOODEVENING_START_TIME_SEC = 43200 -BLOOD_PRIMING_TEXT = "Blood Priming" -SALINE_UNIT = "mL" -BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" +#ui_logs +RESET_BINARY = "0" +SET_BINARY = "1" + +#cloud_sync_device_registration +HD_VERSION_SERIAL = {HD1234567890123, HD4567890123645, HD7890123756241} + + +DG_VERSION_SERIAL = {DG1234567890123, DG4567890123645, DG7890123756241} + + + + + + + + Index: shared/scripts/configuration/strings.py =================================================================== diff -u -r5c0a804b33cdbe79c331971860a9c7dfb44047a2 -reefd61a5d338590b9ea89ef87d3a2c181e045cf5 --- shared/scripts/configuration/strings.py (.../strings.py) (revision 5c0a804b33cdbe79c331971860a9c7dfb44047a2) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision eefd61a5d338590b9ea89ef87d3a2c181e045cf5) @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - ########################################################################### # # Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. @@ -9,853 +7,16 @@ # # @file strings.py # -# @author (last) LTTS -# @date (last) 14-June-2022 +# @author (last) LTTS +# @date (last) 18-Jan-2022 +# ############################################################################ - BLOOD_PRIMING_TEXT = "Blood Priming" SALINE_UNIT = "mL" BLOOD_PRIMING_UNIT = "mL" BLOOD_PRIMING_VALUE_0 = "0" BLOOD_PRIMING_DEFAULT_VALUE = BLOOD_PRIMING_VALUE_0 + " " + BLOOD_PRIMING_UNIT -#pretreatment_screen_bullets -PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "Ultrafiltration" , "BP/HR" , "Connection" , "Start"] -POST_TREATMENT_SCREENS = ["Disconnection", "Review", "Disposables", "Disinfection"] - -BLOOD_PRIMING_UNIT = "mL" -BLOOD_PRIMING_VALUE_0 = "0" -BLOOD_PRIMING_DEFAULT_VALUE = BLOOD_PRIMING_VALUE_0 + " " + BLOOD_PRIMING_UNIT - - -SALINE_UNIT = "mL" -BLOOD_PRIMING_UNIT = "mL" -BLOOD_PRIMING_VALUE_0 = "0" -BLOOD_PRIMING_DEFAULT_VALUE = BLOOD_PRIMING_VALUE_0 + " " + BLOOD_PRIMING_UNIT - -#main_treatment_ultrafilteration -ULTRAFILTRATION_PAUSED_TEXT = "Ultrafiltration Paused" -INCREASE_UF_RATE_TEXT = "Increase UF Rate" -INCREASE_TREATMENT_DURATION_TEXT = "Increase Treatment Duration" -RESUME_TEXT = "RESUME ULTRAFILTRATION" -EDIT_TEXT = "EDIT ULTRAFILTRATION VOLUME" -TITLE_TEXT = "ULTRAFILTRATION VOLUME (L)" - -#recirculate screens -RECIRCULATE_TEXT = "Recirculate" -RECONNECT_BUTTON_TEXT = "RECONNECT" -# pretreatment_patient_connection -DIASTOLIC_TEXT = "diastolic" -SYSTOLIC_TEXT = "systolic" -OUT_OF_RANGE_COLOR = "#c53b33" -IN_RANGE_COLOR = "#fcfcfc" -HEART_RATE_TITLE = "Heart Rate" -BLOOD_PRESSURE_TITLE = "Blood Pressure" -BLOOD_PRESSURE_UNIT = "mmHg" -HEART_RATE_UNIT = "BPM" -PATIENT_CONNECTION_TEXT = "Patient Connection" -UF_VOLUME_TEXT = "Ultrafiltration Volume (L)" -UF_TITLE_TEXT = "Ultrafiltration Setup" -BP_HR_TEXT = "BP/HR" -SKIP_TEXT = "SKIP" -TUTORIAL_TEXT = { - 0 : "Wash your hands and establish vascular access per your clinic's instructions.", - 1 : "Pinch arterial clamp and venous clamp on located on the cartridge patient lines.", - 2 : "Remove arterial and venous line connector.", - 3 : "Connect arterial and venous cartridge lines to your patient access lines." -} - -#rinseback-setup -RINSE_BACK_SETUP_TEXT = "Rinseback Setup" -RINSEBACK_BUTTON_TEXT = "START RINSEBACK" -BACK_TO_TREATMENT_BUTTON_TEXT = "BACK TO TREATMENT" -END_IMAGE_BUTTON_TEXT = "End" -DECELERATE_BUTTON_TEXT = "Decelerate" -ACCELERATE_BUTTON_TEXT = "Accelerate" -PAUSE_BUTTON_TEXT = "Pause" -RESUME_BUTTON_TEXT = "Resume" -RINSEBACK_TEXT = "Rinseback" -RINSEBACK_COMPLETE_TEXT = "Rinseback Complete" -END_TREATMENT_BUTTON_TEXT = "END TREATMENT" -BACK_TO_RECIRCULATE_TEXT = "BACK TO RECIRCULATE" -RECONNECT_TEXT = "Reconnect" - - - -#tst_treatment_saline_data -SALINE_UNIT = "mL" +#ui_logs ACK_REQ_STATUS = 'Ack Req' -ACK_BAK_STATUS = 'Ack Bak' - -#main treatment pressure -PRESSURE_TITLE = "PRESSURES" -ARTERIAL_TITLE = "Arterial" -VENOUS_TITLE = "Venous" -VENOUS_UOM = "mmHg" -ARTERIAL_UOM = "mmHg" -LOW_TEXT = "LOW" -HIGH_TEXT = "HIGH" - -BLOOD_PRIMING_TEXT = "Blood Priming" -SALINE_UNIT = "mL" -BLOOD_PRIMING_UNIT = "mL" -BLOOD_PRIMING_VALUE_0 = "0" -BLOOD_PRIMING_DEFAULT_VALUE = BLOOD_PRIMING_VALUE_0 + " " + BLOOD_PRIMING_UNIT - -#main-treatment heparin -HEPARIN_TEXT = "HEPARIN" -HEPARIN_UNIT = "mL" -HEPARIN_DELIVERY_TEXT = "HEPARIN DELIVERY" -HEPARIN_DELIVERY_OFF_TEXT = "OFF" -HEPARIN_STOP_TEXT = "Delivery Stopped" -HEPARIN_RESUME_DELIVERY_TEXT = "RESUME DELIVERY" -HEPARIN_BOLUS_ACTIVE_TEXT = "Bolus Active" -HEPARIN_BOLUS_DISPENSING_TEXT = "Dispensing Active" -HEPARIN_PAUSE_DELIVERY_TEXT = "PAUSE DELIVERY" -HEPARIN_MAXIMUM_VOLUME_DELIVERED_TEXT = "Maximum Cumulative Heparin Volume Delivered" -HEPARIN_SYRINGE_EMPTY_TEXT = "Syringe Empty" -HEPARIN_DISPENSING_RATE = "Heparin Dispensing Rate" -HEPARIN_BOLUS_VOLUME = "Heparin Bolus Volume" -HEPARIN_STOP_TIME = "Heparin Stop Time" -HEPARIN_TYPE_TITLE = "Heparin Type" - -# dictionary of rejection reason from application source code. -# message location -> denali-> Headers-> common-> MsgDefs.h -REJECTION_REASON = { - 0: "REQUEST_REJECT_REASON_NONE", # Used when there is no rejection - 1: "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE", # Request is not allowed in the current operating mode - 2: "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM", # Validated request was not confirmed by user in reasonable time - 3: "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE", # Request is not allowed if not in treatment mode - 4: "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE", # Request is not allowed in current treatment state - 5: "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED", # Request is not allowed so near end of treatment - 6: "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE", # Treatment duration is out of range - 7: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT", # Treatment time change is less than currently elapsed treatment time - 8: "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE", # Blood flow is out of range - 9: "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE", # Dialysate flow is out of range - 10: "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE", # Dialysate flow rate or treatment duration causes dialysate volume to exceed limit - 11: "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE", # Ultrafiltration volume is out of range - 12: "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE", # Ultrafiltration rate is out of range - 13: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM", # Treatment time change is less than minimum treatment time - 14: "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS", # Ultrafiltration is not currently in progress - 15: "REQUEST_REJECT_REASON_UF_NOT_PAUSED", # Ultrafiltration is not currently paused - 16: "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS", # A saline bolus is in progress - 17: "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE", # A treatment parameter is out of range - 18: "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION", # The Heparin pre-stop setting is greater than the treatment duration - 19: "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH", # Arterial pressure low and high alarm limits are not inconsistent - 20: "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH", # Venous pressure low and high alarm limits are inconsistent - 21: "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED", # Saline bolus volume maximum has been reached - no more saline allowed - 22: "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS", # A saline bolus is not in progress - 23: "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE", # Requested user action is disabled in current state - 24: "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE", # Requested user action not allowed while alarm is active - 25: "REQUEST_REJECT_REASON_INVALID_COMMAND", # Requested user action invalid - 26: "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED", # The treatment has been completed - 27: "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED", # Rinseback additional volume maximum has been reached - no more additional rinsebacks allowed - 28: "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET", # Ultrafiltration volume is not set yet - 29: "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM", # The user has not confirmed patient connection - 30: "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE", # Heparin cannot be paused if not currently deliverying Heparin - 31: "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED", # Heparin cannot be resumed if not paused - 32: "REQUEST_REJECT_REASON_DG_COMM_LOST", # Treatment cannot initiate if DG comm is lost - 33: "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE", # Post-treatment reservoirs drain not complete - 34: "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE", # Treatment cannot initiate if DG is not in standby idle state - 35: "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT", # Request message not formatted properly - 36: "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME", # Given date/time is invalid - 37: "REQUEST_REJECT_REASON_TREATMENT_IN_PROGRESS", # Treatment is in progress - 38: "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED", # Battery does not have enough charge to start treatment - 39: "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED", # Cannot move on to recirculate without completing full rinseback. - 40: "REQUEST_REJECT_REASON_RESERVOIR_ONE_IS_NOT_READY", # Reservoir one fill is not complete - 41: "REQUEST_REJECT_REASON_PUMP_TRACK_NOT_CLOSED", # Pump track is not ready / closed - 42: "REQUEST_REJECT_REASON_DOOR_NOT_CLOSED", # Door is not closed - 43: "REQUEST_REJECT_REASON_SYRINGE_NOT_PRESENT", # Syringe is not present - 44: "REQUEST_REJECT_REASON_DG_DIALYSATE_CAP_OPEN", # Dialysate cap open - 45: "REQUEST_REJECT_REASON_DG_CONCENTRATE_CAP_OPEN", # Concentrate cap open - 46: "NUM_OF_REQUEST_REJECT_REASONS" # Number of settings change reject codes -} - -#Alarm List -UNDEFINED_ALARM_ID_MSG = "ALARM_ID_UNDEFINED" -ALARM_TITLE = "Alarm" -ALARM_LIST_TITLE = "Alarm list" -ALARM_PRIORITIES = {1: "LOW", 2: "MEDIUM", 3: "HIGH"} - -ALARM_PRIORITY_OPTIONS = { - 0 : 'ALARM_PRIORITY_NONE' , - 1 : 'ALARM_PRIORITY_LOW' , - 2 : 'ALARM_PRIORITY_MEDIUM', - 3 : 'ALARM_PRIORITY_HIGH', -} - - -BLOOD_PRIMING_UNIT = "mL" -BLOOD_PRIMING_VALUE_0 = "0" -BLOOD_PRIMING_DEFAULT_VALUE = BLOOD_PRIMING_VALUE_0 + " " + BLOOD_PRIMING_UNIT - -#Setting -DEVICE_SETTINGS_TEXT = "Device Settings" -DEVICE_SETTINGS_SCREEN_PARAMETER = ["Information", "Volume And Brightness", "Wi-Fi", "Bluetooth Cuff", "DG Cleaning", "Service", "Export Logs"] -CLEAR_ALARM_CONDITION_TEXT = "Clear Alarm Condition" -EXPORT_LOGS ="Export Logs" -SHUTDOWN_BUTTON_TEXT = "SHUTDOWN" -BACK_BUTTON_TEXT = "BACK" -EXPORT_LOGS_OPTIONS = ["Application", "Treatment", "Service"] -SD_CARD_DETAILS =["SD-Card (MB)", "Free : 0.000","Total: 0.000"] -USB_DRIVE_DETAILS = ["USB Drive (MB)","Free : 0.000","Total: 0.000"] -EXPORT_BUTTON_TEXT = "Export" -SettingsHome_Treatment_Text = "Treatment" -SettingsHome_Manager_Text = "Manager" -SettingsHome_Settings_Text = "Settings" -SERVICE_SCREEN_TITLE_TEXT = "Service" -SERVICE_SCREEN_PARAMETER = ["Information", "Volume And Brightness", "Wi-Fi", "Bluetooth Cuff", "Dialysate Generator Settings", "Services"] - -#create custom treatment -TREATMENT_TITLE = "Create a Custom Treatment" -CONFIRM_TREATMENT_TITLE = "Confirm Treatment" -PRESCRIPTION_TITLE = "PRESCRIPTION" -OPERATING_PARAMETERS_TITLE = "OPERATING PARAMETERS" -PATIENT_ID_TEXT = "Patient ID" -BLOOD_FLOW_RATE = "Blood Flow Rate" -DIALYSATE_FLOW_RATE = "Dialysate Flow Rate" -DURATION = "Duration" -SALINE_BOLUS_VOLUME = "Saline Bolus Volume" - -#main treatment screen -VITALS_TITLE = "VITALS" - - -PATIENT_ID = "demopatientid" -SALINE_BOLUS_TITLE = "Saline Bolus" -ACID_CONCENTRATE_TITLE = "Acid Concentrate" -BICARBONATE_CONCENTRATE_TITLE = "Bicarbonate Concentrate" -DIALYZER_TYPE_TITLE = "Dialyzer Type" -DIALYSATE_TEMPERATURE = "Dialysate Temperature" -BLOOD_PRESSURE_MEASUREMENT_INTERVAL = "Blood Pressure Measurement Interval" -RINSEBACK_FLOW_RATE = "Rinseback Flow Rate" - - -CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", "Duration","Heparin Dispensing Rate", - "Heparin Bolus Volume","Heparin Stop Time", "Saline Bolus", "Dialysate Temperature", - "Blood Pressure Measurement Interval", "Rinseback Flow Rate"] - -OFF_TEXT = "OFF" -CONTINUE_TEXT = "CONTINUE" - -PRESCRIPTION_DETAILS = { - "Blood Flow Rate": "mL/min", "Dialysate Flow Rate": "mL/min", - "Duration": "min", "Heparin Dispensing Rate": "mL/hr", - "Heparin Bolus Volume": "mL", "Heparin Stop Time": "min", - "Saline Bolus Volume": "mL", - "Dialysate Temperature": "°C", "Arterial Pressure Limit Low": "mmHg", - "Arterial Pressure Limit High": "mmHg","Blood Pressure Measure Interval":"min", - "Rinseback Rate" : "mL/min", "Venous Pressure Limit High": "mmHg", - "Venous Pressure Limit Low": "mmHg" -} - -#Time_Duration -TREATMENT_PAUSED_TEXT = "Treatment Paused" - -#pre-treatment -CONSUMABLE_SELF_TEST_TEXT = "Consumables Self Test" -BICARB_PUMP_CHECK_TEXT = "BiCarb Pump Check" -ACID_PUMP_CHECK_TEXT = "Acid Pump Check" -SELF_TEST_COMPLETE_TEXT = "Self Test Complete!" -BUSY = "Busy" -CHECK = "Check" -BEGIN_PRIME_TITLE = "Begin Prime" -PRIMING_TITLE = "Priming" -SYSTEM_SELF_TEST_TITLE = "System Self Test" -FILTER_FLUSH_TITLE = "Filter Flush" - -#Pre-Treatment Disposables -NEXT_BUTTON_TEXT = "NEXT" -BACK_BUTTON_TEXT = "BACK" -CONFIRM_BUTTON_TEXT = "CONFIRM" - -#Pre_treatment_water_sample -SAMPLE_TEXT = "Sample" -CREATE_TEXT = "Create" -WATER_SAMPLE_BUTTON_TEXT = "WATER SAMPLE" -PASS_TEXT = "PASS" -FAIL_TEXT = "FAIL" -OK_TEXT = "OK" - -#Vitals & pretreatment_patient_connection -SYSTOLIC_TEXT = "systolic" -DIASTOLIC_TEXT = "diastolic" - -#priming -TEST_DRY_STEPS = ["Used Cartridge Check", "Occlusion Sensors Check", "Pressure Sensors Check", "Syringe Pump Check"] -PRIMING_STEPS = ["Blood Circuit Priming", "Dialysate Circuit Priming", "Wet Self Tests"] -SELF_TEST_COMPLETION_MSG = "Self Test Complete!" -PRIMING_COMPLETE_MSG = "Priming Complete!" - -#main_treatment_flows -FLOW_UNIT = "mL/min" -BLOOD_FLOW_TEXT = "blood" -DIALYSATE_FLOW_TEXT = "dialysate" - -LIQUID_UNIT = "mL" - -#tst_treatment_monitoring -FLOWS_TEXT = "FLOWS" -BLOOD_UNIT = "mL/min" -DIALYSATE_TEXT = "Dialysate" -BLOOD_TEXT = "Blood" -VITALS_TEXT = "VITALS" -BLOOD_PRESSURE_TEXT = "mmHg" -HEARTRATE_UNIT = "BPM" -PRESSURE_TEXT = "PRESSURE (mmHg)" -ARTEREAL_TEXT = "Arterial" -VENOUS_TEXT = "Venous" -TIME_DURATION_TEXT = "Time Remaining" -ULTRAFILTERATION_TEXT = "ULTRAFILTRATION VOLUME (L)" -SALINE_BOLUS = "SALINE BOLUS" -VOLUME_DELIVERED = "Volume Delivered" -CUMULATIVE_DELIVERED = "Cumulative Delivered" - -#post-treatment -PATIENT_DISCONNECTION_TEXT = "Patient Disconnection" -REVIEW_TEXT = "Review" -PATIENT_DISCONNECTION_CONFIRM_BUTTON_TEXT = "CONFIRM" -DISPOSABLE_TEXT = "Disposables" -NEXT_TEXT = "NEXT" -BACK_TEXT = "BACK" -CONFIRM_TEXT = "CONFIRM" -DISPOSABLES_REMOVAL_TEXT = "Disposables Removal" - -#post treatment review -TREATMENT_REVIEW_TITLE_TEXT = "Treatment Review" -HEPARIN_TYPE = "UFH 1,000 IU/mL" -ACID_CONCENTRATE = ["08-1251-1", "08-2251-0", "08-3251-9"] -BICARBONATE_CONCENTRATE = "Fres. Centrisol" -DIALYZER_TYPE = ["BB Diacap Pro 13H", "BB Diacap Pro 16H", "BB Diacap Pro 19H", "F Optiflux F160NRe", "F Optiflux F180NRe"] -TREATMENT_REVIEW_TITLE_TEXT = "Treatment Review" -EXPORT_TEXT = "Export" -CODE_TEXT = "Code: " -CODE_TEXT_AFTER_LOGGING = "Code: ..." - -POST_TREATMENT_REVIEW_SCREEN_UNITS = { - "Patient ID" : "", - "Heparin Bolus Volume": "mL", - "Heparin Stop" : "min", - "Heparin Dispense Rate" : "mL/hr", - "Heparin Bolus Volume" : "mL", - "Heparin Delivered Volume": "mL", - "Blood Flow Rate" : "mL/min", - "Treatment Start DateTime" : "", - "Dialysate Flow Rate" : "mL/min", - "Treatment End DateTime" : "", - "Treatment Duration" : "min", - "Water Sample Test Result": "", - "Actual Treatment Duration":"min", - "Dialysate Volume Used" : "L", - "Acid ConcentrateType" : "", - "Prescribed UF Volume" : "L", - "Bicarbonate Concentrate Type" : "", - "Target UF Volume" : "L", - "Potassium Concentration" : "mEg/L", - "Actual UF Volume" : "L", - "Calcium Concentration" :"mEg/L", - "Prescribed UF Rate" : "mL/min", - "Bicarbonate Concentration" : "mEg/L", - "Target UF Rate": "mL/min", - "Sodium Concentration" : "mEg/L", - "Actual UF Rate": "mL/min", - "Dialysate Temperature" :"C", - "Saline Bolus Volume" : "mL", - "Dialyzer Type" : "", - "Heparin Type" : "", - "Heparin Concentration" : "IU/mL", - } - - -#Information -INFORMATION_TITLES = ["Information", "Versions"] -INFORMATION_PARAMETERS = ["Information", "UI Version", "HD Version", "HD FPGA Version", "HD Serial Number", "DG Version", "DG FPGA Version", "DG Serial Number"] -SERIVCES_TITLE = "Service" -SERVICES_PARAMETERS = ["HD Last Service Date", "HD Next Service Date", "DG Last Service Date", "DG Next Service Date"] - - -#volume and brightness -VOLUME_AND_BRIGHTNESS_TEXT = "Volume And Brightness" -BRIGHTNESS_TEXT = "Brightness" -ALARM_VOLUME_TEXT = "Alarm Volume" -UNIT_OF_VOLUME_AND_BRIGHTNESS = "%" - -#services -SHUTDOWN_TEXT = "SHUTDOWN" - -# pretreatment_patient_connection & ui logs -ACK_REQ_STATUS = 'Ack Req' -ACK_BAK_STATUS = 'Ack Bak' -PATIENT_CONNECTION_TEXT = "Patient Connection" -UF_VOLUME_TEXT = "Ultrafiltration Volume (L)" -UF_TITLE_TEXT = "Ultrafiltration Setup" -BP_HR_TEXT = "BP/HR" -SKIP_TEXT = "SKIP" -TUTORIAL_TEXT = { - 0 : "Wash your hands and establish vascular access per your clinic's instructions.", - 1 : "Pinch arterial clamp and venous clamp on located on the cartridge patient lines.", - 2 : "Remove arterial and venous shunt.", - 3 : "Connect arterial and venous cartridge lines to your patient access lines." -} - -#End treatment -RINSEBACK_BUTTON_TEXT = "START RINSEBACK" -END_TREATMENT_COMPLETE_STATE_TEXT = "Treatment Complete" -END_TREATMENT_COMPLETE_PAUSED_STATE_TEXT = "Treatment Complete Paused" - -#rinseback-setup -RINSE_BACK_SETUP_TEXT = "Rinseback Setup" -RINSEBACK_BUTTON_TEXT = "START RINSEBACK" -END_IMAGE_BUTTON_TEXT = "End" -DECELERATE_BUTTON_TEXT = "Decelerate" -ACCELERATE_BUTTON_TEXT = "Accelerate" -PAUSE_BUTTON_TEXT = "Pause" -RESUME_BUTTON_TEXT = "Resume" -RINSEBACK_TEXT = "Rinseback" -RINSEBACK_COMPLETE_TEXT = "Rinseback Complete" -END_TREATMENT_BUTTON_TEXT = "END TREATMENT" -ADDITIONAL_BUTTON_TEXT = "ADDITIONAL" -ADDITIONAL_RINSEBACK_TEXT = "Additional Rinseback" -RINSEBACK_UNIT = " mL" -RINSEBACK_UNIT_MIN = " mL/min" - -ALARM_ID_AND_MESSAGES = { - 1: "Stuck button POST failure.\nStop or Off button detected to be pressed for at least 1 second during test shortly after power up.", - 2: "HD FPGA POST failure.", - 3: "DG FPGA POST failure.", - 4: "HD Watchdog POST failure.", - 5: "DG Watchdog POST failure.", - 6: "UI communication POST failure.\nUI failed to communicate within a reasonable time after power up.", - 7: "HD RTC battery low.", - 8: "HD accelerometer failed POST.", - 9: "DG accelerometer failed POST." , - 10: "Alarm ID available for use.", - 11: "Alarm ID available for use.", - 12: "HD firmware image integrity POST test failed.", - 13: "DG firmware image integrity POST test failed.", - 14: "HD blood flow invalid calibration.", - 15: "HD dialysate flow invalid calibration.", - 16: "HD alarm audio failed POST.", - 17: "HD UI POST failed.", - 18: "DG load cells invalid calibration record.", - 19: "DG flow sensors invalid calibration record.", - 20: "DG conductivity sensors invalid calibration record.", - 21: "DG drain line volume invalid calibration record.", - 22: "DG reservoirs invalid calibration record.", - 23: "DG acid concentrate calibration record.", - 24: "DG bicarb concentrate calibration record.", - 25: "DG accelerometer invalid calibration record.", - 26: "HD accelerometer invalid calibration record.", - 27: "HD blood flow invalid calibration record.", - 28: "HD dialyzer flow invalid calibration record.", - 29: "HD heparin force sensor invalid calibration record.", - 30: "HD Software fault.\nSoftware found itself in an unexpected state.", - 31: "Blood pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running.", - 32: "Blood pump failed motor off check.\nMeasured speed while commanded off.", - 33: "Blood pump failed motor direction check.\nMeasured vs commanded.", - 34: "Blood pump failed rotor speed check.\nMismatch with rotor and motor speeds.", - 35: "Dialysis inlet pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running.", - 36: "Dialysis inlet pump failed motor off check.\nMeasured speed while commanded off.", - 37: "Dialysis inlet pump failed motor direction check.\nMeasured vs commanded.", - 38: "Dialysis inlet pump failed rotor speed check.\nMismatch with rotor and motor speeds.", - 39: "Dialysis outlet pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running.", - 40: "Dialysis outlet pump failed motor off check.\nMeasured speed while commanded off.", - 41: "Dialysis outlet pump failed motor direction check.\nMeasured vs commanded.", - 42: "Dialysis outlet pump failed rotor speed check.\nMismatch with rotor and motor speeds.", - 43: "HD blood leak self test fault.", - 44: "User interface communication timeout.", - 45: "HD too many bad communications CRC.", - 46: "System message that required acknowledgment was not acknowledged.", - 47: "Ultrafiltration rate is too high error during treatment.", - 48: "Ultrafiltration volume accuracy error during treatment.", - 49: "HD FPGA communication down for too long.", - 50: "FPGA not accepting commanded valve states.", - 51: "Blood pump failed motor speed check.\nMeasured vs commanded.", - 52: "Dialysate inlet pump failed motor speed check.\nMeasured vs commanded.", - 53: "Dialysate outlet pump failed motor speed check.\nMeasured vs commanded.", - 54: "HD critical data integrity check failed.", - 55: "DG critical data integrity check failed.", - 56: "HD accelerometer error (no readings or FPGA reports error).", - 57: "DG accelerometer error (no readings or FPGA reports error).", - 58: "HD valve homing failed.", - 59: "HD valve transition time out.", - 60: "HD valve not functional.", - 61: "HD valve current out of range.", - 62: "HD valve position out of target.", - 63: "FPGA reports failure reading arterial pressure sensor.", - 64: "FPGA reports failure reading venous pressure sensor.", - 65: "HD requests DG command with invalid parameter fault.", - 66: "HD blood leak sensor set point set failure.", - 67: "HD blood pump occlusion self-test failure alarm.", - 68: "HD active reservoir recirculation out of range.", - 69: "HD blood leak sensor invalid calibration record.", - 70: "HD arterial pressure self-test failure alarm." , - 71: "HD venous pressure self-test failure alarm.", - 72: "HD blood flow meter status check self-test failure alarm.", - 73: "HD dialysate flow meter status check self-test failure alarm.", - 74: "HD blood leak detector self-test transmit timeout.", - 75: "HD syringe pump self-test failure alarm.", - 76: "HD monitored voltage is out of range.", - 77: "DG monitored voltage is out of range.", - 78: "HD syringe pump direction (from encoder) error.", - 79: "HD syringe pump direction (from controller) error.", - 80: "HD syringe pump fault reported by FPGA.", - 81: "HD syringe pump over travel error.", - 82: "HD syringe pump DAC write failure.", - 83: "HD syringe pump is running while the BP is off.", - 84: "HD venous pressure sensor not being read.", - 85: "HD pump track latch opened alarm.", - 86: "HD BP occlusion sensor not being read.", - 87: "DG heating invalid calibration record.", - 88: "DG concentrate pumps hall sensor out of range.", - 89: "HD BP occlusion sensor error.", - 90: "DG load cells FPGA read error.", - 91: "HD No dialysate flow data receive in the last 3 seconds.", - 92: "DG conductivity sensor bad status.", - 93: "DG outlet primary conductivity out of range.", - 94: "DG pressure out of range.", - 95: "DG watchdog expired.", - 96: "Inlet water temperature in high range.", - 97: "Fill conductivity out of range.", - 98: "HD battery communication fault.", - 99: "HD syringe pump stall alarm.", - 100: "HD no cartridge self-test timeout.", - 101: "HD dry self-test timeout.", - 102: "DG heat disinfect temperature gradient out of range.", - 103: "HD non-volatile calibration group invalid record CRC.", - 104: "Air trap level sensors reporting illegal combination of air/fluid.", - 105: "DG non-volatile system group invalid record CRC.", - 106: "Unused.", - 107: "HD reports DG restarted fault.", - 108: "HD syringe pump ADC error.", - 109: "HD syringe pump volume check error.", - 110: "HD syringe pump speed check error.", - 111: "HD syringe pump not stopped in off state error.", - 112: "HD blood leak zero command transmit timeout.", - 113: "HD blood leak zero command fault.", - 114: "HD venous air bubble detector self-test failure.", - 115: "DG temperature sensor out of range.", - 116: "DG temperature sensor ADC out of range.", - 117: "DG CAN message not acked.", - 118: "DG RTC config error.", - 119: "DG RTC battery low error.", - 120: "HD pre-treatment mode wet self-test prime check failure.", - 121: "DG main primary heater voltage out of range.", - 122: "DG small primary heater voltage out of range.", - 123: "DG trimmer heater voltage out of range.", - 124: "HD end of treatment alarm (high priority).", - 125: "Blood sitting too long after treatment stopped by user alarm (>5 min).", - 126: "HD blood leak detected alarm.", - 127: "Venous pressure too low during treatment." , - 128: "HD venous air bubble detected alarm.", - 129: "HD venous air bubble detected rinseback alarm.", - 130: "Venous pressure too high during treatment.", - 131: "Arterial pressure too low during treatment.", - 132: "Arterial pressure too high during treatment.", - 133: "DG fluid leak detected alarm.", - 134: "HD fluid leak detected alarm." , - 135: "HD experienced large acceleration.", - 136: "DG experienced large acceleration.", - 137: "HD tilt exceeds maximum.", - 138: "DG tilt exceeds maximum.", - 139: "HD AC power lost alarm.", - 140: "Dialysate generator communication timeout.", - 141: "Air trap fill timeout during treatment.", - 142: "Blood pump occlusion detected.", - 143: "DG dialysate temperature sensors out of range.", - 144: "Alarm ID available for use.", - 145: "Concentrate conductivity after adding acid out of range alarm.", - 146: "DG RTC or timer accuracy failure.", - 147: "Wait for the DG to produce dialysate.", - 148: "Inlet water temperature too high.", - 149: "HD watchdog expired.", - 150: "Inlet water conductivity in high range.", - 151: "Inlet water conductivity in low range.", - 152: "Inlet water pressure in low range.", - 153: "HD prime completed high priority alarm.", - 154: "EEPROM operations (read, write, erase) failure.", - 155: "Alarm ID available for use.", - 156: "Alarm ID available for use.", - 157: "DG chemical disinfect prime acid line timeout.", - 158: "Inlet water temperature is in the low range.", - 159: "Dialysate inlet pump failed flow vs motor speed check.", - 160: "Blood pump rotor speed too high.", - 161: "DG comm too many bad CRCs.", - 162: "DG FPGA clock speed check failure.", - 163: "HD sees primary load cell for reservoir 1 change too much too fast.", - 164: "HD sees primary load cell for reservoir 2 change too much too fast.", - 165: "HD in treatment rinseback operation timeout.", - 166: "HD in treatment re-circ sub-mode for too long.", - 167: "HD cartridge door opened alarm.", - 168: "HD active reservoir depletion timeout.", - 169: "Dialysate flow rate out of range.", - 170: "HD syringe empty alarm.", - 171: "HD syringe pump occlusion alarm.", - 172: "HD syringe pump not enough Heparin alarm.", - 173: "HD RTC configuration error.", - 174: "HD RTC or timer accuracy failure.", - 175: "HD pump direction status error.", - 176: "HD active reservoir is full during treatment and DG not ready to switch reservoirs.", - 177: "DG software fault.\nSoftware found itself in an unexpected state.", - 178: "HD communication timeout.", - 179: "DG FPGA communication down for too long.", - 180: "DG load cell ADC error.", - 181: "DG load cells weight out of range for tare.", - 182: "DG load cells invalid calibration.", - 183: "DG invalid load cell value.", - 184: "Inlet or Outlet UV reactor not healthy.", - 185: "DG fan RPM out of range.", - 186: "DG concentrate pump fault.", - 187: "DG concentrate pump CP1 speed control error.", - 188: "DG concentrate pump CP2 speed control error.", - 189: "DG drain pump RPM out of range.", - 190: "DG drain pump off fault.", - 191: "DG flow rate out of upper range.", - 192: "DG flow rate out of lower range.", - 193: ".", - 194: "DG RO pump duty cycle out of range.", - 195: "DG RO pump pressure out of range.", - 196: "DG temperature sensor error flag fault.", - 197: "DG temperature sensors ADC fault.", - 198: "Alarm ID available for use.", - 199: ".", - 200: "DG thermistors/sensors temperature out of range.", - 201: "HD pre-treatment mode wet self-test lc vs FMD failure.", - 202: "HD pre-treatment mode dry pressure normal self-test failure.", - 203: "Pressure sensor fault.", - 204: "RO rejection ratio out of range.", - 205: "Conductivity sensor fault.", - 206: "DG dialysate fill runs out of time.", - 207: "DG flow meter check failure alarm.", - 208: "Alarm ID available for use.", - 209: "DG drain circulation line timeout.", - 210: "HD battery pack detected an error.", - 211: "Blood sitting too long warning (>4 min).", - 212: "HD end of treatment alarm (user not acting to end treatment).", - 213: "HD prime completed medium priority alarm.", - 214: "HD Saline bolus volume check failure.", - 215: "HD rinseback volume check failure.", - 216: "HD end treatment sub-mode timeout alarm.", - 217: "HD blood prime volume check failure.", - 218: "HD syringe detected alarm.", - 219: "HD syringe pump syringe removed alarm.", - 220: "HD battery pack SOC is too low.", - 221: "HD Saline bag is empty.", - 222: "HD dialysate temperature too high alarm.", - 223: "HD dialysate temperature too low alarm.", - 224: "Treatment stopped by user action.", - 225: "HD end of treatment warning.", - 226: "HD prime completed low priority alarm.", - 227: "HD prime out of time alarm.", - 228: "HD time out on prime sub-mode purge air state.", - 229: "HD prime dialysate dialyzer time out alarm.", - 230: "HD prime dialysate bypass time out alarm.", - 231: "HD pre-treatment mode dry pressure self-test failure.", - 232: "HD pre-treatment mode wet self-test LC vs LC failure.", - 233: "Alarm ID available for use.", - 234: "RTC (i.e read time) or RAM operations failure (read or write).", - 235: "HD in treatment stopped sub-mode after rinseback completed (no escalation).", - 236: "HD needs new cartridge to be installed.", - 237: "HD prime saline dialyzer time out alarm.", - 238: "HD no cartridge loaded or installed improperly alarm.", - 239: "HD fail to remove cartridge alarm.", - 240: "Bicarb conductivity out of range during bicarb pump check alarm.", - 241: "DG reservoir drain time out.", - 242: "DG reservoir fill time out.", - 243: "DG reservoir leak time out.", - 244: "DG temperature sensors difference out of range.", - 245: "DG heat disinfect target temperature time out (could not reach to temperature).", - 246: "DG heat disinfect inlet pressure and temperature sensors out of range.", - 247: "DG heat disinfect inlet conductivity and temperature out of range.", - 248: "DG chemical disinfect could not reach to target temperature.", - 249: "DG chemical disinfect inlet pressure and temperature sensors out of range.", - 250: "DG chemical disinfect inlet conductivity and temperature out of range.", - 251: "HD invalid system record.", - 252: "HD invalid service record.", - 253: "DG invalid system record.", - 254: "DG invalid service record.", - 255: "HD and UI software builds are not compatible.", - 256: "HD and DG software builds are not compatible.", - 257: "DG FPGA power out timeout.", - 258: "HD FPGA power out timeout.", - 259: "HD temperatures out of range.", - 260: "UI POST Application Integrity (Sha256Sum) failure.", - 261: "UI POST CANBus failure.", - 262: "UI POST Display failure.", - 263: "UI POST Touch failure.", - 264: "UI POST SD-Card failure.", - 265: "UI POST RTC failure.", - 266: "UI POST WiFi failure.", - 267: "UI POST Bluetooth failure.", - 268: "UI POST Ethernet failure.", - 269: "UI POST Sound failure.", - 270: "HD POST Safety Shutdown failure.", - 271: "DG POST Safety Shutdown failure.", - 272: "HD Fan RPM out of range.", - 273: "HD measured blood pump flow rate is out of range.", - 274: "HD measured dialysate inlet pump flow rate is out of range.", - 275: "HD arterial pressure sensor is reading out of range.", - 276: "HD venous pressure sensor is reading out of range.", - 277: "HD BP occlusion sensor is reading out of range.", - 278: "HD active reservoir weight out of range.", - 279: "DG dialysate drain time out.", - 280: "HD arterial pressure sensor read timeout error.", - 281: "Acid concentration bottle low volume alarm.", - 282: "Bicarbonate concentration bottle low volume alarm.", - 283: "DG load cells weight out of range.", - 284: "DG load cells primary/back up drift out of range.", - 285: "HD treatment recirculate timeout warning.", - 286: "HD treatment rinseback complete timeout warning.", - 287: "HD processor clock speed checks against FPGA clock failure.", - 288: "HD load cells primary/back up drift out of range.", - 289: "DG dialysate or concentrate caps not closed.", - 290: "DG flow too low while heater is on." - } - -ALARM_PRIORITIES = {1: "LOW", 2: "MEDIUM", 3: "HIGH"} -ALARM_LIST_TITLE = "Alarm list" - -REJECTION_REASON = { - 0: "No Active Alarm List", - 1: "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE", # Request is not allowed in the current operating mode - 2: "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM", # Validated request was not confirmed by user in reasonable time - 3: "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE", # Request is not allowed if not in treatment mode - 4: "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE", # Request is not allowed in current treatment state - 5: "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED", # Request is not allowed so near end of treatment - 6: "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE", # Treatment duration is out of range - 7: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT", # Treatment time change is less than currently elapsed treatment time - 8: "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE", # Blood flow is out of range - 9: "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE", # Dialysate flow is out of range - 10: "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE", # Dialysate flow rate or treatment duration causes dialysate volume to exceed limit - 11: "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE", # Ultrafiltration volume is out of range - 12: "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE", # Ultrafiltration rate is out of range - 13: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM", # Treatment time change is less than minimum treatment time - 14: "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS", # Ultrafiltration is not currently in progress - 15: "REQUEST_REJECT_REASON_UF_NOT_PAUSED", # Ultrafiltration is not currently paused - 16: "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS", # A saline bolus is in progress - 17: "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE", # A treatment parameter is out of range - 18: "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION", # The Heparin pre-stop setting is greater than the treatment duration - 19: "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH", # Arterial pressure low and high alarm limits are not inconsistent - 20: "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH", # Venous pressure low and high alarm limits are inconsistent - 21: "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED", # Saline bolus volume maximum has been reached - no more saline allowed - 22: "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS", # A saline bolus is not in progress - 23: "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE", # Requested user action is disabled in current state - 24: "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE", # Requested user action not allowed while alarm is active - 25: "REQUEST_REJECT_REASON_INVALID_COMMAND", # Requested user action invalid - 26: "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED", # The treatment has been completed - 27: "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED", # Rinseback additional volume maximum has been reached - no more additional rinsebacks allowed - 28: "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET", # Ultrafiltration volume is not set yet - 29: "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM", # The user has not confirmed patient connection - 30: "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE", # Heparin cannot be paused if not currently deliverying Heparin - 31: "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED", # Heparin cannot be resumed if not paused - 32: "REQUEST_REJECT_REASON_DG_COMM_LOST", # Treatment cannot initiate if DG comm is lost - 33: "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE", # Post-treatment reservoirs drain not complete - 34: "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE", # Treatment cannot initiate if DG is not in standby idle state - 35: "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT", # Request message not formatted properly - 36: "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME", # Given date/time is invalid - 37: "REQUEST_REJECT_REASON_TREATMENT_IN_PROGRESS", # Treatment is in progress - 38: "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED", # Battery does not have enough charge to start treatment - 39: "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED", # Cannot move on to recirculate without completing full rinseback. - 40: "REQUEST_REJECT_REASON_RESERVOIR_ONE_IS_NOT_READY", # Reservoir one fill is not complete - 41: "REQUEST_REJECT_REASON_PUMP_TRACK_NOT_CLOSED", # Pump track is not ready / closed - 42: "REQUEST_REJECT_REASON_DOOR_NOT_CLOSED", # Door is not closed - 43: "REQUEST_REJECT_REASON_SYRINGE_NOT_PRESENT", # Syringe is not present - 44: "REQUEST_REJECT_REASON_DG_DIALYSATE_CAP_OPEN", # Dialysate cap open - 45: "REQUEST_REJECT_REASON_DG_CONCENTRATE_CAP_OPEN", #Concentrate cap open - 46: "NUM_OF_REQUEST_REJECT_REASONS" # Number of settings change reject codes - } - -# dictionary of rejection reason from application source code. -# message location -> denali-> Headers-> common-> MsgDefs.h - -#create custom treatment -TREATMENT_TITLE = "Create a Custom Treatment" -HEPARIN_TYPE = "UFH 1,000 IU/mL" -ACID_CONCENTRATE = ["08-1251-1", "08-2251-0", "08-3251-9"] -BICARBONATE_CONCENTRATE = "Fres. Centrisol" -DIALYZER_TYPE = ["BB Diacap Pro 13H", "BB Diacap Pro 16H", "BB Diacap Pro 19H", "F Optiflux F160NRe", "F Optiflux F180NRe"] -CONFIRM_TREATMENT_TITLE = "Confirm Treatment" -PRESCRIPTION_TITLE = "PRESCRIPTION" -OPERATING_PARAMETERS_TITLE = "OPERATING PARAMETERS" - -COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", - "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", - "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", - "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} - -CURRENT_COLOR = '#000000' -COMPLETE_COLOR= '#4290ec' -ENABLED_COLOR = '#fcfcfc' -INCOMPLETE_COLOR = '#607a91' -BLOOD_FLOW_RATE = "Blood Flow Rate" -DIALYSATE_FLOW_RATE = "Dialysate Flow Rate" -DURATION = "Duration" -HEPARIN_DISPENSING_RATE = "Heparin Dispensing Rate" -HEPARIN_BOLUS_VOLUME = "Heparin Bolus Volume" -HEPARIN_STOP_TIME = "Heparin Stop Time" -SALINE_BOLUS_VOLUME = "Saline Bolus Volume" -HEPARIN_TYPE_TITLE = "Heparin Type" -SALINE_BOLUS_TITLE = "Saline Bolus" -ACID_CONCENTRATE_TITLE = "Acid Concentrate" -BICARBONATE_CONCENTRATE_TITLE = "Bicarbonate Concentrate" -DIALYZER_TYPE_TITLE = "Dialyzer Type" -DIALYSATE_TEMPERATURE = "Dialysate Temperature" -BLOOD_PRESSURE_MEASUREMENT_INTERVAL = "Blood Pressure Measurement Interval" -RINSEBACK_FLOW_RATE = "Rinseback Flow Rate" - - -CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", "Duration","Heparin Dispensing Rate", - "Heparin Bolus Volume","Heparin Stop Time", "Saline Bolus", "Dialysate Temperature", - "Blood Pressure Measurement Interval", "Rinseback Flow Rate"] -TREATMENT_UNHIGHLIGHTED_COLOR = "#000000" -TREATMENT_HIGHLIGHTED_COLOR = "#135088" -OFF_TEXT = "OFF" -BACK_TEXT = "BACK" -CONTINUE_TEXT = "CONTINUE" - -PRESCRIPTION_DETAILS = { - "Blood Flow Rate": "mL/min", "Dialysate Flow Rate": "mL/min", - "Duration": "min", "Heparin Dispensing Rate": "mL/hr", - "Heparin Bolus Volume": "mL", "Heparin Stop Time": "min", - "Saline Bolus Volume": "mL", - "Dialysate Temperature": "°C", "Arterial Pressure Limit Low": "mmHg", - "Arterial Pressure Limit High": "mmHg","Blood Pressure Measure Interval":"min", - "Rinseback Rate" : "mL/min", "Venous Pressure Limit High": "mmHg", - "Venous Pressure Limit Low": "mmHg" -} - -OPERATIONAL_PARAMETERS = {"Heparin Type": HEPARIN_TYPE, "Acid Concentrate": "Fres. Naturalyte", - "Bicarbonate Concentrate": BICARBONATE_CONCENTRATE, "Dialyzer Type": "BB Diacap Pro 16H"} - -LIQUID_UNIT = "mL" - - -#Time_Duration -CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", "Duration","Heparin Dispensing Rate", - "Heparin Bolus Volume","Heparin Stop Time", "Saline Bolus","Dialysate Temperature","Blood Pressure Measurement Interval", - "Rinseback Flow Rate"] - - - -#Pre-Treatment Disposables -NEXT_BUTTON_TEXT = "NEXT" -BACK_BUTTON_TEXT = "BACK" -CONFIRM_BUTTON_TEXT = "CONFIRM" -CONSUMABLE_SELF_TEST_TEXT = "Consumables Self Test" -BICARB_PUMP_CHECK_TEXT = "BiCarb Pump Check" -ACID_PUMP_CHECK_TEXT = "Acid Pump Check" -SELF_TEST_COMPLETE_TEXT = "Self Test Complete!" -BUSY = "Busy" -CHECK = "Check" -BEGIN_PRIME_TITLE = "Begin Prime" -PRIMING_TITLE = "Priming" -SYSTEM_SELF_TEST_TITLE = "System Self Test" -FILTER_FLUSH_TITLE = "Filter Flush" - -#service -BACK_TEXT = "BACK" -CONFIRM_TEXT = "CONFIRM" -SHUTDOWN_TEXT = "SHUTDOWN" - - - +ACK_BAK_STATUS = 'Ack Bak' \ No newline at end of file Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -reefd61a5d338590b9ea89ef87d3a2c181e045cf5 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision eefd61a5d338590b9ea89ef87d3a2c181e045cf5) @@ -12,76 +12,19 @@ # ############################################################################ - -import sys +import csv import test import squish -from configuration import config +from dialin.ui.hd_simulator import HDSimulator from builtins import int as pyInt +from builtins import format +from datetime import datetime +hd_simulator = HDSimulator() + +LOG_LOCATION = "/home/denali/Desktop/sd-card/log/*.log" -def start_application(app_name): - """ - Function to start application and verify application status [running] - If application does not start or running status is false, test stops - Argument: - @param app_name : (str) - Name of the application - @param app_executable : (str) - Actual application - @return: handle for the application if the application is in running state, - or error (exist the application) - """ - counter = 0 - while True: - try: - counter += 1 - test.log("Starting {}".format(app_name)) - squish.startApplication(app_name) - if counter == 1: - test.log("Application launched at the "+str(counter)+" st try.") - elif counter == 2: - test.log("Application launched at the "+str(counter)+" nd try.") - elif counter == 3: - test.log("Application launched at the "+str(counter)+" rd try.") - else: - test.log("Application launched at the "+str(counter)+" th try.") - break - except RuntimeError: - if counter == 1: - test.log("Application failed to launch after "+str(counter)+" try - Please refer logs") - elif counter == 20: - test.log("Exiting after "+str(counter)+ " tries..") - sys.exit(1) - else: - test.log("Application failed to launch after "+str(counter)+ " tries - Please refer logs") - except: - logErrorDetails("Failed to start the application") - sys.exit(1) - -def check_if_object_is_within_the_container(obj=None, container=None): - """ - check if an object is inside a container - @param obj - child UI object - @param container - container UI object - @return boolean true/false - """ - container = squish.findObject(container) - containerPos = container.mapToGlobal(squish.QPoint(0, 0)) - container_x, container_y = pyInt(containerPos.x), pyInt(containerPos.y) - container_width, container_height = pyInt(container.width), pyInt(container.height) - - obj = squish.findObject(obj) - objPos = obj.mapToGlobal(squish.QPoint(0, 0)) - obj_x, obj_y = pyInt(objPos.x), pyInt(objPos.y) - obj_width, obj_height = pyInt(obj.width), pyInt(obj.height) - - if obj_x >= container_x and obj_y >= container_y: - if (obj_x + obj_width) <= (container_x + container_width) and (obj_y + obj_height) <= (container_y + container_height): - return True - - return False - - def scroll_to_zone(zone=None, screen_object=None): """ scroll to the numeric if object is hidden @@ -108,3 +51,200 @@ raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") + +def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M:%S'): + + date = datetime.now() + return str(date.strftime(date_format)) + +def is_float(num): + """ + This function checks the value is adaptable for float conversion. + + @param num - (string) input value for conversion. + @return True/False- (bool) returns True if the value can type casted into float, else False + """ + try: + if '.' in num: + float(num) + return True + except ValueError: + return False + + +def is_intiger(num): + """ + This function checks the value is adaptable for integer conversion. + + @param num - (string) (string) input value for conversion. + @return True/False- (bool) returns True if the value can type casted into int, else False + """ + try: + if num.isdigit(): + return True + except ValueError: + return False + + +def get_extracted_file(): + """ + This function is the handler for getting file from log folder. + + This handler will go inside log folder and looks for newly added log based on current time. + if it satisfied that condition, it will return the exact path of newly created log. + + Application log file is automatically created on '/home/denali/Desktop/sd-card/log/ {current_date}_denaliSquish.log' + + @return latest_file - (string) returns latest file that append on log folder from sd-data + """ + try: + current_date = get_current_date_and_time(date_format = "%Y_%m_%d") + latest_file = '/home/denali/Desktop/sd-card/log/'+current_date+'_denaliSquish.log' + return latest_file + except: + return False + + +def get_message_from_log(file_name, message_text): + + """ + This method intended to extract the message from application log. + For row[index], index represent column to be extracted. + + @param file_name - (string) path of the latest log file created. + @param message_text - (string) message text to be extracted. + @return message - (list) API arguments displayed in log. + """ + message = [] + count = 0 + try: + with open(file_name, 'r') as csv_file: + try: + for row in reversed(list(csv.reader(csv_file))): + if row[0].isalpha(): + pass + else: + row_length = sum(1 for values in row) + if row_length >= 4: + if row[3]!= None and row[3] == message_text: + if count == 30: + test.fail("handler unable to find message text from log file.") + message_length = sum(1 for values in row) + for column in range(4, message_length, 1): + message.append(row[column]) + count +=1 + for value in range(len(message)): + float_status = is_float(message[value]) + int_status = is_intiger(message[value]) + if float_status is True: + message[value] = float(message[value]) + if int_status is True: + message[value] = int(message[value]) + return message + else: + pass + except: + test.fail("application log data is corrupted") + except: + test.fail("Log file is not created or log file is not created based on standard log naming format.") + + +def get_ack_request_details(file_name, message_text): + """ + This method intended to extract acknowledgement request status, negative requested acknowledgement + and message id from application log. + + For row[index], were index represent column to be extracted. + + @param file_name - (string) path of the latest log file created. + @param message_text - (string) message text to be extracted from log. + @return row[3] - (string) acknowledgement request status. + @return row[4] - (string) Negative requested acknowledgement value (Sq). + @return message_id - (string) formatted message id from log. + """ + try: + message_id = " ID" + with open(file_name, 'r') as csv_file: + try: + for row in reversed(list(csv.reader(csv_file))): + if row[0].isalpha(): + pass + else: + row_length = sum(1 for values in row) + if row_length == 6 and row[3] != message_text: + if row[5].split(':')[0] == message_id: + extracted_message_id = pyInt(row[5].split(':')[1], 16) + formatted_message_id = format(extracted_message_id, '#0x') + # MSG_ID_HD_DEBUG_EVENT (0xFFF1) and MSG_ID_DG_DEBUG_EVENT (0xFFF2) hex values are reversed in log. + string_format_id = str(formatted_message_id) + first_two_char = string_format_id[2:4] + last_two_char = string_format_id[-2:] + if last_two_char != '00': + return row[3], row[4], ('0x'+last_two_char+first_two_char) + else: + return row[3], row[4], formatted_message_id.replace("00", "") + else: + pass + except: + test.fail("application log data is corrupted - unable to fetch data") + except: + test.fail("Log file is not created or log file is not created based on standard log naming format.") + + +def get_bak_request_details(file_name, ack_bak_value): + """ + This method intended to extract the acknowledgement back status from application log. + + For row[index], were index represent column to be extracted. + + @param file_name - (string) path of the latest log file created. + @param ack_bak_value - (string) Positive back acknowledgement value (Sq). + @return row[3] - (string) acknowledgement back status. + """ + try: + with open(file_name, 'r') as csv_file: + try: + for row in reversed(list(csv.reader(csv_file))): + if row[0].isalpha(): + pass + else: + row_length = sum(1 for values in row) + if row_length >= 5: + if row[4] == ack_bak_value: + return row[3] + else: + pass + else: + pass + except: + test.fail("application log data is corrupted") + except: + test.fail("Log file is not created or log file is not created based on standard log naming format.") + + + +def get_current_log_details(message_ack = False, message_text = None): + """ + This function is capable to perform data analysis from application log folder. + + logs are automatically created in path :"/home/denali/Desktop/sd-card/log/*.log". + + In row[index], index represent column to be extracted. + @param message_ack - (bool) 'True' - if ack is satisfied in log / 'False' - if ack condition is not satisfied + @param message_text - (string) message text to be extracted from log. + @return content_record - (list) list contains extracted data (ack_req, ack_bak, message, message_id). + """ + content_record = [] + file_name = get_extracted_file() + if message_text != None: + message = get_message_from_log(file_name, message_text) + content_record.append(message) + if message_ack != False: + ack_req_status, ack_req_value, message_id = get_ack_request_details(file_name, message_text) + ack_bak_value = ack_req_value.replace(":-", ":") # getting negative requested ack from positive requested ack + content_record.append(ack_req_status) + content_record.append(message_id.lower()) + if message_ack != False and ack_bak_value != None: + ack_bak_status = get_bak_request_details(file_name, ack_bak_value) + content_record.append(ack_bak_status) + return content_record Index: shared/scripts/names.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -reefd61a5d338590b9ea89ef87d3a2c181e045cf5 --- shared/scripts/names.py (.../names.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/names.py (.../names.py) (revision eefd61a5d338590b9ea89ef87d3a2c181e045cf5) @@ -47,6 +47,7 @@ o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +#cloud_sync_device_registeration Index: suite.conf =================================================================== diff -u -r8df6f936193bbd9127d3ec940562e62db0060bcb -reefd61a5d338590b9ea89ef87d3a2c181e045cf5 --- suite.conf (.../suite.conf) (revision 8df6f936193bbd9127d3ec940562e62db0060bcb) +++ suite.conf (.../suite.conf) (revision eefd61a5d338590b9ea89ef87d3a2c181e045cf5) @@ -1,6 +1,6 @@ AUT=denaliSquish LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_cloud_sync_device_registration VERSION=3 WRAPPERS=Qt Index: tst_cloud_sync_device_registration/test.py =================================================================== diff -u --- tst_cloud_sync_device_registration/test.py (revision 0) +++ tst_cloud_sync_device_registration/test.py (revision eefd61a5d338590b9ea89ef87d3a2c181e045cf5) @@ -0,0 +1,1043 @@ +# -*- coding: utf-8 -*- + +## +# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# copyright +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, +# IN PART OR IN WHOLE, +# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# file tst_UI_log_verification +# date 2022/07/06 +# author Amol Pandharinath Shinde +# author Akshay Dhawan +# + +# NOTE: +# This test verifies the logs for the messages provided + +from dialin.ui.hd_simulator_alarms import HDAlarmsSimulator +import logging +from dialin.protocols.CAN import DenaliCanMessenger +from dialin.ui import HDSimulator +from dialin.ui import DGSimulator +from dialin.ui import utils +from configuration import utility +from configuration import config +import builtins +from dialin.common.msg_ids import MsgIds +from dialin.common.hd_defs import HDOpSubModes, HDOpModes +from dialin.common import msg_defs +from dialin.utils.conversions import integer_to_bytearray, float_to_bytearray, short_to_bytearray, unsigned_integer_to_bytearray, integer_to_bit_array + +hd_simulator = HDSimulator() +dg_simulator = DGSimulator() + +logger= logging.getLogger("INFO") +messenger= DenaliCanMessenger('can0') +hd_alarm= HDAlarmsSimulator(can_interface=messenger, logger=logger) +NUMBER_OF_OPMODE = 9 +NUMBER_OF_TREATMENTMODES = 3 +CONDITIONS = [0,1] + +def verify_log(msg_id,msg=None, param=None): + """ + This function verifies the UI log's. + @param msg_id - (string) expected message_id's. + @param msg - (string) message to be displayed on log. + @param param - (list) parameters for msg_id's. + """ + test.startSection("Verification of UI log based on message ID : " + str(msg_id)) + utils.waitForGUI(2) + ack = False + if not msg_id in msg_defs.ACK_NOT_REQUIRED: + ack = True + message_extracted = utility.get_current_log_details(message_ack=ack, message_text=msg) + if ack == True: + test.verify(config.ACK_REQ_STATUS in message_extracted, "ack request is verified") + test.verify(config.ACK_BAK_STATUS in message_extracted, "ack back is verified") + message_id_hex = builtins.hex(builtins.int(msg_id)) + message_id_str = builtins.str(message_id_hex) + test.verify(message_id_str in message_extracted, "message ID is verified") + if param != None: + test.verify(param in message_extracted, "parameters are verified") + test.endSection() + + +def main(): + utils.tstStart(__file__) + startApplication(config.AUT_NAME) + +# #HD Broadcast +# #0x0D00 +# hd_simulator.cmd_set_treatment_time(200,60,0) +# verify_log(msg_id = MsgIds.MSG_ID_TREATMENT_TIME.value, msg = "TreatmentTime", param = [200,60,0]) +# +# #0x0500 +# hd_simulator.cmd_set_treatment_blood_flow_rate(flow_set_pt = 20, measured_flow = 10.5, +# rot_speed = 112.2 , mot_speed = 120.3, mc_speed = 100.0, +# mc_current = 12.5, pwm = 32.3, rotor_count = 30) +# verify_log(msg_id = MsgIds.MSG_ID_BLOOD_FLOW_DATA.value, msg = "BloodFlow", param = [20,10.5,112.2,120.3,100.0,12.5,32.3,30]) +# +# #0x0800 +# hd_simulator.cmd_set_treatment_dialysate_flow_rate(flow_set_pt=20, measured_flow=10.5, +# rot_speed = 112.2 , mot_speed = 120.3, mc_speed = 100.0, +# mc_current = 12.5, pwm = 32.3) +# verify_log(msg_id = MsgIds.MSG_ID_DIALYSATE_FLOW_DATA.value, msg = "DialysateFlow", param = [20,10.5,112.2,120.3,100.0,12.5,32.3]) +# +# #0x0900 +# hd_simulator.cmd_set_pressure_occlusion_data(arterial_prs = 54.5, venous_prs = 20.1, blood_pump_occlusion = 3, +# dialysate_inlet_pump_occlusion = 2, dialysate_outlet_pump_occlusion = 5) +# verify_log(msg_id = MsgIds.MSG_ID_PRESSURE_OCCLUSION_DATA.value, msg = "Pressure/Occlusion", param = [54.5,20.1,3,2,5]) +# +# #0x0B00 +# hd_simulator.cmd_set_treatment_ultrafiltration_outlet_flow_data(ref_uf_vol = 77.5, measured_uf_vol = 22.6, +# rot_speed = 54.0, mot_speed = 66.2, mc_speed = 33.3, +# mc_current = 21.2, pwm = 322.2) +# verify_log(msg_id = MsgIds.MSG_ID_DIALYSATE_OUT_FLOW_DATA.value, msg = "OutletFlow",param = [77.5,22.6,54.0,66.2,33.3,21.2,322.2]) +# +# #0x1A00 +# hd_simulator.cmd_set_treatment_parameter_ranges(min_treatment_duration = 300, max_treatment_duration = 500, +# min_uf_volume = 22.6, max_uf_volume = 34.2, +# min_dialysate_flow_rate = 3, max_dialysate_flow_rate = 5) +# +# verify_log(msg_id = str(MsgIds.MSG_ID_TREATMENT_PARAM_CHANGE_RANGES.value), msg = "TreatmentRanges", param = [300,500,22.6,34.2,3,5]) +# +# #0x2F00 +# hd_simulator.cmd_set_treatment_saline_bolus_data(target = 2, cumulative = 90.0, delivered = 67.2) +# verify_log(msg_id = MsgIds.MSG_ID_SALINE_BOLUS_DATA.value, msg = "Saline", param = [2,90.0,67.2]) +# +# #0x4D00 +# hd_simulator.cmd_set_treatment_heparin_data(cumulative = 4) +# verify_log(msg_id = MsgIds.MSG_ID_HD_HEPARIN_DATA_BROADCAST.value, msg = "Heparin", param = [4]) +# +# #0x3300 +# hd_simulator.cmd_send_accelerometer_hd_data(x = 12.3, y = 22.2, z = 4.0, +# x_max = 14.0, y_max = 30.2, z_max = 10.5, +# x_tilt = 11.0, y_tilt = 22.1, z_tilt = 5.5) +# verify_log(msg_id = MsgIds.MSG_ID_HD_ACCELEROMETER_DATA.value, msg = "Accel", param = [12.3,22.2,4.0,14.0,30.2,10.5,11.0,22.1,5.5]) +# +# #0x3A00 +# #TODO: Payload values need to been changed after discussion +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(MsgIds.MSG_ID_HD_VALVES_DATA.value) +# payload += short_to_bytearray(3) +# payload += short_to_bytearray(4) +# payload += float_to_bytearray(3) +# payload += short_to_bytearray(7) +# payload += short_to_bytearray(5) +# payload += short_to_bytearray(4) +# payload += unsigned_integer_to_bytearray(3) +# payload += unsigned_integer_to_bytearray(5) +# hd_simulator.cmd_send_hd_general_response(message_id=58, accepted=1, reason=1, is_pure_data=False, has_parameters=False, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_VALVES_DATA.value, msg="~HD_Valves_Data") +# +# #0x3E00 +# hd_simulator.cmd_send_hd_general_response(message_id = 62, accepted = 1, reason = 1) +# hd_simulator.cmd_send_hd_air_trap_data(lower_level = 1, upper_level = 10) +# verify_log(msg_id = MsgIds.MSG_ID_HD_AIR_TRAP_DATA.value, msg = "AirTrap", param = [1,10]) +# +# #0x6900 +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(0) +# payload += float_to_bytearray(5.5) +# payload += float_to_bytearray(1.5) +# payload += integer_to_bytearray(1) +# payload += float_to_bytearray(7.5) +# payload += float_to_bytearray(2.5) +# payload += float_to_bytearray(1.5) +# payload += float_to_bytearray(1.2) +# payload += float_to_bytearray(2) +# payload += unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=105, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_SYRINGE_PUMP_DATA.value, msg="Syringe") +# +# +# #0x6A00 +# payload = unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=106, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id = MsgIds.MSG_ID_HD_FLUID_LEAK_STATE.value, msg = "~HD_Fluid_Leak_Data") +# +# #0x6C00 +# hd_simulator.cmd_send_hd_blood_leak_data(blood_leak_status = 0, blood_leak_state = 1, +# blood_leak_zero_status_counter = 2, blood_leak_counter = 3, +# blood_leak_zeroed_status = 2, blood_leak_detect_set_point = 1, +# blood_leak_detect_level = 1, blood_leak_st_count = 1, +# blood_leak_led_intensity = 2, blood_leak_register_counter = 3) +# verify_log(msg_id = MsgIds.MSG_ID_HD_BLOOD_LEAK_DATA.value, msg = "BloodLeak", param = [0,1,2,3,2,1,1,1,2,3]) +# +# #0x9300 +# hd_simulator.cmd_send_hd_air_bubble_data(venous_air_bubble_status = 2, venous_air_bubble_state = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_BUBBLES_DATA.value, msg = "AirBubble", param = [2,0]) +# +# #0x7B00 +# payload = float_to_bytearray(1.1) +# payload += float_to_bytearray(2.1) +# payload += float_to_bytearray(4) +# payload += float_to_bytearray(3) +# payload += float_to_bytearray(7) +# payload += float_to_bytearray(6) +# payload += float_to_bytearray(1) +# payload += float_to_bytearray(2) +# payload += float_to_bytearray(3) +# payload += float_to_bytearray(4) +# payload += float_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=123, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_VOLTAGES_DATA.value, msg="~HD_Voltages_Data") +# +# #0x7D00 +# payload = unsigned_integer_to_bytearray(10) +# payload += float_to_bytearray(3) +# payload += float_to_bytearray(2) +# payload += float_to_bytearray(0.5) +# payload += unsigned_integer_to_bytearray(2) +# hd_simulator.cmd_send_hd_general_response(message_id=125, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_ALARM_INFORMATION.value, msg="~HD_Alarm_Information") +# +# #0xA200 +# payload = unsigned_integer_to_bytearray(20) +# payload += unsigned_integer_to_bytearray(30) +# hd_simulator.cmd_send_hd_general_response(message_id=162, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_SWITCHES_DATA.value, msg="~HD_Switches_Data") +# +# #0x9D00 +# payload = float_to_bytearray(1) +# payload += float_to_bytearray(1) +# payload += float_to_bytearray(3) +# payload += float_to_bytearray(2) +# payload += float_to_bytearray(5) +# payload += float_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=157, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_TEMPERATURES_DATA.value, msg="~HD_Temperature_Data") +# +# #0xA300 +# payload = float_to_bytearray(3) +# payload += float_to_bytearray(4) +# payload += float_to_bytearray(10) +# payload += unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=163, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_FANS_DATA.value, msg="~HD_Fans_Data") +# +# #0xA800 +# payload = unsigned_integer_to_bytearray(1) +# payload += float_to_bytearray(4) +# payload += float_to_bytearray(10) +# payload += float_to_bytearray(1) +# payload += float_to_bytearray(2) +# payload += unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(133) +# payload += float_to_bytearray(13) +# hd_simulator.cmd_send_hd_general_response(message_id=168, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_RESERVOIRS_DATA.value, msg="~HD_Reservoirs_Data") +# +# +# #HD Operation Mode +# #0x2500 +# mode_data = HDOpModes.NUM_OF_MODES.value +# submode_data = HDOpSubModes.NUM_OF_STANDBY_STATES.value +# for mode in range(mode_data): +# for sub_mode in range(submode_data): +# #hd_simulator.cmd_send_hd_operation_mode(op_mode = mode, sub_mode = 0) +# hd_simulator.cmd_send_hd_operation_mode(op_mode = mode, sub_mode = sub_mode) +# verify_log(msg_id = MsgIds.MSG_ID_HD_OP_MODE.value, msg = "OpMode", param = [mode,sub_mode]) +# +# #0x5C00 +# for s_mode in range(NUMBER_OF_OPMODE): +# hd_simulator.cmd_send_pre_treatment_state_data(sub_mode = s_mode, water_sample_state = 0, consumables_self_test_state = 0, +# no_cartridge_self_test_state = 0, installation_state = 0, +# dry_self_test_state = 0, prime_state = 0, +# recirculate_state = 0, patient_connection_state = 0) +# verify_log(msg_id = MsgIds.MSG_ID_PRE_TREATMENT_STATE.value, msg = "PreTreatmentStates",param = [s_mode,0,0,0,0,0,0,0,0]) +# +# #0x0F00 +# for s_mode in range(NUMBER_OF_TREATMENTMODES): +# hd_simulator.cmd_set_treatment_states_data(sub_mode = s_mode, uf_state = 0, saline_state = 0, heparin_state = 0, +# rinseback_state = 0, recirculate_state = 0, blood_prime_state = 0, +# treatment_end_state = 0, treatment_stop_state = 0, dialysis_state = 0) +# verify_log(msg_id = MsgIds.MSG_ID_TREATMENT_STATE.value, msg = "TreatmentStates", param = [s_mode,0,0,0,0,0,0,0,0,0]) +# +# #0x7700 +# # for s_mode in range(3): +# payload = integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=119, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_POST_TREATMENT_STATE.value, msg="PostTreatmentStates") +# +# #0x7E00 +# for s_mode in range(NUMBER_OF_TREATMENTMODES): +# hd_simulator.cmd_send_hd_disinfection_state(sub_mode = s_mode, flush_mode = 0, heat_mode = 0, chemical_mode = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_DISINFECT_STANDBY_DATA.value, msg = "DisinfectStates", param = [s_mode,0,0,0]) +# +# #0x9A00 UI-HD +# +# #0x9B00 +# # hd_simulator.cmd_send_hd_disinfect_response(accepted = True, reason =1) +# payload = integer_to_bytearray(1) +# payload += integer_to_bytearray(2) +# hd_simulator.cmd_send_hd_general_response(message_id=155, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_SET_STANDBY_DISINFECT_SUB_MODE_RESPONSE.value, msg="~HD_Set_Standby_Disinfect_State_Response") +# +# #RINSEBACK +# +# #0x5200 UI-HD +# +# #0x5300 +# hd_simulator.cmd_send_treatment_adjust_rinseback_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_RINSEBACK_CMD_RESPONSE.value, msg = "AdjustRinseback", param = [1,0]) +# +# #0x5400 +# +# #0x5500 +# hd_simulator.cmd_send_treatment_adjust_recirculate_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_RECIRC_CMD_RESPONSE.value, msg = "AdjustRecirculate", param = [1,0]) +# +# #0x5600 +# hd_simulator.cmd_send_treatment_rinseback_data(target_vol = 2.4, current_vol = 1.9, flow_rate = 1, timeout = 4, +# timeout_countdown = 8, is_completed = False) +# verify_log(msg_id = MsgIds.MSG_ID_HD_RINSEBACK_PROGRESS.value, msg = "Rinseback", param = [2.4,1.9,1,4,8,False]) +# +# #0x5A00 +# hd_simulator.cmd_send_treatment_recirculate_data(timeout_total = 200, timeout_count_down = 100) +# verify_log(msg_id = MsgIds.MSG_ID_HD_RECIRC_PROGRESS.value, msg = "Recirculate", param = [200,100]) +# +# #Treatment End(sub-mode) +# #0x5800 +# hd_simulator.cmd_send_treatment_adjust_end_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_TX_END_CMD_RESPONSE.value, msg = "AdjustTxEnd", param = [1,0]) +# +# #Treatment Blood Prime(sub-mode) +# #0x5900 +# #there is an additional parameter in the log +# hd_simulator.cmd_send_treatment_blood_prime_data(target = 22.2, current = 33.3) +# verify_log(msg_id = MsgIds.MSG_ID_HD_BLOOD_PRIME_PROGRESS.value, msg = "BloodPrime", param = [22.2,33.3, 0.0]) +# +# #Treatment Stop(sub-mode) +# #0x4900 +# payload = unsigned_integer_to_bytearray(150) +# payload += unsigned_integer_to_bytearray(300) +# hd_simulator.cmd_send_hd_general_response(message_id=73, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_TREATMENT_STOP_TIMER_DATA.value, msg="Stop") +# +# #RTC +# #0x0A00 +# payload = unsigned_integer_to_bytearray(20) +# hd_simulator.cmd_send_hd_general_response(message_id=10, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id = MsgIds.MSG_ID_RTC_EPOCH.value, msg = "~HD_RTC_Epoch_Data") +# +# #0x6E00 +# hd_simulator.cmd_send_set_rtc_response(response = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_UI_SET_RTC_RESPONSE.value, msg = "AdjustHDDateTime", param = [1,0]) +# +# #0x7000 +# dg_simulator.cmd_send_set_rtc_response(response = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_DG_UI_SET_RTC_RESPONSE.value, msg = "AdjustDGDateTime", param = [1,0]) +# +# #Power +# #0x0100 +# hd_simulator.cmd_send_poweroff_button_pressed() +# verify_log(msg_id = MsgIds.MSG_ID_OFF_BUTTON_PRESS.value, msg = "PowerOff") +# +# #0x0E00 +# hd_simulator.cmd_send_broadcast_poweroff_imminent() +# verify_log(msg_id = MsgIds.MSG_ID_POWER_OFF_WARNING.value, msg = "ShuttingDown") +# +# #Events +# #0xA400 +# for value in CONDITIONS: +# payload = unsigned_integer_to_bytearray(MsgIds.MSG_ID_HD_EVENT.value) +# payload += unsigned_integer_to_bytearray(4) +# payload += integer_to_bytearray(value) +# payload += unsigned_integer_to_bytearray(4) +# payload += integer_to_bytearray(value) +# hd_simulator.cmd_send_hd_general_response(message_id=164, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_EVENT.value, msg="General") +# +# #0xA500 +# for value in CONDITIONS: +# payload = unsigned_integer_to_bytearray(MsgIds.MSG_ID_DG_EVENT.value) +# payload += unsigned_integer_to_bytearray(4) +# payload += integer_to_bytearray(value) +# payload += unsigned_integer_to_bytearray(4) +# payload += integer_to_bytearray(value) +# dg_simulator.cmd_send_dg_general_response(message_id=165, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id = MsgIds.MSG_ID_DG_EVENT.value) +# +# #Power-On Self-Test [POST] +# #0x8E00 +# hd_simulator.cmd_send_hd_post(item = 1, passed = True, done = False) +# verify_log(msg_id = MsgIds.MSG_ID_HD_POST_SINGLE_TEST_RESULT.value, msg = "POSTItem", param = [1,1]) +# +# #0x8F00 +# hd_simulator.cmd_send_hd_post(item = 1, passed = False, done = True) +# verify_log(msg_id = MsgIds.MSG_ID_HD_POST_FINAL_TEST_RESULT.value, msg = "POSTDone", param = [0]) +# +# #0x9000 +# dg_simulator.cmd_send_dg_post(item = 1, passed = True, done = False) +# verify_log(msg_id = MsgIds.MSG_ID_DG_POST_SINGLE_TEST_RESULT.value, msg = "POSTItem", param = [1,1]) +# +# #0x9100 +# dg_simulator.cmd_send_dg_post(item = 1, passed = False, done = True) +# verify_log(msg_id = MsgIds.MSG_ID_DG_POST_FINAL_TEST_RESULT.value, msg = "POSTDone", param = [0]) +# +# #0x9C00 +# #TODO: Payload values need to been changed after discussion +# hd_simulator.cmd_send_hd_general_response(message_id=156, accepted=1, reason=1, is_pure_data=False, has_parameters=False, parameters_payload=None) +# verify_log(msg_id=MsgIds.MSG_ID_HD_DG_POST_RESULT_REQUEST.value) +# +# #Versions +# #0x1D00 +# hd_simulator.cmd_send_version_hd_data(major=1, minor=1, micro=0, build=4, +# fpga_id=5, fpga_major=1, fpga_minor=2, fpga_lab=3, +# compatibility_rev=6) +# verify_log(msg_id = MsgIds.MSG_ID_HD_VERSION.value, msg = "VersionRsp", param = [1,1,0,4,5,1,2,3,6]) +# +# #0x1E00 +# dg_simulator.cmd_send_version_dg_data(major=1, minor=1, micro=0, build=4, +# fpga_id=5, fpga_major=1, fpga_minor=2, fpga_lab=3, +# compatibility_rev=6) +# verify_log(msg_id = MsgIds.MSG_ID_DG_VERSION.value, msg = "VersionRsp", param = [1,1,0,4,5,1,2,3,6]) +# +# #0x9E00 +# hd_simulator.cmd_send_hd_request_ui_version() +# verify_log(msg_id = MsgIds.MSG_ID_HD_UI_VERSION_INFO_RESPONSE.value, msg = "VersionReq") +# +# #0x2000 +# dg_simulator.cmd_set_dg_pressures_data(ro_inlet_pressure = 0.0, ro_outlet_pressure = 1.0, drain_inlet_pressure = 2.0, drain_outlet_pressure = 3.0) +# verify_log(msg_id = MsgIds.MSG_ID_DG_PRESSURES_DATA.value, msg = "Pressures", param = [0.0, 1.0, 2.0, 3.0]) +# +# #0x2800 +# dg_simulator.cmd_set_dg_reservoir_data(active_reservoir = 0, fill_to_vol_ml = 1, drain_to_vol_ml = 2) +# verify_log(msg_id = MsgIds.MSG_ID_DG_RESERVOIRS_DATA.value, msg = "Reservoir", param = [0, 1, 2]) +# +# #0x2A00 +# #there is a parameter mismatch here as the log contains a series of boolean values instead of one integer +# dg_simulator.cmd_set_dg_valves_states(valves_states = 3) +# verify_log(msg_id = MsgIds.MSG_ID_DG_VALVES_STATES.value, msg = "ValvesStates") +# +# #0x2C00 +# #there is a parameter mismatch here as the log contains a 3 float values [0.0,0.0,0.0] instead of 3 given integers +# dg_simulator.cmd_set_dg_heaters_data(main_primary_dc = 1, small_primary_dc = 2, trimmer_dc = 3) +# verify_log(msg_id = MsgIds.MSG_ID_DG_HEATERS_DATA.value, msg = "Heaters", param = [0.0, 0.0, 0.0]) +# +# #0x0C00 +# dg_simulator.cmd_set_dg_load_cell_readings_data(reservoir1_primary = 1.0, reservoir1_backup = 2.0,reservoir2_primary = 3.0, reservoir2_backup = 4.0) +# verify_log(msg_id = MsgIds.MSG_ID_LOAD_CELL_READINGS.value, msg = "LoadCell", param = [1.0,2.0,3.0,4.0]) +# +# #0x2D00 +# dg_simulator.cmd_set_dg_temperatures_data(inlet_primary_heater = 1.0, outlet_primary_heater = 2.0, +# conductivity_sensor1 = 3.0, conductivity_sensor2 = 4.0, +# outlet_redundancy = 5.0, inlet_dialysate = 6.0, +# primary_heater_thermocouple = 7.0, trimmer_heater_thermocouple = 8.0, +# primary_heater_cold_junction = 9.0, trimmer_heater_cold_junction = 10.0, +# primary_heater_internal_temp = 11.0, trimmer_heater_internal_temp = 12.0) +# verify_log(msg_id = MsgIds.MSG_ID_DG_TEMPERATURE_DATA.value, msg = "Temperatures") +# +# #0x3100 +# dg_simulator.cmd_send_dg_conductivity_data(ro_rejection_ratio = 1.0, cpi_conductivity = 2.0, +# cpo_conductivity = 3.0, cd1_conductivity = 4.0, +# cd2_conductivity = 5.0) +# verify_log(msg_id = MsgIds.MSG_ID_DG_CONDUCTIVITY_DATA.value, msg = "Conductivity", param = [1.0, 2.0, 3.0, 4.0,5.0]) +# +# #0x3700 +# payload = integer_to_bytearray(1) +# payload += integer_to_bytearray(20) +# payload += integer_to_bytearray(15) +# payload += integer_to_bytearray(30) +# payload += integer_to_bytearray(25) +# payload += float_to_bytearray(2.0) +# payload += float_to_bytearray(1.0) +# payload += integer_to_bytearray(40) +# dg_simulator.cmd_send_dg_general_response(message_id=55, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_HEAT_DISINFECT_DATA.value, msg = "~DG_Heat_Disinfect_Data") +# +# #0x4200 +# payload = float_to_bytearray(2.22) +# payload += float_to_bytearray(1.45) +# payload += float_to_bytearray(4.67) +# payload += float_to_bytearray(5.93) +# dg_simulator.cmd_send_dg_general_response(message_id=66, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_CONCENTRATE_PUMP_DATA.value, msg="~DG_Concentrate_Pump_Data") +# +# #0x4400 +# payload = integer_to_bytearray(10) +# payload += integer_to_bytearray(15) +# payload += integer_to_bytearray(30) +# payload += integer_to_bytearray(20) +# dg_simulator.cmd_send_dg_general_response(message_id=68, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_UV_REACTORS_DATA.value, msg="~DG_UV_Reactors_Data") +# +# #0x4500 +# payload = float_to_bytearray(1.25) +# payload += float_to_bytearray(4.17) +# payload += float_to_bytearray(5.53) +# dg_simulator.cmd_send_dg_general_response(message_id=69, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_THERMISTORS_DATA.value, msg="~DG_Thermistors_Data") +# +# #0x4800 +# payload = float_to_bytearray(1.9) +# payload += float_to_bytearray(4.7) +# payload += float_to_bytearray(9.5) +# payload += float_to_bytearray(9.3) +# payload += float_to_bytearray(8.8) +# payload += float_to_bytearray(5.3) +# payload += float_to_bytearray(8.1) +# payload += float_to_bytearray(6.7) +# dg_simulator.cmd_send_dg_general_response(message_id=72, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_FANS_DATA.value, msg="~DG_Fans_Data") +# +# #0x3400 +# dg_simulator.cmd_send_accelerometer_dg_data(x=1.0, y=2.0, z=3.0, x_max=2.0, y_max=2.0, z_max=3.0, x_tilt=2.0, y_tilt=3.0, z_tilt=4.0) +# verify_log(msg_id = MsgIds.MSG_ID_DG_ACCELEROMETER_DATA.value, msg = "Accel", param = [1.0, 2.0, 3.0, 2.0, 2.0, 3.0, 2.0, 3.0, 4.0]) +# +# #0x6B00 +# payload = integer_to_bytearray(0) +# dg_simulator.cmd_send_dg_general_response(message_id=107, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_FLUID_LEAK_STATE.value, msg="~DG_Fluid_Leak_Data") +# +# #0x7A00 +# payload = integer_to_bytearray(5) +# payload += integer_to_bytearray(60) +# payload += integer_to_bytearray(30) +# dg_simulator.cmd_send_dg_general_response(message_id=122, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_FLUSH_DATA.value, msg="~DG_Flush_Data") +# +# #0x8600 +# payload = float_to_bytearray(1.0) +# payload += float_to_bytearray(1.2) +# payload += float_to_bytearray(1.8) +# payload += float_to_bytearray(1.8) +# payload += float_to_bytearray(3.0) +# payload += float_to_bytearray(3.0) +# payload += float_to_bytearray(3.0) +# payload += float_to_bytearray(3.3) +# payload += float_to_bytearray(3.3) +# payload += float_to_bytearray(5.0) +# payload += float_to_bytearray(5.0) +# payload += float_to_bytearray(5.0) +# payload += float_to_bytearray(24.0) +# payload += float_to_bytearray(24.0) +# payload += float_to_bytearray(24.0) +# dg_simulator.cmd_send_dg_general_response(message_id=134, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_VOLTAGES_DATA.value, msg="~DG_Voltages_Data") +# +# #0x8700 +# payload = integer_to_bytearray(1) +# payload += integer_to_bytearray(60) +# payload += integer_to_bytearray(30) +# payload += integer_to_bytearray(0) +# payload += float_to_bytearray(2.0) +# payload += float_to_bytearray(4.0) +# payload += integer_to_bytearray(24) +# payload += integer_to_bytearray(30) +# payload += integer_to_bytearray(1) +# dg_simulator.cmd_send_dg_general_response(message_id=135, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_CHEM_DISINFECT_DATA.value, msg="~DG_Chemical_Disinfect_Data") +# +# #0xA100 +# payload = integer_to_bytearray(1) +# payload += integer_to_bytearray(0) +# payload += integer_to_bytearray(1) +# dg_simulator.cmd_send_dg_general_response(message_id=161, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_SWITCHES_DATA.value, msg="~DG_Switches_Data") +# +# #0xA700 +# #TODO: Payload values need to been changed after discussion +# payload = integer_to_bytearray(1) +# dg_simulator.cmd_send_dg_general_response(message_id=167, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_ALARM_INFO.value, msg=None) +# +# #0xAA00 +# #TODO: Payload values need to been changed after discussion +# payload = float_to_bytearray(88.6) +# payload += float_to_bytearray(256.8) +# payload += integer_to_bytearray(156) +# dg_simulator.cmd_send_dg_general_response(message_id=170, accepted=1, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_CONCENTRATE_MIXING_RATIOS_DATA.value, msg = None) +# +# #0xA600 +# payload = float_to_bytearray(22.2) +# dg_simulator.cmd_send_dg_general_response(message_id=166, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_DIALYSATE_FLOW_METER_DATA.value, msg="~DG_Dialysate_Flow_Data") +# +# #0xAB00 +# #TODO: Payload values need to been changed after discussion +# dg_simulator.cmd_send_dg_general_response(message_id=171, accepted=0, reason=1, is_pure_data=False, has_parameters=False, parameters_payload=None) +# verify_log(msg_id=MsgIds.MSG_ID_DG_SCHEDULED_RUNS_DATA.value, msg="DG scheduled runs data") +# +# #0xAC00 +# #TODO: Payload values need to been changed after discussion +# dg_simulator.cmd_send_dg_general_response(message_id=172, accepted=0, reason=1, is_pure_data=False, has_parameters=False, parameters_payload=None) +# verify_log(msg_id = MsgIds.MSG_ID_DG_SCHEDULED_RUNS_INFO.value, msg = "DG scheduled runs info") +# +# #TODO: Msg_Ids need to be update as per patch file. line number 446 should be uncomment after the fix +# #Fix id : ID not logged for the ones in ACK_NOT_REQUIRED list #46 +# #0xAE00 +# #TODO: Payload values need to been changed after discussion +# payload = float_to_bytearray(22.2) +# payload += float_to_bytearray(22.2) +# payload += integer_to_bytearray(1) +# payload += float_to_bytearray(22.2) +# payload += float_to_bytearray(22.2) +# payload += float_to_bytearray(22.2) +# payload += float_to_bytearray(22.2) +# dg_simulator.cmd_send_dg_general_response(message_id=174, accepted=0, reason=1, is_pure_data = False, +# has_parameters = True, +# parameters_payload = payload) +# #verify_log(msg_id = MsgIds.MSG_ID_DG_FILL_MODE_DATA.value, msg = None) +# +# +# #TODO: Msg_Ids need to be update as per patch file. line number 453 should be uncomment after the fix +# #Fix id : ID not logged for the ones in ACK_NOT_REQUIRED list #46 +# #0xAF00 +# #TODO: Payload values need to been changed after discussion +# payload = unsigned_integer_to_bytearray(456) +# dg_simulator.cmd_send_dg_general_response(message_id=175, accepted=0, reason=1, is_pure_data = False, +# has_parameters = True, +# parameters_payload = payload) +# #verify_log(msg_id = MsgIds.MSG_ID_DG_IDLE_MODE_BAD_FILL_SUB_STATES.value, msg = None) +# +# +# #0x0200 +# hd_alarm.cmd_send_clear_alarms() +# verify_log(msg_id = MsgIds.MSG_ID_ALARM_STATUS.value, msg = "AlarmStatus") +# +# #0x0300 +# #parameter data type mismatch +# hd_alarm.cmd_set_alarm_triggered(alarm_id = 1, field_descriptor_1 = 1, data_field_1 = '2', +# field_descriptor_2 = 3, data_field_2 = '4', +# priority = 5, rank = 6, clear_top = 7) +# verify_log(msg_id = MsgIds.MSG_ID_ALARM_TRIGGERED.value, msg = "AlarmTriggered") +# +# #0x0400 +# hd_alarm.cmd_set_alarm_cleared(alarm_id = 4) +# verify_log(msg_id = MsgIds.MSG_ID_ALARM_CLEARED.value, msg = "AlarmCleared", param = [4]) +# +# +# #0x7C00 +# hd_simulator.cmd_send_hd_general_response(message_id=124, accepted=1, reason=1) +# verify_log(msg_id = MsgIds.MSG_ID_HD_ALARM_AUDIO_VOLUME_SET_RESPONSE.value, msg = "AdjustHDAlarmVolume") +# +# +# #0x3F00 +# #TODO: Payload values need to been changed after discussion +# hd_simulator.cmd_send_hd_general_response(message_id=63, accepted=1, reason=1) +# verify_log(msg_id = MsgIds.MSG_ID_ALARM_CONDITION_CLEARED.value, msg = "AlarmCondition") +# +# #0x3200 +# #TODO: Payload values need to been changed after discussion +# payload = unsigned_integer_to_bytearray(6) +# dg_simulator.cmd_send_dg_general_response(message_id=50, accepted=0, reason=1, is_pure_data= False, has_parameters = True, parameters_payload = payload) +# verify_log(msg_id = MsgIds.MSG_ID_USER_REQUEST_ALARM_SILENCE.value, msg = "AlarmSilence") +# +# #0x9800 +# hd_alarm.cmd_send_active_list_response(accept = True, reason = 0, +# a0 = 0, a1 = 0, a2 = 0, a3 = 0, a4 = 0, +# a5 = 0, a6 = 0, a7 = 0, a8 = 0, a9 = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_ACTIVE_ALARMS_LIST_REQUEST_RESPONSE.value, msg = "AlarmActiveList", param = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) +# +# +# #UF Vol. +# +# #0x4100 +# #parameter mismatch : expected 1 int but 3 integers are logged +# hd_simulator.cmd_set_treatment_adjust_ultrafiltration_accepted(state = 1) +# verify_log(msg_id = MsgIds.MSG_ID_USER_UF_PAUSE_RESUME_RESPONSE.value, msg = "AdjustUFState") +# +# #0x1300 +# #TODO: Payload values need to been changed after discussion +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(6) +# payload += float_to_bytearray(8.4) +# payload += unsigned_integer_to_bytearray(14) +# payload += unsigned_integer_to_bytearray(6) +# payload += float_to_bytearray(5.2) +# payload += float_to_bytearray(5.8) +# payload += float_to_bytearray(2.3) +# hd_simulator.cmd_send_hd_general_response(message_id=19, accepted=1, reason=1, is_pure_data= False, has_parameters = True,parameters_payload = payload) +# verify_log(msg_id=MsgIds.MSG_ID_USER_UF_SETTINGS_CHANGE_RESPONSE.value, msg="AdjustUFEdit",param = [1, 6, 8.4, 14, 6, 5.2, 5.8, 2.3] ) +# +# #0x2E00 +# #parameter mismatch : expected 1 int but 3 integers are logged +# hd_simulator.cmd_set_treatment_adjust_ultrafiltration_confirm_rejected(reason = 1) +# verify_log(msg_id = MsgIds.MSG_ID_USER_UF_SETTINGS_CHANGE_CONFIRMATION_RESPONSE.value, msg = "AdjustUFConfirm") +# +# #Saline +# +# #0x1400 +# hd_simulator.cmd_set_saline_bolus_response(accepted = 0, reason = 1, target = 2) +# verify_log(msg_id = MsgIds.MSG_ID_USER_SALINE_BOLUS_RESPONSE.value, msg = "AdjustSaline", param = [0,1,2]) +# +# #Heparin +# +# #0x4C00 +# hd_simulator.cmd_set_heparin_pause_resume_response(accepted = 0, reason = 1) +# verify_log(msg_id = MsgIds.MSG_ID_HD_HEPARIN_PAUSE_RESUME_RESPONSE.value, msg = "AdjustHeparin", param = [0,1]) +# +# #Duration +# +# #0x1B00 +# hd_simulator.cmd_send_treatment_adjust_duration_response(accepted = 0, reason = 1, +# duration = 2, ultrafiltration = 3.0) +# verify_log(msg_id = MsgIds.MSG_ID_USER_TREATMENT_TIME_CHANGE_RESPONSE.value, msg = "AdjustDuration", param = [0, 1, 2, 3.0]) +# +# #Blood / Dialysate +# +# #0x1800 +# hd_simulator.cmd_send_treatment_adjust_blood_dialysate_response(accepted = 0, reason = 1, +# blood_rate = 2, dialysate_flow_rate = 3) +# verify_log(msg_id = MsgIds.MSG_ID_USER_BLOOD_DIAL_RATE_CHANGE_RESPONSE.value, msg = "AdjustBloodDialysate", param = [0, 1, 2, 3]) +# +# #PRS-58: In-Line Blood Pressure Limits +# +# #0x4700 +# hd_simulator.cmd_send_treatment_adjust_pressures_limit_response(accepted = 0, reason = 1, +# arterial_low = 2, arterial_high = 3, +# venous_low = 4, venous_high = 5) +# verify_log(msg_id = MsgIds.MSG_ID_HD_PRESSURE_LIMITS_CHANGE_RESPONSE.value, msg = "AdjustPressuresLimits", param = [0, 1, 2, 3, 4, 5]) +# +# #Service Information +# #0x8A00 +# # hd_simulator._handler_system_usage_response() +# hd_simulator.cmd_send_hd_general_response(message_id=138, accepted=0, reason=1) +# verify_log(msg_id=MsgIds.MSG_ID_HD_SERVICE_SCHEDULE_DATA.value, msg="ServiceDate") +# +# #0x8C00 +# # dg_simulator._handler_system_usage_response() +# dg_simulator.cmd_send_dg_general_response(message_id=140, accepted=0, reason=1) +# verify_log(msg_id=MsgIds.MSG_ID_DG_SERVICE_SCHEDULE_DATA.value, msg="ServiceDate") +# +# #System Usage Information +# #0x8B00 +# payload = unsigned_integer_to_bytearray(6) +# hd_simulator.cmd_send_hd_general_response(message_id=139, accepted=0, reason=1, is_pure_data= False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_USAGE_DATA.value, msg="~HD_Usage_Data") +# +# #0x8D00 +# payload = float_to_bytearray(3.5) +# dg_simulator.cmd_send_dg_general_response(message_id=141, accepted=0, reason=1, is_pure_data= False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_USAGE_DATA.value, msg="~DG_Usage_Data") +# +# #DG Command +# #0x2100 +# payload = unsigned_integer_to_bytearray(6) +# hd_simulator.cmd_send_hd_general_response(message_id=33, accepted=0, reason=1, is_pure_data= False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds. MSG_ID_DG_SWITCH_RESERVOIR_CMD.value, msg="~DG_Switch_Res_Cmd") +# +# #0x2200 +# payload = unsigned_integer_to_bytearray(6) +# payload += unsigned_integer_to_bytearray(8) +# hd_simulator.cmd_send_hd_general_response(message_id=34, accepted=0, reason=1, is_pure_data= False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds. MSG_ID_DG_FILL_CMD.value, msg="~DG_Fill_Cmd") +# +# #0x2300 +# payload = unsigned_integer_to_bytearray(6) +# payload += unsigned_integer_to_bytearray(8) +# payload += unsigned_integer_to_bytearray(6) +# payload += unsigned_integer_to_bytearray(8) +# hd_simulator.cmd_send_hd_general_response(message_id=35, accepted=0, reason=1, is_pure_data= False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_DRAIN_CMD.value, msg="~DG_Drain_Cmd") +# +# #0x1900 +# payload = float_to_bytearray(10.5) +# payload += unsigned_integer_to_bytearray(2) +# payload += float_to_bytearray(1.5) +# payload += unsigned_integer_to_bytearray(6) +# payload += float_to_bytearray(20.5) +# hd_simulator.cmd_send_hd_general_response(message_id=25, accepted=0, reason=1) +# verify_log(msg_id=MsgIds.MSG_ID_SET_DG_DIALYSATE_TEMP_TARGETS.value, msg="~DG_Dialysate_Tgt_Temps") +# +# #0x2600 +# payload = unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=38, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_STARTING_STOPPING_TREATMENT_CMD.value, msg="~DG_Cmd") +# +# #0x2900 +# payload = unsigned_integer_to_bytearray(2) +# hd_simulator.cmd_send_hd_general_response(message_id=41, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_SAMPLE_WATER_CMD.value, msg="~DG_Sample_Water_Cmd") +# +# #0x2B00 +# payload = unsigned_integer_to_bytearray(1) +# payload += float_to_bytearray(20.5) +# hd_simulator.cmd_send_hd_general_response(message_id=43, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds. MSG_ID_DG_START_STOP_TRIMMER_HEATER_CMD.value, msg="~DG_Trimmer_Htr_Cmd") +# +# #0x3000 +# payload = unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=48, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_START_STOP_HEAT_DISINFECT.value, msg="~DG_Heat_Disinfect_Cmd") +# +# #0x5B00 +# payload = unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=91, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_CHANGE_VALVE_SETTING_CMD.value, msg="~DG_Chg_Valves_Cmd") +# +# #0x5100 +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(0) +# payload += unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=81, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id = MsgIds.MSG_ID_DG_COMMAND_RESPONSE.value, msg="~DG_Cmd_Rsp") +# +# #0x7800 +# payload = unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=120, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_START_STOP_CHEM_DISINFECT.value, msg="~DG_Chem_Disinfect_Cmd") +# +# #0x7900 +# payload = unsigned_integer_to_bytearray(1) +# hd_simulator.cmd_send_hd_general_response(message_id=121, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id = MsgIds.MSG_ID_DG_START_STOP_FLUSH.value, msg = "~DG_Flush_Cmd") +# +# #0xA900 +# hd_simulator.cmd_send_hd_general_response(message_id=169, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=None) +# verify_log(msg_id=MsgIds.MSG_ID_HD_REQUEST_DG_CONCENTRATE_MIXING_RATIOS.value, msg="~DG_Mixing_Ratio_Fill_Prep_Request") +# +# #FW Debug +# #0xF1FF +# payload = integer_to_bit_array(val = 65, num_bits = 42) +# hd_simulator.cmd_send_hd_general_response(message_id=65521, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_DEBUG_EVENT.value, msg="Debug") +# +# #0xF2FF +# payload = integer_to_bit_array(val = 65, num_bits = 42) +# dg_simulator.cmd_send_dg_general_response(message_id=65522, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_DG_DEBUG_EVENT.value, msg="Debug") +# +# #Initiate (Create/Select) a Treatment +# #ID:0x3900 +# hd_simulator.cmd_initiate_treatment_response(response = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_INITIATE_TREATMENT_RESPONSE.value, msg= "InitTreatment", param = [1,0]) +# +# #Treatment Parameters Validation +# #ID:0x3600 +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(2) +# payload += unsigned_integer_to_bytearray(3) +# payload += unsigned_integer_to_bytearray(4) +# payload += unsigned_integer_to_bytearray(5) +# payload += unsigned_integer_to_bytearray(6) +# payload += unsigned_integer_to_bytearray(7) +# payload += unsigned_integer_to_bytearray(8) +# payload += unsigned_integer_to_bytearray(9) +# payload += unsigned_integer_to_bytearray(10) +# payload += unsigned_integer_to_bytearray(11) +# payload += unsigned_integer_to_bytearray(12) +# payload += unsigned_integer_to_bytearray(13) +# payload += unsigned_integer_to_bytearray(14) +# payload += unsigned_integer_to_bytearray(15) +# payload += unsigned_integer_to_bytearray(16) +# payload += unsigned_integer_to_bytearray(17) +# payload += unsigned_integer_to_bytearray(18) +# payload += unsigned_integer_to_bytearray(19) +# hd_simulator.cmd_send_hd_general_response(message_id=54, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_NEW_TREATMENT_PARAMS_RESPONSE.value, msg="Validate New Create Treatment Response") +# +# #Pre-Treatment Water Sample (sub-mode) +# #ID:0x5E00 +# hd_simulator.cmd_send_pre_treatment_water_sample_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_SAMPLE_WATER_CMD_RESPONSE.value, msg = "AdjustWaterSample", param = [1,0]) +# +# #ID:0x6000 +# dg_simulator.cmd_send_dg_pre_treatment_filter_flush_progress_data(total = 120, countdown = 60) +# verify_log(msg_id = MsgIds.MSG_ID_DG_FILTER_FLUSH_PROGRESS.value, msg = "FilterFlush", param = [120,60]) +# +# #Pre-Treatment No Cartridge Self-Test (sub-mode) +# #ID:0x6100 +# hd_simulator.cmd_send_pre_treatment_self_test_no_cartridge_progress_data(total = 120, countdown = 60) +# verify_log(msg_id = MsgIds.MSG_ID_HD_NO_CART_SELF_TEST_PROGRESS.value, msg = "SelfTestNoCartridge", param = [120,60]) +# +# #Pre-Treatment Disposable Installation (sub-mode) +# #TODO: Msg_Ids need to be update as per patch file +# #ID:0xAD00(API is missing, also message id is not present in msgs.py file +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(0) +# hd_simulator.cmd_send_hd_general_response(message_id=173, accepted=0, reason=1, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# #verify_log(msg_id = MsgIds.MSG_ID_HD_UI_DISPOSABLE_INSTALLATION_RESPONSE.value, msg = "AdjustDisposablesConfirm", param = [0,1]) +# +# #Pre-Treatment Dry Self-Test (sub-mode) +# #ID:0x6300 +# hd_simulator.cmd_send_pre_treatment_self_test_dry_progress_data(total = 120, countdown = 60) +# verify_log(msg_id = MsgIds.MSG_ID_HD_DRY_SELF_TEST_PROGRESS.value, msg = "SelfTestDry", param = [120,60]) +# +# #Pre-Treatment Prime (sub-mode) +# #ID:0x3D00 +# hd_simulator.cmd_send_pre_treatment_prime_start_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_START_PRIME_RESPONSE.value, msg = "AdjustDisposablesPrime", param = [1,0]) +# +# #ID:0x4300 +# hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(timeout = 120, countdown = 60) +# verify_log(msg_id = MsgIds.MSG_ID_HD_PRIMING_STATUS_DATA.value, msg = "DisposablesPrime", param = [120,60]) +# +# #Pre-Treatment Patient Connection Begin +# #ID:0x6500 +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(0) +# hd_simulator.cmd_send_hd_general_response(message_id=101, accepted=1, reason=0, is_pure_data=False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_PATIENT_CONNECTION_BEGIN_RESPONSE.value, msg="Patient Connection Begin Response") +# +# #Pre-Treatment Ultrafiltration (Init) Volume Adjustment +# #ID:0x5000 +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(0) +# payload += float_to_bytearray(11.500) +# hd_simulator.cmd_send_hd_general_response(message_id=80, accepted=1, reason=0, is_pure_data = False, has_parameters=True, parameters_payload=payload) +# verify_log(msg_id=MsgIds.MSG_ID_HD_SET_UF_VOLUME_PARAMETER_RESPONSE.value, msg="Pre UF Volume Adjustment Response") +# +# #Pre-Treatment Patient Connection Confirm +# #ID:0x6700 +# hd_simulator.cmd_send_pre_treatment_patient_connection_confirm_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_PATIENT_CONNECTION_CONFIRM_RESPONSE.value, msg = "AdjustPatientConnectionBegin", param = [1,0]) +# +# +# +# #Start Treatment +# #ID:0x7200 +# hd_simulator.cmd_send_pre_treatment_continue_to_treament_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_START_TREATMENT_RESPONSE.value, msg = "AdjustPatientConnectionConfirm", param = [1,0]) +# +# +# +# #Post-Treatment +# #ID:0x7400 +# hd_simulator.cmd_send_post_treatment_disposable_removal_confirm_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE.value, msg = "AdjustDisposablesRemovalConfirm", param = [1,0]) +# +# +# +# #Treatment Log +# #ID:0x7600 +# #parameter mismatch: the last parameter (water_sample_test_result) value is always 1000 regardless of the argument passed +# hd_simulator.cmd_send_post_treatment_log_response(accepted = 1, reason = 1, +# bood_flow_rate = 1, +# dialysate_flow_rate = 1, +# treatment_duration = 1, +# actual_treatment_duration = 1, +# acid_concentrate_type = 1, +# bicarbonate_concentrate_type = 1, +# potassium_concentration = 1, +# calcium_concentration = 1, +# bicarbonate_concentration = 1, +# sodium_concentration = 1, +# dialysate_temperature = 1.0, +# dialyzer_type = 1, +# treatment_start_date_time = 1, +# treatment_end_date_time = 1, +# average_blood_flow = 1.0, +# average_dialysate_flow = 1.0, +# dialysate_volume_used = 1.0, +# average_dialysate_temp = 1.0, +# origin_uf_volume = 1.0, +# target_uf_volume = 1.0, +# actual_uf_volume = 1.0, +# origin_uf_rate = 1.0, +# target_uf_rate = 1.0, +# actual_uf_rate = 1.0, +# saline_bolus_volume = 1, +# heparin_bolus_volume = 1.0, +# heparin_dispense_rate = 1.0, +# heparin_pre_stop = 1, +# heparin_delivered_volume = 1.0, +# heparin_type = 1, +# average_arterial_pressure = 1.0, +# average_venous_pressure = 1.0, +# device_id = 1, +# water_sample_test_result = 10) +# verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_LOG_DATA_RESPONSE.value, msg = "AdjustTreatmentLog") +# +# #ID:0x9400 +# hd_simulator.cmd_send_treatment_log_data(blood_flow_rate = 1, dialysate_flow_rate = 1, uf_rate = 1.0, +# arterial_pressure = 0.0, venous_pressure = 1.0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_LOG_PERIODIC_DATA.value, msg = "TreatmentLogAvrge", param = [1,1,1.0,0.0,1.0]) +# +# #ID:0x9500 +# hd_simulator.cmd_send_treatment_log_alarm(alarm_id = 1, parameter1 = 0.0, parameter2 = 1.0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_LOG_ALARM_EVENT.value, msg = "TreatmentLogAlarm", param = [1,0.0,1.0]) +# +# #ID:0x9600 +# hd_simulator.cmd_send_treatment_log_event(event_id = 1, old_value = 1.0, new_value = 0.0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_TREATMENT_LOG_EVENT.value, msg = "TreatmentLogEvent", param = [1,1.0,0.0]) +# +# #Post-Treatment - Disinfect +# #ID:0x8000 +# hd_simulator.cmd_send_hd_disinfect_response(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_DISINFECT_RESPONSE.value, msg = "AdjustDisinfect", param =[1,0]) +# +# #ID:0x8200 +# hd_simulator.cmd_send_hd_disinfect_chemical_confirm(accepted = 1, reason = 0) +# verify_log(msg_id = MsgIds.MSG_ID_HD_CHEM_DISINFECT_CONFIRM_RESPONSE.value, msg = "AdjustDisinfectChemicalConfirm" ,param = [1,0]) +# +# #ID:0x8300 +# dg_simulator.cmd_send_dg_disinfect_progress_time_flush(total = 120, countdown = 60) +# verify_log(msg_id = MsgIds.MSG_ID_DG_FLUSH_TIME_DATA.value, msg = "DisinfectDGFlushTime", param = [120,60]) +# +# #ID:0x8400 +# dg_simulator.cmd_send_dg_disinfect_progress_time_heat(total = 120, countdown = 60) +# verify_log(msg_id = MsgIds.MSG_ID_DG_HEAT_DISINFECT_TIME_DATA.value, msg = "DisinfectDGHeatTime", param = [120,60]) +# +# #ID:0x8500 +# dg_simulator.cmd_send_dg_disinfect_progress_time_checmical(total = 120, countdown = 60) +# verify_log(msg_id = MsgIds.MSG_ID_DG_CHEM_DISINFECT_TIME_DATA.value, msg = "DisinfectDGChemicalTime", param = [120,60]) +# + utils.waitForGUI(5) + #0x9900 + hd_simulator.cmd_send_serial_hd_data(serial = 'HD1234567890123') + #verify_log(msg_id = MsgIds.MSG_ID_HD_SERIAL_NUMBER.value, msg = "Serial", param = ['HD1234567890123']) + + utils.waitForGUI(5) + #0x8800 + dg_simulator.cmd_send_serial_dg_data(serial = 'DG1234567890123') + #verify_log(msg_id = MsgIds.MSG_ID_DG_SERIAL_NUMBER.value, msg = "Serial", param = ['DG1234567890123']) + + utils.waitForGUI(5) + #0x9900 + hd_simulator.cmd_send_serial_hd_data(serial = 'HD1234567890123') + #verify_log(msg_id = MsgIds.MSG_ID_HD_SERIAL_NUMBER.value, msg = "Serial", param = ['HD1234567890123']) + + #0x8800 + dg_simulator.cmd_send_serial_dg_data(serial = 'DG1234567890123') + #verify_log(msg_id = MsgIds.MSG_ID_DG_SERIAL_NUMBER.value, msg = "Serial", param = ['DG1234567890123']) + + + +# +# #0x1F00 +# payload = float_to_bytearray(1.2) +# payload += float_to_bytearray(1.2) +# payload += float_to_bytearray(1.2) +# payload += unsigned_integer_to_bytearray(2) +# dg_simulator.cmd_send_dg_general_response(message_id=31, accepted=1, reason=1, is_pure_data = False, has_parameters = True, parameters_payload = payload) +# verify_log(msg_id = MsgIds.MSG_ID_RO_PUMP_DATA.value) +# +# #0x2400 +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(1) +# dg_simulator.cmd_send_dg_general_response(message_id=36, accepted=1, reason=1, is_pure_data = False, has_parameters = True, parameters_payload = payload) +# verify_log(msg_id = MsgIds.MSG_ID_DRAIN_PUMP_DATA.value, msg = "DrainPump") +# +# #0x2700 +# payload = unsigned_integer_to_bytearray(1) +# payload += unsigned_integer_to_bytearray(1) +# dg_simulator.cmd_send_dg_general_response(message_id=39, accepted=1, reason=1, is_pure_data = False, has_parameters = True, parameters_payload = payload) +# verify_log(msg_id = MsgIds.MSG_ID_DG_OP_MODE.value, msg = "OpMode") +# +# #0x2D00 +# payload = float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# payload += float_to_bytearray(11.500) +# dg_simulator.cmd_send_dg_general_response(message_id=45, accepted=1, reason=1, is_pure_data = False, has_parameters = True, parameters_payload = payload) +# verify_log(msg_id = MsgIds.MSG_ID_DG_TEMPERATURE_DATA.value, msg = "Temperatures") + + utils.tstDone()