Index: tests/peter/test_dg_records.py =================================================================== diff -u -r89f9210ef5bf37a6812c4dc06aaa636dd47b9d72 -r47eb368c929e01fbff7d7749a822ee0efb467ea5 --- tests/peter/test_dg_records.py (.../test_dg_records.py) (revision 89f9210ef5bf37a6812c4dc06aaa636dd47b9d72) +++ tests/peter/test_dg_records.py (.../test_dg_records.py) (revision 47eb368c929e01fbff7d7749a822ee0efb467ea5) @@ -166,38 +166,47 @@ while not observer.received: sleep(0.2) - # Get a snapshot of the current calibration record prior to modifying the dictionary with the latest values - previous_firmware_record = dg.calibration_record.dg_calibration_record + print(dg.calibration_record.dg_calibration_record) # 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] = 1.0 + dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppi"]["fourth_order"][1] = 0.0 + dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppi"]["gain"][1] = 1.0 dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppi"]["cal_time"][1] = \ NVOpsUtils.get_current_time_in_epoch() dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppi"]["crc"][1] = \ NVOpsUtils.get_group_record_crc(dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppi"]) - - dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppo"]["second_order"][1] = 2.0 + """ + dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppo"]["second_order"][1] = 0.0 dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppo"]["cal_time"][1] = \ NVOpsUtils.get_current_time_in_epoch() dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppo"]["crc"][1] = \ - NVOpsUtils.get_group_record_crc(dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppo"]) + NVOpsUtils.get_group_record_crc(dg.calibration_record.dg_calibration_record["pressure_sensors"]["ppo"]) + + dg.calibration_record.dg_calibration_record["load_cells"]["load_cell_a1"]["gain"][1] = 1.0 + dg.calibration_record.dg_calibration_record["load_cells"]["load_cell_a1"]["cal_time"][1] = \ + NVOpsUtils.get_current_time_in_epoch() + 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) - """ + + print(dg.calibration_record.dg_calibration_record) + record_old_formatted = pprint.pformat(dg.calibration_record.dg_calibration_record, indent=4) with open("/home/fw/projects/dialin/tests/peter/dg_cal_record.log", 'w') as f: f.write(record_old_formatted) - print(dg.calibration_record.dg_calibration_record) #subprocess.call("meld /home/fw/projects/dialin/tests/peter/dialin_test_record_old.log" # " /home/fw/projects/dialin/tests/peter/dialin_test_record_new.log", shell=True) - """ + def test_dg_reset_record(): dg = DG(log_level="DEBUG") if dg.cmd_log_in_to_dg(): #dg.calibration_record.cmd_reset_dg_calibration_record() + #dg.scheduled_runs_record.cmd_reset_dg_calibration_record() dg.system_record.cmd_reset_dg_system_record() #dg.service_record.cmd_reset_dg_service_record() @@ -230,7 +239,8 @@ while not observer.received: sleep(0.2) - dg.system_record.dg_system_record['system_record']['top_level_pn'][1] = 'abc-345' + dg.system_record.dg_system_record['system_record']['top_level_sn'][1] = 'abc-345' + dg.system_record.dg_system_record['system_record']['top_level_pn'][1] = '123' dg.system_record.dg_system_record['system_record']['crc'][1] = \ NVOpsUtils.get_group_record_crc(dg.system_record.dg_system_record['system_record'])