Skip to content

Commit 16d8c62

Browse files
authored
v1.0.3
version 1.0.3
2 parents 6e11c7b + bba6d45 commit 16d8c62

27 files changed

+789
-415
lines changed

pyobs_gui/coolingwidget.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ def __init__(self, **kwargs):
2626
# connect signals
2727
self.signal_update_gui.connect(self.update_gui)
2828

29+
async def _init(self) -> None:
30+
if isinstance(self.module, ICooling):
31+
enabled, setpoint, _ = await self.module.get_cooling()
32+
self.checkEnabled.setChecked(enabled)
33+
self.spinSetPoint.setValue(setpoint)
34+
2935
async def _update(self) -> None:
3036
# get status
3137
if isinstance(self.module, ICooling):
@@ -44,12 +50,15 @@ def update_gui(self) -> None:
4450

4551
# set it
4652
if enabled:
47-
self.labelStatus.setText("N/A" if set_point is None else "Set=%.1f°C" % set_point)
53+
self.labelStatus.setText("N/A" if set_point is None else "%.1f°C" % set_point)
4854
self.labelPower.setText("N/A" if power is None else "%d%%" % power)
4955
else:
5056
self.labelStatus.setText("N/A" if power is None else "OFF")
5157
self.labelPower.clear()
5258

59+
def on_checkEnabled_toggled(self, enabled: bool) -> None:
60+
self.spinSetPoint.setEnabled(enabled)
61+
5362
def on_buttonApply_clicked(self) -> None:
5463
asyncio.create_task(self.set_cooling())
5564

pyobs_gui/mainwindow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,10 @@ async def _client_connected(self, event: Event, client: str) -> bool:
369369
for cw in self.custom_widgets:
370370
if cw["module"] == client:
371371
widget = self.create_widget(cw["widget"], module=proxy)
372-
icon = qta.icon(DEFAULT_ICONS[None])
372+
373+
# got an icon?
374+
icon = qta.icon(cw["icon"]) if "icon" in cw else qta.icon(DEFAULT_ICONS[None])
375+
print(icon)
373376

374377
# still nothing?
375378
if widget is None:

pyobs_gui/qt/camerawidget_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
# Form implementation generated from ..reading ui file 'camerawidget.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.7
5+
# Created by: PyQt5 UI code generator 5.14.2
66
#
7-
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8-
# run again. Do not edit this file unless you know what you are doing.
7+
# WARNING! All changes made in this file will be lost!
98

109

1110
from PyQt5 import QtCore, QtGui, QtWidgets

pyobs_gui/qt/compassmovewidget_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
# Form implementation generated from ..reading ui file 'compassmovewidget.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.6
5+
# Created by: PyQt5 UI code generator 5.14.2
66
#
7-
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8-
# run again. Do not edit this file unless you know what you are doing.
7+
# WARNING! All changes made in this file will be lost!
98

109

1110
from PyQt5 import QtCore, QtGui, QtWidgets

pyobs_gui/qt/coolingwidget.ui

