Subversion Repositories Projects

Rev

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

Rev 623 Rev 626
Line 20... Line 20...
20
 
20
 
21
CHANNEL_NAMES = ["GyroYaw", "GyroRoll", "GyroNick", "Pressure", "Batt", "AccTop", "AccRoll", "AccNick"]
21
CHANNEL_NAMES = ["GyroYaw", "GyroRoll", "GyroNick", "Pressure", "Batt", "AccTop", "AccRoll", "AccNick"]
22
FS = 11111
22
FS = 11111
Line -... Line 23...
-
 
23
pi = 3.14
-
 
24
 
23
pi = 3.14
25
rootPath = ""
24
 
26
 
25
# Needs Numeric or numarray or NumPy
27
# Needs Numeric or numarray or NumPy
26
try:
28
try:
27
    import numpy.oldnumeric as _Numeric
29
    import numpy.oldnumeric as _Numeric
Line 49... Line 51...
49
(MeasDataEvent, EVT_MEAS_DATA) = wx.lib.newevent.NewEvent()  
51
(MeasDataEvent, EVT_MEAS_DATA) = wx.lib.newevent.NewEvent()  
Line 50... Line 52...
50
 
52
 
51
class MeasureDialog(wx.Dialog):
53
class MeasureDialog(wx.Dialog):
52
    def __init__(self, *args, **kwds):
54
    def __init__(self, *args, **kwds):
53
        # begin wxGlade: MeasureDialog.__init__
55
        # begin wxGlade: MeasureDialog.__init__
54
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.THICK_FRAME
56
        kwds["style"] = wx.CAPTION|wx.RESIZE_BORDER|wx.THICK_FRAME
55
        wx.Dialog.__init__(self, *args, **kwds)
57
        wx.Dialog.__init__(self, *args, **kwds)
56
        self.text_ctrl_1 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL)
58
        self.text_ctrl_1 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL)
57
        self.button = wx.Button(self, -1, "STOP")
59
        self.button = wx.Button(self, -1, "STOP")
58
        self.voltageCtrl = speedmeter.SpeedMeter(self, extrastyle=speedmeter.SM_DRAW_HAND | speedmeter.SM_DRAW_PARTIAL_SECTORS |  speedmeter.SM_DRAW_MIDDLE_ICON )
60
        self.voltageCtrl = speedmeter.SpeedMeter(self, extrastyle=speedmeter.SM_DRAW_HAND | speedmeter.SM_DRAW_PARTIAL_SECTORS |  speedmeter.SM_DRAW_MIDDLE_ICON )
-
 
61
        self.speedCtrl = speedmeter.SpeedMeter(self, extrastyle=speedmeter.SM_DRAW_HAND | speedmeter.SM_DRAW_PARTIAL_SECTORS | speedmeter.SM_DRAW_MIDDLE_TEXT | speedmeter.SM_DRAW_SECONDARY_TICKS)
59
        self.speedCtrl = speedmeter.SpeedMeter(self, extrastyle=speedmeter.SM_DRAW_HAND | speedmeter.SM_DRAW_PARTIAL_SECTORS | speedmeter.SM_DRAW_MIDDLE_TEXT | speedmeter.SM_DRAW_SECONDARY_TICKS)
62
 
60
        self.__set_properties()
63
        self.__set_properties()
Line 61... Line 64...
61
        self.__do_layout()
64
        self.__do_layout()
62
 
65
 
Line -... Line 66...
-
 
66
        self.Bind(wx.EVT_BUTTON, self.onButton, self.button)
-
 
67
        # end wxGlade
63
        self.Bind(wx.EVT_BUTTON, self.onButton, self.button)
68
       
64
        # end wxGlade
69
        self.button.SetFocus()
65
       
70
       
66
        YELLOW = wx.Colour(255, 240, 0)
-
 
67
        BG = wx.Colour(0x80, 0x80, 0x80)
71
        YELLOW = wx.Colour(255, 240, 0)
68
        # Configure Voltage Ctrl
72
        BG = wx.Colour(0x80, 0x80, 0x80)
69
        #self.voltageCtrl.SetAngleRange(-3.14/3, 3.14/3)
73
        # Configure Voltage Ctrl
70
        self.voltageCtrl.SetAngleRange(0,pi)
74
        self.voltageCtrl.SetAngleRange(0,pi)
71
        intervals = range(0, 5)
75
        intervals = range(0, 5)
72
        self.voltageCtrl.SetIntervals(intervals)
