Index: tests/peter/test_hd_records.py =================================================================== diff -u -r3a70bfb451b74106348c064c34f19934aadd9119 -rc3b33cf5796df77eb213523c1e06ba4adbb9501d --- tests/peter/test_hd_records.py (.../test_hd_records.py) (revision 3a70bfb451b74106348c064c34f19934aadd9119) +++ tests/peter/test_hd_records.py (.../test_hd_records.py) (revision c3b33cf5796df77eb213523c1e06ba4adbb9501d) @@ -47,10 +47,14 @@ while not observer.received: sleep(0.2) + #print(hd.calibration_record.hd_calibration_record) + + """ # store the old record after reading it from fw record_old_formatted = pprint.pformat(hd.calibration_record.hd_calibration_record, indent=4) with open("/home/fw/projects/dialin/tests/peter/hd_cal_record.log", 'w') as f: f.write(record_old_formatted) + """ hd.calibration_record.hd_calibration_record["accelerometer_sensor"]["accelerometer"]["y_offset"][1] = 2.0 hd.calibration_record.hd_calibration_record["accelerometer_sensor"]["accelerometer"]["cal_time"][1] = \ @@ -70,6 +74,7 @@ hd.calibration_record.cmd_set_hd_calibration_record(hd.calibration_record.hd_calibration_record) + def test_hd_reset_calibration_record(): hd = HD(log_level="DEBUG") if hd.cmd_log_in_to_hd(resend=False): @@ -97,9 +102,11 @@ if hd.cmd_log_in_to_hd(resend=False): hd.calibration_record.cmd_reset_hd_calibration_record() - print(hd.calibration_record.hd_calibration_record) - hd.system_record.cmd_reset_hd_system_record() + sleep(0.2) + #print(hd.calibration_record.hd_calibration_record) + #hd.system_record.cmd_reset_hd_system_record() hd.service_record.cmd_reset_hd_service_record() + #print(hd.service_record.hd_service_record) def test_hd_system_record(): @@ -125,12 +132,38 @@ hd.system_record.cmd_set_hd_system_record(hd.system_record.hd_system_record) +def test_hd_sw_config_record(): + hd = HD(log_level="DEBUG") + if hd.cmd_log_in_to_hd(): + + #print(dg.cmd_ui_request_dg_version()) + #dg.sw_configs.cmd_reset_dg_sw_config_record() + #hd.sw_configs.cmd_reset_hd_sw_config_record() + #sleep(2) + + hd.sw_configs.cmd_get_hd_sw_config_record() + #hd.sw_configs.cmd_update_hd_sw_config_record('/home/fw/projects/HD_NV_Records/2022-02-08-HD-SW-CONFIGS-Record.xlsx') + #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'][DGSWConfigs.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) + + if __name__ == "__main__": - test_hd_reset_record_record() + # test_hd_reset_record_record() + test_hd_sw_config_record() #test_hd_calibration_record() - # test_hd_service_record() + #test_hd_service_record() #test_hd_reset_system_record() #test_hd_system_record() # test_crc()