Subversion Repositories Projects

Rev

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

Rev 640 Rev 643
Line 327... Line 327...
327
        self.static_line_1 = wx.StaticLine(self, -1)
327
        self.static_line_1 = wx.StaticLine(self, -1)
328
        self.graphCtrl = wx.lib.plot.PlotCanvas(self, size=(800,300))
328
        self.graphCtrl = wx.lib.plot.PlotCanvas(self, size=(800,300))
329
        self.label_40 = wx.StaticText(self, -1, "Graph Type ")
329
        self.label_40 = wx.StaticText(self, -1, "Graph Type ")
330
        self.graphTypeChoice = wx.Choice(self, -1, choices=["Raw Signal", "Filtered Signal", "Spectrum"])
330
        self.graphTypeChoice = wx.Choice(self, -1, choices=["Raw Signal", "Filtered Signal", "Spectrum"])
331
        self.label_41 = wx.StaticText(self, -1, "Y Axis Range ")
331
        self.label_41 = wx.StaticText(self, -1, "Y Axis Range ")
332
        self.yAxisChoice = wx.Choice(self, -1, choices=["25", "50", "100", "200"])
332
        self.yAxisChoice = wx.Choice(self, -1, choices=["25", "50", "75", "100", "200"])
333
        self.copyGraphButton = wx.Button(self, -1, "Copy Graph Data")
333
        self.copyGraphButton = wx.Button(self, -1, "Copy Graph Data")
334
        self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
334
        self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
Line 335... Line 335...
335
 
335
 
336
        self.__set_properties()
336
        self.__set_properties()
Line 584... Line 584...
584
                 xydata[:,1] = vibTest.getRawData()
584
                 xydata[:,1] = vibTest.getRawData()
585
                 line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red', width=2)
585
                 line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red', width=2)
Line 586... Line 586...
586
       
586
       
587
                 title = "Raw Signal: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
587
                 title = "Raw Signal: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
588
                 self.graphCtrl.setLogScale((False,False))
588
                 self.graphCtrl.setLogScale((False,False))
589
                 self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line], title, "Time (ms)", "Acc"), yAxis= (-y,y))
589
                 self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line], title, "Time (ms)", "Acc"), yAxis= (-y/2,y/2))
590
                 self.graphCtrl.SetEnableGrid('Horizontal')
590
                 self.graphCtrl.SetEnableGrid('Horizontal')
Line 591... Line 591...
591
                 self.graphCtrl.SetEnableLegend(False)
591
                 self.graphCtrl.SetEnableLegend(False)
Line 597... Line 597...
597
                 xydata[:,1] = vibTest.getFilteredData(self.app.settings["hpf"].value, self.app.settings["lpf"].value)
597
                 xydata[:,1] = vibTest.getFilteredData(self.app.settings["hpf"].value, self.app.settings["lpf"].value)
598
                 line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red', width=2)
598
                 line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red', width=2)
Line 599... Line 599...
599
       
599
       
600
                 title = "Filtered Signal: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
600
                 title = "Filtered Signal: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
601
                 self.graphCtrl.setLogScale((False,False))
601
                 self.graphCtrl.setLogScale((False,False))
602
                 self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line], title, "Time (ms)", "Acc"), yAxis= (-y,y))
602
                 self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line], title, "Time (ms)", "Acc"), yAxis= (-y/2,y/2))
603
                 self.graphCtrl.SetEnableGrid('Horizontal')
603
                 self.graphCtrl.SetEnableGrid('Horizontal')
Line 604... Line 604...
604
                 self.graphCtrl.SetEnableLegend(False)
604
                 self.graphCtrl.SetEnableLegend(False)
605
   
605
   
Line 679... Line 679...
679
          mp.channels = []
679
          mp.channels = []
680
          if self.accTopCb.IsChecked(): mp.channels.append(5)
680
          if self.accTopCb.IsChecked(): mp.channels.append(5)
681
          if self.accRollCb.IsChecked(): mp.channels.append(6)
681
          if self.accRollCb.IsChecked(): mp.channels.append(6)
682
          if self.accNickCb.IsChecked(): mp.channels.append(7)
682
          if self.accNickCb.IsChecked(): mp.channels.append(7)
683
          s = self.speedCtrl.GetValue()
683
          s = self.speedCtrl.GetValue()
684
          if s=="test":
684
          if s=="test1":
-
 
685
            mp.speeds = (100,100,100,100,100,100,100,100, 200,200,200,200,200,200,200,200, 100,200, 100,200, 100,200, 100,200)
-
 
686
          elif s=="test2":
685
            mp.speeds = (100,100,100,100,100, 150,150,150,150,150, 200,200,200,200,200, 100,150,200, 100,150,200, 100,150,200, 100,150,200)
687
            mp.speeds = (100,100,100,100,100, 150,150,150,150,150, 200,200,200,200,200, 100,150,200, 100,150,200, 100,150,200, 100,150,200)          
686
          elif s.count("-") == 1:
688
          elif s.count("-") == 1:
687
              # assume from-to:step format
689
              # assume from-to:step format
688
              s = s.split("-")
690
              s = s.split("-")
689
              if len(s) != 2: raise Exception("Invalid format")
691
              if len(s) != 2: raise Exception("Invalid format")
690
              s[1] = s[1].split(":")
692
              s[1] = s[1].split(":")
Line 748... Line 750...
748
    def onAbout(self, event): # wxGlade: MainFrame.<event_handler>
750
    def onAbout(self, event): # wxGlade: MainFrame.<event_handler>
749
         # First we create and fill the info object
751
         # First we create and fill the info object
750
        print "about"
752
        print "about"
751
        info = wx.AboutDialogInfo()
753
        info = wx.AboutDialogInfo()
752
        info.Name = "MK Vibration Test"
754
        info.Name = "MK Vibration Test"
753
        info.Version = "0.2"
755
        info.Version = "0.9"
754
        info.Copyright = ""
756
        info.Copyright = ""
755
        info.Developers=["Frederic Goddeeris"]
757
        info.Developers=["Frederic Goddeeris  Frederic@rc-flight.be"]
756
        info.Description = "Please consult the WIKI page for a complete description of the tool:"
758
        info.Description = "Please consult the WIKI page for a complete description of the tool:"
757
        info.WebSite = ("http://www.mikrokopter.de/ucwiki/en/VibrationTest", "VibrationTest WIKI page")
759
        info.WebSite = ("http://www.mikrokopter.de/ucwiki/en/VibrationTest", "VibrationTest WIKI page")
758
        wx.AboutBox(info)
760
        wx.AboutBox(info)