2,6 → 2,7 |
# -*- coding: iso-8859-15 -*- |
# generated by wxGlade 0.6.3 on Thu Sep 24 15:46:36 2009 |
|
import sys |
import wx |
import wx.lib |
import wx.lib.plot |
31,23 → 32,16 |
|
class wxFrame(wx.Panel): |
def __init__(self, *args, **kwds): |
# begin wxGlade: wxFrame.__init__ |
kwds["style"] = wx.TAB_TRAVERSAL |
wx.Panel.__init__(self, *args, **kwds) |
# content of this block not found: did you rename this class? |
pass |
|
self.__set_properties() |
self.__do_layout() |
# end wxGlade |
|
def __set_properties(self): |
# begin wxGlade: wxFrame.__set_properties |
# content of this block not found: did you rename this class? |
pass |
# end wxGlade |
|
def __do_layout(self): |
# begin wxGlade: wxFrame.__do_layout |
# content of this block not found: did you rename this class? |
pass |
# end wxGlade |
|
# end of class wxFrame |
|
91,7 → 85,7 |
self.text_ctrl_8 = wx.TextCtrl(self, -1, "") |
self.button_1 = wx.Button(self, -1, "button_1") |
self.GraphFanel = wx.Panel(self, -1) |
self.panel_1 = wxFrame(self, -1) |
self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER) |
|
self.__set_properties() |
self.__do_layout() |
108,6 → 102,7 |
def __do_layout(self): |
# begin wxGlade: MainFrame.__do_layout |
sizer_1 = wx.BoxSizer(wx.VERTICAL) |
grid_sizer_2 = wx.GridSizer(2, 1, 4, 4) |
grid_sizer_1 = wx.GridSizer(5, 4, 4, 4) |
grid_sizer_1.Add(self.Port, 0, wx.ALIGN_RIGHT, 0) |
grid_sizer_1.Add(self.text_ctrl_1, 0, 0, 0) |
128,15 → 123,15 |
grid_sizer_1.Add(self.button_1, 0, 0, 0) |
sizer_1.Add(grid_sizer_1, 0, 0, 2) |
sizer_1.Add(self.GraphFanel, 0, wx.EXPAND, 0) |
sizer_1.Add(self.panel_1, 1, wx.ALL|wx.EXPAND, 0) |
grid_sizer_2.Add(self.TestListCtrl, 1, wx.ALL|wx.EXPAND, 0) |
sizer_1.Add(grid_sizer_2, 1, wx.EXPAND, 0) |
self.SetSizer(sizer_1) |
sizer_1.Fit(self) |
self.Layout() |
# end wxGlade |
|
|
# Configure Graph |
self.client = wx.lib.plot.PlotCanvas(self.GraphFanel) |
#define the function for drawing pointLabels |
self.client.SetPointLabelFunc(self.DrawPointLabel) |
|
self.client.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL)) |
155,7 → 150,11 |
(3.*pi/4., -1)], legend='Cross Legend', colour='blue', |
marker='cross') |
self.client.Draw(wx.lib.plot.PlotGraphics([markers1,markers2],"Graph Title", "X Axis", "Y Axis")) |
|
|
# Configure TestListCtrl |
self.TestListCtrl.InsertColumn(0, "Name") |
self.TestListCtrl.InsertColumn(1, "Result") |
|
def DrawPointLabel(self, dc, mDataDict): |
"""This is the fuction that defines how the pointLabels are plotted |
dc - DC that will be passed |
183,12 → 182,37 |
# end of class MainFrame |
|
|
class VibTest: |
def __init__(self, name, rawData): |
self.name = name |
self.rawData = rawData |
|
class App(wx.App): |
def __init__(self, par): |
print "A" |
self.VibTests = [] |
|
wx.App.__init__(self, par) |
|
|
def AddTest(self, name, rawData): |
test = VibTest(name, rawData) |
self.VibTests.append(test) |
|
index = self.frame_1.TestListCtrl.InsertStringItem(sys.maxint, test.name) |
self.frame_1.TestListCtrl.SetStringItem(index, 1, "OK") |
|
def OnInit(self): |
wx.InitAllImageHandlers() |
frame_1 = MainFrame(None, -1, "") |
self.SetTopWindow(frame_1) |
frame_1.Show() |
self.frame_1 = MainFrame(None, -1, "") |
self.SetTopWindow(self.frame_1) |
|
print "B" |
|
self.AddTest("Test1", range(0,1000)) |
self.AddTest("Test2", range(0,1000)) |
|
self.frame_1.Show() |
return 1 |
|
# end of class App |