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

Public Member Functions

None __init__ (self, _CoolLEDConnection connection, str name, **kwargs)
 
typing.List[str] get_status (self)
 
None enable (self)
 
None disable (self)
 
bool get_is_on (self)
 
microscope.TriggerType trigger_type (self)
 
microscope.TriggerMode trigger_mode (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 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

None _do_shutdown (self)
 
float _do_get_power (self)
 
None _do_set_power (self, float power)
 
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
 _do_disable (self)
 
 _do_enable (self)
 

Protected Attributes

 _conn = _CoolLEDChannelConnection(connection, name)
 
bool _should_be_on = False
 
- 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

Individual light devices that compose a CoolLED controller.

Definition at line 133 of file coolled.py.

Constructor & Destructor Documentation

◆ __init__()

None microscope.controllers.coolled._CoolLEDChannel.__init__ ( self,
_CoolLEDConnection connection,
str name,
** kwargs )

Reimplemented from microscope.abc.LightSource.

Definition at line 136 of file coolled.py.

138 ) -> None:
139 super().__init__(**kwargs)
140 self._conn = _CoolLEDChannelConnection(connection, name)
141 # If a channel is disabled ("unselected"), setting the trigger
142 # type to software ("on") is not recorded and reverts back to
143 # high ("off"). Because of this, we keep track of what
144 # trigger type we want, i.e., should be "on" or "off", and
145 # apply it when the channel is enabled.
146 self._should_be_on = False
147
148 # The channel may be "selected" (enabled) and "off" (trigger
149 # type HIGH). When we set the trigger type to software,
150 # that's the same as setting it "on" which will make the
151 # channel emit light. Constructing this channel should not
152 # accidentally mae it emit light so disable it firt.
153 self.disable()
154
155 # Default to software trigger type.
156 self.set_trigger(
157 microscope.TriggerType.SOFTWARE, microscope.TriggerMode.BULB
158 )
159

Member Function Documentation

◆ _do_get_power()

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

Reimplemented from microscope.abc.LightSource.

Definition at line 183 of file coolled.py.

183 def _do_get_power(self) -> float:
184 return self._conn.get_intensity() / 100.0
185

◆ _do_set_power()

None microscope.controllers.coolled._CoolLEDChannel._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 186 of file coolled.py.

186 def _do_set_power(self, power: float) -> None:
187 self._conn.set_intensity(int(power * 100.0))
188

◆ _do_shutdown()

None microscope.controllers.coolled._CoolLEDChannel._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 160 of file coolled.py.

160 def _do_shutdown(self) -> None:
161 pass
162

◆ _do_trigger()

None microscope.controllers.coolled._CoolLEDChannel._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 228 of file coolled.py.

228 def _do_trigger(self) -> None:
230 "trigger does not make sense in trigger mode bulb, only enable"
231 )
232
233

◆ disable()

None microscope.controllers.coolled._CoolLEDChannel.disable ( self)
Disable the device for a short period for inactivity.

Reimplemented from microscope.abc.Device.

Definition at line 175 of file coolled.py.

175 def disable(self) -> None:
176 self._conn.set_selected_state("X")
177

◆ enable()

None microscope.controllers.coolled._CoolLEDChannel.enable ( self)
Enable the device.

Reimplemented from microscope.abc.Device.

Definition at line 166 of file coolled.py.

166 def enable(self) -> None:
167 self._conn.set_selected_state("S")
168 if self._should_be_on:
169 # TriggerType.SOFTWARE
170 self._conn.set_switch_state("N")
171 else:
172 # TriggerType.HIGH
173 self._conn.set_switch_state("F")
174

◆ get_is_on()

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

Reimplemented from microscope.abc.LightSource.

Definition at line 178 of file coolled.py.

178 def get_is_on(self) -> bool:
179 selected = self._conn.get_selected_state()
180 assert selected in ["S", "X"]
181 return selected == "S"
182

◆ get_status()

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

Reimplemented from microscope.abc.LightSource.

Definition at line 163 of file coolled.py.

163 def get_status(self) -> typing.List[str]:
164 return []
165

◆ set_trigger()

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

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 210 of file coolled.py.

212 ) -> None:
213 if tmode is not microscope.TriggerMode.BULB:
215 "the only trigger mode supported is 'bulb'"
216 )
217 if ttype is microscope.TriggerType.SOFTWARE:
218 self._conn.set_switch_state("N")
219 self._should_be_on = True
220 elif ttype is microscope.TriggerType.HIGH:
221 self._conn.set_switch_state("F")
222 self._should_be_on = False
223 else:
225 "trigger type supported must be 'SOFTWARE' or 'HIGH'"
226 )
227

◆ trigger_mode()

microscope.TriggerMode microscope.controllers.coolled._CoolLEDChannel.trigger_mode ( self)

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 207 of file coolled.py.

207 def trigger_mode(self) -> microscope.TriggerMode:
208 return microscope.TriggerMode.BULB
209

◆ trigger_type()

microscope.TriggerType microscope.controllers.coolled._CoolLEDChannel.trigger_type ( self)

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 190 of file coolled.py.

190 def trigger_type(self) -> microscope.TriggerType:
191 if self._conn.get_selected_state() == "S":
192 # Channel is "selected" (enabled): get the answer from
193 # switch state ("on" or "off").
194 if self._conn.get_switch_state() == "N":
195 return microscope.TriggerType.SOFTWARE
196 else:
197 return microscope.TriggerType.HIGH
198 else:
199 # Channel is "unselected" (disabled): trigger type will be
200 # whatever we set it to when we enable it.
201 if self._should_be_on:
202 return microscope.TriggerType.SOFTWARE
203 else:
204 return microscope.TriggerType.HIGH
205

Member Data Documentation

◆ _conn

microscope.controllers.coolled._CoolLEDChannel._conn = _CoolLEDChannelConnection(connection, name)
protected

Definition at line 140 of file coolled.py.

◆ _should_be_on

bool microscope.controllers.coolled._CoolLEDChannel._should_be_on = False
protected

Definition at line 146 of file coolled.py.


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