sensor_client_address = os.environ["EX9132_ADDRESS"] sensor_client_port = os.environ["EX9132_PORT_1"] actuator_client_address = os.environ["EX9132_ADDRESS"] actuator_client_port = os.environ["EX9132_PORT_2"] # http Connection Parameter server_address = os.environ["WT_ADDRESS"] server_port = os.environ["WT_PORT"] # DB Connection parameter db_name = os.environ["DB_NAME"] db_host = os.environ["DB_HOST"] db_port = os.environ["DB_PORT"] db_user = os.environ["DB_USER"] user_password = os.environ["USER_PASSWORD"] s = Sensors(sensor_client_address, sensor_client_port,server_address, server_port) a = Actuators(actuator_client_address, actuator_client_port) dbi = DBInsert(db_name = db_name, db_host = db_host, db_port = db_port, db_user = db_user, user_password = user_password) valve_open = 1.0 valve_closed = 0.0 try: while True: time_measurement = time.time() rtm1_0 = s.get_temperature_northeast() wt_3 = s.get_temperature_northwest() wt_2 = s.get_temperature_west() rtm1_1 = s.get_temperature_southwest() wt_0 = s.get_temperature_southeast() wt_1 = s.get_temperature_east()
from sensors_actuators_k004b.actuators import Actuators import os client_address_sensors = os.environ["EX9132_ADDRESS"] client_port_sensors = os.environ["EX9132_PORT_2"] a = Actuators(client_address_sensors, client_port_sensors) k = 0 print a.get_valve_position() print a.set_valve_position(opening_level=1.0) while k < 5: print a.get_valve_position() k += 1 del a
logging.basicConfig() log = logging.getLogger() log.setLevel(logging.DEBUG) s = Sensors(client_address = sensor_client_address, \ client_port = sensor_client_port, \ server_address = server_address, \ server_port = server_port, \ serial_port = serial_port_sensors, \ baudrate = baudrate_sensors, \ parity = parity_sensors, \ stopbits = stopbits_sensors, \ bytesize = bytesize_sensors, \ timeout = timeout_sensors) a = Actuators(client_address = actuator_client_address, \ client_port = actuator_client_port) s.get_temperature_northwest() s.get_temperature_northeast() s.get_temperature_east() s.get_temperature_west() s.get_temperature_southwest() s.get_temperature_southeast() s.get_flowrate_radiator() s.get_temperature_radiator_inlet() s.get_temperature_radiator_outlet() s.get_radiation_total() s.get_radiation_diffuse() s.get_sunshine_presence() a.set_valve_position(opening_level=0.0) a.get_valve_position()