-
Notifications
You must be signed in to change notification settings - Fork 0
/
wxgui.py
199 lines (176 loc) · 8.95 KB
/
wxgui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#!/usr/bin/env python
# -*- coding: CP1252 -*-
#
# generated by wxGlade 0.6.8 (standalone edition) on Thu Jul 23 13:44:02 2015
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0)
self.notebook_1_pane_1 = wx.Panel(self.notebook_1, wx.ID_ANY)
self.checkbox_sim = wx.CheckBox(self.notebook_1_pane_1, wx.ID_ANY, "Simulator Mode")
self.spin_ctrl_port = wx.SpinCtrl(self.notebook_1_pane_1, wx.ID_ANY, "4", min=1, max=100)
self.label_1 = wx.StaticText(self.notebook_1_pane_1, wx.ID_ANY, "COMPORT")
self.spin_ctrl_bias = wx.SpinCtrl(self.notebook_1_pane_1, wx.ID_ANY, "1", min=-8000, max=8000)
self.label_bias = wx.StaticText(self.notebook_1_pane_1, wx.ID_ANY, "BIAS")
self.button_start = wx.Button(self.notebook_1_pane_1, wx.ID_ANY, "Start")
self.button_pause = wx.Button(self.notebook_1_pane_1, wx.ID_ANY, "Pause")
self.button_close = wx.Button(self.notebook_1_pane_1, wx.ID_ANY, "Close")
self.text_ctrl_bias = wx.TextCtrl(self.notebook_1_pane_1, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.text_ctrl_current = wx.TextCtrl(self.notebook_1_pane_1, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.label_5 = wx.StaticText(self.notebook_1_pane_1, wx.ID_ANY, "BIAS Value")
self.label_6 = wx.StaticText(self.notebook_1_pane_1, wx.ID_ANY, "Current Value")
self.panel_1 = wx.Panel(self.notebook_1_pane_1, wx.ID_ANY, style=wx.DOUBLE_BORDER | wx.TAB_TRAVERSAL)
self.notebook_1_pane_2 = wx.Panel(self.notebook_1, wx.ID_ANY)
self.checkbox_sim_v2 = wx.CheckBox(self.notebook_1_pane_2, wx.ID_ANY, "Simulator Mode")
self.spin_ctrl_port_v2 = wx.SpinCtrl(self.notebook_1_pane_2, wx.ID_ANY, "4", min=1, max=100)
self.COMPORT = wx.StaticText(self.notebook_1_pane_2, wx.ID_ANY, "COMPORT")
self.button_start_v2 = wx.Button(self.notebook_1_pane_2, wx.ID_ANY, "Start")
self.button_close_v2 = wx.Button(self.notebook_1_pane_2, wx.ID_ANY, "Close")
self.text_ctrl_bias_v2 = wx.TextCtrl(self.notebook_1_pane_2, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.text_ctrl_current_v2 = wx.TextCtrl(self.notebook_1_pane_2, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.label_3 = wx.StaticText(self.notebook_1_pane_2, wx.ID_ANY, "BIAS Value")
self.label_4 = wx.StaticText(self.notebook_1_pane_2, wx.ID_ANY, "Current Value")
self.panel_graph_v2 = wx.Panel(self.notebook_1_pane_2, wx.ID_ANY, style=wx.SIMPLE_BORDER | wx.TAB_TRAVERSAL)
self.text_ctrl_eta_v2 = wx.TextCtrl(self.notebook_1_pane_2, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_CHECKBOX, self.On_Sim, self.checkbox_sim)
self.Bind(wx.EVT_SPINCTRL, self.On_Port, self.spin_ctrl_port)
self.Bind(wx.EVT_SPINCTRL, self.On_bias, self.spin_ctrl_bias)
self.Bind(wx.EVT_BUTTON, self.On_Start, self.button_start)
self.Bind(wx.EVT_BUTTON, self.On_Pause, self.button_pause)
self.Bind(wx.EVT_BUTTON, self.On_Close, self.button_close)
self.Bind(wx.EVT_CHECKBOX, self.On_sim_v2, self.checkbox_sim_v2)
self.Bind(wx.EVT_SPINCTRL, self.On_port_v2, self.spin_ctrl_port_v2)
self.Bind(wx.EVT_BUTTON, self.On_start_v2, self.button_start_v2)
self.Bind(wx.EVT_BUTTON, self.On_Close_v2, self.button_close_v2)
self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.On_Changed, self.notebook_1)
# end wxGlade
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("frame_1")
self.SetSize((584, 646))
self.panel_1.SetMinSize((400, 400))
self.panel_graph_v2.SetMinSize((320, 400))
self.text_ctrl_eta_v2.SetMinSize((225, 471))
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_6 = wx.BoxSizer(wx.VERTICAL)
sizer_11 = wx.BoxSizer(wx.HORIZONTAL)
sizer_15 = wx.BoxSizer(wx.HORIZONTAL)
sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
sizer_7 = wx.BoxSizer(wx.HORIZONTAL)
sizer_9 = wx.BoxSizer(wx.HORIZONTAL)
sizer_2 = wx.BoxSizer(wx.VERTICAL)
sizer_16 = wx.BoxSizer(wx.HORIZONTAL)
sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
sizer_10 = wx.BoxSizer(wx.HORIZONTAL)
sizer_12 = wx.BoxSizer(wx.VERTICAL)
sizer_13 = wx.BoxSizer(wx.VERTICAL)
sizer_14 = wx.BoxSizer(wx.HORIZONTAL)
sizer_14.Add(self.checkbox_sim, 0, 0, 0)
sizer_13.Add(sizer_14, 0, wx.EXPAND, 0)
sizer_12.Add(sizer_13, 0, wx.EXPAND, 0)
sizer_2.Add(sizer_12, 0, wx.EXPAND, 0)
sizer_10.Add(self.spin_ctrl_port, 0, 0, 0)
sizer_10.Add(self.label_1, 0, 0, 0)
sizer_2.Add(sizer_10, 0, wx.EXPAND, 0)
sizer_3.Add(self.spin_ctrl_bias, 0, 0, 0)
sizer_3.Add(self.label_bias, 0, 0, 0)
sizer_2.Add(sizer_3, 0, wx.EXPAND, 0)
sizer_4.Add(self.button_start, 0, 0, 0)
sizer_4.Add(self.button_pause, 0, 0, 0)
sizer_4.Add(self.button_close, 0, 0, 0)
sizer_2.Add(sizer_4, 0, wx.EXPAND, 0)
sizer_5.Add(self.text_ctrl_bias, 0, 0, 0)
sizer_5.Add((20, 20), 0, 0, 0)
sizer_5.Add(self.text_ctrl_current, 0, 0, 0)
sizer_2.Add(sizer_5, 0, wx.EXPAND, 0)
sizer_16.Add(self.label_5, 0, 0, 0)
sizer_16.Add((83, 16), 0, 0, 0)
sizer_16.Add(self.label_6, 0, 0, 0)
sizer_2.Add(sizer_16, 0, wx.EXPAND, 0)
sizer_2.Add(self.panel_1, 0, wx.ALL, 0)
self.notebook_1_pane_1.SetSizer(sizer_2)
sizer_6.Add(self.checkbox_sim_v2, 0, 0, 0)
sizer_9.Add(self.spin_ctrl_port_v2, 0, 0, 0)
sizer_9.Add(self.COMPORT, 0, 0, 0)
sizer_6.Add(sizer_9, 0, wx.EXPAND, 0)
sizer_7.Add(self.button_start_v2, 0, 0, 0)
sizer_7.Add(self.button_close_v2, 0, 0, 0)
sizer_6.Add(sizer_7, 0, wx.EXPAND, 0)
sizer_8.Add(self.text_ctrl_bias_v2, 0, 0, 0)
sizer_8.Add((23, 20), 0, 0, 0)
sizer_8.Add(self.text_ctrl_current_v2, 0, 0, 0)
sizer_6.Add(sizer_8, 0, wx.EXPAND, 0)
sizer_15.Add(self.label_3, 0, 0, 0)
sizer_15.Add((86, 17), 0, 0, 0)
sizer_15.Add(self.label_4, 0, 0, 0)
sizer_6.Add(sizer_15, 0, wx.EXPAND, 0)
sizer_11.Add(self.panel_graph_v2, 0, wx.ALL | wx.EXPAND, 0)
sizer_11.Add(self.text_ctrl_eta_v2, 0, wx.EXPAND, 0)
sizer_6.Add(sizer_11, 1, wx.EXPAND, 0)
self.notebook_1_pane_2.SetSizer(sizer_6)
self.notebook_1.AddPage(self.notebook_1_pane_1, "Constant Voltage")
self.notebook_1.AddPage(self.notebook_1_pane_2, "Waveform Program")
sizer_1.Add(self.notebook_1, 1, wx.EXPAND, 0)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
def On_Sim(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_Sim' not implemented!"
event.Skip()
def On_Port(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_Port' not implemented!"
event.Skip()
def On_bias(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_bias' not implemented!"
event.Skip()
def On_Start(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_Start' not implemented!"
event.Skip()
def On_Pause(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_Pause' not implemented!"
event.Skip()
def On_Close(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_Close' not implemented!"
event.Skip()
def On_sim_v2(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_sim_v2' not implemented!"
event.Skip()
def On_port_v2(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_port_v2' not implemented!"
event.Skip()
def On_start_v2(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_start_v2' not implemented!"
event.Skip()
def On_Close_v2(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_Close_v2' not implemented!"
event.Skip()
def On_Changed(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler 'On_Changed' not implemented!"
event.Skip()
# end of class MyFrame
class MyApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
frame_1 = MyFrame(None, wx.ID_ANY, "")
self.SetTopWindow(frame_1)
frame_1.Show()
return 1
# end of class MyApp
if __name__ == "__main__":
app = MyApp(0)
app.MainLoop()