Subversion Repositories Projects

Rev

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

Rev 683 Rev 690
Line 1... Line 1...
1
#!/usr/bin/env python
1
#!/usr/bin/env python
2
# -*- coding: iso-8859-15 -*-
2
# -*- coding: iso-8859-15 -*-
3
# generated by wxGlade 0.6.3 on Thu Sep 24 15:46:36 2009
3
# generated by wxGlade 0.6.3 on Thu Sep 24 15:46:36 2009
Line 4... Line 4...
4
 
4
 
5
#
5
#
6
# Mikrokopter VibrationTest  Rev: $Rev: 683 $
6
# Mikrokopter VibrationTest  Rev: $Rev: 690 $
7
#
7
#
8
# Author: Frederic Goddeeris   (frederic@rc-flight.be) 
8
# Author: Frederic Goddeeris   (frederic@rc-flight.be) 
Line 9... Line 9...
9
#
9
#
Line 352... Line 352...
352
        self.Bind(wx.EVT_CHOICE, self.onYAxisChange, self.yAxisChoice)
352
        self.Bind(wx.EVT_CHOICE, self.onYAxisChange, self.yAxisChoice)
353
        self.Bind(wx.EVT_BUTTON, self.onCopyGraphData, self.copyGraphButton)
353
        self.Bind(wx.EVT_BUTTON, self.onCopyGraphData, self.copyGraphButton)
354
        # end wxGlade
354
        # end wxGlade
355
        favicon = wx.Icon('%s/Resources/60px-Procman.ico' % rootPath, wx.BITMAP_TYPE_ICO, 32, 32)
355
        favicon = wx.Icon('%s/Resources/60px-Procman.ico' % rootPath, wx.BITMAP_TYPE_ICO, 32, 32)
356
        wx.Frame.SetIcon(self, favicon)
356
        wx.Frame.SetIcon(self, favicon)
-
 
357
        self.graphCtrl.canvas.Bind(wx.EVT_LEFT_DOWN, self.OnMouseLeftDown)
-
 
358
        self.measureState = 0
Line 357... Line 359...
357
       
359
       
358
 
360
 
Line 563... Line 565...
563
                break
565
                break
564
            if not found:
566
            if not found:
565
                tests.append([header, idx])
567
                tests.append([header, idx])
566
            idx = self.TestListCtrl.GetNextSelected(idx)
568
            idx = self.TestListCtrl.GetNextSelected(idx)
567
        return tests
569
        return tests
-
 
570
     
-
 
571
    def OnMouseLeftDown(self,event):
-
 
572
        x,y = self.graphCtrl._getXY(event)
-
 
573
        s= "Left Mouse Down at Point: (%.4f, %.4f)" % (x,y)
-
 
574
        print s
-
 
575
        if self.measureState == 0:
-
 
576
            self.measureX1 = x
-
 
577
            self.measureState += 1
-
 
578
        elif self.measureState == 1:
-
 
579
            dx = x-self.measureX1
-
 
580
            rpm = 60.0*1000/dx
-
 
581
            s = "Time-Difference: %.1fms\n"%dx
-
 
582
            for i in range(1,5):
-
 
583
                s += "\n%dT -> %d RPM" %(i,rpm*i)
-
 
584
            dial = wx.MessageDialog(None, s, 'RPM Measurement', wx.OK )
-
 
585
            dial.ShowModal()
-
 
586
         
-
 
587
            self.measureState = 0
-
 
588
           
Line 568... Line 589...
568
       
589
       
Line 569... Line 590...
569
 
590
 
Line 802... Line 823...
802
    def onAbout(self, event): # wxGlade: MainFrame.<event_handler>
823
    def onAbout(self, event): # wxGlade: MainFrame.<event_handler>
803
         # First we create and fill the info object
824
         # First we create and fill the info object
804
        print "about"
825
        print "about"
805
        info = wx.AboutDialogInfo()
826
        info = wx.AboutDialogInfo()
806
        info.Name = "MK Vibration Test - "
827
        info.Name = "MK Vibration Test - "
807
        info.Version = "v1.1 (EXPERIMENTAL) ($Rev: 683 $)".replace("$","")
828
        info.Version = "v1.1 (EXPERIMENTAL) ($Rev: 690 $)".replace("$","")
808
        info.Copyright = ""
829
        info.Copyright = ""
809
        info.Developers=["Frederic Goddeeris  (Frederic@rc-flight.be)"]
830
        info.Developers=["Frederic Goddeeris  (Frederic@rc-flight.be)"]
810
        info.Description = "Please consult the WIKI page for a complete description of the tool:"
831
        info.Description = "Please consult the WIKI page for a complete description of the tool:"
811
        info.WebSite = ("http://www.mikrokopter.de/ucwiki/en/VibrationTest", "VibrationTest WIKI page")
832
        info.WebSite = ("http://www.mikrokopter.de/ucwiki/en/VibrationTest", "VibrationTest WIKI page")
812
        wx.AboutBox(info)
833
        wx.AboutBox(info)