Skip to content

Commit

Permalink
Replaced update methods for startCalculateExposureTime and startCalcu…
Browse files Browse the repository at this point in the history
…lateAutofocus
  • Loading branch information
Galoshi committed Mar 27, 2024
1 parent 4d73fe6 commit f66a283
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions source/rpc/imager.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,19 @@ def startCalculateExposureTime(self, minAnalogGainFactor: int = None, maxAnalogG
"""
inputAutoExposure = {}
if minAnalogGainFactor:
inputAutoExposure.update({"minAnalogGainFactor": minAnalogGainFactor})
inputAutoExposure["minAnalogGainFactor"] = minAnalogGainFactor
if maxAnalogGainFactor:
inputAutoExposure.update({"maxAnalogGainFactor": maxAnalogGainFactor})
inputAutoExposure["maxAnalogGainFactor"] = maxAnalogGainFactor
if saturatedRatio:
inputAutoExposure.update({"saturatedRatio": saturatedRatio})
inputAutoExposure["saturatedRatio"] = saturatedRatio
if ROIs:
inputAutoExposure.update({"ROIs": ROIs})
inputAutoExposure["ROIs"] = ROIs
if RODs and not ROIs:
defaultROIsZone = [{"id": 0, "group": 0, "type": "Rect", "width": 1280,
"height": 960, "angle": 0, "center_x": 640, "center_y": 480}]
inputAutoExposure.update({"ROIs": defaultROIsZone})
inputAutoExposure["ROIs"] = defaultROIsZone
if RODs:
inputAutoExposure.update({"RODs": RODs})
inputAutoExposure["RODs"] = RODs
self._imagerProxy.startCalculateExposureTime(json.dumps(inputAutoExposure))
while self.getProgressCalculateExposureTime() < 1.0:
time.sleep(1)
Expand All @@ -387,13 +387,13 @@ def startCalculateAutofocus(self, ROIs: list = None, RODs: list = None) -> None:
"""
inputAutoFocus = {}
if ROIs:
inputAutoFocus.update({"ROIs": ROIs})
inputAutoFocus["ROIs"] = ROIs
if RODs and not ROIs:
defaultROIsZone = [{"id": 0, "group": 0, "type": "Rect", "width": 1280,
"height": 960, "angle": 0, "center_x": 640, "center_y": 480}]
inputAutoFocus.update({"ROIs": defaultROIsZone})
inputAutoFocus["ROIs"] = defaultROIsZone
if RODs:
inputAutoFocus.update({"RODs": RODs})
inputAutoFocus["RODs"] = RODs
self._imagerProxy.startCalculateAutofocus(json.dumps(inputAutoFocus))
while self.getProgressCalculateAutofocus() < 1.0:
time.sleep(1)
Expand Down

0 comments on commit f66a283

Please sign in to comment.