Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 626 → Rev 627

/VibrationTest/trunk/VibrationTest/VibrationTestGui.py
289,6 → 289,8
wxglade_tmp_menu.Append(301, "Clear All", "", wx.ITEM_NORMAL)
wxglade_tmp_menu.Append(302, "Clear Selected", "", wx.ITEM_NORMAL)
wxglade_tmp_menu.AppendSeparator()
wxglade_tmp_menu.Append(310, "Select All", "", wx.ITEM_NORMAL)
wxglade_tmp_menu.AppendSeparator()
wxglade_tmp_menu.Append(303, "Load", "", wx.ITEM_NORMAL)
wxglade_tmp_menu.Append(304, "Save", "", wx.ITEM_NORMAL)
self.frame_1_menubar.Append(wxglade_tmp_menu, "TestSet")
319,6 → 321,7
self.graphTypeChoice = wx.Choice(self, -1, choices=["Raw Signal", "Filtered Signal", "Spectrum"])
self.label_41 = wx.StaticText(self, -1, "Y Axis Range ")
self.yAxisChoice = wx.Choice(self, -1, choices=["25", "50", "100", "200"])
self.copyGraphButton = wx.Button(self, -1, "Copy Graph Data")
self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
 
self.__set_properties()
328,6 → 331,7
self.Bind(wx.EVT_MENU, self.onExit, id=150)
self.Bind(wx.EVT_MENU, self.onClear, id=301)
self.Bind(wx.EVT_MENU, self.onClearSelected, id=302)
self.Bind(wx.EVT_MENU, self.onSelectAll, id=310)
self.Bind(wx.EVT_MENU, self.OnImport, id=303)
self.Bind(wx.EVT_MENU, self.onExport, id=304)
self.Bind(wx.EVT_MENU, self.onAbout, id=1099)
334,6 → 338,7
self.Bind(wx.EVT_BUTTON, self.onStartMeasure, self.button_4)
self.Bind(wx.EVT_CHOICE, self.onGraphTypeChange, self.graphTypeChoice)
self.Bind(wx.EVT_CHOICE, self.onYAxisChange, self.yAxisChoice)
self.Bind(wx.EVT_BUTTON, self.onCopyGraphData, self.copyGraphButton)
# end wxGlade
favicon = wx.Icon('%s/Resources/60px-Procman.ico' % rootPath, wx.BITMAP_TYPE_ICO, 32, 32)
wx.Frame.SetIcon(self, favicon)
389,6 → 394,8
sizer_12.Add((40, 20), 0, 0, 0)
sizer_12.Add(self.label_41, 0, wx.ALIGN_CENTER_VERTICAL, 0)
sizer_12.Add(self.yAxisChoice, 0, 0, 0)
sizer_12.Add((80, 20), 0, 0, 0)
sizer_12.Add(self.copyGraphButton, 0, 0, 0)
sizer_11.Add(sizer_12, 0, 0, 0)
sizer_8.Add(sizer_11, 0, 0, 0)
sizer_8.Add((20, 30), 0, 0, 0)
476,6 → 483,7
elif nbSelected > 1:
self.graphTypeChoice.Disable()
self.copyGraphButton.Enable()
x = 1
data = []
idx = self.TestListCtrl.GetFirstSelected()
491,6 → 499,7
 
else:
self.graphTypeChoice.Enable()
self.copyGraphButton.Disable()
vibTest = self.app.getTest(self.activeTestId)
nb = vibTest.getDataLen()
 
625,18 → 634,7
if idx == -1: break
self._removeTest(idx)
def onCopyData(self, event): # wxGlade: MainFrame.<event_handler>
clipdata = wx.TextDataObject()
txt = ""
idx = self.TestListCtrl.GetFirstSelected()
while idx != -1:
txt += ("%d\n" % self.app.getTest(idx).getVibValue(self.app.settings["hpf"].value, self.app.settings["lpf"].value))
idx = self.TestListCtrl.GetNextSelected(idx)
clipdata.SetText(txt)
wx.TheClipboard.Open()
wx.TheClipboard.SetData(clipdata)
wx.TheClipboard.Close()
 
def onAbout(self, event): # wxGlade: MainFrame.<event_handler>
# First we create and fill the info object
655,6 → 653,22
self.Close(True)
 
 
def onSelectAll(self, event): # wxGlade: MainFrame.<event_handler>
for i in xrange(self.TestListCtrl.GetItemCount()):
self.TestListCtrl.Select(i)
 
def onCopyGraphData(self, event): # wxGlade: MainFrame.<event_handler>
clipdata = wx.TextDataObject()
txt = ""
idx = self.TestListCtrl.GetFirstSelected()
while idx != -1:
txt += ("%d\n" % self.app.getTest(idx).getVibValue(self.app.settings["hpf"].value, self.app.settings["lpf"].value))
idx = self.TestListCtrl.GetNextSelected(idx)
clipdata.SetText(txt)
wx.TheClipboard.Open()
wx.TheClipboard.SetData(clipdata)
wx.TheClipboard.Close()
 
# end of class MainFrame
 
class Setting:
/VibrationTest/trunk/VibrationTest/VibrationTestGui.wxg
1,5 → 1,5
<?xml version="1.0"?>
<!-- generated by wxGlade 0.6.3 on Tue Oct 06 22:57:54 2009 -->
<!-- generated by wxGlade 0.6.3 on Wed Oct 07 09:18:43 2009 -->
 
<application path="C:\DATA\MK\SVN\Projects\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">
43,6 → 43,16
<name>---</name>
</item>
<item>
<label>Select All</label>
<id>310</id>
<handler>onSelectAll</handler>
</item>
<item>
<label>---</label>
<id>---</id>
<name>---</name>
</item>
<item>
<label>Load</label>
<id>303</id>
<handler>OnImport</handler>
333,6 → 343,24
</events>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="spacer" name="spacer" base="EditSpacer">
<height>20</height>
<width>80</width>
</object>
</object>
<object class="sizeritem">
<border>0</border>
<option>0</option>
<object class="wxButton" name="copyGraphButton" base="EditButton">
<label>Copy Graph Data</label>
<events>
<handler event="EVT_BUTTON">onCopyGraphData</handler>
</events>
</object>
</object>
</object>
</object>
</object>