BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
microscope.clients.DataClient Class Reference
Inheritance diagram for microscope.clients.DataClient:
microscope.clients.Client

Public Member Functions

def __init__ (self, url)
 
def enable (self)
 
def receiveData (self, data, timestamp, *args)
 
def trigger_and_wait (self)
 
def __init__ (self, url)
 

Detailed Description

A client that can receive and buffer data.

Definition at line 70 of file clients.py.

Constructor & Destructor Documentation

◆ __init__()

def microscope.clients.DataClient.__init__ (   self,
  url 
)

Reimplemented from microscope.clients.Client.

Definition at line 73 of file clients.py.

73 def __init__(self, url):
74 super().__init__(url)
75 self._buffer = queue.Queue()
76 # Register self with a listener.
77 if self._url.split("@")[1].split(":")[0] in ["127.0.0.1", "localhost"]:
78 iface = "127.0.0.1"
79 else:
80 # TODO: support multiple interfaces. Could use ifaddr.get_adapters() to
81 # query ip addresses then pick first interface on the same subnet.
82 iface = socket.gethostbyname(socket.gethostname())
83 if iface not in LISTENERS:
84 LISTENERS[iface] = Pyro4.Daemon(host=iface)
85 lthread = threading.Thread(target=LISTENERS[iface].requestLoop)
86 lthread.daemon = True
87 lthread.start()
88 self._client_uri = LISTENERS[iface].register(self)
89

Member Function Documentation

◆ enable()

def microscope.clients.DataClient.enable (   self)

◆ receiveData()

def microscope.clients.DataClient.receiveData (   self,
  data,
  timestamp,
args 
)

Definition at line 99 of file clients.py.

99 def receiveData(self, data, timestamp, *args):
100 del args
101 self._buffer.put((data, timestamp))
102

◆ trigger_and_wait()

def microscope.clients.DataClient.trigger_and_wait (   self)

Definition at line 103 of file clients.py.

103 def trigger_and_wait(self):
104 if not hasattr(self, "trigger"):
105 raise Exception("Device has no trigger method.")
106 self.trigger()
107 return self._buffer.get(block=True)

The documentation for this class was generated from the following file: