예제 #1
0
 def __init__(self, group=None, target=None, name=None, args=(),
              kwargs=None, verbose=None, *vargs, **keywords):
     ImmortalThread.__init__(self, group, target, name, args, kwargs,
                             verbose, *vargs, **keywords)
     self.__one_time_init()
     self.__every_time_init()
     return
예제 #2
0
 def __init__(self, refresh_rate=900.0):
     ImmortalThread.__init__(self, name='RAFD')
     if debug: print 'init RAFD Server '
     self.semaphore = Semaphore(0)
     self._scheduler = scheduler
     self.refresh_rate = refresh_rate
     scheduler.seconds_from_now_do(30.0, self._tick)
예제 #3
0
파일: bvlc.py 프로젝트: mcruse/monotone
 def __init__(self, refresh_rate=900.0):
     ImmortalThread.__init__(self, name='RAFD')
     if debug: print 'init RAFD Server '
     self.semaphore = Semaphore(0)
     self._scheduler = scheduler
     self.refresh_rate = refresh_rate
     scheduler.seconds_from_now_do(30.0, self._tick)
예제 #4
0
 def __init__(self, node):
     node_url = as_node_url(node)
     ImmortalThread.__init__(self, name='_WhoIsThread(%r)' % node_url)
     self.node = node
     self.debug = node.debug
     self.discover_interval = node.discover_interval
     if self.debug:
         print '%s.__init__()' % self.getName()
예제 #5
0
파일: __init__.py 프로젝트: mcruse/monotone
 def __init__(self):
     ImmortalThread.__init__(self, name="Redusa Async Core")
     self._use_poll = 0
     try:
         select.poll()
         self._use_poll = 1
     except:
         msglog.log('broadway', msglog.types.INFO,
                    'Platform does not support poll().')
     return
예제 #6
0
 def __init__(self):
     ImmortalThread.__init__(self, name="Redusa Async Core")
     self._use_poll = 0
     try:
         select.poll()
         self._use_poll = 1
     except:
         msglog.log('broadway', msglog.types.INFO,
                    'Platform does not support poll().')
     return
예제 #7
0
 def __init__(self, timeout=2.0):
     self.timeout = timeout
     self.stations = {}
     self._monitor = monitor.ChannelMonitor(self.timeout)
     self.tm_number = self.tm_counter.increment()
     self._response_tp = ThreadPool(1, 'Jace Response Pool')
     self._pending_responses = Queue()
     self._callbacks = {}
     self._running = False
     self._sync_get_lock = Lock()
     self._last_sync_get = uptime.secs()
     self._cv = Condition()
     ImmortalThread.__init__(self, None, None, 'Jace Transaction Manager')
     return
예제 #8
0
 def __init__(self,
              group=None,
              target=None,
              name=None,
              args=(),
              kwargs=None,
              verbose=None,
              *vargs,
              **keywords):
     ImmortalThread.__init__(self, group, target, name, args, kwargs,
                             verbose, *vargs, **keywords)
     self.__one_time_init()
     self.__every_time_init()
     return
예제 #9
0
 def __init__(self, timeout=2.0):
     self.timeout = timeout
     self.stations = {}
     self._monitor = monitor.ChannelMonitor(self.timeout)
     self.tm_number = self.tm_counter.increment()
     self._response_tp = ThreadPool(1, 'Jace Response Pool')
     self._pending_responses = Queue()
     self._callbacks = {}
     self._running = False
     self._sync_get_lock = Lock()
     self._last_sync_get = uptime.secs()
     self._cv = Condition()
     ImmortalThread.__init__(self, None, None,
                             'Jace Transaction Manager')
     return
예제 #10
0
    def __init__(self, owner):
        self._buffer = None
        self.owner = owner  # owner is the slave ion
        self._port = owner.parent  # slave ion is child of com port
        ImmortalThread.__init__(self, name="%s(%r)" % (self.__class__, self._port.dev))
        # Determine if we are attached to an RS485 port on a Megatron
        # If so then we need to handle reception of our transmitted data
        self.megatron = properties.HARDWARE_CODENAME == "Megatron"
        self.megatron_485 = self.megatron and (self.owner.parent.name in ("com3", "com4", "com5", "com6"))
        print "Modbus Slave device thread started in",
        if self.megatron_485:
            print "RS485 echo mode"
        else:
            print "RS485 no-echo mode"

        return
예제 #11
0
    def __init__(self, owner):
        self._buffer = None
        self.owner = owner  #owner is the slave ion
        self._port = owner.parent  #slave ion is child of com port
        ImmortalThread.__init__(self,
                                name="%s(%r)" %
                                (self.__class__, self._port.dev))
        # Determine if we are attached to an RS485 port on a Megatron
        # If so then we need to handle reception of our transmitted data
        self.megatron = properties.HARDWARE_CODENAME == 'Megatron'
        self.megatron_485 = self.megatron and (self.owner.parent.name
                                               in ('com3', 'com4', 'com5',
                                                   'com6'))
        print 'Modbus Slave device thread started in',
        if self.megatron_485:
            print 'RS485 echo mode'
        else:
            print 'RS485 no-echo mode'

        return
예제 #12
0
파일: vcp.py 프로젝트: ed-aicradle/monotone
 def __init__(self, vcp):
     #super(TcpTunnel, self).__init__(self)
     ImmortalThread.__init__(self)
     self._needs_reconfig = 0
     # link to the port object
     self._vcp = vcp
     self._lock = Lock()
     self._op_lock = Lock()
     # list of operations to apply to an {out|in}bound tcp 
     # segment. In the future this might include operations 
     # such as encryption or compression - for now, only the
     # header info. that is applied by devices such as 
     # Lantronix's UDS-10 is supported.  Up refers to what is
     # being applied to outbound tcp data, down to received.
     # Methods should be added to these lists in the order they
     # are to be applied.
     self._up_segment_ops = []
     self._down_segment_ops = []
     # transaction identifier - used only in vcp mode.
     self.__tid = 0
     self._pending_tid = 0
     # one and only poll object.  socket, serial fd and
     # command pipe are all polled.
     self._poll_obj = None
     # command pipe allows other threads to insert control
     # messages.
     self._cmd_pipe = None
     # both sides (serial & socket) of the tunnel
     self._sock_listen_fd = None
     self._sock_fd = None
     self._serial_port = None
     # tcp state management
     self._is_connected = 0
     self.is_active = 0
     # tunnel statistics
     self.tcp_bytes_rcvd = 0
     self.tcp_bytes_sent = 0
     self.serial_bytes_rcvd = 0
     self.serial_bytes_sent = 0
     self.connection_attempts = 0
예제 #13
0
 def __init__(self, connection):
     ImmortalThread.__init__(self, name='MODBUS')
     self.connection = connection
     if debug: print 'init MODBUS Server '
     self.debug = debug
     self.ready = 0
예제 #14
0
파일: bvlc.py 프로젝트: mcruse/monotone
 def __init__(self, queue):
     ImmortalThread.__init__(self, name='BBMD')
     self.queue = queue
     if debug: print 'init BBMD Server '
예제 #15
0
 def __init__(self, queue):
     ImmortalThread.__init__(self, name='BBMD')
     self.queue = queue
     if debug: print 'init BBMD Server '
예제 #16
0
 def __init__(self, connection):
     ImmortalThread.__init__(self, name='MODBUS')
     self.connection = connection
     if debug: print 'init MODBUS Server '
     self.debug = debug
     self.ready = 0