def fogging(self, Indoor, Parameter, Control): if Indoor.get_temperature() > Parameter.temperature_to_open_fogging + 1: Control.set_fogging("on") # if Control.get_thermal_screen()=="on" # Control.set_thermal_screen("off") elif Indoor.get_temperature() < Parameter.temperature_to_open_fogging - 1: Control.set_fogging("off")
def heating(self, Indoor, Parameter, Control): if Indoor.get_temperature( ) < Parameter.hearting_start_lowest_temperature: Control.set_heating("on") elif Indoor.get_temperature( ) > Parameter.hearting_stop_highest_temperature: Control.set_heating("off")
def cooling_pump(self, Indoor, Parameter, Control): if Indoor.get_temperature() > ( Parameter.temperature_to_open_cooling_pad + 1): Control.set_cooling_pad("on") elif Indoor.get_temperature() < ( Parameter.temperature_to_open_cooling_pad - 1): # 此时侧窗是与湿帘风机对应的,所以暂时不需要考虑90度方向的侧窗是否关闭 Control.set_cooling_pad("off")
def save_db_indoor(Indoor): with app.app_context(): db = get_db() db.execute('INSERT INTO indoor(node_number,update_time,temperature,humidity,radiation,co2) VALUES(?,?,?,?,?,?)', [Indoor.get_name(), Indoor.get_update_time(), Indoor.get_temperature(), Indoor.get_humidity(), Indoor.get_radiation(), Indoor.get_co2()]) db.commit() db.close() print 'indoor save success'
def save_db_indoor(Indoor): with app.app_context(): db = get_db() indoor_node = "indoor_node_" + Indoor.get_name() db.cursor().execute( 'insert into ' + indoor_node + '(node,update_time,temperature,humidity,radiation,co2) values(%s,%s,%s,%s,%s,%s)', [ Indoor.get_name(), get_current_time(), Indoor.get_temperature(), Indoor.get_humidity(), Indoor.get_radiation(), Indoor.get_co2() ]) db.commit() db.cursor().close() db.close() print 'indoor save success'
def cooling_pump(self, Indoor, Parameter, Control): if Indoor.get_temperature() > (Parameter.temperature_to_open_cooling_pad + 1): Control.set_cooling_pad("on") elif Indoor.get_temperature() < ( Parameter.temperature_to_open_cooling_pad - 1): # 此时侧窗是与湿帘风机对应的,所以暂时不需要考虑90度方向的侧窗是否关闭 Control.set_cooling_pad("off")
def heating(self, Indoor, Parameter, Control): if Indoor.get_temperature() < Parameter.hearting_start_lowest_temperature: Control.set_heating("on") elif Indoor.get_temperature() > Parameter.hearting_stop_highest_temperature: Control.set_heating("off")