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


Python CompositeNode.start方法代码示例

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


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

示例1: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     self._pdo = PersistentDataObject(self)
     self._pdo.last_dictionary = None
     self._pdo.load()
     self._started = 1
     self.parent.event_subscribe(self,AlarmTriggerEvent)
     CompositeNode.start(self)
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:last_alarm.py

示例2: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
    def start(self):
        if self.parent.room == 1:
            msglog.log('USAP', INFO, 'Object:start() - %s --> %s --> %s' % (self.parent.parent.name, self.parent.name, self.name))
            self.path = string.join([self.parent.name, self.name], '.')
            self.lh = self.parent.parent.lh
            self.request_obj = self.parent.parent.request_obj
            self.response_obj = self.parent.parent.response_obj
            self.unison_v1_9_0_or_prior = self.parent.parent.unison_v1_9_0_or_prior
        else:
            msglog.log('USAP', INFO, 'Object:start() - %s --> %s --> %s --> %s' % (self.parent.parent.parent.name, self.parent.parent.name, self.parent.name, self.name))
            self.path = string.join([self.parent.parent.name, \
                                     self.parent.name, self.name], '.')
            self.lh = self.parent.parent.parent.lh
            self.request_obj = self.parent.parent.parent.request_obj
            self.response_obj = self.parent.parent.parent.response_obj
            self.unison_v1_9_0_or_prior = self.parent.parent.parent.unison_v1_9_0_or_prior

        # Find the relevant protocol child objects ahead of time to
        # be more efficient.
        self.req_startCode_obj = self.request_obj.findChildByName("startCode")
        self.req_vData_obj = self.request_obj.findChildByName("vData")
        self.req_crc_obj = self.request_obj.findChildByName("crc")
        #
        self.resp_startCode_obj = self.response_obj.findChildByName("startCode")
        self.resp_vData_obj = self.response_obj.findChildByName("vData")
        self.resp_crc_obj = self.response_obj.findChildByName("crc")
        #
        CompositeNode.start(self)
开发者ID:mcruse,项目名称:monotone,代码行数:30,代码来源:usap.py