76
        self.voltageCtrl.SetIntervals(intervals)
73
        colours = [wx.RED, wx.GREEN, wx.GREEN, YELLOW]
77
        colours = [wx.RED, wx.GREEN, wx.GREEN, YELLOW]
74
        self.voltageCtrl.SetIntervalColours(colours)
78
        self.voltageCtrl.SetIntervalColours(colours)
75
        ticks = ["", "", "", "", ""]
79
        ticks = ["", "", "", "", ""]
Line 76... Line 80...
76
        self.voltageCtrl.SetTicks(ticks)
80
        self.voltageCtrl.SetTicks(ticks)
77
        self.voltageCtrl.SetTicksColour(wx.WHITE)
81
        self.voltageCtrl.SetTicksColour(wx.WHITE)
78
        self.voltageCtrl.SetHandColour(YELLOW)
82
        self.voltageCtrl.SetHandColour(YELLOW)
Line 79... Line 83...
79
 
83
 
80
        icon = wx.Icon("fuel.ico", wx.BITMAP_TYPE_ICO)
84
        icon = wx.Icon("%s/Resources/fuel.ico" % rootPath, wx.BITMAP_TYPE_ICO)
81
        icon.SetWidth(24)
85
        icon.SetWidth(24)
82
        icon.SetHeight(24)
86
        icon.SetHeight(24)
Line 83... Line 87...
83
 
87
 
84
        self.voltageCtrl.SetMiddleIcon(icon)        
-
 
85
        self.voltageCtrl.SetSpeedBackground(BG)        
88
        self.voltageCtrl.SetMiddleIcon(icon)        
86
        self.voltageCtrl.SetArcColour(wx.WHITE)
89
        self.voltageCtrl.SetSpeedBackground(BG)        
87
        self.voltageCtrl.SetSpeedValue(2)
90
        self.voltageCtrl.SetArcColour(wx.WHITE)
Line 88... Line 91...
88
 
91
        self.voltageCtrl.SetSpeedValue(2)
Line 288... Line 291...
288
        wxglade_tmp_menu.AppendSeparator()
291
        wxglade_tmp_menu.AppendSeparator()
289
        wxglade_tmp_menu.Append(303, "Load", "", wx.ITEM_NORMAL)
292
        wxglade_tmp_menu.Append(303, "Load", "", wx.ITEM_NORMAL)
290
        wxglade_tmp_menu.Append(304, "Save", "", wx.ITEM_NORMAL)
293
        wxglade_tmp_menu.Append(304, "Save", "", wx.ITEM_NORMAL)
291
        self.frame_1_menubar.Append(wxglade_tmp_menu, "TestSet")
294
        self.frame_1_menubar.Append(wxglade_tmp_menu, "TestSet")
292
        wxglade_tmp_menu = wx.Menu()
295
        wxglade_tmp_menu = wx.Menu()
-
 
296
        wxglade_tmp_menu.Append(401, "Flash VibTest FC software", "", wx.ITEM_NORMAL)
-
 
297
        wxglade_tmp_menu.Append(402, "Restore original FC software", "", wx.ITEM_NORMAL)
293
        self.frame_1_menubar.Append(wxglade_tmp_menu, "MK")
298
        self.frame_1_menubar.Append(wxglade_tmp_menu, "MK")
294
        wxglade_tmp_menu = wx.Menu()
299
        wxglade_tmp_menu = wx.Menu()
-
 
300
        wxglade_tmp_menu.Append(1099, "About", "", wx.ITEM_NORMAL)
295
        self.frame_1_menubar.Append(wxglade_tmp_menu, "Help")
301
        self.frame_1_menubar.Append(wxglade_tmp_menu, "Help")
296
        self.SetMenuBar(self.frame_1_menubar)
302
        self.SetMenuBar(self.frame_1_menubar)
297
        # Menu Bar end
303
        # Menu Bar end
298
        self.Description = wx.StaticText(self, -1, "Description")
304
        self.Description = wx.StaticText(self, -1, "Description")
299
        self.tcDescr = wx.TextCtrl(self, -1, "Test")
305
        self.tcDescr = wx.TextCtrl(self, -1, "Test")
300
        self.label_37 = wx.StaticText(self, -1, "Speed(s)")
306
        self.label_37 = wx.StaticText(self, -1, "Speed(s)")
301
        self.tcSpeeds = wx.TextCtrl(self, -1, "100-200:10")
307
        self.tcSpeeds = wx.TextCtrl(self, -1, "100-200:10")
