示例#1
0
 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")
示例#2
0
 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")
示例#3
0
 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")
示例#4
0
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'
示例#5
0
文件: database.py 项目: tj621/py_back
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'
示例#6
0
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'
示例#7
0
文件: test02.py 项目: tj621/py_back
 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")
示例#8
0
文件: test02.py 项目: tj621/py_back
 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")