示例3: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     #only if we are an active point (not simply a parent node)
     if self.lan_address != 0 and self.id_number != 0:
         #do we have a _line_handler and therefore want get/set
         if self._line_handler is None: #preconfigured instead of autodiscovered
             self._line_handler = self.get_line_handler()
         if self._line_handler:
             self.get = self._get
             self.get_result = self._get_result
             self.set = self._set
             self.has_cov = self._has_cov
             self.event_subscribe = self._event_subscribe
             self.event_unsubscribe = self._event_unsubscribe
             self._line_handler_up = self.__line_handler_up
             try:
                 if not self.has_child("_status"):
                     self.__status = self.Status(self)
                     self.__status.configure({'name':'_status', 'parent':self})
             except:
                 msglog.exception()
             if self.is_bound_proxy():
                 self._line_handler.register_bound_proxy(self)
     CompositeNode.start(self)
     ActiveProxyAbstractClass.start(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:27,代码来源:points.py

示例4: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     self.port = self.parent
     if not self.port.is_open():
         self.port.open()
     self.line_handler = cat_lib.CCMLineHandler(self.port)
     self.line_handler.start(self.password)
     CompositeNode.start(self)
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:cat_nodes.py

示例5: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     CompositeNode.start(self)
     self._set_zip_file()
     tread = Thread(name="AutoDiscovery",target=self.kick_start_discovery)
     scheduler.after(2, tread.start)
     self.ad = AutoDiscovery()
     self.ad.configure({"parent":self,"name":"AutoDiscover"})
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:tsws.py

示例6: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     CompositeNode.start(self)
     next_position = 0
     timestamp = PeriodicColumn()
     timestamp.configure({'parent':self.get_child('recorders'),
                          'name':'timestamp',
                          'position':next_position,
                          'sort_order':'ascending',
                          'args':(),
                          'function':self.scheduled_time})
     timestamp.sequence = 0
     sequences = []
     for child in self.get_child('recorders').children_nodes():
         if child.__class__ == Recorder:
             if child.sequence in sequences:
                 raise EConfiguration(
                     'Conflicting RecorderSet sequence %s on %r' %
                     (child.sequence, child.name))
         sequences.append(child.sequence)
     # Force Timestamp as column '0'.
     self.collector.add_column(timestamp)
     children = self.get_child('recorders').children_nodes()
     children.sort(_sort)
     for child in children:
         if child.__class__ == Recorder:
             for channel in child.channels():
                 next_position += 1
                 channel.position = next_position
                 self.collector.add_column(channel)
     cc = ColumnConfiguration()
     cc.configure(timestamp.configuration())
     self.log.configure([cc]+self.collector.columns[1:],
                        self.minimum_size,self.maximum_size)
     self.collector.start()
开发者ID:mcruse,项目名称:monotone,代码行数:36,代码来源:recorders.py

示例7: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     CompositeNode.start(self)
     self.local_context = {}
     try:
         self.compiled_statement = compile(self.statement, '', 'eval')
         #examine each variable and decide what to do with it
         for variable in self.variables:
             name = variable['vn']
             definition = variable['node_reference']
             if self.local_context.has_key(name):
                 raise EInvalidValue('variable',name,
                                     'Variable name duplicated')
             exceptions = []
             conversions = self._conversions[:]
             while conversions:
                 conversion = conversions.pop(0)
                 try:
                     reference = conversion(definition)
                     break
                 except Exception,e:
                     exceptions.append(e)
             else:
                 self.local_context = {}
                 raise EInvalidValue('variable',name,
                                     ('Conversions %s Gave Errors %s.' %
                                      (self._conversions,exceptions)))
             self.local_context[name] = reference
         self.started = 1
开发者ID:mcruse,项目名称:monotone,代码行数:30,代码来源:evaluator.py

示例8: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     if self.readwrite != 1: #since not readonly
         if not(self.parameter == 'L' or self.parameter == 'K' or self.parameter == 'M'):
             self.set = self._set  #read only parameters
     self.line_handler = self.parent.line_handler
     self.unit_number = self.parent.unit_number
     CompositeNode.start(self)
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:value.py

示例9: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     self.device_map = {}
     if self.debug: print 'Start modbus serial slave node'
     CompositeNode.start(self)
     self.subnet.start()
     if self.debug: print 'modbus serial slave node started'
     return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:serial_server.py

示例10: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
    def start(self):
        if self.__running:
            return
        if self.debug:
            msglog.log('EnergywiseManager :', msglog.types.INFO, 'Inside start' )
        CompositeNode.start(self)
#        start_node = as_node('/services/EnergywiseManager/')
#        self.configure_trend_in_switches(start_node, 60)
        self.__running = True
        self._pdo_lock.acquire()
        self._pdo = PersistentDataObject(self, dmtype=GC_NEVER)
        self._pdo.trends = {}
        self._pdo.load()
        self._pdo_lock.release()
        if self.has_child('trends'):
            self.trends = self.get_child('trends')
        else:
            self.trends = CompositeNode()
            self.trends.configure({'parent':self, 'name':'trends'})
            self.trends.start()
        # start trending for saved domains
        for domain,freq in self._pdo.trends.items():
            try:
                start_node = as_node(domain)
               # self.configure_trend_in_switches( start_node,freq )
                start_node.new_trend(freq)
            except:
                self.delete_trend_configuration(domain)
        return
开发者ID:mcruse,项目名称:monotone,代码行数:31,代码来源:energywise_manager.py

示例11: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     self.maps = self.parent.maps #children may reference maps
     if self.separate_cache:
         if self.group_base_register:
             if not self.maps.has_key(self.group_base_register):
                 self.maps[self.group_base_register] = ([], 1.0)
     CompositeNode.start(self)
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:generic.py

示例12: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start( self ):
     CompositeNode.start( self )
     if not self.isStarted:
         self.isStarted = 1
         self._schedule(.15)
     else:
         raise EAlreadyRunning
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:__init__.py

示例13: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     CompositeNode.start(self)
     self.bcu_list = []
     self.running = 1
     if self._who_is_thread is None: #kick off who_is thread
         network._who_are_devices()
         self._who_is_thread = _WhoIsThread(self)
         self._who_is_thread.start()
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:network.py

示例14: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self): #bind to the correct driver functions based on the node name
     self.driver = self.parent.parent.driver
     self._mutex = self.parent.parent._mutex
     if self.name in self.driver.eeprom_parameters.keys():
         addr, length, rw, type, _range, desc = self.driver.eeprom_parameters[self.name]
         if rw:
             self.set = self._set
     CompositeNode.start(self)
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:aerocomm.py

示例15: start

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import start [as 别名]
 def start(self):
     if not self.isDaemon():
         self.setDaemon(True)
     if self.messaging is None:
         self.messaging = as_node("/services/messaging")
     self.commands = self.messaging.get_destination("/node-commands")
     CompositeNode.start(self)
     Thread.start(self)
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:command.py


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