当前位置: 首页>>代码示例>>Python>>正文


Python Control.set_lighting_2方法代码示例

本文整理汇总了Python中control.Control.set_lighting_2方法的典型用法代码示例。如果您正苦于以下问题:Python Control.set_lighting_2方法的具体用法?Python Control.set_lighting_2怎么用?Python Control.set_lighting_2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在control.Control的用法示例。


在下文中一共展示了Control.set_lighting_2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: lighting

# 需要导入模块: from control import Control [as 别名]
# 或者: from control.Control import set_lighting_2 [as 别名]
    def lighting(self,Outdorr,Parameter,Control):#补光策略,在currenttime 加了一个get_time()函数

        while True:
            if Control.get_lighting_1()=="off" and Control.get_lighting_2()=="off":
                if get_current_month()>Parameter.month_to_open_lighting and get_current_month()<Parameter.month_to_close_lighting:
                    if get_current_time()>Parameter.period1_start_lighting and get_current_time()<Parameter.period1_stop_lighting:
                        if Outdoor.radiation<Parameter.radiation1_to_open_lighting:

                            Control.set_lighting_1("on")
                            open_time=get_time()
                    elif get_current_time()>Parameter.period2_start_lighting and get_current_time()<Parameter.period2_stop_lighting:
                        if Outdoor.radiation<Parameter.radiation2_to_open_lighting:
                            Control.set_lighting_1("on")
                            open_time2=get_time()

            elif Control.get_lighting_1()=="on" and Control.get_lighting_2()=="off":
                t1=int(get_time()-open_time)
                t2=int(get_time()-open_time2)
                if t1>1750 and t1<1850:
                    Control.set_lighting_2("on")
                if t2>1750 and t2<1850:
                    Control.set_lighting_2("on")

            elif Control.get_lighting_1()=="on" and Control.get_lighting_2()=="on":
                if get_current_time()>Parameter.period1_start_lighting and get_current_time()<Parameter.period1_stop_lighting:
                    if Outdoor.radiation>Parameter.radiation1_to_open_lighting:
                        Control.set_lighting_1("off")
                        stop_time=get_time()
                elif get_current_time()>Parameter.period2_start_lighting and get_current_time()<Parameter.period2_stop_lighting:
                    if Outdoor.radiation>Parameter.radiation2_to_open_lighting:
                        Control.set_lighting_1("off")
                        stop_time2=get_time()
                else:
                    Control.set_lighting_1("off")
                    stop_time3=get_time()

            elif Control.get_lighting_1()=="off" and Control.get_lighting_2()=="on":
                t3=get_time()-stop_time3
                t4=get_time()-stop_time2
                t5=get_time()-stop_time
                if t3>1750 and t3<1850:
                    Control.set_lighting_2("off")
                if t4>1750 and t4<1850:
                    Control.set_lighting_2("off")
                if t5>1750 and t5<1850:
                    Control.set_lighting_2("off")
开发者ID:tj621,项目名称:shen.tao,代码行数:48,代码来源:test02.py

示例2:

# 需要导入模块: from control import Control [as 别名]
# 或者: from control.Control import set_lighting_2 [as 别名]
print "heating",c.get_heating()
print "co2",c.get_co2()
print "lighting 1",c.get_lighting_1()
print "lighting 2",c.get_lighting_2()
print "irrigation",c.get_irrigation()
c.set_roof_vent_south("stop")
c.set_roof_vent_north("stop")
c.set_side_vent("stop")
c.set_shade_screen_out("stop")
c.set_shade_screen_in("stop")
c.set_thermal_screen("stop")
c.set_cooling_pad("on")
c.set_fogging("on")
c.set_heating("on")
c.set_co2("on")
c.set_lighting_1("on")
c.set_lighting_2("on")
c.set_irrigation("on")
print "roof vent south", c.get_roof_vent_south()
print "roof vent north", c.get_roof_vent_north()
print "side vent", c.get_side_vent()
print "shade screen out", c.get_shade_screen_out()
print "shade screen in", c.get_shade_screen_in()
print "thermal screen", c.get_thermal_screen()
print "cooling pad",c.get_cooling_pad()
print "fogging", c.get_fogging()
print "heating",c.get_heating()
print "co2",c.get_co2()
print "lighting 1",c.get_lighting_1()
print "lighting 2",c.get_lighting_2()
print "irrigation",c.get_irrigation()
开发者ID:tj621,项目名称:py-back-end,代码行数:33,代码来源:debug.py


注:本文中的control.Control.set_lighting_2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。