########################################################################### # # Copyright (c) 2021-2025 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_hd_dg_fans.py # # @author (last) Dara Navaei # @date (last) 23-Feb-2022 # @author (original) Dara Navaei # @date (original) 04-Aug-2021 # ############################################################################ from dialin import HD, DG from dialin.hd.temperatures import HDTemperaturesNames #from dialin.hd.fans import FansNames from dialin.hd.switches import HDSwitchesNames from time import sleep def get_fans_info(): info = ('Target_fans_DC, {:5.3f}, HD_fans_target_RPM, {:5.3f}, Inlet1_RPM, {:5.3f}, Board_temp, {:5.3f}, ' 'Power_supply_temp, {:5.3f}, FPGA_temp, {:5.3f}, Venous_temp, {:5.3f}, pba_adc_temp, {:5.3f}, ' .format(hd.fans.duty_cycle, hd.fans.target_rpm, hd.fans.inlet_1_rpm, hd.temperatures.hd_temperatures[HDTemperaturesNames.THERMISTOR_ONBOARD_NTC.name], hd.temperatures.hd_temperatures[HDTemperaturesNames.THERMISTOR_POWER_SUPPLY_1.name], hd.temperatures.hd_temperatures[HDTemperaturesNames.TEMPSENSOR_FPGA_BOARD.name], hd.temperatures.hd_temperatures[HDTemperaturesNames.TEMPSENSOR_VENOUS_PRESS_TEMP.name], hd.temperatures.hd_temperatures[HDTemperaturesNames.TEMPSENSOR_PBA_ADC_SENSOR.name])) return info def get_hd_switches_info(): info = ('Door_switch, {}, Pump_track_switch, {}'. format(hd.switches.hd_switches_status[HDSwitchesNames.FRONT_DOOR.name], hd.switches.hd_switches_status[HDSwitchesNames.PUMP_TRACK_SWITCH.name])) return info if __name__ == "__main__": # Create an instance of the DG Class hd = HD(log_level='DEBUG') if hd.cmd_log_in_to_hd() == 0: exit(1) while True: print(get_fans_info()) sleep(1)