Index: shared/scripts/configuration/config.py =================================================================== diff -u -r76fdc8bb69841df3df89e211fabb333aa6d48dc0 -r2413e6298b362ada05bed6e59568300c2034e18d --- shared/scripts/configuration/config.py (.../config.py) (revision 76fdc8bb69841df3df89e211fabb333aa6d48dc0) +++ shared/scripts/configuration/config.py (.../config.py) (revision 2413e6298b362ada05bed6e59568300c2034e18d) @@ -25,9 +25,6 @@ COMMON_PATH = os.environ['HOME']+"/Projects" -#StandBy Mode -BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" - #instructions_imagelocation INSTRUCTION_CONF_LOCATION = "/home/denali/Projects/application/resources/settings/Instructions/Instructions.conf" IMAGE_LOCATION = "file:///home/denali/Projects/application/resources/settings/Instructions/" @@ -37,6 +34,12 @@ SERVICE_CONF_LOCATION = os.environ['HOME']+"/Projects/application/resources/settings/Service.conf" +#standby mode +GOODMORNING_START_TIME_SEC = 0 +GOODEVENING_START_TIME_SEC = 43200 +NUM_OF_REQUEST_REJECT_REASONS = 46 #Number of settings change reject codes + + BLOOD_PRIMING_TEXT = "Blood Priming" SALINE_UNIT = "mL" @@ -62,10 +65,6 @@ BICARBONATE_CONCENTRATE = "Fres. Centrisol" DIALYZER_TYPE = ["BB Diacap Pro 13H", "BB Diacap Pro 16H", "BB Diacap Pro 19H", "F Optiflux F160NRe", "F Optiflux F180NRe"] -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"} TREATMENT_UNHIGHLIGHTED_COLOR = "#000000" TREATMENT_HIGHLIGHTED_COLOR = "#135088" @@ -421,13 +420,15 @@ } -#standby mode -GOODMORNING_START_TIME_SEC = 0 -GOODEVENING_START_TIME_SEC = 43200 -NUM_OF_REQUEST_REJECT_REASONS = 46 #Number of settings change reject codes - VALID = True INVALID = False +#cloud sync index +EPOCH_INDEX = 0 +SEQUENCE_INDEX = 1 +CRC_INDEX = 2 +CODE_INDEX = 3 +PARAMETER_COUNT = 4 +PARAMETER_INDEX = 5 Index: shared/scripts/configuration/strings.py =================================================================== diff -u -r5c0a804b33cdbe79c331971860a9c7dfb44047a2 -r2413e6298b362ada05bed6e59568300c2034e18d --- shared/scripts/configuration/strings.py (.../strings.py) (revision 5c0a804b33cdbe79c331971860a9c7dfb44047a2) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision 2413e6298b362ada05bed6e59568300c2034e18d) @@ -13,8 +13,7 @@ # @date (last) 14-June-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 @@ -23,16 +22,7 @@ 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" @@ -96,11 +86,6 @@ 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" @@ -778,10 +763,6 @@ 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' @@ -858,4 +839,3 @@ SHUTDOWN_TEXT = "SHUTDOWN" - Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r812fa8b32b6fc107eb56cf1ab7b4c9ffc581f661 -r2413e6298b362ada05bed6e59568300c2034e18d --- shared/scripts/configuration/utility.py (.../utility.py) (revision 812fa8b32b6fc107eb56cf1ab7b4c9ffc581f661) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 2413e6298b362ada05bed6e59568300c2034e18d) @@ -34,9 +34,11 @@ from dialin.protocols import DenaliMessage, DenaliCanMessenger, DenaliChannels from datetime import datetime - +CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' +CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync/' LOG_LOCATION = "/home/denali/Desktop/sd-card/log/*.log" + def color_verification(exp_val = "Red", act_val = "#c53b33"): test.compare(config.COLOR_CODES[color_name],(act_val.color[name])) @@ -985,3 +987,98 @@ return names.o_recirculate_rejection_msg +def get_current_date_and_time(date_format='%Y/%m/%d - %H:%M:%S'): + """ + Method to get current date and time. + @input date_format (str) - format of date to be retrieved. + @return (str) - date in specified format. + """ + date = datetime.now() + return str(date.strftime(date_format)) + + +def append_cloudsync_credentials_file(): + """ + This function is used for creating .pem files in the cloudsync folder. + pem files is created on '/home/denali/Desktop/cloudsync/credentials' + """ + PEM_FILES = ['1.pem', '2.pem', '3.pem' ] + try: + os.makedirs(CLOUD_CREDENTIALS_LOCATION, exist_ok = True) + test.log("Directory created successfully") + for file_handler in range(len(PEM_FILES)): + path = os.path.join(CLOUD_CREDENTIALS_LOCATION, PEM_FILES[file_handler]) + with open(path, 'w') as file_reader: + pass + except OSError: + test.log("Directory can not be created") + + +def get_cloud_sync_input_file(): + """ + This function is the handler for getting file from log folder. + Application log file is automatically created on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_inp.log' + @return latest_file - (string) returns latest input log file path from sd-data + """ + try: + current_date = get_current_date_and_time(date_format = "%Y_%m_%d") + latest_file = CLOUD_SYNC_LOG_LOCATION+current_date+'_inp.buf' + return latest_file + except: + return False + + +def get_cloud_sync_output_file(): + """ + This function is the handler for getting file from log folder. + Application log file is automatically created on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_out.log' + @return latest_file - (string) returns latest output log file path from sd-data + """ + try: + current_date = get_current_date_and_time(date_format = "%Y_%m_%d") + latest_file = CLOUD_SYNC_LOG_LOCATION+current_date+'_out.buf' + return latest_file + except: + return False + + +def retrive_log_data(readline_count = 1): + """ + This function is the handler for getting file from log folder. + Application log data is automatically appended on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_out.log' + @input readline_count (int) - number of line to be read from cloud-sync log. + @return cloudsync_data - (list) returns extracted log data. + """ + cloudsync_data = [] + count = 0 + file_name = get_cloud_sync_input_file() + try: + with open(file_name,mode = 'r') as filereader: + contents = csv.reader(filereader) + try: + for reader in reversed(list(contents)): + if readline_count == count: + return cloudsync_data + cloudsync_data.append(reader) + count = count + 1 + 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_epoch_value_consistancy(current_epoch_value, expected_epoch_value): + """ + This function is verify consistancy of epoch value. + @input current_epoch_value (float) - current epoch time + @input expected_epoch_value (str) - epoch time from cloud-sync log. + @return (bool) - True - if expected value is in range. else, return False + """ + expected_epoch_value = int(expected_epoch_value) + maximum_epoch_value = int(current_epoch_value + 25) + minimum_epoch_value = int(current_epoch_value - 25) + + if expected_epoch_value > minimum_epoch_value and expected_epoch_value < maximum_epoch_value : + return True + return False + Index: shared/scripts/names.py =================================================================== diff -u -r76fdc8bb69841df3df89e211fabb333aa6d48dc0 -r2413e6298b362ada05bed6e59568300c2034e18d --- shared/scripts/names.py (.../names.py) (revision 76fdc8bb69841df3df89e211fabb333aa6d48dc0) +++ shared/scripts/names.py (.../names.py) (revision 2413e6298b362ada05bed6e59568300c2034e18d) @@ -945,4 +945,13 @@ o_SettingsBase_image_Image = {"container": o_SettingsBase_SettingsBase, "id": "_image", "source": "qrc:/images/iEject", "type": "Image", "unnamed": 1, "visible": True} +#cloudsync +o_PostTreatmentStack_PostTreatmentStack = {"container": o_Gui_MainView, "objectName": "_PostTreatmentStack", "type": "PostTreatmentStack", "visible": True} +o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase = {"container": o_PostTreatmentStack_PostTreatmentStack, "objectName": "_patientDisconnectionConfirm", "type": "TreatmentFlowBase", "visible": True} +o_patient_Disconnection_right_arrow = {"container": o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase, "id": "_rightImage", "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1, "visible": True} +o_patientDisconnectionConfirm_CONFIRM_Text = {"container": o_PostTreatmentStack_patientDisconnectionConfirm_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +o_PostTreatmentStack_treatmentReviewConfirm_PostTreatmentReview = {"container": o_PostTreatmentStack_PostTreatmentStack, "objectName": "_treatmentReviewConfirm", "type": "PostTreatmentReview", "visible": True} +o_treatmentReviewConfirm_Code_Tx_code_Label = {"container": o_PostTreatmentStack_treatmentReviewConfirm_PostTreatmentReview, "text": "Code: Tx_code", "type": "Label", "unnamed": 1, "visible": True} + + Index: suite.conf =================================================================== diff -u -r885196701f9d66ae75b91e4b4d0cd907cbfd3e31 -r2413e6298b362ada05bed6e59568300c2034e18d --- suite.conf (.../suite.conf) (revision 885196701f9d66ae75b91e4b4d0cd907cbfd3e31) +++ suite.conf (.../suite.conf) (revision 2413e6298b362ada05bed6e59568300c2034e18d) @@ -5,6 +5,6 @@ IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_pressure tst_treatment_blood_dialysateflow_rate tst_main_treatment_vitals tst_ui_alarms_list tst_ui_alarms_dialog tst_main_treatment_ultrafiltration tst_main_treatment_heparin tst_pre_treatment_priming pre_treatment_disposables pre_treatment_patient_connection tst_unhandled_message_log tst_instructions_poc tst_service_screen tst_rinseback_setup tst_recirculate tst_settings_information +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_pressure tst_treatment_blood_dialysateflow_rate tst_main_treatment_vitals tst_ui_alarms_list tst_ui_alarms_dialog tst_main_treatment_ultrafiltration tst_main_treatment_heparin tst_pre_treatment_priming pre_treatment_disposables pre_treatment_patient_connection tst_unhandled_message_log tst_instructions_poc tst_service_screen tst_rinseback_setup tst_recirculate tst_settings_information tst_cloud_sync - treatment_screen VERSION=3 WRAPPERS=Qt