summaryrefslogtreecommitdiff
path: root/src/py/cam/cam_qt.py
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-05-27 17:44:30 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-05-27 22:03:38 +0300
commit1698442aa8e3aed1fe0b2323dada6d5e1f2515a3 (patch)
treecdc7847aead57f366ccdcbe97613c7e3d0541ab0 /src/py/cam/cam_qt.py
parent3c82ae3821798794873be939bb46c507d4ebde7c (diff)
py: Re-structure the controls API
Add ControlInfo class and change the controls related methods to resemble the C++ API (e.g. no more string based control methods). We don't implement ControlList or ControlInfoMap but just expose the same data via standard Python dict. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/py/cam/cam_qt.py')
-rw-r--r--src/py/cam/cam_qt.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/py/cam/cam_qt.py b/src/py/cam/cam_qt.py
index d638e9cc..e2395c4b 100644
--- a/src/py/cam/cam_qt.py
+++ b/src/py/cam/cam_qt.py
@@ -267,9 +267,9 @@ class MainWindow(QtWidgets.QWidget):
camera = ctx.camera
- for k, v in camera.properties.items():
+ for cid, cv in camera.properties.items():
lab = QtWidgets.QLabel()
- lab.setText(k + ' = ' + str(v))
+ lab.setText('{} = {}'.format(cid, cv))
groupLayout.addWidget(lab)
group = QtWidgets.QGroupBox('Controls')
@@ -277,9 +277,10 @@ class MainWindow(QtWidgets.QWidget):
group.setLayout(groupLayout)
controlsLayout.addWidget(group)
- for k, (min, max, default) in camera.controls.items():
+ for cid, cinfo in camera.controls.items():
lab = QtWidgets.QLabel()
- lab.setText('{} = {}/{}/{}'.format(k, min, max, default))
+ lab.setText('{} = {}/{}/{}'
+ .format(cid, cinfo.min, cinfo.max, cinfo.default))
groupLayout.addWidget(lab)
controlsLayout.addStretch()