Lines changed: 60 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>307</width>
10-
<height>218</height>
9+
<width>210</width>
10+
<height>161</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -31,55 +31,28 @@
3131
<property name="title">
3232
<string>Cooling</string>
3333
</property>
34-
<layout class="QGridLayout" name="gridLayout_2" columnstretch="1,2">
35-
<item row="0" column="1">
36-
<widget class="QLineEdit" name="labelStatus">
37-
<property name="alignment">
38-
<set>Qt::AlignCenter</set>
39-
</property>
40-
<property name="readOnly">
41-
<bool>true</bool>
42-
</property>
43-
</widget>
44-
</item>
45-
<item row="4" column="1">
46-
<widget class="QPushButton" name="buttonApply">
47-
<property name="text">
48-
<string>Apply</string>
49-
</property>
50-
</widget>
51-
</item>
52-
<item row="2" column="1">
53-
<widget class="QCheckBox" name="checkEnabled">
54-
<property name="text">
55-
<string>Enabled</string>
56-
</property>
57-
</widget>
58-
</item>
34+
<layout class="QGridLayout" name="gridLayout">
5935
<item row="0" column="0">
6036
<widget class="QLabel" name="label_9">
6137
<property name="text">
62-
<string>Status:</string>
38+
<string>Set temp:</string>
6339
</property>
6440
</widget>
6541
</item>
66-
<item row="3" column="1">
67-
<widget class="QDoubleSpinBox" name="spinSetPoint">
68-
<property name="suffix">
69-
<string> °C</string>
70-
</property>
71-
<property name="minimum">
72-
<double>-50.000000000000000</double>
42+
<item row="0" column="1">
43+
<widget class="QLineEdit" name="labelStatus">
44+
<property name="alignment">
45+
<set>Qt::AlignCenter</set>
7346
</property>
74-
<property name="maximum">
75-
<double>50.000000000000000</double>
47+
<property name="readOnly">
48+
<bool>true</bool>
7649
</property>
7750
</widget>
7851
</item>
79-
<item row="3" column="0">
80-
<widget class="QLabel" name="label">
52+
<item row="1" column="0">
53+
<widget class="QLabel" name="label_10">
8154
<property name="text">
82-
<string>SetPoint:</string>
55+
<string>Power:</string>
8356
</property>
8457
</widget>
8558
</item>
@@ -93,10 +66,51 @@
9366
</property>
9467
</widget>
9568
</item>
96-
<item row="1" column="0">
97-
<widget class="QLabel" name="label_10">
69+
<item row="2" column="0" colspan="2">
70+
<widget class="Line" name="line">
71+
<property name="orientation">
72+
<enum>Qt::Horizontal</enum>
73+
</property>
74+
</widget>
75+
</item>
76+
<item row="3" column="1">
77+
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
78+
<property name="spacing">
79+
<number>0</number>
80+
</property>
81+
<item>
82+
<widget class="QDoubleSpinBox" name="spinSetPoint">
83+
<property name="suffix">
84+
<string> °C</string>
85+
</property>
86+
<property name="decimals">
87+
<number>1</number>
88+
</property>
89+
<property name="minimum">
90+
<double>-50.000000000000000</double>
91+
</property>
92+
<property name="maximum">
93+
<double>50.000000000000000</double>
94+
</property>
95+
</widget>
96+
</item>
97+
<item>
98+
<widget class="QToolButton" name="buttonApply">
99+
<property name="text">
100+
<string>...</string>
101+
</property>
102+
<property name="icon">
103+
<iconset resource="resources.qrc">
104+
<normaloff>:/resources/arrow-alt-circle-right-solid.svg</normaloff>:/resources/arrow-alt-circle-right-solid.svg</iconset>
105+
</property>
106+
</widget>
107+
</item>
108+
</layout>
109+
</item>
110+
<item row="3" column="0">
111+
<widget class="QCheckBox" name="checkEnabled">
98112
<property name="text">
99-
<string>Power:</string>
113+
<string>Enable</string>
100114
</property>
101115
</widget>
102116
</item>
@@ -105,6 +119,8 @@
105119
</item>
106120
</layout>
107121
</widget>
108-
<resources/>
122+
<resources>
123+
<include location="resources.qrc"/>
124+
</resources>
109125
<connections/>
110126
</ui>

pyobs_gui/qt/coolingwidget_ui.py

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
# Form implementation generated from ..reading ui file 'coolingwidget.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.6
5+
# Created by: PyQt5 UI code generator 5.14.2
66
#
7-
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8-
# run again. Do not edit this file unless you know what you are doing.
7+
# WARNING! All changes made in this file will be lost!
98

109

1110
from PyQt5 import QtCore, QtGui, QtWidgets
@@ -14,46 +13,55 @@
1413
class Ui_CoolingWidget(object):
1514
def setupUi(self, CoolingWidget):
1615
CoolingWidget.setObjectName("CoolingWidget")
17-
CoolingWidget.resize(307, 218)
16+
CoolingWidget.resize(210, 161)
1817
self.verticalLayout = QtWidgets.QVBoxLayout(CoolingWidget)
1918
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
2019
self.verticalLayout.setObjectName("verticalLayout")
2120
self.groupBox_2 = QtWidgets.QGroupBox(CoolingWidget)
2221
self.groupBox_2.setObjectName("groupBox_2")
23-
self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_2)
24-
self.gridLayout_2.setObjectName("gridLayout_2")
22+
self.gridLayout = QtWidgets.QGridLayout(self.groupBox_2)
23+
self.gridLayout.setObjectName("gridLayout")
24+
self.label_9 = QtWidgets.QLabel(self.groupBox_2)
25+
self.label_9.setObjectName("label_9")
26+
self.gridLayout.addWidget(self.label_9, 0, 0, 1, 1)
2527
self.labelStatus = QtWidgets.QLineEdit(self.groupBox_2)
2628
self.labelStatus.setAlignment(QtCore.Qt.AlignCenter)
2729
self.labelStatus.setReadOnly(True)
2830
self.labelStatus.setObjectName("labelStatus")
29-
self.gridLayout_2.addWidget(self.labelStatus, 0, 1, 1, 1)
30-
self.buttonApply = QtWidgets.QPushButton(self.groupBox_2)
31-
self.buttonApply.setObjectName("buttonApply")
32-
self.gridLayout_2.addWidget(self.buttonApply, 4, 1, 1, 1)
33-
self.checkEnabled = QtWidgets.QCheckBox(self.groupBox_2)
34-
self.checkEnabled.setObjectName("checkEnabled")
35-
self.gridLayout_2.addWidget(self.checkEnabled, 2, 1, 1, 1)
36-
self.label_9 = QtWidgets.QLabel(self.groupBox_2)
37-
self.label_9.setObjectName("label_9")
38-
self.gridLayout_2.addWidget(self.label_9, 0, 0, 1, 1)
39-
self.spinSetPoint = QtWidgets.QDoubleSpinBox(self.groupBox_2)
40-
self.spinSetPoint.setMinimum(-50.0)
41-
self.spinSetPoint.setMaximum(50.0)
42-
self.spinSetPoint.setObjectName("spinSetPoint")
43-
self.gridLayout_2.addWidget(self.spinSetPoint, 3, 1, 1, 1)
44-
self.label = QtWidgets.QLabel(self.groupBox_2)
45-
self.label.setObjectName("label")
46-
self.gridLayout_2.addWidget(self.label, 3, 0, 1, 1)
31+
self.gridLayout.addWidget(self.labelStatus, 0, 1, 1, 1)
32+
self.label_10 = QtWidgets.QLabel(self.groupBox_2)
33+
self.label_10.setObjectName("label_10")
34+
self.gridLayout.addWidget(self.label_10, 1, 0, 1, 1)
4735
self.labelPower = QtWidgets.QLineEdit(self.groupBox_2)
4836
self.labelPower.setAlignment(QtCore.Qt.AlignCenter)
4937
self.labelPower.setReadOnly(True)
5038
self.labelPower.setObjectName("labelPower")
51-
self.gridLayout_2.addWidget(self.labelPower, 1, 1, 1, 1)
52-
self.label_10 = QtWidgets.QLabel(self.groupBox_2)
53-
self.label_10.setObjectName("label_10")
54-
self.gridLayout_2.addWidget(self.label_10, 1, 0, 1, 1)
55-
self.gridLayout_2.setColumnStretch(0, 1)
56-
self.gridLayout_2.setColumnStretch(1, 2)
39+
self.gridLayout.addWidget(self.labelPower, 1, 1, 1, 1)
40+
self.line = QtWidgets.QFrame(self.groupBox_2)
41+
self.line.setFrameShape(QtWidgets.QFrame.HLine)
42+
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
43+
self.line.setObjectName("line")
44+
self.gridLayout.addWidget(self.line, 2, 0, 1, 2)
45+
self.horizontalLayout = QtWidgets.QHBoxLayout()
46+
self.horizontalLayout.setSpacing(0)
47+
self.horizontalLayout.setObjectName("horizontalLayout")
48+
self.spinSetPoint = QtWidgets.QDoubleSpinBox(self.groupBox_2)
49+
self.spinSetPoint.setDecimals(1)
50+
self.spinSetPoint.setMinimum(-50.0)
51+
self.spinSetPoint.setMaximum(50.0)
52+
self.spinSetPoint.setObjectName("spinSetPoint")
53+
self.horizontalLayout.addWidget(self.spinSetPoint)
54+
self.buttonApply = QtWidgets.QToolButton(self.groupBox_2)
55+
icon = QtGui.QIcon()
56+
icon.addPixmap(QtGui.QPixmap(":/resources/arrow-alt-circle-right-solid.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
57+
self.buttonApply.setIcon(icon)
58+
self.buttonApply.setObjectName("buttonApply")
59+
self.horizontalLayout.addWidget(self.buttonApply)
60+
self.horizontalLayout.setStretch(0, 1)
61+
self.gridLayout.addLayout(self.horizontalLayout, 3, 1, 1, 1)
62+
self.checkEnabled = QtWidgets.QCheckBox(self.groupBox_2)
63+
self.checkEnabled.setObjectName("checkEnabled")
64+
self.gridLayout.addWidget(self.checkEnabled, 3, 0, 1, 1)
5765
self.verticalLayout.addWidget(self.groupBox_2)
5866

5967
self.retranslateUi(CoolingWidget)
@@ -63,9 +71,9 @@ def retranslateUi(self, CoolingWidget):
6371
_translate = QtCore.QCoreApplication.translate
6472
CoolingWidget.setWindowTitle(_translate("CoolingWidget", "Form"))
6573
self.groupBox_2.setTitle(_translate("CoolingWidget", "Cooling"))
66-
self.buttonApply.setText(_translate("CoolingWidget", "Apply"))
67-
self.checkEnabled.setText(_translate("CoolingWidget", "Enabled"))
68-
self.label_9.setText(_translate("CoolingWidget", "Status:"))
69-
self.spinSetPoint.setSuffix(_translate("CoolingWidget", " °C"))
70-
self.label.setText(_translate("CoolingWidget", "SetPoint:"))
74+
self.label_9.setText(_translate("CoolingWidget", "Set temp:"))
7175
self.label_10.setText(_translate("CoolingWidget", "Power:"))
76+
self.spinSetPoint.setSuffix(_translate("CoolingWidget", " °C"))
77+
self.buttonApply.setText(_translate("CoolingWidget", "..."))
78+
self.checkEnabled.setText(_translate("CoolingWidget", "Enable"))
79+
from . import resources_rc

pyobs_gui/qt/datadisplaywidget_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
# Form implementation generated from ..reading ui file 'datadisplaywidget.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.6
5+
# Created by: PyQt5 UI code generator 5.14.2
66
#
7-
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8-
# run again. Do not edit this file unless you know what you are doing.
7+
# WARNING! All changes made in this file will be lost!
98

109

1110
from PyQt5 import QtCore, QtGui, QtWidgets

pyobs_gui/qt/eventswidget_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
# Form implementation generated from ..reading ui file 'eventswidget.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.6
5+
# Created by: PyQt5 UI code generator 5.14.2
66
#
7-
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8-
# run again. Do not edit this file unless you know what you are doing.
7+
# WARNING! All changes made in this file will be lost!
98

109

1110
from PyQt5 import QtCore, QtGui, QtWidgets

pyobs_gui/qt/filterwidget_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
# Form implementation generated from ..reading ui file 'filterwidget.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.6
5+
# Created by: PyQt5 UI code generator 5.14.2
66
#
7-
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8-
# run again. Do not edit this file unless you know what you are doing.
7+
# WARNING! All changes made in this file will be lost!
98

109

1110
from PyQt5 import QtCore, QtGui, QtWidgets

pyobs_gui/qt/fitsheaderswidget_ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
# Form implementation generated from ..reading ui file 'fitsheaderswidget.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.6
5+
# Created by: PyQt5 UI code generator 5.14.2
66
#
7-
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8-
# run again. Do not edit this file unless you know what you are doing.
7+
# WARNING! All changes made in this file will be lost!
98

109

1110
from PyQt5 import QtCore, QtGui, QtWidgets

0 commit comments

Comments
 (0)