302
        self.label_35 = wx.StaticText(self, -1, "Motor(s)")
308
        self.label_35 = wx.StaticText(self, -1, "Motor(s)")
303
        self.tcMotors = wx.TextCtrl(self, -1, "1")
309
        self.tcMotors = wx.TextCtrl(self, -1, "1")
304
        self.label_38 = wx.StaticText(self, -1, "")
310
        self.label_38 = wx.StaticText(self, -1, "")
305
        self.text_ctrl_10 = wx.TextCtrl(self, -1, "")
311
        self.panel_2 = wx.Panel(self, -1)
306
        self.label_36 = wx.StaticText(self, -1, "Channel(s)")
312
        self.label_36 = wx.StaticText(self, -1, "Channel(s)")
307
        self.tcChannels = wx.TextCtrl(self, -1, "6")
313
        self.tcChannels = wx.TextCtrl(self, -1, "6")
308
        self.label_39 = wx.StaticText(self, -1, "")
314
        self.label_39 = wx.StaticText(self, -1, "")
309
        self.text_ctrl_11 = wx.TextCtrl(self, -1, "")
315
        self.panel_3 = wx.Panel(self, -1)
310
        self.button_4 = wx.Button(self, -1, "Start")
316
        self.button_4 = wx.Button(self, -1, "Measure")
311
        self.GraphPanel = wx.Panel(self, -1)
317
        self.graphCtrl = wx.lib.plot.PlotCanvas(self, size=(800,300))
312
        self.label_40 = wx.StaticText(self, -1, "Graph Type ")
318
        self.label_40 = wx.StaticText(self, -1, "Graph Type ")
313
        self.graphTypeChoice = wx.Choice(self, -1, choices=["Raw Signal", "Filtered Signal", "Spectrum"])
319
        self.graphTypeChoice = wx.Choice(self, -1, choices=["Raw Signal", "Filtered Signal", "Spectrum"])
314
        self.label_41 = wx.StaticText(self, -1, "Y Axis Range ")
320
        self.label_41 = wx.StaticText(self, -1, "Y Axis Range ")
315
        self.yAxisChoice = wx.Choice(self, -1, choices=["25", "50", "100", "200"])
321
        self.yAxisChoice = wx.Choice(self, -1, choices=["25", "50", "100", "200"])
316
        self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
322
        self.TestListCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
Line 317... Line 323...
317
 
323
 
318
        self.__set_properties()
324
        self.__set_properties()
Line 319... Line 325...
319
        self.__do_layout()
325
        self.__do_layout()
-
 
326
 
320
 
327
        self.Bind(wx.EVT_MENU, self.OnSettings, id=101)
321
        self.Bind(wx.EVT_MENU, self.OnSettings, id=101)
328
        self.Bind(wx.EVT_MENU, self.onExit, id=150)
322
        self.Bind(wx.EVT_MENU, self.onClear, id=301)
329
        self.Bind(wx.EVT_MENU, self.onClear, id=301)
323
        self.Bind(wx.EVT_MENU, self.onClearSelected, id=302)
330
        self.Bind(wx.EVT_MENU, self.onClearSelected, id=302)
-
 
331
        self.Bind(wx.EVT_MENU, self.OnImport, id=303)
324
        self.Bind(wx.EVT_MENU, self.OnImport, id=303)
332
        self.Bind(wx.EVT_MENU, self.onExport, id=304)
325
        self.Bind(wx.EVT_MENU, self.onExport, id=304)
333
        self.Bind(wx.EVT_MENU, self.onAbout, id=1099)
326
        self.Bind(wx.EVT_BUTTON, self.onStartMeasure, self.button_4)
334
        self.Bind(wx.EVT_BUTTON, self.onStartMeasure, self.button_4)
327
        self.Bind(wx.EVT_CHOICE, self.onGraphTypeChange, self.graphTypeChoice)
335
        self.Bind(wx.EVT_CHOICE, self.onGraphTypeChange, self.graphTypeChoice)
-
 
336
        self.Bind(wx.EVT_CHOICE, self.onYAxisChange, self.yAxisChoice)
-
 
337
        # end wxGlade
Line 328... Line 338...
328
        self.Bind(wx.EVT_CHOICE, self.onYAxisChange, self.yAxisChoice)
338
        favicon = wx.Icon('%s/Resources/60px-Procman.ico' % rootPath, wx.BITMAP_TYPE_ICO, 32, 32)
329
        # end wxGlade
