########################################################################### # # Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. # # 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 utils.py # # @author (last) Joseph varghese # @date (last) 18-Jan-2022 # ############################################################################ import os APPLICATION_NAME = "denaliSquish" COMMON_PATH = f"{os.environ['HOME']}/Projects" 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"} ALARM_MESSAGE = [ "" , "Software Error." , "Stuck button POST failure." , "FPGA POST failure." , "Watchdog POST failure." , "UI communication POST failure." , "Blood pump failed motor controller current check." , "Blood pump failed motor off check. \nMeasured speed while commanded off." , "Blood pump failed motor controller direction check." , "Blood pump failed rotor speed check." , "Dialysis inlet pump failed motor controller current check." , "Dialysis inlet pump failed motor off check. \nMeasured speed while commanded off." , "Dialysis inlet pump failed motor controller direction check." , "Dialysis inlet pump failed rotor speed check." , "Dialysis outlet pump failed motor controller current check." , "Dialysis outlet pump failed motor off check. \nMeasured speed while commanded off." , "Dialysis outlet pump failed motor controller direction check." , "Dialysis outlet pump failed rotor speed check." , "Watchdog expired error." , "Real-time clock communication error." , "Real-time clock configuration error." , "Dialysate generator communication timeout." , "User interface communication timeout." , "Too many bad CRCs detected on received system messages." , "Treatment stopped by user action - pressed stop button." , "Blood sitting too long warning (>4 min)." , "Blood sitting too long alarm (>5 min)." , "Blood sitting too long alarm (>10 min)." , "System message needing acknowledgment was not acknowledged." , "Blood pump occlusion detected." , "Dialysate inlet pump occlusion detected." , "Dialysate outlet pump occlusion detected." , "Arterial pressure too low during treatment." , "Arterial pressure too high during treatment." , "Venous pressure too low during treatment." , "Venous pressure too high during treatment." , "Ultrafiltration rate is too high error during treatment." , "Ultrafiltration volume accuracy error during treatment." , "RTC battery low." , "RTC or MCU timer inaccurate." , "RTC or RAM operations failure (read or write)." , "EEPRON operations (read, write, erase) failure." , "Manufacturing record CRC failure." , "Service record CRC failure." , "Calibration record CRC failure." , "HW usage data failure." , "Last disinfection date CRC error." , "Pressure at outlet of RO pump is out of range." , "DG temperature sensors fault." , "FPGA communication down for too long" , "HD communication timeout." , "FPGA not accepting commanded valve states." , "Blood pump failed flow vs. motor speed check. \nMismatch with flow rate and rate implied by motor speed." , "Dialysate inlet pump failed flow vs. motor speed check. \nMismatch with flow rate and rate implied by motor speed." , "Dialysate outlet pump failed flow vs. motor speed check. \nMismatch with flow rate and rate implied by motor speed." , "Blood pump failed motor speed check. Measured vs. commanded." , "Dialysate inlet pump failed motor speed check. Measured vs. commanded." , "Dialysate outlet pump failed motor speed check. Measured vs. commanded." , "Blood pump rotor speed too high." , "Inlet water conductivity too low." , "Inlet water conductivity too high" , "DG software fault. Software found itself in an unexpected state" , "Conductivity sensor fault" , "Inlet water temperature too low" , "Inlet water temperature too high" , "Pressure sensor fault" , "Inlet water pressure too low" , "HD critical data integrity check failed" , "HD accelerometer failed POST" , "DG accelerometer failed POST" , "HD tilt exceeds maximum" , "DG tilt exceeds maximum" , "HD experienced large acceleration" , "DG experienced large acceleration" , "HD accelerometer error (no readings or FPGA reports error)" , "DG accelerometer error (no readings or FPGA reports error)" , "DG critical data integrity check failed" , "RO rejection ratio out of range" , "Inlet water pressure fault" , "HD valve homing failed" , "HD valve transition time out" , "HD valve not functional" , "HD valve current out of range" , "HD valve position out of target" , "Air trap level sensors reporting illegal combination of air/fluid" , "Air trap fill timeout during priming" , "Air trap fill timeout during treatment" , "Blood flow sensor signal strength too low" , "Dialysate flow sensor signal strength too low" , "Saline bag is empty" , "Saline bolus volume check failure" , "FPGA reports failure reading arterial pressure sensor" , "FPGA reports failure reading venous pressure sensor" , "UV reactor not healthy (either inlet or outlet)" , "Post-acid concentrate conductivity out of range" , "Post-bicarb concentrate conductivity out of range" , "RO pump flow rate out of range" , "DG thermistors/sensors temperature out of range" , "DG fan RPM out of range" , "DG dialysate fill runs out of time" , "DG concentrate pump CP1 speed control error" , "DG concentrate pump CP2 speed control error" , "DG flow rate out of range" , "DG RO pump pressure out of range" , "DG drain pump RPM out of range" , "DG heaters cold junction temperature out of range" , "DG heaters fault" , "HD end of treatment warning" , "HD end of treatment alarm (user not acting to end treatment)" , "HD end of treatment alarm (high priority - user still not acting to end treatment)" , "ALARM_ID_UNDEFINED" ]