BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
microscope.cameras.pvcam.PVEnumParam Class Reference
Inheritance diagram for microscope.cameras.pvcam.PVEnumParam:
microscope.cameras.pvcam.PVParam

Public Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from microscope.cameras.pvcam.PVParam
def factory (camera, param_id)
 
- Public Attributes inherited from microscope.cameras.pvcam.PVParam
 cam
 
 param_id
 
 name
 
 dtype
 

Detailed Description

PVParam subclass for enums

Definition at line 1338 of file pvcam.py.

Member Function Documentation

◆ current()

def 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

References microscope.cameras.pvcam.PVParam._query().

◆ set_value()

def 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

References microscope.abc._Setting.name, microscope.cameras._SDK3.dllFunction.name, microscope.cameras.atmcd.dllFunction.name, microscope.cameras.pvcam.dllFunction.name, microscope.cameras.pvcam.PVParam.name, BioImager.Automation.Action.name, BioImager.Automation.Recording.name, BioImager.Filt.name, BioImager.Function.name, BioImager.ImageJ.RoiDecoder.name, BioImager.LightSource.name, BioImager.Plot.name, BioImager.Scripting.Script.name, microscope.cameras.pvcam.PVEnumParam.set_value(), microscope.abc._Setting.values(), microscope.cameras.pvcam.PVParam.values(), microscope.cameras.pvcam.PVEnumParam.values(), and microscope.cameras.pvcam.PVStringParam.values().

Referenced by microscope.stages.linkam._LinkamMDSMixin.move_to(), microscope.stages.linkam.LinkamCMS.refill_chamber(), microscope.stages.linkam.LinkamCMS.refill_dewar(), microscope.stages.linkam.LinkamCMS.set_condensor(), microscope.stages.linkam.LinkamCMS.set_light(), and microscope.cameras.pvcam.PVEnumParam.set_value().

◆ values()

def 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

References microscope.cameras.pvcam.PVParam.cam, microscope.cameras.pvcam.PVParam.count(), microscope.device_server.Filter.count, BioImager.BioImage.ImageJDesc.count, BioImager.SlideImager.count, and microscope.cameras.pvcam.PVParam.param_id.

Referenced by microscope.cameras.pvcam.PVEnumParam.set_value().


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