def __init__(self): # variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifThread = None self.snapshotThread = None # create window self.window = dustWindow.dustWindow( 'Timelapse', self._windowCb_close, ) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=0, column=0) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.show() # add a table frame self.tableFrame = dustFrameTable.dustFrameTable( self.window, self.guiLock, frameName="network activity", row=1, column=0, ) self.tableFrame.show()
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.mgrconnector = None self.lbrconnector = None # create window self.window = dustWindow.dustWindow('LBRConnection', self._windowCb_close) # add an LBR connection frame self.LBRConnectionFrame = dustFrameLBRConnection.dustFrameLBRConnection( self.window, self.guiLock, self._LBRConnectionFrameCb_connected, frameName="LBR connection", row=0, column=0) self.LBRConnectionFrame.show() # add a manager connection frame self.mgrconnectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._mgrconnectionFrameCb_connected, frameName="manager connection", row=1, column=0) self.mgrconnectionFrame.apiLoaded(self.apiDef) self.mgrconnectionFrame.show()
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.connector = None # create window self.window = dustWindow.dustWindow( 'Chaser', self._windowCb_close ) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=0,column=0 ) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.show() # add a directionFrame self.directionFrame = dustFrameDirection.dustFrameDirection( self.window, self.guiLock, self._directionFrameCb, row=1,column=0 )
def __init__(self): # variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifClientHandler = None # create window self.window = dustWindow.dustWindow('MgrListener', self._windowCb_close) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=0, column=0) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.show() # add a table frame self.tableFrame = dustFrameTable.dustFrameTable( self.window, self.guiLock, frameName="received notifications", row=1, column=0) self.tableFrame.show()
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifClientHandler = None # create window self.window = dustWindow.dustWindow('SensorDataReceiver', self._windowCb_close) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=0, column=0) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.show() # add a sensor data frame self.sensorDataFrame = dustFrameSensorData.dustFrameSensorData( self.window, self.guiLock, frameName="received sensor data", row=1, column=0) self.sensorDataFrame.show()
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.dc2126aHandler = None # initialize data singleton dc2126aData().set('selectedMote', None) dc2126aData().set('temperature', None) dc2126aData().set('adcValue', None) dc2126aData().set('energysource', None) # create window self.window = dustWindow.dustWindow( 'DC2126A', self._windowCb_close, ) # add connection Frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="Serial connection", row=0, column=0, ) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.serialPortText.delete("1.0", Tkinter.END) self.connectionFrame.show() # add configuration frame self.configurationFrame = dustFrameDC2126AConfiguration.dustFrameDC2126AConfiguration( self.window, self.guiLock, selectedMoteChangedCB=self._selectedMoteChangedCB, refreshButtonCB=self._refreshButtonCB, getConfigurationCB=self._getConfigurationCB, setConfigurationCB=self._setConfigurationCB, row=1, column=0, ) self.configurationFrame.disableButtons() self.configurationFrame.show() # add report Frame self.reportFrame = dustFrameDC2126AReport.dustFrameDC2126AReport( self.window, self.guiLock, getTemperatureCb=self._getTemperature, getEnergySourceCb=self._getEnergySource, getAdcValueCb=self._getAdcValue, row=0, column=1, ) self.reportFrame.show() # local variables self.userMsg = '' # error message printed to user
def __init__(self): self.fileLock = threading.RLock() self.hdlc = OpenHdlc.OpenHdlc() self.hrParser = HrParser.HrParser() self.api = IpMgrDefinition.IpMgrDefinition() self.connSerial = IpMgrConnectorSerial.IpMgrConnectorSerial() self.oapLock = threading.RLock() self.oap = OAPDispatcher.OAPDispatcher() self.oap.register_notif_handler(self._handle_oap_notif)
def __init__(self, maxQSize=100): api_def = IpMgrDefinition.IpMgrDefinition() SerialConnector.SerialConnector.__init__(self, api_def, maxQSize) self.HELLO_IDS = {'hello': self.api_def.nameToId(*self.HELLO_CMD), 'hello_response': self.api_def.nameToId(*self.HELLO_RESP_CMD), 'manager_hello': self.api_def.nameToId(*self.MGR_HELLO_CMD), } self.helloCmdIds = self.HELLO_IDS.values() self.isConnect = False
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.ledOn = False self.pingOngoing = False self.oap_client = None self.ratecalculator = RateCalculator.RateCalculator() self.connector = None # create window self.window = dustWindow.dustWindow('LEDPing', self._windowCb_close) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=0, column=0) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.show() # add a LEDPing frame self.LEDPingFrame = dustFrameLEDPing.dustFrameLEDPing( self.window, self.guiLock, self._LEDPingFrameCb_startPressed, self._LEDPingFrameCb_stopPressed, frameName="LED ping", row=1, column=0) self.LEDPingFrame.show() # add a text frame self.textFrame = dustFrameText.dustFrameText(self.window, self.guiLock, frameName="Notes", row=2, column=0) self.textFrame.show() # put information in text frame output = [] output += ['The mote this application drives needs to run the'] output += ['default firmware, and operate in master mode.'] output += [''] output += [''] output += ['The start button is only active when the'] output += ['application is connected to a SmartMesh IP manager.'] output = '\n'.join(output) self.textFrame.write(output)
def __init__(self, maxQSize=100): ApiConnector.ApiConnector.__init__(self, maxQSize) self.acknowledgeBuf = None self.ackCmdId = -1 self.sendSemaphor = threading.BoundedSemaphore(1) self.sendLock = threading.Lock() self.socket = None self.inputThread = None self.muxMsg = MuxMsg.MuxMsg(self.processCmd) self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifIds = self.apiDef.getIds(self.apiDef.NOTIFICATION)
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.dc2369aHandler = None self.connector = None # initialize data singleton dc2369aData().set('selectedMote', None) dc2369aData().set('numDisplayedMotes', 0) # create window self.window = dustWindow.dustWindow( 'DC2369A', self._windowCb_close, ) # add connection Frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="Serial connection", row=0, column=0, ) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.serialPortText.delete("1.0", Tkinter.END) self.connectionFrame.show() # add configuration frame self.configurationFrame = dustFrameDC2369AConfiguration.dustFrameDC2369AConfiguration( self.window, self.guiLock, selectedMoteChangedCB=self._selectedMoteChangedCB, displayMoteButtonCB=self._displayMoteButtonCB, refreshButtonCB=self._refreshButtonCB, clearMotesButtonCB=self._clearMotesButtonCB, row=0, column=1, ) self.configurationFrame.disableButtons() self.configurationFrame.show() # establish a list of report Frames, so we can keep track of them as they are added self.reportFrames = [] # local variables self.userMsg = '' # error message printed to user
def _loadApi(self): ''' \brief Called when pressing the 'load' button. ''' # read the configuration entered in the GUI self.guiLock.acquire() temp_networkType = self.networkTypeString.get() if not self.deviceType: self.deviceType = self.deviceTypeString.get() self.guiLock.release() # load the API definition try: if temp_networkType == self.IP and self.deviceType == self.MANAGER: self.apiDef = IpMgrDefinition.IpMgrDefinition() elif temp_networkType == self.IP and self.deviceType == self.MOTE: self.apiDef = IpMoteDefinition.IpMoteDefinition() elif temp_networkType == self.WHART and self.deviceType == self.MANAGER: self.apiDef = HartMgrDefinition.HartMgrDefinition() elif temp_networkType == self.WHART and self.deviceType == self.MOTE: self.apiDef = HartMoteDefinition.HartMoteDefinition() else: raise SystemError("wrong combination "+\ " temp_networkType="+str(temp_networkType)+\ " self.deviceType="+str(self.deviceType)) except NotImplementedError as err: print str(err) return # freeze the form frame self.guiLock.acquire() self.networkTypeMenu.config(state=Tkinter.DISABLED) self.deviceTypeMenu.config(state=Tkinter.DISABLED) self.loadButton.config(state=Tkinter.DISABLED) self.guiLock.release() # call the callback self.cbApiLoaded(self.apiDef)
def __init__(self): # variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifClientHandler = None self.presenterMote = None # create window self.window = dustWindow.dustWindow( 'Voting', self._windowCb_close, ) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=0, column=0) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.show() # add a voting frame self.votingFrame = dustFrameVoting.dustFrameVoting( self.window, self.guiLock, nextQuestionCb=self._nextQuestionCb, presenterChangedCb=self._presenterChangedCb, scanCb=self._scanCb, frameName="voting", row=1, column=0, )
def __init__(self): # log log.debug("Creating PkGenGui") # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifClientHandler = None self.guiUpdaters = 0 self.oap_clients = {} # create window self.window = dustWindow.dustWindow('PkGen', self._windowCb_close) # add a API selection frame self.apiFrame = dustFrameApi.dustFrameApi( self.window, self.guiLock, self._apiFrameCb_apiLoaded, row=0, column=0, deviceType=dustFrameApi.dustFrameApi.MANAGER) self.apiFrame.show() # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=1, column=0) # add a mote list frame columnnames = [ # PkGen { 'name': COL_PKGEN_NUM, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_PKGEN_PPS, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_PKGEN_CLR, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, { 'name': COL_PKGEN_RATE, 'type': dustFrameMoteList.dustFrameMoteList.SETTHREEVAL, }, ] self.moteListFrame = dustFrameMoteList.dustFrameMoteList(self.window, self.guiLock, columnnames, row=2, column=0) self.moteListFrame.show() # add a status (text) frame self.statusFrame = dustFrameText.dustFrameText(self.window, self.guiLock, frameName="status", row=3, column=0) self.statusFrame.show()
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifClientHandler = None self.latencyCalculator = None self.guiUpdaters = 0 self.oap_clients = {} # create window self.window = dustWindow.dustWindow('Heliostat', self._windowCb_close) # add a API selection frame self.apiFrame = dustFrameApi.dustFrameApi( self.window, self.guiLock, self._apiFrameCb_apiLoaded, row=0, column=0, deviceType=dustFrameApi.dustFrameApi.MANAGER) self.apiFrame.show() # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=1, column=0) # add a mote list frame columnnames = [ # led { 'name': COL_LED, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, # counters and latency { 'name': COL_NOTIF_DATA, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_NOTIF_IPDATA, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_NOTIF_HR, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_LAT_MIN, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_LAT_CUR, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_LAT_MAX, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_NOTIF_CLR, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, # temperature { 'name': COL_TEMPERATURE, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_TEMP_NUM, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_TEMP_CLR, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, { 'name': COL_TEMP_RATE, 'type': dustFrameMoteList.dustFrameMoteList.GETSETONEVAL, }, # control and latency { 'name': COL_ACTION1, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, ] self.moteListFrame = dustFrameMoteList.dustFrameMoteList(self.window, self.guiLock, columnnames, row=2, column=0) self.moteListFrame.show() # add a status (text) frame self.statusFrame = dustFrameText.dustFrameText(self.window, self.guiLock, frameName="status", row=3, column=0) self.statusFrame.show()
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifClientHandler = None self.latencyCalculator = None self.guiUpdaters = 0 self.oap_clients = {} # create window self.window = dustWindow.dustWindow('TempMonitor', self._windowCb_close) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=0,column=0) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.show() # add a mote list frame columnnames = [ # led { 'name': COL_LED, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, { 'name': COL_LEDOFF, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, #DIGITAL INPUT { 'name': COL_GETD0, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, { 'name': COL_D0, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_GETD1, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, { 'name': COL_D1, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_GETD2, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, { 'name': COL_D2, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_GETD3, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, { 'name': COL_D3, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, ] self.moteListFrame = dustFrameMoteList.dustFrameMoteList(self.window, self.guiLock, columnnames, row=1,column=0) self.moteListFrame.show() # add a status (text) frame self.statusFrame = dustFrameText.dustFrameText( self.window, self.guiLock, frameName="status", row=2,column=0) self.statusFrame.show()
def __init__(self): # local variables self.guiLock = threading.Lock() self.apiDef = IpMgrDefinition.IpMgrDefinition() self.notifClientHandler = None self.guiUpdaters = 0 self.oap_clients = {} # create window self.window = dustWindow.dustWindow( 'MeshOfMeshes', self._windowCb_close ) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=1,column=0 ) self.connectionFrame.apiLoaded(self.apiDef) self.connectionFrame.show() # add a mote list frame columnnames = [ # role { 'name': COL_ROLE, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, # bridge { 'name': COL_BRIDGE, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, # temperature { 'name': COL_TEMPERATURE, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, # led { 'name': COL_LED, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, # counters { 'name': COL_NOTIF_DATA, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_NOTIF_HEALTHREPORT, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, ] self.moteListFrame = dustFrameMoteList.dustFrameMoteList( self.window, self.guiLock, columnnames, row=2,column=0 ) self.moteListFrame.show() # add a status (text) frame self.statusFrame = dustFrameText.dustFrameText( self.window, self.guiLock, frameName="status", row=3,column=0 ) self.statusFrame.show()
def __init__(self): # local variables self.guiLock = threading.Lock() self.notifClientHandler = None self.macs = [] self.oldData = {} # create window self.window = dustWindow.dustWindow( 'Xively Publisher', self._windowCb_close, ) # add a connection frame self.connectionFrame = dustFrameConnection.dustFrameConnection( self.window, self.guiLock, self._connectionFrameCb_connected, frameName="manager connection", row=0, column=0, ) self.connectionFrame.apiLoaded(IpMgrDefinition.IpMgrDefinition()) self.connectionFrame.show() # add a form frame self.apiKeyFrame = dustFrameForm.dustFrameForm(self.window, self.guiLock, self._apiKeyButtonCb, "Xively API key", row=1, column=0) self.apiKeyFrame.show() self.apiKeyFrame.setVal(DFLT_API_KEY) # add a mote list frame columnnames = [ { 'name': COL_NUMDATARX, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_NUMDATAPUB, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_NUMDATAPUBOK, 'type': dustFrameMoteList.dustFrameMoteList.LABEL, }, { 'name': COL_CLR, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, { 'name': COL_URL, 'type': dustFrameMoteList.dustFrameMoteList.ACTION, }, ] self.moteListFrame = dustFrameMoteList.dustFrameMoteList( self.window, self.guiLock, columnnames, row=2, column=0, ) self.moteListFrame.show() # add a tooltip frame self.toolTipFrame = dustFrameText.dustFrameText( self.window, self.guiLock, frameName="tooltip", row=5, column=0, ) self.toolTipFrame.show()