diff --git a/deapi/client.py b/deapi/client.py
index 7e74a4e..44f9357 100644
--- a/deapi/client.py
+++ b/deapi/client.py
@@ -80,7 +80,7 @@ def set_log_level(self, level):
return
def __str__(self):
- return f"Client(host={self.host}, port={self.port}, camera={self.get_current_camera()})"
+ return f"Client(host={self.host}, port={self.port}, camera={self.camera})"
def _ipython_key_completions_(self):
return self.list_properties()
@@ -91,12 +91,12 @@ def _repr_html_(self):
| Host |
Port |
- Current Camera |
+ Camera |
| {self.host} |
{self.port} |
- {self.currCamera} |
+ {self.camera} |
@@ -176,12 +176,13 @@ def connect(self, host: str = "127.0.0.1", port: int = 13240, read_only=False):
self.socket.setblocking(False)
self.socket.settimeout(2)
- self.cameras = self.__getStrings(self.LIST_CAMERAS)
- if logLevel == logging.DEBUG:
- log.debug("Available cameras: %s", self.cameras)
- self.currCamera = self.cameras[0]
+ command = self._addSingleCommand(self.LIST_CAMERAS, None)
+ response = self._sendCommand(command)
+ if response != False:
+ self.camera = self.__getParameters(response.acknowledge[0])[0]
+
if logLevel == logging.DEBUG:
- log.debug("Current camera: %s", self.currCamera)
+ log.debug("Camera: %s", self.camera)
self.connected = True
self.host = host
@@ -259,9 +260,12 @@ def disconnect(self):
def list_cameras(self) -> List[str]:
"""
+ Deprecated function.
List the available cameras on the server.
"""
- return self.cameras
+ log.warning("list_cameras is deprecated.")
+
+ return [self.camera]
def get_virtual_mask(self, index):
mask_name = f"virtual_mask{index}"
@@ -275,35 +279,29 @@ def get_virtual_mask(self, index):
_,
) = self.get_result(mask_name, DataType.DE8u, attributes=a)
return res
-
+
def get_current_camera(self) -> str:
"""
Get the current camera on the server.
"""
- if self.currCamera is None:
+ if self.camera == "":
return "No current camera"
else:
- return self.currCamera
-
+ return self.camera
+
@write_only
def set_current_camera(self, camera_name: str = None):
"""
+ Deprecated function.
Set the current camera on the server.
"""
- if camera_name is None:
- return False
-
- self.currCamera = camera_name
-
- if logLevel == logging.DEBUG:
- log.debug("current camera: %s", camera_name)
+ log.warning("set_current_camera is deprecated.")
- self.refreshProperties = True
return True
def list_properties(self, options=None, search=None):
"""
- Get a list of property names from the current camera on DE-Server
+ Get a list of property names from the camera on DE-Server
Parameters
----------
@@ -322,7 +320,7 @@ def list_properties(self, options=None, search=None):
def list_registers(self, options=None, search=None):
"""
- Get a list of register names from the current camera on DE-Server
+ Get a list of register names from the camera on DE-Server
for each register, it contains attributes: name of the register, address, Read only, value of the register
Parameters
@@ -345,7 +343,7 @@ def list_registers(self, options=None, search=None):
)
def get_property_spec(self, property_name: str):
"""
- Get a list of allowed values for a property of the current camera on DE-Server
+ Get a list of allowed values for a property of the camera on DE-Server
Deprecated since DE-MC 2.7.4
Parameters
@@ -410,7 +408,7 @@ def get_property_spec(self, property_name: str):
)
def get_property_specifications(self, property_name):
"""
- Get a list of allowed values for a property of the current camera on DE-Server
+ Get a list of allowed values for a property of the camera on DE-Server
Only works for DE-MC version greater or equal to 2.7.4
Parameters
@@ -420,10 +418,10 @@ def get_property_specifications(self, property_name):
"""
t0 = self.GetTime()
values = False
- command = self.__addSingleCommand(
+ command = self._addSingleCommand(
self.GET_PROPERTY_SPECIFICATIONS, property_name
)
- response = self.__sendCommand(command)
+ response = self._sendCommand(command)
if response == False:
return None
@@ -477,7 +475,7 @@ def get_property_specifications(self, property_name):
)
def get_property(self, property_name: str):
"""
- Get the value of a property of the current camera on DE-Server
+ Get the value of a property of the camera on DE-Server
Parameters
----------
@@ -510,7 +508,7 @@ def get_property(self, property_name: str):
def get_register(self, register_name: str):
"""
- Get the value of a register of the current camera on DE-Server
+ Get the value of a register of the camera on DE-Server
Parameters
----------
@@ -565,7 +563,7 @@ def acquiring(self):
@write_only
def set_property(self, name: str, value):
"""
- Set the value of a property of the current camera on DE-Server
+ Set the value of a property of the camera on DE-Server
Parameters
----------
@@ -601,7 +599,7 @@ def set_property(self, name: str, value):
)
def set_property_and_get_changed_properties(self, name, value, changed_properties):
"""
- Set the value of a property of the current camera on DE-Server and get all
+ Set the value of a property of the camera on DE-Server and get all
the changed properties. This is useful for testing and determining how certain
properties affect others.
@@ -643,7 +641,7 @@ def set_property_and_get_changed_properties(self, name, value, changed_propertie
@write_only
def set_register(self, name: str, value):
"""
- Set the value of a register of the current camera on DE-Server
+ Set the value of a register of the camera on DE-Server
Parameters
----------
@@ -677,7 +675,7 @@ def set_register(self, name: str, value):
@write_only
def set_engineering_mode(self, enable, password):
"""
- Set the engineering mode of the current camera on DE-Server. Mostly for internal testing.
+ Set the engineering mode of the camera on DE-Server. Mostly for internal testing.
Parameters
----------
@@ -700,10 +698,10 @@ def setEngModeAndGetChangedProperties(self, enable, password, changedProperties)
ret = False
- command = self.__addSingleCommand(
+ command = self._addSingleCommand(
self.SET_ENG_MODE_GET_CHANGED_PROPERTIES, None, [enable, password]
)
- response = self.__sendCommand(command)
+ response = self._sendCommand(command)
if response != False:
ret = response.acknowledge[0].error != True
self.refreshProperties = True
@@ -720,7 +718,7 @@ def setEngModeAndGetChangedProperties(self, enable, password, changedProperties)
@deprecated_argument(name="sizeY", since="5.2.0", alternative="size_y")
def set_hw_roi(self, offset_x: int, offset_y: int, size_x: int, size_y: int):
"""
- Set the hardware region of interest (ROI) of the current camera on DE-Server.
+ Set the hardware region of interest (ROI) of the camera on DE-Server.
Parameters
----------
@@ -762,14 +760,14 @@ def set_hw_roi(self, offset_x: int, offset_y: int, size_x: int, size_y: int):
@deprecated_argument(name="sizeY", since="5.2.0", alternative="size_y")
def SetScanSize(self, size_x, size_y):
"""
- Set the scan size of the current camera on DE-Server.
+ Set the scan size of the camera on DE-Server.
"""
t0 = self.GetTime()
ret = False
- command = self.__addSingleCommand(self.SET_SCAN_SIZE, None, [size_x, size_y])
- response = self.__sendCommand(command)
+ command = self._addSingleCommand(self.SET_SCAN_SIZE, None, [size_x, size_y])
+ response = self._sendCommand(command)
if response != False:
ret = response.acknowledge[0].error != True
self.refreshProperties = True
@@ -794,10 +792,10 @@ def SetScanSizeAndGetChangedProperties(self, size_x, size_y, changed_properties)
t0 = self.GetTime()
ret = False
- command = self.__addSingleCommand(
+ command = self._addSingleCommand(
self.SET_SCAN_SIZE_AND_GET_CHANGED_PROPERTIES, None, [size_x, size_y]
)
- response = self.__sendCommand(command)
+ response = self._sendCommand(command)
if response != False:
ret = response.acknowledge[0].error != True
self.refreshProperties = True
@@ -820,10 +818,10 @@ def SetScanROI(self, enable, offsetX, offsetY, sizeX, sizeY):
t0 = self.GetTime()
ret = False
- command = self.__addSingleCommand(
+ command = self._addSingleCommand(
self.SET_SCAN_ROI, None, [enable, offsetX, offsetY, sizeX, sizeY]
)
- response = self.__sendCommand(command)
+ response = self._sendCommand(command)
if response != False:
ret = response.acknowledge[0].error != True
self.refreshProperties = True
@@ -848,12 +846,12 @@ def SetScanROIAndGetChangedProperties(
t0 = self.GetTime()
ret = False
- command = self.__addSingleCommand(
+ command = self._addSingleCommand(
self.SET_SCAN_ROI__AND_GET_CHANGED_PROPERTIES,
None,
[enable, offsetX, offsetY, sizeX, sizeY],
)
- response = self.__sendCommand(command)
+ response = self._sendCommand(command)
if response != False:
ret = response.acknowledge[0].error != True
self.refreshProperties = True
@@ -878,7 +876,7 @@ def set_hw_roi_and_get_changed_properties(
self, offsetX: int, offsetY: int, sizeX: int, sizeY: int, changedProperties
):
"""
- Set the hardware region of interest (ROI) of the current camera on DE-Server and get all
+ Set the hardware region of interest (ROI) of the camera on DE-Server and get all
the changed properties. This is useful for testing and determining how certain
properties affect others.
@@ -927,7 +925,7 @@ def set_hw_roi_and_get_changed_properties(
@write_only
def set_sw_roi(self, offsetX: int, offsetY: int, sizeX: int, sizeY: int):
"""
- Set the software region of interest (ROI) of the current camera on DE-Server.
+ Set the software region of interest (ROI) of the camera on DE-Server.
Parameters
----------
@@ -970,7 +968,7 @@ def set_sw_roi(self, offsetX: int, offsetY: int, sizeX: int, sizeY: int):
@deprecated_argument(name="useHW", since="5.2.0", alternative="use_hw")
def set_binning(self, bin_x, bin_y, use_hw=True):
"""
- Set the binning of the current camera on DE-Server. If useHW is True, the binning will
+ Set the binning of the camera on DE-Server. If useHW is True, the binning will
use hardware binning. If useHW is False, the binning will use software binning only.
Note
@@ -1034,7 +1032,7 @@ def set_sw_roi_and_get_changed_properties(
self, offsetX, offsetY, sizeX, sizeY, changedProperties
):
"""
- Set the software region of interest (ROI) of the current camera on DE-Server and get all of
+ Set the software region of interest (ROI) of the camera on DE-Server and get all of
the changed properties. This is useful for testing and determining how certain
properties affect others.
@@ -1085,7 +1083,7 @@ def set_adaptive_roi(
self, size_x: int, size_y: int, offset_x: int = None, offset_y: int = None
):
"""
- Automatically choose the proper HW ROI and set SW ROI of the current camera on DE-Server.
+ Automatically choose the proper HW ROI and set SW ROI of the camera on DE-Server.
If offset_x and offset_y are not provided, they will be centered on the camera.
@@ -1133,7 +1131,7 @@ def set_adaptive_roi_and_get_changed_properties(
self, offsetX, offsetY, sizeX, sizeY, changedProperties, timeoutMsec=5000
):
"""
- Automatically choose the proper HW ROI and set SW ROI of the current camera on DE-Server and get all of
+ Automatically choose the proper HW ROI and set SW ROI of the camera on DE-Server and get all of
the changed properties. This is useful for testing and determining how certain
properties affect others.
@@ -1154,12 +1152,12 @@ def set_adaptive_roi_and_get_changed_properties(
t0 = self.GetTime()
ret = False
- command = self.__addSingleCommand(
+ command = self._addSingleCommand(
self.SET_ADAPTIVE_ROI_AND_GET_CHANGED_PROPERTIES,
None,
[offsetX, offsetY, sizeX, sizeY],
)
- response = self.__sendCommand(command)
+ response = self._sendCommand(command)
if response != False:
ret = response.acknowledge[0].error != True
self.refreshProperties = True
@@ -1742,7 +1740,7 @@ def get_result(
@write_only
def set_virtual_mask(self, id, w, h, mask):
"""
- Set the virtual mask of the current camera on DE-Server.
+ Set the virtual mask of the camera on DE-Server.
Parameters
----------
@@ -1783,7 +1781,7 @@ def set_virtual_mask(self, id, w, h, mask):
@write_only
def setROI(self, offsetX, offsetY, sizeX, sizeY, useHWROI=False):
"""
- Set the region of interest (ROI) of the current camera on DE-Server.
+ Set the region of interest (ROI) of the camera on DE-Server.
Parameters
----------
@@ -1838,7 +1836,7 @@ def setROI(self, offsetX, offsetY, sizeX, sizeY, useHWROI=False):
def get_movie_buffer_info(self, movieBufferInfo=None, timeoutMsec=5000):
"""
- Get the movie buffer information of the current camera on DE-Server.
+ Get the movie buffer information of the camera on DE-Server.
Parameters
----------
@@ -1873,7 +1871,7 @@ def get_movie_buffer(
self, movieBuffer, movieBufferSize, numFrames, timeoutMsec=5000
):
"""
- Get the movie buffer of the current camera on DE-Server. The movie buffer
+ Get the movie buffer of the camera on DE-Server. The movie buffer
is a series of frames that are stored in memory and can be retrieved as
a single buffer for faster processing.
@@ -2564,10 +2562,10 @@ def _sendCommand(self, command: pb.DEPacket = None):
if command is None:
return False
-
+
if len(command.camera_name) == 0:
command.camera_name = (
- self.currCamera
+ self.camera
) # append the current camera name if necessary
try:
@@ -2806,8 +2804,7 @@ def ParseChangedProperties(self, changedProperties, response):
usingMmf = True
debugImagesFolder = "D:\\DebugImages\\"
connected = False
- cameras = None
- currCamera = ""
+ camera = ""
refreshProperties = True
exposureTime = 1
host = 0
diff --git a/deapi/tests/original_tests/01_fps.py b/deapi/tests/original_tests/01_fps.py
index 5592903..d08337e 100644
--- a/deapi/tests/original_tests/01_fps.py
+++ b/deapi/tests/original_tests/01_fps.py
@@ -9,9 +9,6 @@
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version is: {serverVersion}")
diff --git a/deapi/tests/original_tests/02_hwRoisize.py b/deapi/tests/original_tests/02_hwRoisize.py
index 20fa984..333c0ca 100644
--- a/deapi/tests/original_tests/02_hwRoisize.py
+++ b/deapi/tests/original_tests/02_hwRoisize.py
@@ -7,9 +7,6 @@
# Connect to the server
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version is: {serverVersion}")
diff --git a/deapi/tests/original_tests/03_hwBinning.py b/deapi/tests/original_tests/03_hwBinning.py
index b773d0f..5cf241f 100644
--- a/deapi/tests/original_tests/03_hwBinning.py
+++ b/deapi/tests/original_tests/03_hwBinning.py
@@ -8,9 +8,6 @@
# Connect to the server
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version is: {serverVersion}")
diff --git a/deapi/tests/original_tests/04_swBinning.py b/deapi/tests/original_tests/04_swBinning.py
index 7e45bd0..02dcc32 100644
--- a/deapi/tests/original_tests/04_swBinning.py
+++ b/deapi/tests/original_tests/04_swBinning.py
@@ -9,9 +9,6 @@
# Connect to the server
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version is: {serverVersion}")
diff --git a/deapi/tests/original_tests/05_swhwBinning.py b/deapi/tests/original_tests/05_swhwBinning.py
index 9497be1..199298e 100644
--- a/deapi/tests/original_tests/05_swhwBinning.py
+++ b/deapi/tests/original_tests/05_swhwBinning.py
@@ -9,9 +9,6 @@
# Connect to the server
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version is: {serverVersion}")
diff --git a/deapi/tests/original_tests/06_patternPixel.py b/deapi/tests/original_tests/06_patternPixel.py
index 33dd62f..d87c76a 100644
--- a/deapi/tests/original_tests/06_patternPixel.py
+++ b/deapi/tests/original_tests/06_patternPixel.py
@@ -11,9 +11,6 @@
deClient = DEAPI.Client()
# Connect to the Server
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version is: {serverVersion}")
diff --git a/deapi/tests/original_tests/07_reference.py b/deapi/tests/original_tests/07_reference.py
index 8df5866..b5cfc35 100644
--- a/deapi/tests/original_tests/07_reference.py
+++ b/deapi/tests/original_tests/07_reference.py
@@ -9,9 +9,6 @@
# Connect to the server
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version is: {serverVersion}")
diff --git a/deapi/tests/original_tests/08_virtmask.py b/deapi/tests/original_tests/08_virtmask.py
index 213fda3..2fa9320 100644
--- a/deapi/tests/original_tests/08_virtmask.py
+++ b/deapi/tests/original_tests/08_virtmask.py
@@ -10,9 +10,6 @@
# Connect to the server
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version is: {serverVersion}")
diff --git a/deapi/tests/original_tests/09_scanRoi.py b/deapi/tests/original_tests/09_scanRoi.py
index d06bfa6..bcd4024 100644
--- a/deapi/tests/original_tests/09_scanRoi.py
+++ b/deapi/tests/original_tests/09_scanRoi.py
@@ -8,9 +8,6 @@
# Connect to the server
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
-deClient.SetCurrentCamera(camera)
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
print(f"Camera Name: {cameraName}, Server Software Version: {serverVersion}")
diff --git a/deapi/tests/original_tests/10_imageStatistics.py b/deapi/tests/original_tests/10_imageStatistics.py
index d91e487..53dca2e 100644
--- a/deapi/tests/original_tests/10_imageStatistics.py
+++ b/deapi/tests/original_tests/10_imageStatistics.py
@@ -1,3 +1,4 @@
+import math
import sys
import unittest
import deapi as DEAPI
@@ -22,8 +23,6 @@
deClient = DEAPI.Client()
deClient.Connect()
-cameras = deClient.ListCameras()
-camera = cameras[0]
serverVersion = deClient.GetProperty(propertyName.PROP_SERVER_SOFTWARE_VERSION)
cameraName = deClient.GetProperty(propertyName.PROP_CAMERA_NAME)
@@ -75,8 +74,7 @@
numPrecision = 6
frameCount = 1
-deClient.SetCurrentCamera(camera)
-# deClient.SetProperty("Test Pattern", testPattern)
+deClient.SetProperty("Test Pattern", testPattern)
deClient.SetProperty(propertyName.PROP_INSTRUMENT_CLIENT_ADDRESS, "Manual")
deClient.SetProperty(
propertyName.PROP_INSTRUMENT_PROJECT_MAGNIFICATION, instrumentProjectMagnification
@@ -139,6 +137,7 @@ def UpdateStats(
def statisticsValueCheck(imageProcessingMode, correctionMode):
+ ret = True
deClient.SetProperty(propertyName.PROP_IMAGE_PROCESSING_MODE, imageProcessingMode)
deClient.SetProperty(
propertyName.PROP_IMAGE_PROCESSING_FLATFIELD_CORRECTION, correctionMode
@@ -163,14 +162,17 @@ def statisticsValueCheck(imageProcessingMode, correctionMode):
print(f"imagemean: {attributes.imageMean}")
print(stats.eppix)
print(stats.epa2)
- # Sometimes the float number are not equal due to the
- func.compare2FloatValue(stats.eppix, attributes.eppix, numPrecision, "e-/pix")
- func.compare2FloatValue(stats.eppixps, attributes.eppixps, numPrecision, "e-/pix/s")
- func.compare2FloatValue(stats.eps, attributes.eps, numPrecision, "e-/s")
- func.compare2FloatValue(stats.epa2, attributes.epa2, numPrecision, "e-/a^2")
+ # precision issue, we will compare the float number with a tolerance value. The tolerance value is set to 10**-numPrecision * frameCount for e-/pix, 10**-numPrecision * fps for e-/pix/s and 10**-numPrecision * fps * numPhysicalPixels for e-/s.
+ ret &= math.isclose(stats.eppix, attributes.eppix, rel_tol=0, abs_tol=10**-numPrecision * frameCount)
+ ret &= math.isclose(stats.eppixps, attributes.eppixps, rel_tol=0, abs_tol=10**-numPrecision * fps)
+ ret &= math.isclose(stats.eps, attributes.eps, rel_tol=0, abs_tol=10**-numPrecision * fps * numPhysicalPixels)
+
+ ret &= func.compare2FloatValue(stats.epa2, attributes.epa2, numPrecision, "e-/a^2")
+ return ret
def compareBin1Bin2(imageProcessingMode, correctionMode, swBinningFactor):
+ ret = True
deClient.SetProperty(propertyName.PROP_IMAGE_PROCESSING_MODE, imageProcessingMode)
deClient.SetProperty(
propertyName.PROP_IMAGE_PROCESSING_FLATFIELD_CORRECTION, correctionMode
@@ -210,12 +212,11 @@ def compareBin1Bin2(imageProcessingMode, correctionMode, swBinningFactor):
swBinY,
)
- func.compare2FloatValue(statsBin1.eppix, statsBin2.eppix, numPrecision, "e-/pix")
- func.compare2FloatValue(
- statsBin1.eppixps, statsBin2.eppixps, numPrecision, "e-/pix/s"
- )
- func.compare2FloatValue(statsBin1.eps, statsBin2.eps, numPrecision, "e-/s")
- func.compare2FloatValue(statsBin1.epa2, statsBin2.epa2, numPrecision, "e-/a^2")
+ ret &= func.compare2FloatValue(statsBin1.eppix, statsBin2.eppix, numPrecision, "e-/pix")
+ ret &= func.compare2FloatValue(statsBin1.eppixps, statsBin2.eppixps, numPrecision, "e-/pix/s")
+ ret &= func.compare2FloatValue(statsBin1.eps, statsBin2.eps, numPrecision, "e-/s")
+ ret &= func.compare2FloatValue(statsBin1.epa2, statsBin2.epa2, numPrecision, "e-/a^2")
+ return ret
class TestPatternPixelValues(unittest.TestCase):
diff --git a/deapi/tests/original_tests/func.py b/deapi/tests/original_tests/func.py
index 0d3e48f..3c4ab7b 100644
--- a/deapi/tests/original_tests/func.py
+++ b/deapi/tests/original_tests/func.py
@@ -18,6 +18,8 @@ def compare2FloatValue(expectVal, actualVal, numPrecision, name):
f"{name}: expect {round(expectVal, numPrecision)} actual {round(actualVal, numPrecision)}"
)
return False
+ else:
+ return True
def writeLogFile(caseName, scriptName):
diff --git a/deapi/tests/test_client.py b/deapi/tests/test_client.py
index 91bada1..b120744 100644
--- a/deapi/tests/test_client.py
+++ b/deapi/tests/test_client.py
@@ -34,15 +34,6 @@ def teardown(self):
def test_client_connection(self, client):
assert client.connected
- def test_list_cameras(self, client):
- cameras = client.list_cameras()
- assert isinstance(cameras, list)
-
- def test_set_current_camera(self, client):
- cameras = client.list_cameras()
- client.set_current_camera(cameras[0])
- assert client.get_current_camera() == cameras[0]
-
def test_list_properties(self, client):
properties = client.list_properties()
assert isinstance(properties, list)