![]() |
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.
|
Public Member Functions | |
| None | __init__ (self, str name, str dtype, typing.Optional[typing.Callable[[], typing.Any]] get_func, typing.Optional[typing.Callable[[typing.Any], None]] set_func=None, typing.Any values=None, typing.Optional[typing.Callable[[], bool]] readonly=None) |
| describe (self) | |
| get (self) | |
| bool | readonly (self) |
| None | set (self, value) |
| values (self) | |
Public Attributes | |
| name = name | |
| str | dtype = dtype |
Protected Attributes | |
| _get = get_func | |
| _values = values | |
| _last_written = None | |
| _set = set_func | |
| bool | _readonly = lambda: True |
Create a setting.
Args:
name: the setting's name.
dtype: a data type from `"int"`, `"float"`, `"bool"`,
`"enum"`, or `"str"` (see `DTYPES`).
get_func: a function to get the current value.
set_func: a function to set the value.
values: a description of allowed values dependent on dtype, or
function that returns a description.
readonly: an optional function to indicate if the setting is
readonly. A setting may be readonly temporarily, so this
function will return `True` or `False` to indicate its
current state. If set to no `None` (default), then its
value will be dependent on the value of `set_func`.
A client needs some way of knowing a setting name and data type,
retrieving the current value and, if settable, a way to retrieve
allowable values, and set the value.
Setters and getters accept or return:
* the setting value for int, float, bool and str;
* the setting index into a list, dict or Enum type for enum.
.. todo::
refactor into subclasses to avoid if isinstance .. elif
.. else. Settings classes should be private: devices should
use a factory method rather than instantiate settings
directly; most already use add_setting for this.
| None microscope.abc._Setting.__init__ | ( | self, | |
| str | name, | ||
| str | dtype, | ||
| typing.Optional[typing.Callable[[], typing.Any]] | get_func, | ||
| typing.Optional[typing.Callable[[typing.Any], None]] | set_func = None, | ||
| typing.Any | values = None, | ||
| typing.Optional[typing.Callable[[], bool]] | readonly = None ) |
Definition at line 99 of file abc.py.
| microscope.abc._Setting.describe | ( | self | ) |
| microscope.abc._Setting.get | ( | self | ) |
| bool microscope.abc._Setting.readonly | ( | self | ) |
| None microscope.abc._Setting.set | ( | self, | |
| value ) |
Set a setting.
Definition at line 164 of file abc.py.
| microscope.abc._Setting.values | ( | self | ) |
Definition at line 173 of file abc.py.
|
protected |