• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python node.CompositeNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

 def __init__(self):
     CompositeNode.__init__(self)
     ProxyAbstractClass.__init__(self)
     self.debug = 0
     self.value = None
     self.buffer = None
     self.last_set_exception = None
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:server.py


示例2: configure

 def configure(self, config):
     CompositeNode.configure(self, config)
     set_attribute(self, 'url', '', config, str)
     set_attribute(self, 'user', '', config, str)
     set_attribute(self, 'password', '', config, str)
     set_attribute(self, 'spreadsheet', self.name, config, str) #spreadsheet name
     set_attribute(self, 'worksheet', '', config, str)
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:spreadsheet.py


示例3: configure

 def configure(self, cd):
     CompositeNode.configure(self, cd)
     set_attribute(self, 'source',self.source, cd, str)
     set_attribute(self, 'device_link', None, cd, str) #url of Devices node
     set_attribute(self, 'discover_mode', self.discover_mode, cd, str)
     set_attribute(self, '__node_id__',self._node_id, cd, str)
     set_attribute(self, 'bacnet_datatype', 'real', cd, str)
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:bacnet_scheduler.py


示例4: test_configure_sequence_get

 def test_configure_sequence_get(self):
     p = PeriodicLog()
     p.configure({'name':'log','parent':None, 'period':1})
     h = CompositeNode()
     h.configure({'name':'columns','parent':p})
     c = PeriodicDeltaColumn()
     c.configure({'position':0, 'name':'2', 'parent':h,
                  'function':self._next})
     p.start()
     try:
         l = []
         if c.get() != None:
             raise 'Get didn\'t return None on first get'
         if c.get() != None:
             raise 'Get didn\'t return None on second get'
         self.seq.value = 0
         c.function()
         self._next()
         self._next()
         self._next()
         if c.get() != self.seq.value - 1:
             raise 'Got incorrect value after incrementing'
     finally:
         p.stop()
     return
开发者ID:mcruse,项目名称:monotone,代码行数:25,代码来源:_test_case_periodic_delta_column.py


示例5: configure

 def configure(self,config):
     if self.debug:
         msglog.log('EnergywiseManager:', msglog.types.INFO,
                    'Inside configure' )
     CompositeNode.configure(self, config)
     set_attribute(self, 'debug', 0, config, int)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:energywise_manager.py


示例6: start

 def start( self ):
     CompositeNode.start( self )
     if not self.isStarted:
         self.isStarted = 1
         self._schedule(.15)
     else:
         raise EAlreadyRunning
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:__init__.py


示例7: configure

 def configure(self, config):
     CompositeNode.configure(self, config)
     # get handle to ARM in arm.py.  
     # self.coprocessor is the surrogate parent this child.
     # 
     set_attributes(self, (('id',REQUIRED),('coprocessor',REQUIRED)), config)
     self._coprocessor = self.coprocessor._coprocessor # the moab megatron ARM object
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:node.py


示例8: start

 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,代码行数:7,代码来源:tsws.py


示例9: configure

 def configure(self, config):
     CompositeNode.configure(self,config)
     set_attribute(self, 'id', 0, config, str)
     set_attribute(self,'cache_life',30,config,float)
     set_attribute(self,'timeout',10,config,float)
     set_attribute(self,'patience',1,config,float)
     self.port = self.parent
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:__init__.py


示例10: __init__

 def __init__(self):
     self._running = 0
     self.driver = None
     self.mac_address = None
     self.discovery_mode = 'None'
     CompositeNode.__init__(self)
     AutoDiscoveredNode.__init__(self)
     EventProducerMixin.__init__(self)
     self.device_map = {} #keyed by mac address of clients; value=Child node
     self._out_q = [] #request queue
     self._out_q_cv = threading.Condition()
     self._mutex = threading.Lock() #prevent multiple access to outbound commands
     self._registered_clients = {}
     self.transceiver_state = TransceiverState[0]
     self.cov = ChangeOfValueEvent(self, None, self.transceiver_state)
     self.debug = debug
     self.timeout = 10 #seconds
     self.who_is_interval = 10 #seconds
     self.default_discovered_protocol_module = None
     # @todo
     # initailize this through configuration
     self.default_discovered_protocol_module = feu
     self.transceiver_state = 0
     self.relay_node = '/interfaces/relay1'  #this is temporary, should be None
     self.active_devices = {}
     self.status = None
开发者ID:mcruse,项目名称:monotone,代码行数:26,代码来源:aerocomm.py


示例11: start

 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,代码行数:7,代码来源:cat_nodes.py


示例12: start

 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,代码行数:28,代码来源:evaluator.py


示例13: __init__

 def __init__(self):
     CompositeNode.__init__(self)
     self._threads = set()
     self.started = 0
     self._failed = {}
     self._exception = None
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:calculator.py


示例14: start

    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,代码行数:29,代码来源:energywise_manager.py


示例15: stop

 def stop(self):
     try:
         self._interface_node.stop()
     except:
         msglog.log('tsws',msglog.types.ERR,'tsws failed to stop interface node')
     self._interface_node = None
     CompositeNode.stop(self)
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:tsws.py


示例16: __init__

 def __init__(self):
     CompositeNode.__init__(self)
     self._pdo_lock = Lock()
     self._pdo = None
     self.__running = False
     self.debug = 0
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:energywise_manager.py


示例17: test_configure_sequence

 def test_configure_sequence(self):
     p = PeriodicLog()
     p.configure({'name':'log','parent':None, 'period':1})
     h = CompositeNode()
     h.configure({'name':'columns','parent':p})
     c = PeriodicAverageColumn()
     c.configure({'position':0, 'name':'2', 'parent':h,
                  'function':self._next})
     p.start()
     try:
         l = []
         v = []
         for i in range(0,100):
             l.append(c._evaluate())
             v.append(i-0.5)
         if l.pop(0) != None:
             raise 'First delta not None.'
         v.pop(0)
         for i in l:
             j = v.pop(0)
             if i != j:
                 raise 'Incorrect average of %s should be %s.' % (i, j)
     finally:
         p.stop()
     return
开发者ID:mcruse,项目名称:monotone,代码行数:25,代码来源:_test_case_periodic_average_column.py


示例18: children_nodes

    def children_nodes(self):
        children = CompositeNode.children_nodes(self)

        stats = get_c_stat_names()

        # remove all nodes that do not have a stat
        nodeNameList = []
        for c in children:
            if c.name not in stats:
                c.prune()
            else:
                nodeNameList.append( c.name)
        
        # add all stats to node tree (unless already there)
        for stat in stats:
            if stat not in nodeNameList:
                n = CStatNode(stat)
                cd = { 'name'   : stat,
                       'parent' : self,
                       'log_on_change': -1,
                       'time_last_changed': ''}
                
                n.configure( cd)

        return CompositeNode.children_nodes(self)
开发者ID:mcruse,项目名称:monotone,代码行数:25,代码来源:__init__.py


示例19: __init__

 def __init__(self):
     CompositeNode.__init__(self)
     self.running = 0
     self.line_handler = None
     self._pnts_map = {}
     self.debug_lvl = 0 # should be valid immediately after ctor, NOT just after configure()
     self.__status = None
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:rznet_node.py


示例20: __init__

 def __init__(self):
     CompositeNode.__init__(self)
     self.coprocessor = None
     self.port_map = None
     self.eth_map = None
     self.modem_map = None
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:host.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python node.ConfigurableNode类代码示例发布时间:2022-05-27
下一篇:
Python node.as_node函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap