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: