Rev 586 | Rev 590 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 586 | Rev 587 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | # begin wxGlade: extracode |
28 | # begin wxGlade: extracode |
29 | # end wxGlade |
29 | # end wxGlade |
Line -... | Line 30... | ||
- | 30 | ||
- | 31 | ||
- | 32 | ||
- | 33 | class MenuBar(wx.MenuBar): |
|
- | 34 | def __init__(self, *args, **kwds): |
|
- | 35 | # content of this block not found: did you rename this class? |
|
- | 36 | pass |
|
- | 37 | ||
- | 38 | def __set_properties(self): |
|
- | 39 | # content of this block not found: did you rename this class? |
|
- | 40 | pass |
|
- | 41 | ||
- | 42 | def __do_layout(self): |
|
- | 43 | # content of this block not found: did you rename this class? |
|
- | 44 | pass |
|
- | 45 | ||
30 | 46 | # end of class MenuBar |
|
31 | 47 | ||
32 | 48 | ||
33 | class wxFrame(wx.Panel): |
49 | class wxFrame(wx.Panel): |
Line 65... | Line 81... | ||
65 | class MainFrame(wx.Frame): |
81 | class MainFrame(wx.Frame): |
66 | def __init__(self, *args, **kwds): |
82 | def __init__(self, *args, **kwds): |
67 | # begin wxGlade: MainFrame.__init__ |
83 | # begin wxGlade: MainFrame.__init__ |
68 | kwds["style"] = wx.DEFAULT_FRAME_STYLE |
84 | kwds["style"] = wx.DEFAULT_FRAME_STYLE |
69 | wx.Frame.__init__(self, *args, **kwds) |
85 | wx.Frame.__init__(self, *args, **kwds) |
- | 86 | ||
- | 87 | # Menu Bar |
|
- | 88 | self.frame_1_menubar = wx.MenuBar() |
|
- | 89 | wxglade_tmp_menu = wx.Menu() |
|
- | 90 | wxglade_tmp_menu.Append(wx.NewId(), "Exit", "", wx.ITEM_NORMAL) |
|
- | 91 | self.frame_1_menubar.Append(wxglade_tmp_menu, "File") |
|
- | 92 | wxglade_tmp_menu = wx.Menu() |
|
- | 93 | wxglade_tmp_menu.Append(wx.NewId(), "Clear", "", wx.ITEM_NORMAL) |
|
- | 94 | wxglade_tmp_menu.Append(wx.NewId(), "Import", "", wx.ITEM_NORMAL) |
|
- | 95 | self.frame_1_menubar.Append(wxglade_tmp_menu, "TestSet") |
|
- | 96 | wxglade_tmp_menu = wx.Menu() |
|
- | 97 | self.frame_1_menubar.Append(wxglade_tmp_menu, "MK") |
|
- | 98 | wxglade_tmp_menu = wx.Menu() |
|
- | 99 | self.frame_1_menubar.Append(wxglade_tmp_menu, "Help") |
|
- | 100 | self.SetMenuBar(self.frame_1_menubar) |
|
- | 101 | # Menu Bar end |
|
70 | self.Port = wx.StaticText(self, -1, "Port") |
102 | self.Port = wx.StaticText(self, -1, "Port") |
71 | self.text_ctrl_1 = wx.TextCtrl(self, -1, "") |
103 | self.text_ctrl_1 = wx.TextCtrl(self, -1, "") |
72 | self.label_5 = wx.StaticText(self, -1, "label_5") |
104 | self.label_5 = wx.StaticText(self, -1, "label_5") |
73 | self.text_ctrl_5 = wx.TextCtrl(self, -1, "") |
105 | self.text_ctrl_5 = wx.TextCtrl(self, -1, "") |
74 | self.label_2 = wx.StaticText(self, -1, "Motor(s)") |
106 | self.label_2 = wx.StaticText(self, -1, "Motor(s)") |
Line 87... | Line 119... | ||
87 | self.GraphFanel = wx.Panel(self, -1) |
119 | self.GraphFanel = wx.Panel(self, -1) |
88 | self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER) |
120 | self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER) |
Line 89... | Line 121... | ||
89 | 121 | ||
90 | self.__set_properties() |
122 | self.__set_properties() |
- | 123 | self.__do_layout() |
|
- | 124 | ||
91 | self.__do_layout() |
125 | self.Bind(wx.EVT_MENU, self.OnImport, id=-1) |
Line 92... | Line -... | ||
92 | # end wxGlade |
- | |
- | 126 | # end wxGlade |
|
- | 127 | ||
Line 93... | Line 128... | ||
93 | 128 | def setApp(self, app): |
|
94 | 129 | self.app = app |
|
95 | 130 | ||
96 | def __set_properties(self): |
131 | def __set_properties(self): |
97 | # begin wxGlade: MainFrame.__set_properties |
132 | # begin wxGlade: MainFrame.__set_properties |
Line 98... | Line 133... | ||
98 | self.SetTitle("frame_1") |
133 | self.SetTitle("VibrationTest") |
99 | self.GraphFanel.SetMinSize((800,300)) |
134 | self.GraphFanel.SetMinSize((800,300)) |
Line 177... | Line 212... | ||
177 | #make a string to display |
212 | #make a string to display |
178 | s = "Crv# %i, '%s', Pt. (%.2f,%.2f), PtInd %i" %(cNum, legend, px, py, pntIn) |
213 | s = "Crv# %i, '%s', Pt. (%.2f,%.2f), PtInd %i" %(cNum, legend, px, py, pntIn) |
179 | dc.DrawText(s, sx , sy+1) |
214 | dc.DrawText(s, sx , sy+1) |
180 | # ----------- |
215 | # ----------- |
Line -... | Line 216... | ||
- | 216 | ||
- | 217 | def OnImport(self, event): # wxGlade: MainFrame.<event_handler> |
|
- | 218 | self.app.Import() |
|
181 | 219 | ||
Line 182... | Line 220... | ||
182 | # end of class MainFrame |
220 | # end of class MainFrame |
183 | 221 | ||
184 | 222 | ||
185 | class VibTest: |
223 | class VibTest: |
Line -... | Line 224... | ||
- | 224 | def __init__(self, name, rawData): |
|
186 | def __init__(self, name, rawData): |
225 | self.name = name |
187 | self.name = name |
226 | self.rawData = rawData |
188 | self.rawData = rawData |
- | |
189 | 227 | ||
Line 190... | Line 228... | ||
190 | class App(wx.App): |
228 | |
Line 203... | Line 241... | ||
203 | self.frame_1.TestListCtrl.SetStringItem(index, 1, "OK") |
241 | self.frame_1.TestListCtrl.SetStringItem(index, 1, "OK") |
Line 204... | Line 242... | ||
204 | 242 | ||
205 | def OnInit(self): |
243 | def OnInit(self): |
206 | wx.InitAllImageHandlers() |
244 | wx.InitAllImageHandlers() |
- | 245 | self.frame_1 = MainFrame(None, -1, "") |
|
207 | self.frame_1 = MainFrame(None, -1, "") |
246 | self.frame_1.setApp(self); |
Line 208... | Line -... | ||
208 | self.SetTopWindow(self.frame_1) |
- | |
209 | - | ||
210 | print "B" |
- | |
211 | - | ||
212 | self.AddTest("Test1", range(0,1000)) |
- | |
213 | self.AddTest("Test2", range(0,1000)) |
247 | self.SetTopWindow(self.frame_1) |
214 | 248 | ||
Line -... | Line 249... | ||
- | 249 | self.frame_1.Show() |
|
- | 250 | return 1 |
|
- | 251 | ||
- | 252 | def Import(self): |
|
- | 253 | print "Import" |
|
215 | self.frame_1.Show() |
254 | self.AddTest("Test1", range(0,1000)) |
Line 216... | Line 255... | ||
216 | return 1 |
255 | self.AddTest("Test2", range(0,1000)) |
217 | 256 | ||
218 | # end of class App |
257 | # end of class App |