BioImager  5.0.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
Loading...
Searching...
No Matches
microscope.lights.toptica Namespace Reference

Classes

class  _iBeamConnection
 
class  TopticaiBeam
 

Functions

bytes _get_table_value (bytes table, bytes key)
 

Variables

 _logger = logging.getLogger(__name__)
 

Function Documentation

◆ _get_table_value()

bytes microscope.lights.toptica._get_table_value ( bytes table,
bytes key )
protected
Get the value for a key in a table/multiline output.

Some commands return something like a table of key/values.  There
may be even empty lines on this table.  This searches for the
first line with a specific key (hopefully there's only one line
with such key) and returns the associated value.

Definition at line 34 of file toptica.py.

34def _get_table_value(table: bytes, key: bytes) -> bytes:
35 """Get the value for a key in a table/multiline output.
36
37 Some commands return something like a table of key/values. There
38 may be even empty lines on this table. This searches for the
39 first line with a specific key (hopefully there's only one line
40 with such key) and returns the associated value.
41 """
42 # Key might be the first line, hence '(?:^|\r\n)'
43 match = re.search(b"(?:^|\r\n) *" + key + b": (.*)\r\n", table)
44 if match is None:
46 "failed to find key %s on table: %s" % (key, table)
47 )
48 return match.group(1)
49
50

Variable Documentation

◆ _logger

microscope.lights.toptica._logger = logging.getLogger(__name__)
protected

Definition at line 31 of file toptica.py.