Esempio n. 1
0
    def activate(self, conf, glob):
        protocols.activate(self, conf, glob)
        self.logger = logging.getLogger('pellMon')
        self.dbvalues={}

        # Initialize protocol and setup the database according to version_string
        try:
            try:
                self.protocol = Protocol(self.conf['serialport'], self.conf['chipversion'])
            except:
                # Create testprotocol if conf is missing
                self.protocol = Protocol(None, '')
            self.allparameters = self.protocol.getDataBase()

            # Create and start settings_pollthread to log settings changed locally
            settings = menus.getDbWithTags(('Settings',))
            ht = threading.Timer(3, self.settings_pollthread, args=(settings,))
            ht.setDaemon(True)
            ht.start()

            # Create and start alarm_pollthread to log settings changed locally
            ht = threading.Timer(5, self.alarm_pollthread, args=(('mode', 'alarm'),))
            ht.setDaemon(True)
            ht.start()

            self.dataDescriptions = dataDescriptions
        except:
            self.logger.info('scottecom protocol setup failed')
Esempio n. 2
0
    def activate(self, conf, glob):
        protocols.activate(self, conf, glob)
        self.logger = logging.getLogger('pellMon')
        self.dbvalues = {}

        # Initialize protocol and setup the database according to version_string
        try:
            try:
                self.protocol = Protocol(self.conf['serialport'],
                                         self.conf['chipversion'])
            except:
                # Create testprotocol if conf is missing
                self.protocol = Protocol(None, '')
            self.allparameters = self.protocol.getDataBase()

            # Create and start settings_pollthread to log settings changed locally
            settings = menus.getDbWithTags(('Settings', ))
            ht = threading.Timer(3,
                                 self.settings_pollthread,
                                 args=(settings, ))
            ht.setDaemon(True)
            ht.start()

            # Create and start alarm_pollthread to log settings changed locally
            ht = threading.Timer(5,
                                 self.alarm_pollthread,
                                 args=(('mode', 'alarm'), ))
            ht.setDaemon(True)
            ht.start()

            self.dataDescriptions = dataDescriptions
        except:
            self.logger.info('scottecom protocol setup failed')
Esempio n. 3
0
 def getDbWithTags(self, tags):
     """Get the menutags for param"""
     allparameters = self.getDataBase()
     filteredParams = menus.getDbWithTags(tags)            
     params = []
     for param in filteredParams:
         if param in allparameters:
             params.append(param)
     params.sort()
     return params
Esempio n. 4
0
 def getDbWithTags(self, tags):
     """Get the menutags for param"""
     allparameters = self.getDataBase()
     filteredParams = menus.getDbWithTags(tags)
     params = []
     for param in filteredParams:
         if param in allparameters:
             params.append(param)
     params.sort()
     return params