Subversion Repositories Projects

Rev

Rev 626 | Rev 628 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 626 Rev 627
Line 287... Line 287...
287
        self.frame_1_menubar.Append(wxglade_tmp_menu, "File")
287
        self.frame_1_menubar.Append(wxglade_tmp_menu, "File")
288
        wxglade_tmp_menu = wx.Menu()
288
        wxglade_tmp_menu = wx.Menu()
289
        wxglade_tmp_menu.Append(301, "Clear All", "", wx.ITEM_NORMAL)
289
        wxglade_tmp_menu.Append(301, "Clear All", "", wx.ITEM_NORMAL)
290
        wxglade_tmp_menu.Append(302, "Clear Selected", "", wx.ITEM_NORMAL)
290
        wxglade_tmp_menu.Append(302, "Clear Selected", "", wx.ITEM_NORMAL)
291
        wxglade_tmp_menu.AppendSeparator()
291
        wxglade_tmp_menu.AppendSeparator()
-
 
292
        wxglade_tmp_menu.Append(310, "Select All", "", wx.ITEM_NORMAL)
-
 
293
        wxglade_tmp_menu.AppendSeparator()
292
        wxglade_tmp_menu.Append(303, "Load", "", wx.ITEM_NORMAL)
294
        wxglade_tmp_menu.Append(303, "Load", "", wx.ITEM_NORMAL)
293
        wxglade_tmp_menu.Append(304, "Save", "", wx.ITEM_NORMAL)
295
        wxglade_tmp_menu.Append(304, "Save", "", wx.ITEM_NORMAL)
294
        self.frame_1_menubar.Append(wxglade_tmp_menu, "TestSet")
296
        self.frame_1_menubar.Append(wxglade_tmp_menu, "TestSet")
295
        wxglade_tmp_menu = wx.Menu()
297
        wxglade_tmp_menu = wx.Menu()
296
        wxglade_tmp_menu.Append(401, "Flash VibTest FC software", "", wx.ITEM_NORMAL)
298
        wxglade_tmp_menu.Append(401, "Flash VibTest FC software", "", wx.ITEM_NORMAL)
Line 317... Line 319...
317
        self.graphCtrl = wx.lib.plot.PlotCanvas(self, size=(800,300))
319
        self.graphCtrl = wx.lib.plot.PlotCanvas(self, size=(800,300))
318
        self.label_40 = wx.StaticText(self, -1, "Graph Type ")
320
        self.label_40 = wx.StaticText(self, -1, "Graph Type ")
319
        self.graphTypeChoice = wx.Choice(self, -1, choices=["Raw Signal", "Filtered Signal", "Spectrum"])
321
        self.graphTypeChoice = wx.Choice(self, -1, choices=["Raw Signal", "Filtered Signal", "Spectrum"])
320
        self.label_41 = wx.StaticText(self, -1, "Y Axis Range ")
322
        self.label_41 = wx.StaticText(self, -1, "Y Axis Range ")
321
        self.yAxisChoice = wx.Choice(self, -1, choices=["25", "50", "100", "200"])
323
        self.yAxisChoice = wx.Choice(self, -1, choices=["25", "50", "100", "200"])
-
 
324
        self.copyGraphButton = wx.Button(self, -1, "Copy Graph Data")
322
        self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
325
        self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
Line 323... Line 326...
323
 
326
 
324
        self.__set_properties()
327
        self.__set_properties()
Line 325... Line 328...
325
        self.__do_layout()
328
        self.__do_layout()
326
 
329
 
327
        self.Bind(wx.EVT_MENU, self.OnSettings, id=101)
330
        self.Bind(wx.EVT_MENU, self.OnSettings, id=101)
328
        self.Bind(wx.EVT_MENU, self.onExit, id=150)
331
        self.Bind(wx.EVT_MENU, self.onExit, id=150)
-
 
332
        self.Bind(wx.EVT_MENU, self.onClear, id=301)
329
        self.Bind(wx.EVT_MENU, self.onClear, id=301)
333
        self.Bind(wx.EVT_MENU, self.onClearSelected, id=302)
