def topicManager(self): if self._topicManager: return self._topicManager else: self._topicManager = topicManagerFactory.load( self.get(self.kTopicManager)) return self._topicManager
def __init__(self, creator, layer=None, broker=None, topicManager=None): self._layer = layer self._plugin_dir = creator._plugin_dir self._creator = creator self._dict = {} self._mutex = QMutex(0) self._values = {} self.Q = Queue.Queue(self.kQueueSize) self._dirty = False self.establishedFeatures = [] self.restartScheduled = False self.isEditing = False self._iface = creator._iface self._paused = False self._fid = None self._feat = None self._broker = None self._topicType = None self._topicManager = None self._formattersSet = False self._deferredEdit = False if broker is not None and topicManager is not None: self.setBroker(broker, False) if not self.isTLayer(self._layer): self._prepare(broker, topicManager) # Add Layer properties for broker else: _broker = Brokers.instance().find(self.get(self.kBrokerId)) if _broker is None: raise BrokerNotFound( "No MQTT Broker found when loading Telemetry Layer " + self.layer().name()) self.setBroker(_broker) self.setTopicManager( topicManagerFactory.load(self.get(self.kTopicManager))) #self._setFormatters() super(tLayer, self).__init__( self, self._layer.id(), # Add randown self._broker, True) self.updateConnected(False) self._broker.deletingBroker.connect(self.tearDown) self.layer().attributeValueChanged.connect(self.attributeValueChanged) self.commitChanges.connect(self._commitChanges)
def __init__(self, creator, layer=None, broker=None, topicManager=None): self._layer = layer self._plugin_dir = creator._plugin_dir self._creator = creator self._dict = {} self._mutex = QMutex(0) self._values = {} self.Q = Queue.Queue(self.kQueueSize) self._dirty = False self.establishedFeatures = [] self.restartScheduled = False self.isEditing = False self._iface = creator._iface self._paused = False self._fid = None self._feat = None self._broker = None self._topicType = None self._topicManager = None self._formattersSet = False self._deferredEdit = False if broker is not None and topicManager is not None: self.setBroker(broker, False) if not self.isTLayer(self._layer): self._prepare(broker, topicManager) # Add Layer properties for broker else: _broker = Brokers.instance().find(self.get(self.kBrokerId)) if _broker is None: raise BrokerNotFound("No MQTT Broker found when loading Telemetry Layer " + self.layer().name()) self.setBroker(_broker) self.setTopicManager(topicManagerFactory.load(self.get(self.kTopicManager))) #self._setFormatters() super(tLayer, self).__init__(self, self._layer.id(), # Add randown self._broker, True) self.updateConnected(False) self._broker.deletingBroker.connect(self.tearDown) self.layer().attributeValueChanged.connect(self.attributeValueChanged) self.commitChanges.connect(self._commitChanges)
def getTopicManager(self): return tmFactory.load(self.selectTopicManager.itemData(self.selectTopicManager.currentIndex()))
def topicManager(self): if self._topicManager: return self._topicManager else: self._topicManager = topicManagerFactory.load(self.get(self.kTopicManager)) return self._topicManager
def getTopicManager(self): return tmFactory.load( self.selectTopicManager.itemData( self.selectTopicManager.currentIndex()))