Index: tests/peter/test_dg_records.py =================================================================== diff -u -r6b5600f056eff25cbb365fa6a5eefc4f5fad9360 -r3e92417e035803f1401d5818f0117859ee049d9e --- tests/peter/test_dg_records.py (.../test_dg_records.py) (revision 6b5600f056eff25cbb365fa6a5eefc4f5fad9360) +++ tests/peter/test_dg_records.py (.../test_dg_records.py) (revision 3e92417e035803f1401d5818f0117859ee049d9e) @@ -1,3 +1,18 @@ +########################################################################### +# +# Copyright (c) 2019-2022 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 test_dg_records.py +# +# @author (last) Dara Navaei +# @date (last) 15-Dec-2021 +# @author (original) Dara Navaei +# @date (original) 20-Jul-2021 +# +############################################################################ import copy import pprint import subprocess @@ -9,6 +24,7 @@ sys.path.append("../../") from dialin.dg.dialysate_generator import DG from dialin.utils.nv_ops_utils import NVOpsUtils +from dialin.dg.sw_config import SWConfigs from time import sleep """ @@ -155,6 +171,31 @@ self.received = message.get(self.prop, False) +def test_dg_sw_config_record(): + + dg = DG(log_level="DEBUG") + if dg.cmd_log_in_to_dg(): + + #print(dg.cmd_ui_request_dg_version()) + #dg.sw_configs.cmd_reset_dg_sw_config_record() + + #dg.sw_configs.cmd_get_dg_sw_config_record() + + dg.sw_configs.cmd_set_dg_sw_config_record('/home/fw/DG_NV_Records/2022-01-22-SW-CONFIGS-Record.xlsx') + + """ + observer = Observer("dg_sw_config_record") + dg.sw_configs.attach(observer) + while not observer.received: + sleep(0.2) + """ + #dg.sw_configs.dg_sw_config_record['sw_configs'][SWConfigs.SW_CONFIG_DISABLE_HEATERS_MONITOR.name][1] = 1 + #print(dg.sw_configs.dg_sw_config_record) + + #dg.sw_configs.cmd_set_dg_sw_config_record(dg.sw_configs.dg_sw_config_record) + + + def test_dg_calibration_record(): dg = DG(log_level="DEBUG") @@ -168,6 +209,12 @@ print(dg.calibration_record.dg_calibration_record) + dg.calibration_record.dg_calibration_record['flow_sensors']['dialysate_flow_sensor']['offset'][1] = 0.885 + dg.calibration_record.dg_calibration_record['flow_sensors']['dialysate_flow_sensor']["cal_time"][1] = \ + NVOpsUtils.get_current_time_in_epoch() + dg.calibration_record.dg_calibration_record['flow_sensors']['dialysate_flow_sensor']["crc"][1] = \ + NVOpsUtils.get_group_record_crc(dg.calibration_record.dg_calibration_record['flow_sensors']['dialysate_flow_sensor']) + """ # Change the value(s) you are planning to change directly to the dictionary dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppi"]["fourth_order"][1] = 0.0 @@ -189,7 +236,7 @@ dg.calibration_record.dg_calibration_record["load_cells"]["load_cell_a1"]["crc"][1] = \ NVOpsUtils.get_group_record_crc(dg.calibration_record.dg_calibration_record["load_cells"]["load_cell_a1"]) """ - #dg.calibration_record.cmd_set_dg_calibration_record(dg.calibration_record.dg_calibration_record) + dg.calibration_record.cmd_set_dg_calibration_record(dg.calibration_record.dg_calibration_record) print(dg.calibration_record.dg_calibration_record) @@ -206,16 +253,21 @@ dg = DG(log_level="DEBUG") if dg.cmd_log_in_to_dg(): - dg.calibration_record.cmd_reset_dg_calibration_record() - sleep(0.25) - print(dg.calibration_record.dg_calibration_record) + #dg.calibration_record.cmd_reset_dg_calibration_record() + #sleep(0.25) + #print(dg.calibration_record.dg_calibration_record) + #dg.scheduled_runs_record.cmd_reset_dg_calibration_record() #sleep(0.25) dg.system_record.cmd_reset_dg_system_record() sleep(0.25) + print(dg.system_record.dg_system_record) dg.service_record.cmd_reset_dg_service_record() + sleep(0.25) + print(dg.service_record.dg_service_record) + def test_dg_service_record(): dg = DG(log_level="DEBUG") if dg.cmd_log_in_to_dg(): @@ -253,7 +305,6 @@ dg.system_record.cmd_set_dg_system_record(dg.system_record.dg_system_record) - def test_dg_scheduled_runs_record(): dg = DG(log_level="DEBUG") if dg.cmd_log_in_to_dg(): @@ -268,7 +319,8 @@ if __name__ == "__main__": - test_dg_reset_record() + # test_dg_reset_record() + test_dg_sw_config_record() #test_dg_calibration_record() # test_dg_service_record() #test_dg_system_record()