Beispiel #1
0
 def rct(self):
     if self._rct is not None:
         return self._rct
     else:
         self.io_manager = ioloop_manager.IOLoopManager()
         self.io_wrapper = resource_client.IOLoopThreadWrapper(
             self.io_manager.get_ioloop())
         LOGGER.info('Cleanup function \'self.io_manager\': File: %s line: %s' % (
             getframeinfo(currentframe()).filename.split('/')[-1],
             getframeinfo(currentframe()).lineno))
         add_cleanup(self.io_manager.stop)
         self.io_wrapper.default_timeout = _timeout
         self.io_manager.start()
         self.rc = resource_client.KATCPClientResource(
             dict(name='{}'.format(self.katcp_clt),
                  address=('{}'.format(self.katcp_clt),
                           '7147'),
                  controlled=True))
         self.rc.set_ioloop(self.io_manager.get_ioloop())
         self._rct = (resource_client.ThreadSafeKATCPClientResourceWrapper(self.rc,
                                                                           self.io_wrapper))
         self._rct.start()
         LOGGER.info('Cleanup function \'self._rct\': File: %s line: %s' % (
             getframeinfo(currentframe()).filename.split('/')[-1],
             getframeinfo(currentframe()).lineno))
         add_cleanup(self._rct.stop)
         try:
             self._rct.until_synced(timeout=_timeout)
         except TimeoutError:
             self._rct.stop()
     return self._rct
def run_ipy():
    try:
        iotw = resource_client.IOLoopThreadWrapper(ioloop)
        time.sleep(0.24)
        s = rc.sensor.an_int
        ws = resource_client.ThreadsafeKATCPSensorWrapper(s, iotw)
        IPython.embed()
        # stop.wait(10000)
    finally:
        ioloop.stop()
Beispiel #3
0
 def rct(self):
     if self._rct is not None:
         return self._rct
     else:
         self.io_manager = ioloop_manager.IOLoopManager()
         self.io_wrapper = resource_client.IOLoopThreadWrapper(
             self.io_manager.get_ioloop())
         self.io_wrapper.default_timeout = self.timeout
         self.io_manager.start()
         self.rc = resource_client.KATCPClientResource(
             dict(name='{}'.format(self.katcp_client),
                  address=('{}'.format(self.katcp_client),
                           self.prim_port),
                  controlled=True))
         self.rc.set_ioloop(self.io_manager.get_ioloop())
         self._rct = (resource_client.ThreadSafeKATCPClientResourceWrapper(self.rc,
                                                                           self.io_wrapper))
         self._rct.start()
         try:
             self._rct.until_synced(timeout=self.timeout)
         except TimeoutError:
             self._rct.stop()
     return self._rct