330
        self.Bind(wx.EVT_MENU, self.onClearSelected, id=302)
334
        self.Bind(wx.EVT_MENU, self.onSelectAll, id=310)
331
        self.Bind(wx.EVT_MENU, self.OnImport, id=303)
335
        self.Bind(wx.EVT_MENU, self.OnImport, id=303)
332
        self.Bind(wx.EVT_MENU, self.onExport, id=304)
336
        self.Bind(wx.EVT_MENU, self.onExport, id=304)
333
        self.Bind(wx.EVT_MENU, self.onAbout, id=1099)
337
        self.Bind(wx.EVT_MENU, self.onAbout, id=1099)
334
        self.Bind(wx.EVT_BUTTON, self.onStartMeasure, self.button_4)
338
        self.Bind(wx.EVT_BUTTON, self.onStartMeasure, self.button_4)
-
 
339
        self.Bind(wx.EVT_CHOICE, self.onGraphTypeChange, self.graphTypeChoice)
335
        self.Bind(wx.EVT_CHOICE, self.onGraphTypeChange, self.graphTypeChoice)
340
        self.Bind(wx.EVT_CHOICE, self.onYAxisChange, self.yAxisChoice)
336
        self.Bind(wx.EVT_CHOICE, self.onYAxisChange, self.yAxisChoice)
341
        self.Bind(wx.EVT_BUTTON, self.onCopyGraphData, self.copyGraphButton)
337
        # end wxGlade
342
        # end wxGlade
Line 338... Line 343...
338
        favicon = wx.Icon('%s/Resources/60px-Procman.ico' % rootPath, wx.BITMAP_TYPE_ICO, 32, 32)
343
        favicon = wx.Icon('%s/Resources/60px-Procman.ico' % rootPath, wx.BITMAP_TYPE_ICO, 32, 32)
Line 387... Line 392...
387
        sizer_12.Add(self.label_40, 0, wx.ALIGN_CENTER_VERTICAL, 0)
392
        sizer_12.Add(self.label_40, 0, wx.ALIGN_CENTER_VERTICAL, 0)
388
        sizer_12.Add(self.graphTypeChoice, 0, 0, 0)
393
        sizer_12.Add(self.graphTypeChoice, 0, 0, 0)
389
        sizer_12.Add((40, 20), 0, 0, 0)
394
        sizer_12.Add((40, 20), 0, 0, 0)
390
        sizer_12.Add(self.label_41, 0, wx.ALIGN_CENTER_VERTICAL, 0)
395
        sizer_12.Add(self.label_41, 0, wx.ALIGN_CENTER_VERTICAL, 0)
391
        sizer_12.Add(self.yAxisChoice, 0, 0, 0)
396
        sizer_12.Add(self.yAxisChoice, 0, 0, 0)
-
 
397
        sizer_12.Add((80, 20), 0, 0, 0)
-
 
398
        sizer_12.Add(self.copyGraphButton, 0, 0, 0)
392
        sizer_11.Add(sizer_12, 0, 0, 0)
399
        sizer_11.Add(sizer_12, 0, 0, 0)
393
        sizer_8.Add(sizer_11, 0, 0, 0)
400
        sizer_8.Add(sizer_11, 0, 0, 0)
394
        sizer_8.Add((20, 30), 0, 0, 0)
401
        sizer_8.Add((20, 30), 0, 0, 0)
395
        sizer_8.Add(self.TestListCtrl, 1, 0, 0)
402
        sizer_8.Add(self.TestListCtrl, 1, 0, 0)
396
        sizer_8.Add((20, 20), 0, 0, 0)
403
        sizer_8.Add((20, 20), 0, 0, 0)
Line 474... Line 481...
474
         if nbSelected == 0:
481
         if nbSelected == 0:
475
              self.graphCtrl.Clear()
482
              self.graphCtrl.Clear()
Line 476... Line 483...
476
         
483
         
477
         elif nbSelected > 1:
484
         elif nbSelected > 1:
-
 
485
             self.graphTypeChoice.Disable()
478
             self.graphTypeChoice.Disable()
486
             self.copyGraphButton.Enable()
