cgse-gui 2024.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cgse_gui-2024.1.0.dist-info/METADATA +13 -0
- cgse_gui-2024.1.0.dist-info/RECORD +124 -0
- cgse_gui-2024.1.0.dist-info/WHEEL +4 -0
- cgse_gui-2024.1.0.dist-info/entry_points.txt +6 -0
- egse/gui/__init__.py +56 -0
- egse/gui/buttons.py +378 -0
- egse/gui/icons/aeu-cs-start.svg +117 -0
- egse/gui/icons/aeu-cs-stop.svg +118 -0
- egse/gui/icons/aeu-cs.svg +107 -0
- egse/gui/icons/aeu_cs-started.svg +112 -0
- egse/gui/icons/aeu_cs-stopped.svg +112 -0
- egse/gui/icons/aeu_cs.svg +55 -0
- egse/gui/icons/alert.svg +1 -0
- egse/gui/icons/arrow-double-left.png +0 -0
- egse/gui/icons/arrow-double-right.png +0 -0
- egse/gui/icons/arrow-up.svg +11 -0
- egse/gui/icons/backward.svg +1 -0
- egse/gui/icons/busy.svg +1 -0
- egse/gui/icons/cleaning.svg +115 -0
- egse/gui/icons/color-scheme.svg +1 -0
- egse/gui/icons/cs-connected-alert.svg +91 -0
- egse/gui/icons/cs-connected-disabled.svg +43 -0
- egse/gui/icons/cs-connected.svg +89 -0
- egse/gui/icons/cs-not-connected.svg +44 -0
- egse/gui/icons/double-left-arrow.svg +1 -0
- egse/gui/icons/double-right-arrow.svg +1 -0
- egse/gui/icons/erase-disabled.svg +19 -0
- egse/gui/icons/erase.svg +59 -0
- egse/gui/icons/fitsgen-start.svg +47 -0
- egse/gui/icons/fitsgen-stop.svg +48 -0
- egse/gui/icons/fitsgen.svg +1 -0
- egse/gui/icons/forward.svg +1 -0
- egse/gui/icons/fov-hk-start.svg +33 -0
- egse/gui/icons/fov-hk-stop.svg +37 -0
- egse/gui/icons/fov-hk.svg +1 -0
- egse/gui/icons/front-desk.svg +1 -0
- egse/gui/icons/home-actioned.svg +15 -0
- egse/gui/icons/home-disabled.svg +15 -0
- egse/gui/icons/home.svg +13 -0
- egse/gui/icons/info.svg +1 -0
- egse/gui/icons/invalid.png +0 -0
- egse/gui/icons/led-green.svg +20 -0
- egse/gui/icons/led-grey.svg +20 -0
- egse/gui/icons/led-orange.svg +20 -0
- egse/gui/icons/led-red.svg +20 -0
- egse/gui/icons/led-square-green.svg +134 -0
- egse/gui/icons/led-square-grey.svg +134 -0
- egse/gui/icons/led-square-orange.svg +134 -0
- egse/gui/icons/led-square-red.svg +134 -0
- egse/gui/icons/limit-switch-all-green.svg +115 -0
- egse/gui/icons/limit-switch-all-red.svg +117 -0
- egse/gui/icons/limit-switch-el+.svg +116 -0
- egse/gui/icons/limit-switch-el-.svg +117 -0
- egse/gui/icons/location-marker.svg +1 -0
- egse/gui/icons/logo-dpu.svg +48 -0
- egse/gui/icons/logo-gimbal.svg +112 -0
- egse/gui/icons/logo-huber.svg +23 -0
- egse/gui/icons/logo-ogse.svg +31 -0
- egse/gui/icons/logo-puna.svg +92 -0
- egse/gui/icons/logo-tcs.svg +29 -0
- egse/gui/icons/logo-zonda.svg +66 -0
- egse/gui/icons/maximize.svg +1 -0
- egse/gui/icons/meter.svg +1 -0
- egse/gui/icons/more.svg +45 -0
- egse/gui/icons/n-fee-hk-start.svg +24 -0
- egse/gui/icons/n-fee-hk-stop.svg +25 -0
- egse/gui/icons/n-fee-hk.svg +83 -0
- egse/gui/icons/observing-off.svg +46 -0
- egse/gui/icons/observing-on.svg +46 -0
- egse/gui/icons/open-document-hdf5.png +0 -0
- egse/gui/icons/open-document-hdf5.svg +21 -0
- egse/gui/icons/ops-mode.svg +1 -0
- egse/gui/icons/play-green.svg +17 -0
- egse/gui/icons/plugged-disabled.svg +27 -0
- egse/gui/icons/plugged.svg +21 -0
- egse/gui/icons/pm_ui.svg +1 -0
- egse/gui/icons/power-button-green.svg +27 -0
- egse/gui/icons/power-button-red.svg +27 -0
- egse/gui/icons/power-button.svg +27 -0
- egse/gui/icons/radar.svg +1 -0
- egse/gui/icons/radioactive.svg +2 -0
- egse/gui/icons/reload.svg +1 -0
- egse/gui/icons/remote-control-off.svg +28 -0
- egse/gui/icons/remote-control-on.svg +28 -0
- egse/gui/icons/repeat-blue.svg +15 -0
- egse/gui/icons/repeat.svg +1 -0
- egse/gui/icons/settings.svg +1 -0
- egse/gui/icons/shrink.svg +1 -0
- egse/gui/icons/shutter.svg +1 -0
- egse/gui/icons/sign-off.svg +1 -0
- egse/gui/icons/sign-on.svg +1 -0
- egse/gui/icons/sim-mode.svg +1 -0
- egse/gui/icons/small-buttons-go.svg +20 -0
- egse/gui/icons/small-buttons-minus.svg +51 -0
- egse/gui/icons/small-buttons-plus.svg +51 -0
- egse/gui/icons/sponge.svg +220 -0
- egse/gui/icons/start-button-disabled.svg +84 -0
- egse/gui/icons/start-button.svg +50 -0
- egse/gui/icons/stop-button-disabled.svg +84 -0
- egse/gui/icons/stop-button.svg +50 -0
- egse/gui/icons/stop-red.svg +17 -0
- egse/gui/icons/stop.svg +1 -0
- egse/gui/icons/switch-disabled-square.svg +87 -0
- egse/gui/icons/switch-disabled.svg +15 -0
- egse/gui/icons/switch-off-square.svg +87 -0
- egse/gui/icons/switch-off.svg +72 -0
- egse/gui/icons/switch-on-square.svg +87 -0
- egse/gui/icons/switch-on.svg +61 -0
- egse/gui/icons/temperature-control.svg +44 -0
- egse/gui/icons/th_ui_logo.svg +1 -0
- egse/gui/icons/unplugged.svg +23 -0
- egse/gui/icons/unvalid.png +0 -0
- egse/gui/icons/user-interface.svg +1 -0
- egse/gui/icons/vacuum.svg +1 -0
- egse/gui/icons/valid.png +0 -0
- egse/gui/icons/zoom-to-pixel-dark.svg +64 -0
- egse/gui/icons/zoom-to-pixel-white.svg +36 -0
- egse/gui/led.py +162 -0
- egse/gui/limitswitch.py +143 -0
- egse/gui/states.py +148 -0
- egse/gui/styles/dark.qss +343 -0
- egse/gui/styles/default.qss +48 -0
- egse/gui/styles.qss +48 -0
- egse/gui/switch.py +108 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cgse-gui
|
|
3
|
+
Version: 2024.1.0
|
|
4
|
+
Summary: GUI components for CGSE
|
|
5
|
+
Author-email: Rik Huygen <rik.huygen@kuleuven.be>, Sara Regibo <sara.regibo@kuleuven.be>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: CGSE,Common-EGSE,GUI
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Requires-Dist: cgse-common
|
|
10
|
+
Requires-Dist: pyqt5
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# GUI Components used in CGSE apps
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
egse/gui/__init__.py,sha256=78gC4zQBaJQE5JW83q73MvQmGYC1-pbZhfbOFLp-hpY,1752
|
|
2
|
+
egse/gui/buttons.py,sha256=TPB1WmMBHObl2gD1BPy4iSzL_kTd8Z-n4QtBhhTBBy8,11904
|
|
3
|
+
egse/gui/led.py,sha256=GewPxz2FQL9xpGHLr0vB5HeatBOINGp67tTfciI2NSk,4580
|
|
4
|
+
egse/gui/limitswitch.py,sha256=jSW0V-gbfT3veUNGF2uK4CSMZt0aePUun0fTjKdF28U,4157
|
|
5
|
+
egse/gui/states.py,sha256=qik2Rk9Spc-yrVfQqaStYn1JEoZeyo7-tXiL-MT9nug,4410
|
|
6
|
+
egse/gui/styles.qss,sha256=19tQBeCcei41s-ozMoFFepUQibv_EkmQLHDkDWtoCQs,1042
|
|
7
|
+
egse/gui/switch.py,sha256=bzPrPVB9fqujvR8C4MV8vy-W7_sclm7M3MKTvoDAm_g,2419
|
|
8
|
+
egse/gui/icons/aeu-cs-start.svg,sha256=o6DjZkWaArEioCPmD83TRfTklZ_cyawZHNG-ztRn_10,33010
|
|
9
|
+
egse/gui/icons/aeu-cs-stop.svg,sha256=IWeb4v-DLoz3TSJSsA6I641Oo0tYW6LKf1jjzIvyYpE,32483
|
|
10
|
+
egse/gui/icons/aeu-cs.svg,sha256=BxjU69kWLSidLltMIrY0hFF0drQfHYJIr74y9x3VQs8,29194
|
|
11
|
+
egse/gui/icons/aeu_cs-started.svg,sha256=F-3Fix1UbQevoeWmTQoyAAGOpUy5SdKKeJ42tGEo288,29417
|
|
12
|
+
egse/gui/icons/aeu_cs-stopped.svg,sha256=SzEv6_Lien_1-rIYTMIs_H1j1D7xbki02WMfTOqBy9Y,29417
|
|
13
|
+
egse/gui/icons/aeu_cs.svg,sha256=loSYB9nPbupjluF2UZRzVZauWEJRJ8XflsPZqQSwBto,13990
|
|
14
|
+
egse/gui/icons/alert.svg,sha256=1HuaYVhhF1rDAmIxCek36Mp8yC5NzxP0jczl5JLdrrM,6423
|
|
15
|
+
egse/gui/icons/arrow-double-left.png,sha256=lSoxWZg4Tv7yga1T5PnrEYUFzto0JPNuEg9K5fPyR3E,544
|
|
16
|
+
egse/gui/icons/arrow-double-right.png,sha256=KTGx0pFkMAMWvIZtgkGcloEmoTpfIsTFzInOAsiVHs4,541
|
|
17
|
+
egse/gui/icons/arrow-up.svg,sha256=wl_qS6gwcH5JCXP32TOzQJ_Lwz40XMcNrGgG77W_xpk,501
|
|
18
|
+
egse/gui/icons/backward.svg,sha256=nwmruFL-tt9Iny-Gy4Ibq3JTRJrhG7yK6aBZAuspHEo,958
|
|
19
|
+
egse/gui/icons/busy.svg,sha256=fKNR2AxNupsAga7huDQF-kEYTThMkxgqGVZvXbma0G4,2964
|
|
20
|
+
egse/gui/icons/cleaning.svg,sha256=FSt4KOFxbvnkiED_nj9yLvwKz_ZlOhCBKASUYRwXkiI,7763
|
|
21
|
+
egse/gui/icons/color-scheme.svg,sha256=pbEVmwXt62GoVE_BalJEVVOIZ3KHL4wDwgSQDftWQmA,5536
|
|
22
|
+
egse/gui/icons/cs-connected-alert.svg,sha256=pMb7WV509a6E1Cytm81fg0VNWZpfNhGng87lpKs-IRI,5007
|
|
23
|
+
egse/gui/icons/cs-connected-disabled.svg,sha256=RpN2xM-GYIZYzHHNfj_OKW4bLrq3hZGzxMHisiymHWk,6636
|
|
24
|
+
egse/gui/icons/cs-connected.svg,sha256=Atvl399IoJ8PVGsJn2OPWkwGUgSJBlu6b-j1ILWa20U,5032
|
|
25
|
+
egse/gui/icons/cs-not-connected.svg,sha256=2ScUnese5THM9ZTQMjhxHXTOFVx3bkbWaageemF42to,6897
|
|
26
|
+
egse/gui/icons/double-left-arrow.svg,sha256=z0sBSiUO51PtLBI66gd7gBUhGkGpq0Mf26hlc0dEauo,505
|
|
27
|
+
egse/gui/icons/double-right-arrow.svg,sha256=C5W7yHpoVXexwY712Whf6fg4qzN0lKEhs4z0VXqwjQk,512
|
|
28
|
+
egse/gui/icons/erase-disabled.svg,sha256=XTqvLRnMTpFg457FxuHsSjGzx2IspKe0aoAVs0FTuBA,3263
|
|
29
|
+
egse/gui/icons/erase.svg,sha256=ZIQFDCtRM7fhoFyz3tz4GZnygTsDwbRjnSTO7Btbj_I,2744
|
|
30
|
+
egse/gui/icons/fitsgen-start.svg,sha256=nqQ6zCBrgo-LJTuYnIDZZDnu8-qONAvohr3cJxiHAOg,11192
|
|
31
|
+
egse/gui/icons/fitsgen-stop.svg,sha256=r8_A-nwSvZ6ecYiCY2IL29i60cDa0Sig-TgNVrpQaeo,10642
|
|
32
|
+
egse/gui/icons/fitsgen.svg,sha256=To9HxrepPOJSwjFo2tU8LmAInl_Yq9Vz-OAILsvOsV4,4099
|
|
33
|
+
egse/gui/icons/forward.svg,sha256=NHvi_spS243CRFHhVcm1bAMY_YIQStYMTD_O5KGLNbc,943
|
|
34
|
+
egse/gui/icons/fov-hk-start.svg,sha256=Wa2_A989349jsL2bXU4uqWtBWnyC1oukk97eBnKBKV4,13358
|
|
35
|
+
egse/gui/icons/fov-hk-stop.svg,sha256=EKRUNCAVQjTTPBOZeXbyK8_xzs_OJaMrJMm0ISx_B4A,13727
|
|
36
|
+
egse/gui/icons/fov-hk.svg,sha256=Jw34a3XLVTCxB_8nL3Tm5KRIVF7Or5VEgfyVghJoocg,7402
|
|
37
|
+
egse/gui/icons/front-desk.svg,sha256=ncb7qhsjGEUWKXP3JXX9QZ1eBoXDuhKIfSlZA8U1qrU,4057
|
|
38
|
+
egse/gui/icons/home-actioned.svg,sha256=7ZsoG_m5w8CvvLgpIv0mFmrv1TFuQnTOMwuoVUEiCxM,2061
|
|
39
|
+
egse/gui/icons/home-disabled.svg,sha256=_4y3RyZOfTPPXdO0KF3jlbzl7gLTxvy-F-MlzSqEuUI,2077
|
|
40
|
+
egse/gui/icons/home.svg,sha256=qg9G_6uwRzYz-yAdaiq6A2kSX_qGEXmR6f6yk7nrLp8,2076
|
|
41
|
+
egse/gui/icons/info.svg,sha256=Ytz5L0Ys_iqh382IjMEpFyotqqPrvBpcdfofYxT-1cE,2671
|
|
42
|
+
egse/gui/icons/invalid.png,sha256=I8iTMtwYLue7sXPIKrxos1kMEicQlQsVVhtBFYPpoUM,3327
|
|
43
|
+
egse/gui/icons/led-green.svg,sha256=yJXvmDItfEZc7Q5dEU-BX_WlO2MvJBFfjSV9h1RGKA8,2302
|
|
44
|
+
egse/gui/icons/led-grey.svg,sha256=MU-HDM44D1UGqnNfYXNTd30bgHWUwZi7zaqzy2xI7gQ,2302
|
|
45
|
+
egse/gui/icons/led-orange.svg,sha256=LAZYf2F2TMcRy5nyMS9HnH_iIBeCo-f3uOtBU9fJ23w,2302
|
|
46
|
+
egse/gui/icons/led-red.svg,sha256=m29lYkxnLitsXRdDRRsQ3neEYaf-QdoYMSahUIE9ZZE,2302
|
|
47
|
+
egse/gui/icons/led-square-green.svg,sha256=pojw93adqHsLmdp2yFqbbjE519hWdKyNaKcJFkYiX1A,13514
|
|
48
|
+
egse/gui/icons/led-square-grey.svg,sha256=mUBnXViGnq3LAhHg2h5m1CqpY9shp8bhWrboYyt4-hk,13514
|
|
49
|
+
egse/gui/icons/led-square-orange.svg,sha256=hK-pOiV3HjriZe8uCY_eSIoD731pbC73siJJ7O-b_fI,13514
|
|
50
|
+
egse/gui/icons/led-square-red.svg,sha256=LSmF15syF9jwu7X0Wontr2zeV_jFY2Wp-JfWglVwTQg,13514
|
|
51
|
+
egse/gui/icons/limit-switch-all-green.svg,sha256=60dBapd15q2ejHBlaWElXxa83fKQn96Uzi6IemXMKwc,10024
|
|
52
|
+
egse/gui/icons/limit-switch-all-red.svg,sha256=gPgRQ0bG0wSTTj-ojgWFzAaJGIFjs_O0oVLyKYK3O90,10507
|
|
53
|
+
egse/gui/icons/limit-switch-el+.svg,sha256=oP0ABWzo1tfFKpo8AIVvCbWzbSanzYWWpEbUSQpyaQg,10246
|
|
54
|
+
egse/gui/icons/limit-switch-el-.svg,sha256=Gd7OEZ5C7SfXT7kpF3EsZSfxr54rG20FoeFi7pPnqVE,10507
|
|
55
|
+
egse/gui/icons/location-marker.svg,sha256=n1nZRczeF24FrsHTyy1XycmhMqaBO2nXBltFIov3f2s,3056
|
|
56
|
+
egse/gui/icons/logo-dpu.svg,sha256=sHIXzab6l6C8tq-A1_PByinr73OkHycUNYceaxkW-d4,6927
|
|
57
|
+
egse/gui/icons/logo-gimbal.svg,sha256=x_pigJaLqBPJS0XysKZolrDgN-mhRVitfgQxAMFrPjs,5128
|
|
58
|
+
egse/gui/icons/logo-huber.svg,sha256=0w5RBTJtX_VzhYoh7J7WU7VOFJZNxxXa2L58-EuQpfM,3986
|
|
59
|
+
egse/gui/icons/logo-ogse.svg,sha256=sFWB7BDacmTTfZH8IoAw_qDSH7WprDbZDYsQdW5Tub0,4957
|
|
60
|
+
egse/gui/icons/logo-puna.svg,sha256=U04tCkp2kh6djC9pEb_1ZlPFmJXyJpZpC970tK0YWBY,21409
|
|
61
|
+
egse/gui/icons/logo-tcs.svg,sha256=1_a-_u9ROupPuxfEBLabbzD8Y0Qv8gTTFY2Bo1KNnSU,3315
|
|
62
|
+
egse/gui/icons/logo-zonda.svg,sha256=djAcEySDAUmzJMJSJ07sF87qkQ0mkTFVwiBPkafBcKo,12192
|
|
63
|
+
egse/gui/icons/maximize.svg,sha256=RmdlzHAjlUA2Z7jYSdzYMw0U3m1taonRTQwbpS6pQ9c,1388
|
|
64
|
+
egse/gui/icons/meter.svg,sha256=6m7bIU2Abm0TLOGTKeaEQoo-oF9jfBYimxxRiJmvqb4,11441
|
|
65
|
+
egse/gui/icons/more.svg,sha256=tacNSD-hEayw3QRy_q1ZumpfFPC4caolIzOgPxKDveg,940
|
|
66
|
+
egse/gui/icons/n-fee-hk-start.svg,sha256=AoY-D2Mu49POF0sMgRaCiyFL_GZGnkOOxKtLAwtGamU,11088
|
|
67
|
+
egse/gui/icons/n-fee-hk-stop.svg,sha256=LGiSyxJcbS9gSykKzoBAdAnSimB44WKAbZ3c3Hm9uF4,10513
|
|
68
|
+
egse/gui/icons/n-fee-hk.svg,sha256=ICeyXcjz-MoKeyO4MWJOE0CjIQqTUlux4nb9_jYfKq4,4429
|
|
69
|
+
egse/gui/icons/observing-off.svg,sha256=apDx85UZxrL9JBd_QuZNU2PuS6xxXWFjy1_VyYcB_zk,11297
|
|
70
|
+
egse/gui/icons/observing-on.svg,sha256=YHay87z9YNqF4KxOGBHs7EsVnN-xecuO64czzbwPyUM,11297
|
|
71
|
+
egse/gui/icons/open-document-hdf5.png,sha256=q3vAEY1CRWcmfjDvEaW_0F_onhcNMStox5lGbtJSV6s,1391
|
|
72
|
+
egse/gui/icons/open-document-hdf5.svg,sha256=gHLg6THEhiEjZs3abMVd8AzdsnsfBs0IKm_KYWfebzQ,6272
|
|
73
|
+
egse/gui/icons/ops-mode.svg,sha256=P6uhgnlXF5UXiJXIlpawklTcCZQePPEI5fGONtL_Y3o,5199
|
|
74
|
+
egse/gui/icons/play-green.svg,sha256=kGGqcbE43D9FAv3KUm-s_QNM6On-GLhBinDbuNLgU38,3290
|
|
75
|
+
egse/gui/icons/plugged-disabled.svg,sha256=feZKKYVatU_uERPz5958xa-uWDImnW-raZt027Ihr_A,6814
|
|
76
|
+
egse/gui/icons/plugged.svg,sha256=iMKsUqn7_sw2wULAQoNCBVNrYDirUpxd_XbqjBfkZc4,5571
|
|
77
|
+
egse/gui/icons/pm_ui.svg,sha256=YbBc_Eynwa4RwyWidJZ54tTWkzccy-bqo6we4DZwQEw,6383
|
|
78
|
+
egse/gui/icons/power-button-green.svg,sha256=coyje_a_yEn269FUS8qWoYRqB-7EHi2Pcb3DYzC6-YM,4613
|
|
79
|
+
egse/gui/icons/power-button-red.svg,sha256=ltJUefoQG-aqg5iQbcDuZ4cstE1RFbf-ALIreBOBb3M,4613
|
|
80
|
+
egse/gui/icons/power-button.svg,sha256=Ph5LdFDA4ybGwbc2G_cQzunPMelCfq2UAAKKAXI7izE,4613
|
|
81
|
+
egse/gui/icons/radar.svg,sha256=a9SNSUdVq-uEB_UaHC6e71h814MUayB_LuJWojdTRBk,4976
|
|
82
|
+
egse/gui/icons/radioactive.svg,sha256=CNn5fSBuNjGbX-qKTg077EC0879rHMKQE0jQrTVqyi8,12268
|
|
83
|
+
egse/gui/icons/reload.svg,sha256=BHBruuV375hkyW8CMmwq-SQrxlJXS6ZQHjirnxY4ed0,2905
|
|
84
|
+
egse/gui/icons/remote-control-off.svg,sha256=EID9v-uXC4CNpIH9EBQhwHzdiEM-YK1U6kE_vBtGo6o,5200
|
|
85
|
+
egse/gui/icons/remote-control-on.svg,sha256=Brruc6nZV0NX_eXfqvX1plZL-YNOOBszf3XAxX_EZ50,5200
|
|
86
|
+
egse/gui/icons/repeat-blue.svg,sha256=i21cx18kyezHrOZQb0tNVXIXEOXuCQoAn2L922z5HBA,5555
|
|
87
|
+
egse/gui/icons/repeat.svg,sha256=kMB9thIfqhyouPf8wq3d088SB_4rPWPF320jSpnFKfA,2655
|
|
88
|
+
egse/gui/icons/settings.svg,sha256=iY0hA-VuKovZkVzwJVOC-my4HYNl5QIUMZX29duL1V0,3005
|
|
89
|
+
egse/gui/icons/shrink.svg,sha256=3msr-8_U6oOXtC4SN3g96PESuc69B4rorLIrvjAz4Ng,1342
|
|
90
|
+
egse/gui/icons/shutter.svg,sha256=sbxILMXzsHkQb3Hoc5hzeDYHjIY8oHM3_ID2kP85Xmc,3518
|
|
91
|
+
egse/gui/icons/sign-off.svg,sha256=wd3eRwkMvvTXbEfAcuk9fU1sORqEyP7WNk4I-0tm6-c,836
|
|
92
|
+
egse/gui/icons/sign-on.svg,sha256=mZFH9Y7Fnpw8Z-pF4pAAf0FKC_Bq_Q7Bddt9bVA-dKU,847
|
|
93
|
+
egse/gui/icons/sim-mode.svg,sha256=iDU6i0nTqyeYJOY9NAIj6NvjBQWAo2XSJ__35funhXY,6911
|
|
94
|
+
egse/gui/icons/small-buttons-go.svg,sha256=Lr7i594LNyrST0gD_Z8-FfzbIaIQHE4l7ATsw6iLVPY,5257
|
|
95
|
+
egse/gui/icons/small-buttons-minus.svg,sha256=hmX4-PBUkoLZO22vcCOYaUOJQa8tvRtT2E7gvb-lTRc,10679
|
|
96
|
+
egse/gui/icons/small-buttons-plus.svg,sha256=zYwxwXiVPnn5Eu6xvmR02gnmYiKETvzsbByBJ8BwveE,10679
|
|
97
|
+
egse/gui/icons/sponge.svg,sha256=-oZ6icJYZghC5yDz0ccvbz1Ix2TY-B19nh0vCOs86to,13384
|
|
98
|
+
egse/gui/icons/start-button-disabled.svg,sha256=7pJHKdR5EYZLUEZIjCipXogbT-RS9f4cstDJvztv8Q8,37771
|
|
99
|
+
egse/gui/icons/start-button.svg,sha256=z8eCfFd7HizHu53Oc_9BVpi6wQxFU6_M5i7Y9d7OeEM,15925
|
|
100
|
+
egse/gui/icons/stop-button-disabled.svg,sha256=BBW83FgXrGJ-9TaE-61qheCAoBLNGJwu1lGjrkeRBBw,37771
|
|
101
|
+
egse/gui/icons/stop-button.svg,sha256=OIYgMg4M8Iepx18PsjmbtHLeTTjEMdqe8OX0oYijTAs,19090
|
|
102
|
+
egse/gui/icons/stop-red.svg,sha256=rZ0B88KnH33Bg3G__ycqSoZg9c9IwwIC3tTVUxD3nug,2570
|
|
103
|
+
egse/gui/icons/stop.svg,sha256=r0zpGFJYdelvQcb_CY3-QXzvB8Z5NYd9j_9dKjWCFMA,4238
|
|
104
|
+
egse/gui/icons/switch-disabled-square.svg,sha256=aRTQxmUS5KO6XyH5izY77oqlgE2rc6BxPgFZaMXIn-4,19713
|
|
105
|
+
egse/gui/icons/switch-disabled.svg,sha256=O2rmMBALW0PA-42b9lfx0n7TbdzSyNoF--hLdhrAcog,2024
|
|
106
|
+
egse/gui/icons/switch-off-square.svg,sha256=qNqlIKqHR56RIhUQy08ISkh3ypQIpNMK7sL-RS8QxE8,19713
|
|
107
|
+
egse/gui/icons/switch-off.svg,sha256=ThijyUJS_NUm4ZPf_spUHJ7vRWuPOkcHJnTI40yt4f0,3858
|
|
108
|
+
egse/gui/icons/switch-on-square.svg,sha256=URhKawWQn3tDyIKVJlS-ugpIoRYHoT1-VaT4D4jf5Ps,19713
|
|
109
|
+
egse/gui/icons/switch-on.svg,sha256=Sstld1aklhuAya_eUTdGDY_iBEdwertcDNkwuFp_o_E,2871
|
|
110
|
+
egse/gui/icons/temperature-control.svg,sha256=fPlbaFHrT-SO7Ou4RnT5nn_6tDx9BlCD9VWtso3LcX0,5379
|
|
111
|
+
egse/gui/icons/th_ui_logo.svg,sha256=YoXjKULY1ntslRPIcNWUuFECOLEYgWtjCkI-sF4xDzE,16613
|
|
112
|
+
egse/gui/icons/unplugged.svg,sha256=iccWZUzghT2VoDHgRzMqwSgBKu_AzIHy1U607K3Gl6E,6709
|
|
113
|
+
egse/gui/icons/unvalid.png,sha256=HoznN3gOj062TE8Z3jB3VtT3QcUycrsG5CxC1iWWy-Q,2628
|
|
114
|
+
egse/gui/icons/user-interface.svg,sha256=q_KWgHJ9ATdbw-HFghoaGQIBe52ZyxyAKitHpDaFWm8,2375
|
|
115
|
+
egse/gui/icons/vacuum.svg,sha256=scUVFO4CN4VGzwD7NdsH9EFUhhwluhWyNQt0-59D8-Q,2421
|
|
116
|
+
egse/gui/icons/valid.png,sha256=8EyTl3HlUBINbtkAictC99EHQSbQB7sNf79axjtTDU0,3353
|
|
117
|
+
egse/gui/icons/zoom-to-pixel-dark.svg,sha256=56ODuomCYQicW6_B3WZerILK2OSFcJWTBJnLIWMJ7Y4,17852
|
|
118
|
+
egse/gui/icons/zoom-to-pixel-white.svg,sha256=UUpW4Shv_EqxI1h3oiSGspzrJIZoE6WtfV90PqaISho,11875
|
|
119
|
+
egse/gui/styles/dark.qss,sha256=BxZ2NNdkl5fxe5rW-DPHghyyY5DVmMLJjwJ8AaxhWtY,10726
|
|
120
|
+
egse/gui/styles/default.qss,sha256=19tQBeCcei41s-ozMoFFepUQibv_EkmQLHDkDWtoCQs,1042
|
|
121
|
+
cgse_gui-2024.1.0.dist-info/METADATA,sha256=6JO0QQ23JVXkSctSYerS4yviZekJLB2fNZoRgRj-VzQ,379
|
|
122
|
+
cgse_gui-2024.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
123
|
+
cgse_gui-2024.1.0.dist-info/entry_points.txt,sha256=LJEgBSLYM4TB8o4WM5xMtvQyBnddot__Pv3gsL824Gk,104
|
|
124
|
+
cgse_gui-2024.1.0.dist-info/RECORD,,
|
egse/gui/__init__.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from PyQt5.QtWidgets import QFrame
|
|
4
|
+
from PyQt5.QtWidgets import QMessageBox
|
|
5
|
+
|
|
6
|
+
from egse.resource import initialise_resources
|
|
7
|
+
|
|
8
|
+
# Load the resources that are defined by this package, we do not have resource ids other than those
|
|
9
|
+
# defined by default, therefore no need to call add_resource_id().
|
|
10
|
+
|
|
11
|
+
initialise_resources(Path(__file__).parent)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def show_warning_message(description: str, info_text: str = None, detailed_text: str = None):
|
|
15
|
+
msg_box = QMessageBox()
|
|
16
|
+
|
|
17
|
+
msg_box.setWindowTitle("Warning")
|
|
18
|
+
msg_box.setIcon(QMessageBox.Warning)
|
|
19
|
+
msg_box.setText(description)
|
|
20
|
+
if info_text is not None:
|
|
21
|
+
msg_box.setInformativeText(info_text)
|
|
22
|
+
if detailed_text is not None:
|
|
23
|
+
msg_box.setDetailedText(detailed_text)
|
|
24
|
+
msg_box.setStandardButtons(QMessageBox.Ok)
|
|
25
|
+
msg_box.exec_()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def show_info_message(description: str, info_text: str = None, detailed_text: str = None):
|
|
29
|
+
msg_box = QMessageBox()
|
|
30
|
+
|
|
31
|
+
msg_box.setWindowTitle("Warning")
|
|
32
|
+
msg_box.setIcon(QMessageBox.Information)
|
|
33
|
+
msg_box.setText(description)
|
|
34
|
+
if info_text is not None:
|
|
35
|
+
msg_box.setInformativeText(info_text)
|
|
36
|
+
if detailed_text is not None:
|
|
37
|
+
msg_box.setDetailedText(detailed_text)
|
|
38
|
+
msg_box.setStandardButtons(QMessageBox.Ok)
|
|
39
|
+
msg_box.exec_()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class VLine(QFrame):
|
|
43
|
+
"""Presents a simple Vertical Bar that can be used in e.g. the status bar."""
|
|
44
|
+
|
|
45
|
+
def __init__(self):
|
|
46
|
+
super().__init__()
|
|
47
|
+
self.setFrameShape(self.VLine | self.Sunken)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class QHLine(QFrame):
|
|
51
|
+
"""Presents a simple Horizontal Bar that can be used in e.g. the status bar."""
|
|
52
|
+
|
|
53
|
+
def __init__(self):
|
|
54
|
+
super(QHLine, self). __init__()
|
|
55
|
+
self.setFrameShape(QFrame.HLine)
|
|
56
|
+
self.setFrameShadow(QFrame.Sunken)
|
egse/gui/buttons.py
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from typing import Union
|
|
5
|
+
|
|
6
|
+
from PyQt5.QtCore import QPoint
|
|
7
|
+
from PyQt5.QtCore import Qt
|
|
8
|
+
from PyQt5.QtGui import QPainter
|
|
9
|
+
from PyQt5.QtSvg import QSvgRenderer
|
|
10
|
+
from PyQt5.QtWidgets import QApplication
|
|
11
|
+
from PyQt5.QtWidgets import QCheckBox
|
|
12
|
+
from PyQt5.QtWidgets import QPushButton
|
|
13
|
+
from PyQt5.QtWidgets import QToolButton
|
|
14
|
+
from PyQt5.QtWidgets import QWidget
|
|
15
|
+
|
|
16
|
+
from egse.resource import get_resource
|
|
17
|
+
|
|
18
|
+
BUTTON_DISABLED = 0
|
|
19
|
+
BUTTON_SELECTED = 1
|
|
20
|
+
BUTTON_NOT_SELECTED = 2
|
|
21
|
+
BUTTON_NO_CHANGE = 3
|
|
22
|
+
BUTTON_ACTIONED = 4
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Use the ToolTouchButton when you do not have a QToolBar to manage your buttons,
|
|
26
|
+
# but you have them in a QVBoxLayout or QHBoxLayout. The other TouchButton will not
|
|
27
|
+
# properly work if not used in a QToolBar, i.e. the icons will not have the proper size.
|
|
28
|
+
|
|
29
|
+
class ToolTouchButton(QToolButton):
|
|
30
|
+
def __init__(
|
|
31
|
+
self,
|
|
32
|
+
width: int = 32,
|
|
33
|
+
height: int = 32,
|
|
34
|
+
name: str = None,
|
|
35
|
+
status_tip: str = None,
|
|
36
|
+
selected: Union[str, Path] = None,
|
|
37
|
+
disabled: Union[str, Path] = None,
|
|
38
|
+
parent: Optional[QWidget] = None
|
|
39
|
+
):
|
|
40
|
+
super().__init__(parent=parent)
|
|
41
|
+
|
|
42
|
+
self.setFixedSize(width, height)
|
|
43
|
+
self.setCursor(Qt.PointingHandCursor)
|
|
44
|
+
self.setText(name)
|
|
45
|
+
self.setStatusTip(status_tip)
|
|
46
|
+
|
|
47
|
+
self.status_tip = status_tip
|
|
48
|
+
|
|
49
|
+
self.button_selected = selected
|
|
50
|
+
self.button_disabled = disabled
|
|
51
|
+
|
|
52
|
+
self.resource = {
|
|
53
|
+
BUTTON_DISABLED: self.button_disabled,
|
|
54
|
+
BUTTON_SELECTED: self.button_selected,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
self.state = BUTTON_SELECTED
|
|
58
|
+
self.disabled = False
|
|
59
|
+
|
|
60
|
+
self.clicked.connect(self.handle_clicked)
|
|
61
|
+
|
|
62
|
+
def handle_clicked(self):
|
|
63
|
+
self.repaint()
|
|
64
|
+
|
|
65
|
+
def print_clicked(self, *args, **kwargs):
|
|
66
|
+
print(f"clicked: {args=}, {kwargs=}")
|
|
67
|
+
print(f" {self.text()=}")
|
|
68
|
+
self.repaint()
|
|
69
|
+
|
|
70
|
+
def print_pressed(self, *args, **kwargs):
|
|
71
|
+
print(f"pressed: {args=}, {kwargs=}")
|
|
72
|
+
|
|
73
|
+
def print_released(self, *args, **kwargs):
|
|
74
|
+
print(f"released: {args=}, {kwargs=}")
|
|
75
|
+
|
|
76
|
+
def setDisabled(self, flag: bool = True):
|
|
77
|
+
self.disabled = flag
|
|
78
|
+
super().setDisabled(flag)
|
|
79
|
+
self.setStatusTip(f"{self.status_tip or ''} {'[DISABLED]' if flag else ''}")
|
|
80
|
+
|
|
81
|
+
def disable(self):
|
|
82
|
+
self.setDisabled(True)
|
|
83
|
+
|
|
84
|
+
def enable(self):
|
|
85
|
+
self.setDisabled(False)
|
|
86
|
+
|
|
87
|
+
def hitButton(self, pos: QPoint):
|
|
88
|
+
return self.contentsRect().contains(pos)
|
|
89
|
+
|
|
90
|
+
def paintEvent(self, *args, **kwargs):
|
|
91
|
+
|
|
92
|
+
painter = QPainter(self)
|
|
93
|
+
painter.setRenderHint(QPainter.Antialiasing)
|
|
94
|
+
painter.setPen(Qt.NoPen)
|
|
95
|
+
|
|
96
|
+
self.drawCustomWidget(painter)
|
|
97
|
+
|
|
98
|
+
painter.end()
|
|
99
|
+
|
|
100
|
+
def drawCustomWidget(self, painter):
|
|
101
|
+
renderer = QSvgRenderer()
|
|
102
|
+
resource = self.resource[self.state if not self.disabled else BUTTON_DISABLED]
|
|
103
|
+
renderer.load(str(resource))
|
|
104
|
+
renderer.render(painter)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class TouchButton(QPushButton):
|
|
108
|
+
def __init__(
|
|
109
|
+
self,
|
|
110
|
+
width: int = 32,
|
|
111
|
+
height: int = 32,
|
|
112
|
+
name: str = None,
|
|
113
|
+
status_tip: str = None,
|
|
114
|
+
selected: Union[str, Path] = None,
|
|
115
|
+
disabled: Union[str, Path] = None,
|
|
116
|
+
parent: Optional[QWidget] = None
|
|
117
|
+
):
|
|
118
|
+
super().__init__(parent=parent)
|
|
119
|
+
|
|
120
|
+
self.setFixedSize(width, height)
|
|
121
|
+
self.setCursor(Qt.PointingHandCursor)
|
|
122
|
+
self.setText(name)
|
|
123
|
+
self.setStatusTip(status_tip)
|
|
124
|
+
|
|
125
|
+
self.status_tip = status_tip
|
|
126
|
+
|
|
127
|
+
self.button_selected = selected
|
|
128
|
+
self.button_disabled = disabled
|
|
129
|
+
|
|
130
|
+
self.resource = {
|
|
131
|
+
BUTTON_DISABLED: self.button_disabled,
|
|
132
|
+
BUTTON_SELECTED: self.button_selected,
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
self.state = BUTTON_SELECTED
|
|
136
|
+
self.disabled = False
|
|
137
|
+
|
|
138
|
+
self.clicked.connect(self.handle_clicked)
|
|
139
|
+
|
|
140
|
+
def handle_clicked(self):
|
|
141
|
+
self.repaint()
|
|
142
|
+
|
|
143
|
+
def print_clicked(self, *args, **kwargs):
|
|
144
|
+
print(f"clicked: {args=}, {kwargs=}")
|
|
145
|
+
print(f" {self.text()=}")
|
|
146
|
+
self.repaint()
|
|
147
|
+
|
|
148
|
+
def print_pressed(self, *args, **kwargs):
|
|
149
|
+
print(f"pressed: {args=}, {kwargs=}")
|
|
150
|
+
|
|
151
|
+
def print_released(self, *args, **kwargs):
|
|
152
|
+
print(f"released: {args=}, {kwargs=}")
|
|
153
|
+
|
|
154
|
+
def setDisabled(self, flag: bool = True):
|
|
155
|
+
self.disabled = flag
|
|
156
|
+
super().setDisabled(flag)
|
|
157
|
+
self.setStatusTip(f"{self.status_tip or ''} {'[DISABLED]' if flag else ''}")
|
|
158
|
+
|
|
159
|
+
def disable(self):
|
|
160
|
+
self.setDisabled(True)
|
|
161
|
+
|
|
162
|
+
def enable(self):
|
|
163
|
+
self.setDisabled(False)
|
|
164
|
+
|
|
165
|
+
def hitButton(self, pos: QPoint):
|
|
166
|
+
return self.contentsRect().contains(pos)
|
|
167
|
+
|
|
168
|
+
def paintEvent(self, *args, **kwargs):
|
|
169
|
+
|
|
170
|
+
painter = QPainter(self)
|
|
171
|
+
painter.setRenderHint(QPainter.Antialiasing)
|
|
172
|
+
painter.setPen(Qt.NoPen)
|
|
173
|
+
|
|
174
|
+
self.drawCustomWidget(painter)
|
|
175
|
+
|
|
176
|
+
painter.end()
|
|
177
|
+
|
|
178
|
+
def drawCustomWidget(self, painter):
|
|
179
|
+
renderer = QSvgRenderer()
|
|
180
|
+
resource = self.resource[self.state if not self.disabled else BUTTON_DISABLED]
|
|
181
|
+
renderer.load(str(resource))
|
|
182
|
+
renderer.render(painter)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class ToggleButton(QCheckBox):
|
|
186
|
+
def __init__(
|
|
187
|
+
self,
|
|
188
|
+
width: int = 32,
|
|
189
|
+
height: int = 32,
|
|
190
|
+
name: str = None,
|
|
191
|
+
status_tip: str = None,
|
|
192
|
+
selected: Union[str, Path] = None,
|
|
193
|
+
not_selected: Union[str, Path] = None,
|
|
194
|
+
no_change: Union[str, Path] = None,
|
|
195
|
+
disabled: Union[str, Path, list] = None,
|
|
196
|
+
tristate: bool = False,
|
|
197
|
+
parent: Optional[QWidget] = None
|
|
198
|
+
):
|
|
199
|
+
super().__init__(parent=parent)
|
|
200
|
+
|
|
201
|
+
self.setFixedSize(width, height)
|
|
202
|
+
self.setCursor(Qt.PointingHandCursor)
|
|
203
|
+
self.setTristate(tristate)
|
|
204
|
+
self.setText(name)
|
|
205
|
+
self.setStatusTip(status_tip)
|
|
206
|
+
|
|
207
|
+
self.status_tip = status_tip
|
|
208
|
+
|
|
209
|
+
self.max_states = 3 if tristate else 2
|
|
210
|
+
|
|
211
|
+
self.button_selected = selected
|
|
212
|
+
self.button_not_selected = not_selected
|
|
213
|
+
self.no_change = no_change
|
|
214
|
+
if isinstance(disabled, list):
|
|
215
|
+
# this assumed we do not change the states definition anymore!
|
|
216
|
+
self.button_disabled = [0, *disabled]
|
|
217
|
+
else:
|
|
218
|
+
self.button_disabled = [0, disabled, disabled, disabled]
|
|
219
|
+
|
|
220
|
+
self.resource = {
|
|
221
|
+
BUTTON_DISABLED: self.button_disabled,
|
|
222
|
+
BUTTON_SELECTED: self.button_selected,
|
|
223
|
+
BUTTON_NOT_SELECTED: self.button_not_selected,
|
|
224
|
+
BUTTON_NO_CHANGE: self.no_change,
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
self.state = BUTTON_SELECTED
|
|
228
|
+
self.disabled = False
|
|
229
|
+
|
|
230
|
+
self.clicked.connect(self.handle_clicked)
|
|
231
|
+
|
|
232
|
+
def __str__(self):
|
|
233
|
+
return f"ToggleButton: name={self.text()}, tristate={self.isTristate()}, selected={self.is_selected()}"
|
|
234
|
+
|
|
235
|
+
def handle_clicked(self):
|
|
236
|
+
self.state = 1 if self.state == self.max_states else self.state + 1
|
|
237
|
+
self.repaint()
|
|
238
|
+
|
|
239
|
+
def setDisabled(self, flag: bool = True):
|
|
240
|
+
self.disabled = flag
|
|
241
|
+
super().setDisabled(flag)
|
|
242
|
+
self.setStatusTip(f"{self.status_tip or ''} {'[DISABLED]' if flag else ''}")
|
|
243
|
+
|
|
244
|
+
def disable(self):
|
|
245
|
+
self.setDisabled(True)
|
|
246
|
+
|
|
247
|
+
def enable(self):
|
|
248
|
+
self.setDisabled(False)
|
|
249
|
+
|
|
250
|
+
def is_selected(self):
|
|
251
|
+
return self.state == BUTTON_SELECTED
|
|
252
|
+
|
|
253
|
+
def set_selected(self, on: bool = True):
|
|
254
|
+
self.state = BUTTON_SELECTED if on else BUTTON_NOT_SELECTED
|
|
255
|
+
self.repaint()
|
|
256
|
+
|
|
257
|
+
def hitButton(self, pos: QPoint):
|
|
258
|
+
return self.contentsRect().contains(pos)
|
|
259
|
+
|
|
260
|
+
def paintEvent(self, *args, **kwargs):
|
|
261
|
+
|
|
262
|
+
painter = QPainter(self)
|
|
263
|
+
painter.setRenderHint(QPainter.Antialiasing)
|
|
264
|
+
painter.setPen(Qt.NoPen)
|
|
265
|
+
|
|
266
|
+
self.drawCustomWidget(painter)
|
|
267
|
+
painter.end()
|
|
268
|
+
|
|
269
|
+
def drawCustomWidget(self, painter):
|
|
270
|
+
renderer = QSvgRenderer()
|
|
271
|
+
if not self.disabled:
|
|
272
|
+
resource = self.resource[self.state]
|
|
273
|
+
else:
|
|
274
|
+
resource = self.resource[BUTTON_DISABLED][self.state]
|
|
275
|
+
renderer.load(str(resource))
|
|
276
|
+
renderer.render(painter)
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
if __name__ == "__main__":
|
|
280
|
+
|
|
281
|
+
from PyQt5.QtWidgets import QMainWindow
|
|
282
|
+
from PyQt5.QtWidgets import QFrame
|
|
283
|
+
from PyQt5.QtWidgets import QVBoxLayout
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
class MainWindow(QMainWindow):
|
|
287
|
+
def __init__(self):
|
|
288
|
+
super().__init__()
|
|
289
|
+
self.resize(200, 200)
|
|
290
|
+
|
|
291
|
+
self.container = QFrame()
|
|
292
|
+
self.container.setObjectName("Container")
|
|
293
|
+
self.layout = QVBoxLayout()
|
|
294
|
+
|
|
295
|
+
# button_selected = get_resource(":/icons/cs-connected.svg")
|
|
296
|
+
# button_not_selected = get_resource(":/icons/cs-not-connected.svg")
|
|
297
|
+
# button_no_change = get_resource(":/icons/cs-connected-alert.svg")
|
|
298
|
+
# button_disabled = get_resource(":/icons/cs-connected-disabled.svg")
|
|
299
|
+
|
|
300
|
+
button_selected = get_resource(":/icons/start-button.svg")
|
|
301
|
+
button_not_selected = get_resource(":/icons/stop-button.svg")
|
|
302
|
+
button_no_change = get_resource(":/icons/plugged.svg")
|
|
303
|
+
button_disabled = [
|
|
304
|
+
get_resource(":/icons/start-button-disabled.svg"),
|
|
305
|
+
get_resource(":/icons/stop-button-disabled.svg"),
|
|
306
|
+
get_resource(":/icons/plugged-disabled.svg"),
|
|
307
|
+
]
|
|
308
|
+
|
|
309
|
+
self.toggle = ToggleButton(
|
|
310
|
+
name="CS-CONNECT",
|
|
311
|
+
status_tip="connect-disconnect hexapod control server",
|
|
312
|
+
selected=button_selected,
|
|
313
|
+
not_selected=button_not_selected,
|
|
314
|
+
no_change=button_no_change,
|
|
315
|
+
disabled=button_disabled,
|
|
316
|
+
tristate=True,
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
self.touch = TouchButton(
|
|
320
|
+
name="HOME",
|
|
321
|
+
status_tip="Perform a homing operation",
|
|
322
|
+
selected=get_resource(":/icons/home.svg"),
|
|
323
|
+
disabled=get_resource(":/icons/home-disabled.svg"),
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
self.layout.addWidget(self.toggle, Qt.AlignCenter, Qt.AlignCenter)
|
|
327
|
+
self.layout.addWidget(self.touch, Qt.AlignCenter, Qt.AlignCenter)
|
|
328
|
+
self.layout.addWidget(pb := QPushButton("disable"))
|
|
329
|
+
self.container.setLayout(self.layout)
|
|
330
|
+
self.setCentralWidget(self.container)
|
|
331
|
+
|
|
332
|
+
self.pb = pb
|
|
333
|
+
self.pb.setCheckable(True)
|
|
334
|
+
self.pb.clicked.connect(self.toggle_disable)
|
|
335
|
+
|
|
336
|
+
self.toggle.clicked.connect(self.print_clicked)
|
|
337
|
+
self.touch.clicked.connect(self.print_clicked)
|
|
338
|
+
|
|
339
|
+
# Use the following for further debugging
|
|
340
|
+
|
|
341
|
+
# self.toggle.stateChanged.connect(self.print_state_changed)
|
|
342
|
+
# self.toggle.pressed.connect(self.print_pressed)
|
|
343
|
+
# self.toggle.released.connect(self.print_released)
|
|
344
|
+
|
|
345
|
+
# self.touch.pressed.connect(self.print_pressed)
|
|
346
|
+
# self.touch.released.connect(self.print_released)
|
|
347
|
+
|
|
348
|
+
self.statusBar()
|
|
349
|
+
|
|
350
|
+
def toggle_disable(self, checked: bool):
|
|
351
|
+
self.toggle.disable() if checked else self.toggle.enable()
|
|
352
|
+
self.touch.disable() if checked else self.touch.enable()
|
|
353
|
+
self.pb.setText("enable" if checked else "disable")
|
|
354
|
+
|
|
355
|
+
def print_state_changed(self, *args, **kwargs):
|
|
356
|
+
sender = self.sender()
|
|
357
|
+
print(f"stateChanged: {args=}, {kwargs=}")
|
|
358
|
+
print(f" {sender.isChecked()=} {sender.checkState()=}")
|
|
359
|
+
|
|
360
|
+
def print_clicked(self, *args, **kwargs):
|
|
361
|
+
sender = self.sender()
|
|
362
|
+
print(f"clicked: {args=}, {kwargs=}")
|
|
363
|
+
print(f" {sender.state=}")
|
|
364
|
+
print(f" {sender.text()=}")
|
|
365
|
+
|
|
366
|
+
def print_pressed(self, *args, **kwargs):
|
|
367
|
+
print(f"pressed: {args=}, {kwargs=}")
|
|
368
|
+
|
|
369
|
+
def print_released(self, *args, **kwargs):
|
|
370
|
+
print(f"released: {args=}, {kwargs=}")
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
app = QApplication(sys.argv)
|
|
375
|
+
window = MainWindow()
|
|
376
|
+
window.show()
|
|
377
|
+
|
|
378
|
+
sys.exit(app.exec_())
|