339
        wx.Frame.SetIcon(self, favicon)
Line 330... Line 340...
330
 
340
 
331
    def setApp(self, app):
341
    def setApp(self, app):
332
        self.app = app
342
        self.app = app
333
 
343
 
334
    def __set_properties(self):
344
    def __set_properties(self):
335
        # begin wxGlade: MainFrame.__set_properties
345
        # begin wxGlade: MainFrame.__set_properties
336
        self.SetTitle("VibrationTest")
346
        self.SetTitle("VibrationTest")
337
        self.SetSize((850, 700))
347
        self.SetSize((850, 700))
338
        self.Description.SetMinSize((53, 13))
348
        self.Description.SetMinSize((53, 13))
339
        self.button_4.SetMinSize((80, 80))
349
        self.button_4.SetMinSize((80, 80))
340
        self.GraphPanel.SetMinSize((800,300))
350
        self.graphCtrl.SetMinSize((800,300))
Line 359... Line 369...
359
        grid_sizer_1.Add(self.label_37, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
369
        grid_sizer_1.Add(self.label_37, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
360
        grid_sizer_1.Add(self.tcSpeeds, 0, 0, 0)
370
        grid_sizer_1.Add(self.tcSpeeds, 0, 0, 0)
361
        grid_sizer_1.Add(self.label_35, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
371
        grid_sizer_1.Add(self.label_35, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
362
        grid_sizer_1.Add(self.tcMotors, 0, 0, 0)
372
        grid_sizer_1.Add(self.tcMotors, 0, 0, 0)
363
        grid_sizer_1.Add(self.label_38, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
373
        grid_sizer_1.Add(self.label_38, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
364
        grid_sizer_1.Add(self.text_ctrl_10, 0, 0, 0)
374
        grid_sizer_1.Add(self.panel_2, 1, wx.EXPAND, 0)
365
        grid_sizer_1.Add(self.label_36, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
375
        grid_sizer_1.Add(self.label_36, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
366
        grid_sizer_1.Add(self.tcChannels, 0, 0, 0)
376
        grid_sizer_1.Add(self.tcChannels, 0, 0, 0)
367
        grid_sizer_1.Add(self.label_39, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
377
        grid_sizer_1.Add(self.label_39, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0)
368
        grid_sizer_1.Add(self.text_ctrl_11, 0, 0, 0)
378
        grid_sizer_1.Add(self.panel_3, 1, wx.EXPAND, 0)
369
        sizer_9.Add(grid_sizer_1, 0, 0, 0)
379
        sizer_9.Add(grid_sizer_1, 0, 0, 0)
370
        sizer_10.Add((50, 20), 0, 0, 0)
380
        sizer_10.Add((50, 20), 0, 0, 0)
371
        sizer_10.Add(self.button_4, 0, wx.ALIGN_CENTER_VERTICAL, 0)
381
        sizer_10.Add(self.button_4, 0, wx.ALIGN_CENTER_VERTICAL, 0)
372
        sizer_9.Add(sizer_10, 1, wx.EXPAND, 0)
382
        sizer_9.Add(sizer_10, 1, wx.EXPAND, 0)
373
        sizer_8.Add(sizer_9, 0, 0, 0)
383
        sizer_8.Add(sizer_9, 0, 0, 0)
374
        sizer_8.Add((20, 30), 0, 0, 0)
384
        sizer_8.Add((20, 30), 0, 0, 0)
375
        sizer_11.Add(self.GraphPanel, 1, wx.EXPAND, 0)
385
        sizer_11.Add(self.graphCtrl, 1, wx.EXPAND, 0)
376
        sizer_11.Add((20, 5), 0, 0, 0)
386
        sizer_11.Add((20, 5), 0, 0, 0)
377
        sizer_12.Add(self.label_40, 0, wx.ALIGN_CENTER_VERTICAL, 0)
387
        sizer_12.Add(self.label_40, 0, wx.ALIGN_CENTER_VERTICAL, 0)
378
        sizer_12.Add(self.graphTypeChoice, 0, 0, 0)
388
        sizer_12.Add(self.graphTypeChoice, 0, 0, 0)
379
        sizer_12.Add((40, 20), 0, 0, 0)
389
        sizer_12.Add((40, 20), 0, 0, 0)
380
        sizer_12.Add(self.label_41, 0, wx.ALIGN_CENTER_VERTICAL, 0)
390
        sizer_12.Add(self.label_41, 0, wx.ALIGN_CENTER_VERTICAL, 0)
Line 392... Line 402...
392
 
402
 
393
        # List events
403
        # List events
Line 394... Line 404...
394
        self.TestListCtrl.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnTestSelected, self.TestListCtrl)
404
        self.TestListCtrl.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnTestSelected, self.TestListCtrl)
395
 
405
 
Line 396... Line 406...
396
        # Configure Graph
406
        # Configure Graph
Line 397... Line 407...
397
        self.client = wx.lib.plot.PlotCanvas(self.GraphPanel, size=(800,300))
407
        #self.graphCtrl = wx.lib.plot.PlotCanvas(self.GraphPanel, size=(800,300))
398
       
408
       
399
        self.client.SetPointLabelFunc(self.DrawPointLabel)
409
        self.graphCtrl.SetPointLabelFunc(self.DrawPointLabel)
400
       
410
       
Line 401... Line 411...
401
        self.client.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL))
411
        self.graphCtrl.SetFont(wx.Font(10,wx.SWISS,wx.NORMAL,wx.NORMAL))
402
        self.client.SetFontSizeAxis(10)
412
        self.graphCtrl.SetFontSizeAxis(10)
403
        self.client.SetFontSizeLegend(7)
413
        self.graphCtrl.SetFontSizeLegend(7)
Line 460... Line 470...
460
         y = int(self.yAxisChoice.GetStringSelection())
470
         y = int(self.yAxisChoice.GetStringSelection())
Line 461... Line 471...
461
 
471
 
Line 462... Line 472...
462
         nbSelected = self.TestListCtrl.SelectedItemCount
472
         nbSelected = self.TestListCtrl.SelectedItemCount
463
 
473
 
Line 464... Line 474...
464
         if nbSelected == 0:
474
         if nbSelected == 0:
465
              self.client.Clear()
475
              self.graphCtrl.Clear()
466
         
476
         
467
         elif nbSelected > 1:
477
         elif nbSelected > 1:
Line 474... Line 484...
474
                 x += 1
484
                 x += 1
475
                 idx = self.TestListCtrl.GetNextSelected(idx)
485
                 idx = self.TestListCtrl.GetNextSelected(idx)
476
             line = wx.lib.plot.PolyLine(data, legend= 'Vibrations', colour='red', width=2)
486
             line = wx.lib.plot.PolyLine(data, legend= 'Vibrations', colour='red', width=2)
477
             markers = wx.lib.plot.PolyMarker(data, legend= '', colour='red', marker='circle',size=2)
487
             markers = wx.lib.plot.PolyMarker(data, legend= '', colour='red', marker='circle',size=2)
478
             title = "Comparing tests"
488
             title = "Comparing tests"
479
             self.client.Draw(wx.lib.plot.PlotGraphics([line, markers], title, "Test", "Vibration Value"), xAxis=(1,max(x,10)), yAxis=(0,y))
489
             self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line, markers], title, "Test", "Vibration Value"), xAxis=(1,max(x,10)), yAxis=(0,y))
480
             self.client.SetEnableGrid('Horizontal')
490
             self.graphCtrl.SetEnableGrid('Horizontal')
Line 481... Line 491...
481
 
491
 
482
         else:
492
         else:
483
             self.graphTypeChoice.Enable()
493
             self.graphTypeChoice.Enable()
484
             vibTest = self.app.getTest(self.activeTestId)
494
             vibTest = self.app.getTest(self.activeTestId)
Line 489... Line 499...
489
                 xydata.shape = (nb, 2)
499
                 xydata.shape = (nb, 2)
490
                 xydata[:,1] = vibTest.getRawData()
500
                 xydata[:,1] = vibTest.getRawData()
491
                 line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red', width=2)
501
                 line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red', width=2)
Line 492... Line 502...
492
       
502
       
493
                 title = "Raw Signal: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
503
                 title = "Raw Signal: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
494
                 self.client.Draw(wx.lib.plot.PlotGraphics([line], title, "Time (ms)", "Acc"), yAxis= (-y,y))
504
                 self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line], title, "Time (ms)", "Acc"), yAxis= (-y,y))
