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.controllers.toptica._iChromeLaser Class Reference
Inheritance diagram for microscope.controllers.toptica._iChromeLaser:
microscope.abc.LightSource microscope.abc.TriggerTargetMixin microscope.abc.Device

Public Member Functions

None __init__ (self, _iChromeConnection conn, int laser_number)
 
typing.List[str] get_status (self)
 
bool get_is_on (self)
 
microscope.TriggerMode trigger_mode (self)
 
microscope.TriggerType trigger_type (self)
 
None set_trigger (self, microscope.TriggerType ttype, microscope.TriggerMode tmode)
 
- Public Member Functions inherited from microscope.abc.LightSource
float power (self)
 
None power (self, float power)
 
float get_set_power (self)
 
- Public Member Functions inherited from microscope.abc.TriggerTargetMixin
None trigger (self)
 
- Public Member Functions inherited from microscope.abc.Device
None __del__ (self)
 
bool get_is_enabled (self)
 
None disable (self)
 
None enable (self)
 
None initialize (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

float _do_get_power (self)
 
None _do_set_power (self, float power)
 
None _do_enable (self)
 
None _do_disable (self)
 
None _do_shutdown (self)
 
None _do_trigger (self)
 
- Protected Member Functions inherited from microscope.abc.LightSource
- Protected Member Functions inherited from microscope.abc.TriggerTargetMixin
- Protected Member Functions inherited from microscope.abc.Device

Protected Attributes

 _conn = _iChromeLaserConnection(conn, laser_number)
 
- Protected Attributes inherited from microscope.abc.LightSource
float _set_point = 0.0
 
- Protected Attributes inherited from microscope.abc.Device
dict _settings = {}
 

Additional Inherited Members

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

Detailed Description

Definition at line 170 of file toptica.py.

Constructor & Destructor Documentation

◆ __init__()

None microscope.controllers.toptica._iChromeLaser.__init__ ( self,
_iChromeConnection conn,
int laser_number )

Reimplemented from microscope.abc.LightSource.

Definition at line 171 of file toptica.py.

171 def __init__(self, conn: _iChromeConnection, laser_number: int) -> None:
172 super().__init__()
173 self._conn = _iChromeLaserConnection(conn, laser_number)
174
175 # FIXME: set values to '0' because we need to pass an int as
176 # values for settings of type str. Probably a bug on
177 # Device.set_setting.
178 self.add_setting("label", "str", self._conn.get_label, None, values=0)
179 self.add_setting("type", "str", self._conn.get_type, None, values=0)
180
181 self.add_setting(
182 "delay", "int", self._conn.get_delay, None, values=tuple()
183 )
184

Member Function Documentation

◆ _do_disable()

None microscope.controllers.toptica._iChromeLaser._do_disable ( self)
protected
Do any device-specific work on disable.

Subclasses should override this method rather than modify
`disable`.

Reimplemented from microscope.abc.Device.

Definition at line 209 of file toptica.py.

209 def _do_disable(self) -> None:
210 self._conn.set_enable(False)
211

◆ _do_enable()

None microscope.controllers.toptica._iChromeLaser._do_enable ( self)
protected
Do any device specific work on enable.

Subclasses should override this method, rather than modify
`enable`.

Reimplemented from microscope.abc.Device.

Definition at line 206 of file toptica.py.

206 def _do_enable(self) -> None:
207 self._conn.set_enable(True)
208

◆ _do_get_power()

float microscope.controllers.toptica._iChromeLaser._do_get_power ( self)
protected
Internal function that actually returns the light source power.

Reimplemented from microscope.abc.LightSource.

Definition at line 200 of file toptica.py.

200 def _do_get_power(self) -> float:
201 return self._conn.get_level() / 100.0
202

◆ _do_set_power()

None microscope.controllers.toptica._iChromeLaser._do_set_power ( self,
float power )
protected
Internal function that actually sets the light source power.

This function will be called by the `power` attribute setter
after clipping the argument to the [0, 1] interval.

Reimplemented from microscope.abc.LightSource.

Definition at line 203 of file toptica.py.

203 def _do_set_power(self, power: float) -> None:
204 self._conn.set_level(power * 100.0)
205

◆ _do_shutdown()

None microscope.controllers.toptica._iChromeLaser._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 212 of file toptica.py.

212 def _do_shutdown(self) -> None:
213 pass # Nothing to do
214

◆ _do_trigger()

None microscope.controllers.toptica._iChromeLaser._do_trigger ( self)
protected
Actual trigger of the device.

Classes implementing this interface should implement this
method instead of `trigger`.

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 247 of file toptica.py.

247 def _do_trigger(self) -> None:
249 "trigger does not make sense in trigger mode bulb, only enable"
250 )
251
252

◆ get_is_on()

bool microscope.controllers.toptica._iChromeLaser.get_is_on ( self)
Return True if the light source is currently able to produce light.

Reimplemented from microscope.abc.LightSource.

Definition at line 188 of file toptica.py.

188 def get_is_on(self) -> bool:
189 if self._conn.get_enable():
190 if self._conn.get_cw():
191 return True
192 else:
193 # There doesn't seem to be command to check whether
194 # the TTL line is currently high, so just return True
195 # if set that way.
196 return self._conn.get_use_ttl()
197 else:
198 return False
199

◆ get_status()

typing.List[str] microscope.controllers.toptica._iChromeLaser.get_status ( self)
Query and return the light source status.

Reimplemented from microscope.abc.LightSource.

Definition at line 185 of file toptica.py.

185 def get_status(self) -> typing.List[str]:
186 return self._conn.get_status_txt().split()
187

◆ set_trigger()

None microscope.controllers.toptica._iChromeLaser.set_trigger ( self,
microscope.TriggerType ttype,
microscope.TriggerMode tmode )
Set device for a specific trigger.

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 226 of file toptica.py.

228 ) -> None:
229 if tmode is not microscope.TriggerMode.BULB:
231 "only TriggerMode.BULB mode is supported"
232 )
233
234 # From the manual it seems that cw and ttl parameters are
235 # mutually exclusive but also still need to be set separately.
236 if ttype is microscope.TriggerType.HIGH:
237 self._conn.set_cw(False)
238 self._conn.set_use_ttl(True)
239 elif ttype is microscope.TriggerType.SOFTWARE:
240 self._conn.set_use_ttl(False)
241 self._conn.set_cw(True)
242 else:
244 "only trigger type HIGH and SOFTWARE are supported"
245 )
246

◆ trigger_mode()

microscope.TriggerMode microscope.controllers.toptica._iChromeLaser.trigger_mode ( self)

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 216 of file toptica.py.

216 def trigger_mode(self) -> microscope.TriggerMode:
217 return microscope.TriggerMode.BULB
218

◆ trigger_type()

microscope.TriggerType microscope.controllers.toptica._iChromeLaser.trigger_type ( self)

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 220 of file toptica.py.

220 def trigger_type(self) -> microscope.TriggerType:
221 if self._conn.get_use_ttl():
222 return microscope.TriggerType.HIGH
223 else:
224 return microscope.TriggerType.SOFTWARE
225

Member Data Documentation

◆ _conn

microscope.controllers.toptica._iChromeLaser._conn = _iChromeLaserConnection(conn, laser_number)
protected

Definition at line 173 of file toptica.py.


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