displayscreen.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:softconsole 作者: kevinkahn 项目源码 文件源码
def __init__(self):

        debug.debugPrint("Main", "Screensize: ", config.screenwidth, config.screenheight)
        config.Logs.Log("Screensize: " + str(config.screenwidth) + " x " + str(config.screenheight))
        config.Logs.Log(
            "Scaling ratio: " + "{0:.2f}".format(config.dispratioW) + ':' + "{0:.2f}".format(config.dispratioH))

        self.dim = 'Bright'  # either Bright or Dim (or '' for don't change when a parameter
        self.state = 'Home'  # one of Home, NonHome, Maint, Cover, Alert

        # Central Task List
        self.Tasks = EventList()
        self.WatchNodes = {}  # Nodes that should be watched for changes (key is node address, value is [alerts]
        # todo if ever possible to delete alerts then need id per comment on vars
        self.WatchVars = {}  # Variables that should be watched for changes (key is (vartype,varid) value is [alerts]
        # todo if watches could be dynamic then delete needs to pass in the alert to id which to delete
        self.Deferrals = []
        self.WatchVarVals = {}  # most recent reported watched variable values

        # Events that drive the main control loop
        # self.ACTIVITYTIMER = pygame.event.Event(
        #   pygame.USEREVENT + 1)  # screen activity timing (Dimming, persistence etc)
        self.ACTIVITYTIMER = pygame.USEREVENT + 1
        self.ISYChange = pygame.USEREVENT + 2  # Node state change in a current screen watched node on the ISY
        self.ISYAlert = pygame.USEREVENT + 3  # Mpde state change in watched node for alerts
        self.ISYVar = pygame.USEREVENT + 4  # Var value change for a watched variable on ISY
        self.NOEVENT = pygame.event.Event(pygame.NOEVENT)

        self.AS = None  # Active Screen
        self.ScreensDict = {}  # all the sceens by name for setting navigation keys
        self.Chain = 0  # which screen chain is active 0: Main chain 1: Secondary Chain
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号