Skip to content

Commit 160c55c

Browse files
committed
qtvcp -panels: add versa probe as a separate panel
1 parent cc1b1f0 commit 160c55c

2 files changed

Lines changed: 172 additions & 0 deletions

File tree

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>MainWindow</class>
4+
<widget class="QMainWindow" name="MainWindow">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>688</width>
10+
<height>534</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>MainWindow</string>
15+
</property>
16+
<widget class="QWidget" name="centralwidget">
17+
<layout class="QVBoxLayout" name="verticalLayout">
18+
<property name="spacing">
19+
<number>4</number>
20+
</property>
21+
<property name="leftMargin">
22+
<number>4</number>
23+
</property>
24+
<property name="topMargin">
25+
<number>4</number>
26+
</property>
27+
<property name="rightMargin">
28+
<number>4</number>
29+
</property>
30+
<property name="bottomMargin">
31+
<number>4</number>
32+
</property>
33+
<item>
34+
<widget class="ScreenOptions" name="screen_options">
35+
<property name="notify_option" stdset="0">
36+
<bool>false</bool>
37+
</property>
38+
<property name="catch_close_option" stdset="0">
39+
<bool>true</bool>
40+
</property>
41+
<property name="catch_errors_option" stdset="0">
42+
<bool>false</bool>
43+
</property>
44+
<property name="play_sounds_option" stdset="0">
45+
<bool>false</bool>
46+
</property>
47+
<property name="pref_filename_string" stdset="0">
48+
<string>~/.qtvcp_versaprobe_preferences</string>
49+
</property>
50+
<property name="embedded_program_option" stdset="0">
51+
<bool>false</bool>
52+
</property>
53+
<property name="closeDialog_option" stdset="0">
54+
<bool>false</bool>
55+
</property>
56+
<property name="calculatorDialog_option" stdset="0">
57+
<bool>true</bool>
58+
</property>
59+
<layout class="QVBoxLayout" name="verticalLayout_2">
60+
<item>
61+
<widget class="VersaProbe" name="versaprobe"/>
62+
</item>
63+
</layout>
64+
</widget>
65+
</item>
66+
</layout>
67+
</widget>
68+
<widget class="QMenuBar" name="menubar">
69+
<property name="geometry">
70+
<rect>
71+
<x>0</x>
72+
<y>0</y>
73+
<width>688</width>
74+
<height>24</height>
75+
</rect>
76+
</property>
77+
</widget>
78+
</widget>
79+
<customwidgets>
80+
<customwidget>
81+
<class>ScreenOptions</class>
82+
<extends>QWidget</extends>
83+
<header>qtvcp.widgets.screen_options</header>
84+
<container>1</container>
85+
</customwidget>
86+
<customwidget>
87+
<class>VersaProbe</class>
88+
<extends>QWidget</extends>
89+
<header>qtvcp.widgets.versa_probe</header>
90+
</customwidget>
91+
</customwidgets>
92+
<resources/>
93+
<connections/>
94+
</ui>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
############################
2+
# **** IMPORT SECTION **** #
3+
############################
4+
from qtvcp.core import Status, Action
5+
6+
# Set up logging
7+
from qtvcp import logger
8+
9+
###########################################
10+
# **** instantiate libraries section **** #
11+
###########################################
12+
13+
STATUS = Status()
14+
ACTION = Action()
15+
LOG = logger.getLogger(__name__)
16+
# Set the log level for this module
17+
#LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL
18+
19+
###################################
20+
# **** HANDLER CLASS SECTION **** #
21+
###################################
22+
23+
class HandlerClass:
24+
25+
########################
26+
# **** INITIALIZE **** #
27+
########################
28+
# widgets allows access to widgets from the qtvcp files
29+
# at this point the widgets and hal pins are not instantiated
30+
def __init__(self, halcomp,widgets,paths):
31+
self.hal = halcomp
32+
self.w = widgets
33+
self.PATHS = paths
34+
##########################################
35+
# Special Functions called from QTVCP
36+
##########################################
37+
38+
# at this point:
39+
# the widgets are instantiated.
40+
# the HAL pins are built but HAL is not set ready
41+
def initialized__(self):
42+
pass
43+
44+
########################
45+
# callbacks from STATUS #
46+
########################
47+
48+
#######################
49+
# callbacks from form #
50+
#######################
51+
52+
#####################
53+
# general functions #
54+
#####################
55+
56+
#####################
57+
# KEY BINDING CALLS #
58+
#####################
59+
60+
###########################
61+
# **** closing event **** #
62+
###########################
63+
64+
##############################
65+
# required class boiler code #
66+
##############################
67+
68+
def __getitem__(self, item):
69+
return getattr(self, item)
70+
def __setitem__(self, item, value):
71+
return setattr(self, item, value)
72+
73+
################################
74+
# required handler boiler code #
75+
################################
76+
77+
def get_handlers(halcomp,widgets,paths):
78+
return [HandlerClass(halcomp,widgets,paths)]

0 commit comments

Comments
 (0)