本文整理汇总了Python中mpx.lib.node.CompositeNode类的典型用法代码示例。如果您正苦于以下问题:Python CompositeNode类的具体用法?Python CompositeNode怎么用?Python CompositeNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CompositeNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
示例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)
示例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)
示例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
示例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
示例6: start
def start( self ):
CompositeNode.start( self )
if not self.isStarted:
self.isStarted = 1
self._schedule(.15)
else:
raise EAlreadyRunning
示例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
示例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"})
示例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
示例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
示例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)
示例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
示例13: __init__
def __init__(self):
CompositeNode.__init__(self)
self._threads = set()
self.started = 0
self._failed = {}
self._exception = None
return
示例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
示例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)