Index: tests/test_conductivity.py =================================================================== diff -u -rda38ea23e487b717e2671fdfc06af915dfc17929 -r0251ff11e97b1f71ddf669272a343639db9373c6 --- tests/test_conductivity.py (.../test_conductivity.py) (revision da38ea23e487b717e2671fdfc06af915dfc17929) +++ tests/test_conductivity.py (.../test_conductivity.py) (revision 0251ff11e97b1f71ddf669272a343639db9373c6) @@ -5,6 +5,7 @@ import os import csv + directory = 'DG Cond' file_name = 'Test 1' notes = 'None' @@ -15,9 +16,9 @@ if not os.path.isdir(cwd + f'/{directory}'): os.mkdir(cwd + f'/{directory}') + current_time = datetime.now().strftime('%b-%d-%Y %H-%M-%S') result_file_name = f'{directory}/{file_name} - {current_time}.csv' - dg = DG() if dg.cmd_log_in_to_dg() == 0: sys.exit('Unable to login into DG') @@ -49,8 +50,36 @@ # DG Op modes dg_mode = dg.get_operation_mode() - dg_sub_mode = dg.dg_operation_sub_mode() + dg_sub_mode = dg.get_operation_sub_mode() + if dg_mode == 6: + + if dg_sub_mode == 1: # TEST INLET WATER + dg.temperatures.cmd_temperatures_value_override(17, 31.0) # override the TPi temperature sensor + dg.conductivity_sensors.cmd_conductivity_sensor_override(0, 2100) # override CPI conductivity + dg.pressures.cmd_pressure_override(0, 30) # override inlet water pressure + + elif dg_sub_mode == 4: # TEST BICARB CONDUCTIVITY + dg.temperatures.cmd_temperatures_value_override(17, 34.0) # override the TPi temperature sensor + dg.conductivity_sensors.cmd_conductivity_sensor_override(3, 6821.0) # bicarb CD2 conductivity + + elif dg_sub_mode == 5: # TEST ACID CONDUCTIVITY + dg.temperatures.cmd_temperatures_value_override(17, 35.0) # override the TPi temperature sensor + dg.conductivity_sensors.cmd_conductivity_sensor_override(2, 12252.0) # Acid CD1 conductivity + dg.conductivity_sensors.cmd_conductivity_sensor_override(3, 12252.0) # Bicarb CD2 conductivity + + elif dg_sub_mode == 6: # TEST PRODUCE DIALYSATE + dg.temperatures.cmd_temperatures_value_override(17, 36.0) # override the TPi temperature sensor + dg.conductivity_sensors.cmd_conductivity_sensor_override(0, 2100) # override the inlet conductivity + + elif dg_sub_mode == 7: # TEST DELIVER DIALYSATE + dg.temperatures.cmd_temperatures_value_override(17, 37.0) # override the TPi temperature sensor + dg.conductivity_sensors.cmd_conductivity_sensor_override(0, 2100) # override the inlet conductivity + + else: + dg.temperatures.cmd_temperatures_value_override(17, 30.0) # override the TPi temperature sensor + dg.conductivity_sensors.cmd_conductivity_sensor_override(0, 2100) # override the inlet conductivity + # flows fmp = dg.ro_pump.get_measured_flow_rate() raw_fmp = dg.ro_pump.get_ro_pump_measured_raw_flow_rate_mlp() @@ -72,8 +101,9 @@ lc_b1 = dg.load_cells.load_cell_B1 lc_b2 = dg.load_cells.load_cell_B2 + # f'DG SubMode, {dg_sub_mode}, ' \ data_string = f'DG Mode, {dg_mode}, ' \ - f'DG SubMode, {dg_sub_mode}, ' \ + f'SubMode, {dg_sub_mode}, ' \ f'CPi, {cpi:.4f}, ' \ f'CPo, {cpo:.4f}, ' \ f'CD1, {cd1:.4f}, ' \