BioImager  4.9.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.testsuite.devices.TestFloatingDevice Class Reference
Inheritance diagram for microscope.testsuite.devices.TestFloatingDevice:
microscope.abc.FloatingDeviceMixin microscope.abc.Device

Public Member Functions

None __init__ (self, str uid, **kwargs)
 
None initialize (self)
 
int get_index (self)
 
str get_id (self)
 
- Public Member Functions inherited from microscope.abc.FloatingDeviceMixin
- Public Member Functions inherited from microscope.abc.Device
None __del__ (self)
 
bool get_is_enabled (self)
 
None disable (self)
 
None enable (self)
 
None shutdown (self)
 
None add_setting (self, name, dtype, get_func, set_func, values, typing.Optional[typing.Callable[[], bool]] readonly=None)
 
 get_setting (self, str name)
 
 get_all_settings (self)
 
None set_setting (self, str name, value)
 
 describe_setting (self, str name)
 
 describe_settings (self)
 
 update_settings (self, incoming, bool init=False)
 

Protected Member Functions

None _do_shutdown (self)
 
- Protected Member Functions inherited from microscope.abc.Device
 _do_disable (self)
 
 _do_enable (self)
 

Protected Attributes

bool _initialized = False
 
 _uid = uid
 
- Protected Attributes inherited from microscope.abc.FloatingDeviceMixin
 _index = index
 
- Protected Attributes inherited from microscope.abc.Device
dict _settings = {}
 

Additional Inherited Members

- Public Attributes inherited from microscope.abc.Device
bool enabled = False
 

Detailed Description

Simple device with a UID after having been initialized.

Floating devices are devices where we can't specify which one to
get, we can only construct it and after initialisation check its
UID.  In this class for test units we can check which UID to get.

Definition at line 213 of file devices.py.

Constructor & Destructor Documentation

◆ __init__()

None microscope.testsuite.devices.TestFloatingDevice.__init__ ( self,
str uid,
** kwargs )

Reimplemented from microscope.abc.FloatingDeviceMixin.

Definition at line 224 of file devices.py.

224 def __init__(self, uid: str, **kwargs) -> None:
225 super().__init__(**kwargs)
226 self._initialized = False
227 self._uid = uid
228 self.initialize()
229

Member Function Documentation

◆ _do_shutdown()

None microscope.testsuite.devices.TestFloatingDevice._do_shutdown ( self)
protected
Private method - actual shutdown of the device.

Users should be calling :meth:`shutdown` and not this method.
Concrete implementations should implement this method instead
of `shutdown`.

Reimplemented from microscope.abc.Device.

Definition at line 246 of file devices.py.

246 def _do_shutdown(self) -> None:
247 pass

◆ get_id()

str microscope.testsuite.devices.TestFloatingDevice.get_id ( self)
Return a unique hardware identifier such as a serial number.

Reimplemented from microscope.abc.FloatingDeviceMixin.

Definition at line 238 of file devices.py.

238 def get_id(self) -> str:
239 if self._initialized:
240 return self._uid
241 else:
243 "uid is not available until after initialisation"
244 )
245

◆ get_index()

int microscope.testsuite.devices.TestFloatingDevice.get_index ( self)
Expose private _index for testing purposes.

Definition at line 234 of file devices.py.

234 def get_index(self) -> int:
235 """Expose private _index for testing purposes."""
236 return self._index
237

◆ initialize()

None microscope.testsuite.devices.TestFloatingDevice.initialize ( self)
Initialize the device.

If devices have this method (not required, and many don't),
then they should call it as part of the initialisation, i.e.,
they should call it on their `__init__` method.

Reimplemented from microscope.abc.Device.

Definition at line 230 of file devices.py.

230 def initialize(self) -> None:
231 super().initialize()
232 self._initialized = True
233

Member Data Documentation

◆ _initialized

bool microscope.testsuite.devices.TestFloatingDevice._initialized = False
protected

Definition at line 226 of file devices.py.

◆ _uid

microscope.testsuite.devices.TestFloatingDevice._uid = uid
protected

Definition at line 227 of file devices.py.


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