Line 495... Line 505...
495
                 self.client.SetEnableGrid('Horizontal')
505
                 self.graphCtrl.SetEnableGrid('Horizontal')
496
   
506
   
497
             if self.graphTypeChoice.GetSelection() == 1:
507
             if self.graphTypeChoice.GetSelection() == 1:
498
                 xydata = _Numeric.linspace(0,0.09*nb,2*nb)
508
                 xydata = _Numeric.linspace(0,0.09*nb,2*nb)
499
                 xydata.shape = (nb, 2)
509
                 xydata.shape = (nb, 2)
Line 500... Line 510...
500
                 xydata[:,1] = vibTest.getFilteredData(self.app.settings["hpf"].value, self.app.settings["lpf"].value)
510
                 xydata[:,1] = vibTest.getFilteredData(self.app.settings["hpf"].value, self.app.settings["lpf"].value)
501
                 line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red', width=2)
511
                 line = wx.lib.plot.PolyLine(xydata, legend= 'Raw Data', colour='red', width=2)
502
       
512
       
Line 503... Line 513...
503
                 title = "Filtered Signal: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
513
                 title = "Filtered Signal: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
504
                 self.client.Draw(wx.lib.plot.PlotGraphics([line], title, "Time (ms)", "Acc"), yAxis= (-y,y))