479
             x = 1
487
             x = 1
480
             data = []
488
             data = []
481
             idx = self.TestListCtrl.GetFirstSelected()
489
             idx = self.TestListCtrl.GetFirstSelected()
482
             while idx != -1:
490
             while idx != -1:
Line 489... Line 497...
489
             self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line, markers], title, "Test", "Vibration Value"), xAxis=(1,max(x,10)), yAxis=(0,y))
497
             self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line, markers], title, "Test", "Vibration Value"), xAxis=(1,max(x,10)), yAxis=(0,y))
490
             self.graphCtrl.SetEnableGrid('Horizontal')
498
             self.graphCtrl.SetEnableGrid('Horizontal')
Line 491... Line 499...
491
 
499
 
492
         else:
500
         else:
-
 
501
             self.graphTypeChoice.Enable()
493
             self.graphTypeChoice.Enable()
502
             self.copyGraphButton.Disable()
494
             vibTest = self.app.getTest(self.activeTestId)
503
             vibTest = self.app.getTest(self.activeTestId)
Line 495... Line 504...
495
             nb = vibTest.getDataLen()
504
             nb = vibTest.getDataLen()
496
 
505
 
Line 623... Line 632...
623
        while True:
632
        while True:
624
            idx = self.TestListCtrl.GetFirstSelected()
633
            idx = self.TestListCtrl.GetFirstSelected()
625
            if idx == -1: break
634
            if idx == -1: break
626
            self._removeTest(idx)
635
            self._removeTest(idx)
Line 627... Line 636...
627
           
636
           
628
   
-
 
629
    def onCopyData(self, event): # wxGlade: MainFrame.<event_handler>
-
 
630
        clipdata = wx.TextDataObject()
-
 
631
        txt = ""
-
 
632
        idx = self.TestListCtrl.GetFirstSelected()
-
 
633
        while idx != -1:
-
 
634
             txt += ("%d\n" % self.app.getTest(idx).getVibValue(self.app.settings["hpf"].value, self.app.settings["lpf"].value))
-
 
635
             idx = self.TestListCtrl.GetNextSelected(idx)
-
 
636
        clipdata.SetText(txt)
-
 
637
        wx.TheClipboard.Open()
-
 
638
        wx.TheClipboard.SetData(clipdata)
-
 
Line 639... Line 637...
639
        wx.TheClipboard.Close()
637
       
640
 
638
 
641
    def onAbout(self, event): # wxGlade: MainFrame.<event_handler>
639
    def onAbout(self, event): # wxGlade: MainFrame.<event_handler>
642
         # First we create and fill the info object
640
         # First we create and fill the info object
Line 653... Line 651...
653
       
651
       
654
    def onExit(self, event): # wxGlade: MainFrame.<event_handler>
652
    def onExit(self, event): # wxGlade: MainFrame.<event_handler>
Line -... Line 653...
-
 
653
        self.Close(True)
-
 
654
 
-
 
655
 
-
 
656
    def onSelectAll(self, event): # wxGlade: MainFrame.<event_handler>
-
 
657
        for i in xrange(self.TestListCtrl.GetItemCount()):
-
 
658
          self.TestListCtrl.Select(i)
-
 
659
 
-
 
660
    def onCopyGraphData(self, event): # wxGlade: MainFrame.<event_handler>
-
 
661
        clipdata = wx.TextDataObject()
-
 
662
        txt = ""
-
 
663
        idx = self.TestListCtrl.GetFirstSelected()
-
 
664
        while idx != -1:
-
 
665
             txt += ("%d\n" % self.app.getTest(idx).getVibValue(self.app.settings["hpf"].value, self.app.settings["lpf"].value))
-
 
666
             idx = self.TestListCtrl.GetNextSelected(idx)
-
 
667
        clipdata.SetText(txt)
-
 
668
        wx.TheClipboard.Open()
655
        self.Close(True)
669
        wx.TheClipboard.SetData(clipdata)
Line 656... Line 670...
656
 
670
        wx.TheClipboard.Close()
657
 
671
 
658
# end of class MainFrame
672
# end of class MainFrame