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.cameras.pvcam.PVEnumParam Class Reference
Inheritance diagram for microscope.cameras.pvcam.PVEnumParam:
microscope.cameras.pvcam.PVParam

Public Member Functions

 set_value (self, new_value)
 
 current (self)
 
 values (self)
 
- Public Member Functions inherited from microscope.cameras.pvcam.PVParam
 __init__ (self, camera, param_id)
 
 access (self)
 
 available (self)
 
 count (self)
 

Public Attributes

 name
 
 count = {}
 
- Public Attributes inherited from microscope.cameras.pvcam.PVParam
 cam = weakref.proxy(camera)
 
 param_id = param_id
 
str name = _param_to_name[param_id]
 
 dtype = _dtypemap[self._pvtype]
 
 available
 

Additional Inherited Members

- Static Public Member Functions inherited from microscope.cameras.pvcam.PVParam
 factory (camera, param_id)
 
- Protected Member Functions inherited from microscope.cameras.pvcam.PVParam
 _query (self, what=ATTR_CURRENT, force_query=False)
 
- Protected Attributes inherited from microscope.cameras.pvcam.PVParam
int _pvtype = param_id >> 24 & 255
 
 _ctype = _typemap[self._pvtype]
 

Detailed Description

PVParam subclass for enums

Definition at line 1338 of file pvcam.py.

Member Function Documentation

◆ current()

microscope.cameras.pvcam.PVEnumParam.current ( self)
Return the current (or cached) enum parameter value.

Reimplemented from microscope.cameras.pvcam.PVParam.

Definition at line 1365 of file pvcam.py.

1365 def current(self):
1366 """Return the current (or cached) enum parameter value."""
1367 # c_void_p(0) is None, so replace with 0
1368 return int(self._query() or 0)
1369

◆ set_value()

microscope.cameras.pvcam.PVEnumParam.set_value ( self,
new_value )
Set an enum parameter value.

Reimplemented from microscope.cameras.pvcam.PVParam.

Definition at line 1341 of file pvcam.py.

1341 def set_value(self, new_value):
1342 """Set an enum parameter value."""
1343 # We may be passed a value, a description string, or a tuple of
1344 # (value, string).
1345 values, descriptions = list(zip(*self.values.items()))
1346 if hasattr(new_value, "__iter__"):
1347 desc = str(new_value[1])
1348 elif isinstance(new_value, str):
1349 desc = str(new_value)
1350 else:
1351 desc = None
1352 # If we have a description, rely on that, as this avoids any confusion
1353 # of index and value.
1354 if desc and desc in descriptions:
1355 new_index = descriptions.index(desc)
1356 new_value = values[new_index]
1357 elif desc:
1358 raise Exception(
1359 "Could not find description '%s' for enum %s."
1360 % (desc, self.name)
1361 )
1362 super().set_value(new_value)
1363

◆ values()

microscope.cameras.pvcam.PVEnumParam.values ( self)
Get allowable enum values

Reimplemented from microscope.cameras.pvcam.PVParam.

Definition at line 1371 of file pvcam.py.

1371 def values(self):
1372 """Get allowable enum values"""
1373 values = {}
1374 for i in range(self.count):
1375 length = _enum_str_length(self.cam.handle, self.param_id, i)
1376 value, desc = _get_enum_param(
1377 self.cam.handle, self.param_id, i, length
1378 )
1379 values[value.value] = desc.value.decode()
1380 return values
1381
1382

Member Data Documentation

◆ count

microscope.cameras.pvcam.PVEnumParam.count = {}

Definition at line 1374 of file pvcam.py.

◆ name

microscope.cameras.pvcam.PVEnumParam.name

Definition at line 1360 of file pvcam.py.


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