當前位置: 首頁>>代碼示例>>Python>>正文


Python Control.set_lighting_1方法代碼示例

本文整理匯總了Python中control.Control.set_lighting_1方法的典型用法代碼示例。如果您正苦於以下問題:Python Control.set_lighting_1方法的具體用法?Python Control.set_lighting_1怎麽用?Python Control.set_lighting_1使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在control.Control的用法示例。


在下文中一共展示了Control.set_lighting_1方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: lighting

# 需要導入模塊: from control import Control [as 別名]
# 或者: from control.Control import set_lighting_1 [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_1 [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_1方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。