514
                 self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line], title, "Time (ms)", "Acc"), yAxis= (-y,y))
505
                 self.client.SetEnableGrid('Horizontal')
515
                 self.graphCtrl.SetEnableGrid('Horizontal')
Line 517... Line 527...
517
                 filterLine1 = wx.lib.plot.PolyLine(((fc,0),(fc,y)), legend='HP Filter', colour='Black', width=4)
527
                 filterLine1 = wx.lib.plot.PolyLine(((fc,0),(fc,y)), legend='HP Filter', colour='Black', width=4)
518
                 fc = self.app.settings["lpf"].value
528
                 fc = self.app.settings["lpf"].value
519
                 filterLine2 = wx.lib.plot.PolyLine(((fc,0),(fc,y)), legend='HP Filter', colour='Black', width=4)
529
                 filterLine2 = wx.lib.plot.PolyLine(((fc,0),(fc,y)), legend='HP Filter', colour='Black', width=4)
Line 520... Line 530...
520
       
530
       
521
                 title = "Spectrum: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
531
                 title = "Spectrum: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
522
                 self.client.Draw(wx.lib.plot.PlotGraphics([line,markers, filterLine1, filterLine2], title, "Freq (Hz)", "Acc"), xAxis=(0,200), yAxis= (-0,y))
532
                 self.graphCtrl.Draw(wx.lib.plot.PlotGraphics([line,markers, filterLine1, filterLine2], title, "Freq (Hz)", "Acc"), xAxis=(0,200), yAxis= (-0,y))
Line 523... Line 533...
523
                 self.client.SetEnableGrid(True)
533
                 self.graphCtrl.SetEnableGrid(True)
524
 
534
 
525
 
535
 
Line 614... Line 624...
614
            idx = self.TestListCtrl.GetFirstSelected()
624
            idx = self.TestListCtrl.GetFirstSelected()
615
            if idx == -1: break
625
            if idx == -1: break
616
            self._removeTest(idx)
626
            self._removeTest(idx)
Line -... Line 627...
-
 
627
           
-
 
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)
-
 
639
        wx.TheClipboard.Close()
-
 
640
 
-
 
641
    def onAbout(self, event): # wxGlade: MainFrame.<event_handler>
-
 
642
         # First we create and fill the info object
-
 
643
        print "about"
-
 
644
        info = wx.AboutDialogInfo()
-
 
645
        info.Name = "MK Vibration Test"
-
 
646
        info.Version = "0.2"
-
 
647
        info.Copyright = ""
-
 
648
        info.Developers=["Frederic Goddeeris"]
-
 
649
        info.Description = "Please consult the WIKI page for a complete description of the tool:"
-
 
650
        info.WebSite = ("http://www.mikrokopter.de/ucwiki/en/VibrationTest", "VibrationTest WIKI page")
-
 
651
        wx.AboutBox(info)
-
 
652
       
-
 
653
       
-
 
654
    def onExit(self, event): # wxGlade: MainFrame.<event_handler>
-
 
655
        self.Close(True)
617
           
656
 
Line 618... Line 657...
618
   
657
 
619
# end of class MainFrame
658
# end of class MainFrame
620
 
659
 
Line 959... Line 998...
959
 
998
 
Line 960... Line 999...
960
       
999
       
-
 
1000
# end of class App
-
 
1001
 
-
 
1002
if __name__ == "__main__":
-
 
1003
 
-
 
1004
    rootPath = os.path.abspath(os.path.dirname(sys.argv[0]))
961
# end of class App
1005
   
962
 
1006
    print rootPath