Beispiel #1
0
    def connectToSpec(self, specVersion):
        self.connection = SpecConnectionsManager().getConnection(specVersion)
        self.__specVersion = specVersion

        SpecEventsDispatcher.connect(self.connection, 'connected',
                                     self.__connected)
        SpecEventsDispatcher.connect(self.connection, 'disconnected',
                                     self.__disconnected)

        if self.connection.isSpecConnected():
            self.__connected()
Beispiel #2
0
    def _connectToServer(self, host, specname):

        server_conn = SpecConnectionsManager(
            False).getConnection("%s:%s" % (host, specname))
        #server_conn = SpecConnection("%s:%s" % (host,specname))

        if server_conn:
            # if we use an already existing spec connection the dispatcher will not send events.
            # but as the connection is already available. we do not need them
            if server_conn.dispatcher.connected:
                self.differ_connected = True
            else:
                Dispatcher.connect(server_conn, 'connected',
                                   self.server_connected)
                Dispatcher.connect(server_conn, 'disconnected',
                                   self.server_disconnected)

        return server_conn
Beispiel #3
0
    def connectToSpec(self, specVersion):
        self.connection = SpecConnectionsManager().getConnection(specVersion)
        self.__specVersion = specVersion

        SpecEventsDispatcher.connect(self.connection, 'connected',
                                     self.connected)
        SpecEventsDispatcher.connect(self.connection, 'disconnected',
                                     self.__disconnected)

        self.connection.registerChannel('status/ready', self.__statusReady,
                                    dispatchMode=SpecEventsDispatcher.FIREEVENT)
        self.connection.registerChannel('var/_SC_NEWSCAN', self.__newScan,
                                    dispatchMode=SpecEventsDispatcher.FIREEVENT)
        self.connection.registerChannel('var/_SC_NEWPLOTDATA',
                                    self.__newScanPoint,
                                    dispatchMode=SpecEventsDispatcher.FIREEVENT)
        self.connection.registerChannel('var/_SC_NEWSCANDATA',
                                    self.__newScanData,
                                    dispatchMode=SpecEventsDispatcher.FIREEVENT)

        if self.connection.isSpecConnected():
            self.connected()
Beispiel #4
0
 def update(self):
     SpecEventsDispatcher.dispatch()
Beispiel #5
0
 def update(self):
     SpecEventsDispatcher.dispatch()