Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 591 → Rev 592

/VibrationTest/trunk/VibrationTest/VibrationTestGui.py
117,8 → 117,8
self.text_ctrl_8 = wx.TextCtrl(self, -1, "")
self.button_1 = wx.Button(self, -1, "button_1")
self.GraphPanel = wx.Panel(self, -1, style=wx.DOUBLE_BORDER|wx.TAB_TRAVERSAL)
self.choice_3 = wx.Choice(self, -1, choices=[])
self.choice_4 = wx.Choice(self, -1, choices=[])
self.yAxesChoice = wx.ComboBox(self, -1, choices=["10", "25", "50", "100", "250"], style=wx.CB_DROPDOWN)
self.graphTypeChoise = wx.ComboBox(self, -1, choices=["Raw Data", "Filtered Data", "Spectrum"], style=wx.CB_DROPDOWN)
self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
 
self.__set_properties()
125,6 → 125,7
self.__do_layout()
 
self.Bind(wx.EVT_MENU, self.OnImport, id=-1)
self.Bind(wx.EVT_COMBOBOX, self.onYAxesChange, self.yAxesChoice)
# end wxGlade
 
def setApp(self, app):
134,6 → 135,8
# begin wxGlade: MainFrame.__set_properties
self.SetTitle("VibrationTest")
self.GraphPanel.SetMinSize((800,300))
self.yAxesChoice.SetSelection(2)
self.graphTypeChoise.SetSelection(0)
# end wxGlade
 
def __do_layout(self):
162,9 → 165,9
grid_sizer_1.Add(self.button_1, 0, 0, 0)
sizer_1.Add(grid_sizer_1, 0, 0, 2)
sizer_1.Add((20, 20), 0, 0, 0)
sizer_1.Add(self.GraphPanel, 1, wx.ALIGN_CENTER_HORIZONTAL, 0)
sizer_2.Add(self.choice_3, 0, 0, 0)
sizer_2.Add(self.choice_4, 0, 0, 0)
sizer_1.Add(self.GraphPanel, 1, 0, 0)
sizer_2.Add(self.yAxesChoice, 0, 0, 0)
sizer_2.Add(self.graphTypeChoise, 0, 0, 0)
sizer_1.Add(sizer_2, 0, wx.EXPAND, 0)
sizer_1.Add((20, 20), 0, 0, 0)
grid_sizer_2.Add(self.TestListCtrl, 1, wx.ALL|wx.EXPAND, 0)
229,9 → 232,13
def OnTestSelected(self, event):
testId = event.m_itemIndex
print "Test Selected id=%d" % (testId)
self.activeTestId = testId
self.drawGraph()
 
vibTest = self.app.getTest(testId)
def drawGraph(self):
vibTest = self.app.getTest(self.activeTestId)
nb = vibTest.getDataLen()
y = int(self.yAxesChoice.GetStringSelection())
 
self.client.Clear()
xydata = _Numeric.arange(nb*2)
238,12 → 245,16
xydata.shape = (nb, 2)
xydata[:,1] = vibTest.getRawData()
line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red')
self.client.Draw(wx.lib.plot.PlotGraphics([line],"Graph Title", "Time", "Acc"), yAxis= (-100,100))
self.client.Draw(wx.lib.plot.PlotGraphics([line],"Graph Title", "Time", "Acc"), yAxis= (-y,y))
self.client.SetEnableGrid('Horizontal')
 
 
def OnImport(self, event): # wxGlade: MainFrame.<event_handler>
self.app.Import()
 
def onYAxesChange(self, event): # wxGlade: MainFrame.<event_handler>
self.drawGraph()
 
# end of class MainFrame
 
 
/VibrationTest/trunk/VibrationTest/VibrationTestGui.wxg
1,5 → 1,5
<?xml version="1.0"?>
<!-- generated by wxGlade 0.6.3 on Tue Sep 29 18:21:51 2009 -->
<!-- generated by wxGlade 0.6.3 on Tue Sep 29 18:58:17 2009 -->
 
<application path="D:\Fred\MK_Proj\VibrationTest\trunk\VibrationTest\VibrationTestGui.py" name="VibrationTestGui" class="App" option="0" language="python" top_window="frame_1" encoding="ISO-8859-15" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6" is_template="0">
<object class="MainFrame" name="frame_1" base="EditFrame">
203,18 → 203,29
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxChoice" name="choice_3" base="EditChoice">
<selection>0</selection>
<object class="wxComboBox" name="yAxesChoice" base="EditComboBox">
<selection>2</selection>
<choices>
<choice>10</choice>
<choice>25</choice>
<choice>50</choice>
<choice>100</choice>
<choice>250</choice>
</choices>
<events>
<handler event="EVT_COMBOBOX">onYAxesChange</handler>
</events>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxChoice" name="choice_4" base="EditChoice">
<object class="wxComboBox" name="graphTypeChoise" base="EditComboBox">
<selection>0</selection>
<choices>
<choice>Raw Data</choice>
<choice>Filtered Data</choice>
<choice>Spectrum</choice>
</choices>
</object>
</object>