Rev 585 | Rev 587 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 585 | Rev 586 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #!/usr/bin/env python |
1 | #!/usr/bin/env python |
2 | # -*- coding: iso-8859-15 -*- |
2 | # -*- coding: iso-8859-15 -*- |
3 | # generated by wxGlade 0.6.3 on Thu Sep 24 15:46:36 2009 |
3 | # generated by wxGlade 0.6.3 on Thu Sep 24 15:46:36 2009 |
Line -... | Line 4... | ||
- | 4 | ||
4 | 5 | import sys |
|
5 | import wx |
6 | import wx |
6 | import wx.lib |
7 | import wx.lib |
Line 7... | Line 8... | ||
7 | import wx.lib.plot |
8 | import wx.lib.plot |
Line 29... | Line 30... | ||
29 | 30 | ||
30 | 31 | ||
31 | 32 | ||
32 | class wxFrame(wx.Panel): |
- | |
33 | def __init__(self, *args, **kwds): |
- | |
34 | # begin wxGlade: wxFrame.__init__ |
- | |
35 | kwds["style"] = wx.TAB_TRAVERSAL |
- | |
36 | wx.Panel.__init__(self, *args, **kwds) |
- | |
37 | 33 | class wxFrame(wx.Panel): |
|
Line 38... | Line 34... | ||
38 | self.__set_properties() |
34 | def __init__(self, *args, **kwds): |
39 | self.__do_layout() |
35 | # content of this block not found: did you rename this class? |
40 | # end wxGlade |
36 | pass |
41 | - | ||
Line 42... | Line 37... | ||
42 | def __set_properties(self): |
37 | |
43 | # begin wxGlade: wxFrame.__set_properties |
38 | def __set_properties(self): |
44 | pass |
39 | # content of this block not found: did you rename this class? |
45 | # end wxGlade |
- | |
Line 46... | Line 40... | ||
46 | 40 | pass |
|
Line 47... | Line 41... | ||
47 | def __do_layout(self): |
41 | |
Line 89... | Line 83... | ||
89 | self.text_ctrl_4 = wx.TextCtrl(self, -1, "") |
83 | self.text_ctrl_4 = wx.TextCtrl(self, -1, "") |
90 | self.label_8 = wx.StaticText(self, -1, "label_8") |
84 | self.label_8 = wx.StaticText(self, -1, "label_8") |
91 | self.text_ctrl_8 = wx.TextCtrl(self, -1, "") |
85 | self.text_ctrl_8 = wx.TextCtrl(self, -1, "") |
92 | self.button_1 = wx.Button(self, -1, "button_1") |
86 | self.button_1 = wx.Button(self, -1, "button_1") |
93 | self.GraphFanel = wx.Panel(self, -1) |
87 | self.GraphFanel = wx.Panel(self, -1) |
94 | self.panel_1 = wxFrame(self, -1) |
88 | self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER) |
Line 95... | Line 89... | ||
95 | 89 | ||
96 | self.__set_properties() |
90 | self.__set_properties() |
97 | self.__do_layout() |
91 | self.__do_layout() |
Line 106... | Line 100... | ||
106 | # end wxGlade |
100 | # end wxGlade |
Line 107... | Line 101... | ||
107 | 101 | ||
108 | def __do_layout(self): |
102 | def __do_layout(self): |
109 | # begin wxGlade: MainFrame.__do_layout |
103 | # begin wxGlade: MainFrame.__do_layout |
- | 104 | sizer_1 = wx.BoxSizer(wx.VERTICAL) |
|
110 | sizer_1 = wx.BoxSizer(wx.VERTICAL) |
105 | grid_sizer_2 = wx.GridSizer(2, 1, 4, 4) |
111 | grid_sizer_1 = wx.GridSizer(5, 4, 4, 4) |
106 | grid_sizer_1 = wx.GridSizer(5, 4, 4, 4) |
112 | grid_sizer_1.Add(self.Port, 0, wx.ALIGN_RIGHT, 0) |
107 | grid_sizer_1.Add(self.Port, 0, wx.ALIGN_RIGHT, 0) |
113 | grid_sizer_1.Add(self.text_ctrl_1, 0, 0, 0) |
108 | grid_sizer_1.Add(self.text_ctrl_1, 0, 0, 0) |
114 | grid_sizer_1.Add(self.label_5, 0, wx.ALIGN_RIGHT, 0) |
109 | grid_sizer_1.Add(self.label_5, 0, wx.ALIGN_RIGHT, 0) |
Line 126... | Line 121... | ||
126 | grid_sizer_1.Add(self.label_8, 0, wx.ALIGN_RIGHT, 0) |
121 | grid_sizer_1.Add(self.label_8, 0, wx.ALIGN_RIGHT, 0) |
127 | grid_sizer_1.Add(self.text_ctrl_8, 0, 0, 0) |
122 | grid_sizer_1.Add(self.text_ctrl_8, 0, 0, 0) |
128 | grid_sizer_1.Add(self.button_1, 0, 0, 0) |
123 | grid_sizer_1.Add(self.button_1, 0, 0, 0) |
129 | sizer_1.Add(grid_sizer_1, 0, 0, 2) |
124 | sizer_1.Add(grid_sizer_1, 0, 0, 2) |
130 | sizer_1.Add(self.GraphFanel, 0, wx.EXPAND, 0) |
125 | sizer_1.Add(self.GraphFanel, 0, wx.EXPAND, 0) |
131 | sizer_1.Add(self.panel_1, 1, wx.ALL|wx.EXPAND, 0) |
126 | grid_sizer_2.Add(self.TestListCtrl, 1, wx.ALL|wx.EXPAND, 0) |
- | 127 | sizer_1.Add(grid_sizer_2, 1, wx.EXPAND, 0) |
|
132 | self.SetSizer(sizer_1) |
128 | self.SetSizer(sizer_1) |
133 | sizer_1.Fit(self) |
129 | sizer_1.Fit(self) |
134 | self.Layout() |
130 | self.Layout() |
135 | # end wxGlade |
131 | # end wxGlade |
Line 136... | Line -... | ||
136 | - | ||
- | 132 | ||
137 | 133 | # Configure Graph |
|
138 | self.client = wx.lib.plot.PlotCanvas(self.GraphFanel) |
- | |
139 | #define the function for drawing pointLabels |
134 | self.client = wx.lib.plot.PlotCanvas(self.GraphFanel) |
Line 140... | Line 135... | ||
140 | self.client.SetPointLabelFunc(self.DrawPointLabel) |
135 | self.client.SetPointLabelFunc(self.DrawPointLabel) |
141 | 136 | ||
142 | self.client.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL)) |
137 | self.client.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL)) |
Line 153... | Line 148... | ||
153 | pi = 3.1415 |
148 | pi = 3.1415 |
154 | markers2 = wx.lib.plot.PolyMarker([(0., 0.), (pi/4., 1.), (pi/2, 0.), |
149 | markers2 = wx.lib.plot.PolyMarker([(0., 0.), (pi/4., 1.), (pi/2, 0.), |
155 | (3.*pi/4., -1)], legend='Cross Legend', colour='blue', |
150 | (3.*pi/4., -1)], legend='Cross Legend', colour='blue', |
156 | marker='cross') |
151 | marker='cross') |
157 | self.client.Draw(wx.lib.plot.PlotGraphics([markers1,markers2],"Graph Title", "X Axis", "Y Axis")) |
152 | self.client.Draw(wx.lib.plot.PlotGraphics([markers1,markers2],"Graph Title", "X Axis", "Y Axis")) |
158 | 153 | ||
- | 154 | # Configure TestListCtrl |
|
- | 155 | self.TestListCtrl.InsertColumn(0, "Name") |
|
- | 156 | self.TestListCtrl.InsertColumn(1, "Result") |
|
- | 157 | ||
159 | def DrawPointLabel(self, dc, mDataDict): |
158 | def DrawPointLabel(self, dc, mDataDict): |
160 | """This is the fuction that defines how the pointLabels are plotted |
159 | """This is the fuction that defines how the pointLabels are plotted |
161 | dc - DC that will be passed |
160 | dc - DC that will be passed |
162 | mDataDict - Dictionary of data that you want to use for the pointLabel |
161 | mDataDict - Dictionary of data that you want to use for the pointLabel |
Line 181... | Line 180... | ||
181 | # ----------- |
180 | # ----------- |
Line 182... | Line 181... | ||
182 | 181 | ||
Line -... | Line 182... | ||
- | 182 | # end of class MainFrame |
|
- | 183 | ||
- | 184 | ||
- | 185 | class VibTest: |
|
- | 186 | def __init__(self, name, rawData): |
|
183 | # end of class MainFrame |
187 | self.name = name |
- | 188 | self.rawData = rawData |
|
- | 189 | ||
- | 190 | class App(wx.App): |
|
- | 191 | def __init__(self, par): |
|
- | 192 | print "A" |
|
- | 193 | self.VibTests = [] |
|
- | 194 | ||
- | 195 | wx.App.__init__(self, par) |
|
- | 196 | ||
- | 197 | ||
- | 198 | def AddTest(self, name, rawData): |
|
- | 199 | test = VibTest(name, rawData) |
|
- | 200 | self.VibTests.append(test) |
|
- | 201 | ||
184 | 202 | index = self.frame_1.TestListCtrl.InsertStringItem(sys.maxint, test.name) |
|
185 | 203 | self.frame_1.TestListCtrl.SetStringItem(index, 1, "OK") |
|
186 | class App(wx.App): |
204 | |
187 | def OnInit(self): |
205 | def OnInit(self): |
- | 206 | wx.InitAllImageHandlers() |
|
- | 207 | self.frame_1 = MainFrame(None, -1, "") |
|
- | 208 | self.SetTopWindow(self.frame_1) |
|
- | 209 | ||
- | 210 | print "B" |
|
- | 211 | ||
188 | wx.InitAllImageHandlers() |
212 | self.AddTest("Test1", range(0,1000)) |
189 | frame_1 = MainFrame(None, -1, "") |
213 | self.AddTest("Test2", range(0,1000)) |
Line 190... | Line 214... | ||
190 | self.SetTopWindow(frame_1) |
214 | |
Line 191... | Line 215... | ||
191 | frame_1.Show() |
215 | self.frame_1.Show() |