Rev 661 | Rev 690 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 661 | Rev 683 | ||
---|---|---|---|
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: 661 $ |
6 | # Mikrokopter VibrationTest Rev: $Rev: 683 $ |
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 313... | Line 313... | ||
313 | self.frame_1_menubar.Append(wxglade_tmp_menu, "Help") |
313 | self.frame_1_menubar.Append(wxglade_tmp_menu, "Help") |
314 | self.SetMenuBar(self.frame_1_menubar) |
314 | self.SetMenuBar(self.frame_1_menubar) |
315 | # Menu Bar end |
315 | # Menu Bar end |
316 | self.label_1 = wx.StaticText(self, -1, "Test Description :", style=wx.ALIGN_RIGHT) |
316 | self.label_1 = wx.StaticText(self, -1, "Test Description :", style=wx.ALIGN_RIGHT) |
317 | self.descrCtrl = wx.TextCtrl(self, -1, "N/A") |
317 | self.descrCtrl = wx.TextCtrl(self, -1, "N/A") |
318 | self.label_2 = wx.StaticText(self, -1, "Channel(s) :", style=wx.ALIGN_RIGHT) |
318 | self.label_1_copy = wx.StaticText(self, -1, "Channel(s) :", style=wx.ALIGN_RIGHT) |
- | 319 | self.gyroYawCb = wx.CheckBox(self, -1, "Gyro Yaw") |
|
- | 320 | self.gyroRollCb = wx.CheckBox(self, -1, "Gyro Roll") |
|
- | 321 | self.gyroNickCb = wx.CheckBox(self, -1, "Gyro Nick") |
|
319 | self.accTopCb = wx.CheckBox(self, -1, "ACC Top") |
322 | self.accTopCb = wx.CheckBox(self, -1, "ACC Top") |
320 | self.accRollCb = wx.CheckBox(self, -1, "ACC Roll") |
323 | self.accRollCb = wx.CheckBox(self, -1, "ACC Roll") |
321 | self.accNickCb = wx.CheckBox(self, -1, "ACC Nick") |
324 | self.accNickCb = wx.CheckBox(self, -1, "ACC Nick") |
322 | self.label_3 = wx.StaticText(self, -1, "Motor(s) :", style=wx.ALIGN_RIGHT) |
325 | self.label_3 = wx.StaticText(self, -1, "Motor(s) :", style=wx.ALIGN_RIGHT) |
323 | self.motorsCtrl = wx.TextCtrl(self, -1, "1") |
326 | self.motorsCtrl = wx.TextCtrl(self, -1, "1") |
Line 361... | Line 364... | ||
361 | self.SetTitle("VibrationTest") |
364 | self.SetTitle("VibrationTest") |
362 | self.SetSize((850, 700)) |
365 | self.SetSize((850, 700)) |
363 | self.label_1.SetMinSize((110, -1)) |
366 | self.label_1.SetMinSize((110, -1)) |
364 | self.label_1.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
367 | self.label_1.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
365 | self.descrCtrl.SetMinSize((350, -1)) |
368 | self.descrCtrl.SetMinSize((350, -1)) |
366 | self.label_2.SetMinSize((110, -1)) |
369 | self.label_1_copy.SetMinSize((110, -1)) |
367 | self.label_2.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
370 | self.label_1_copy.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
- | 371 | self.gyroYawCb.SetMinSize((100, -1)) |
|
- | 372 | self.gyroYawCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
|
- | 373 | self.gyroRollCb.SetMinSize((100, -1)) |
|
- | 374 | self.gyroRollCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
|
- | 375 | self.gyroNickCb.SetMinSize((100, -1)) |
|
- | 376 | self.gyroNickCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
|
- | 377 | self.accTopCb.SetMinSize((100, -1)) |
|
368 | self.accTopCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
378 | self.accTopCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
- | 379 | self.accRollCb.SetMinSize((100, -1)) |
|
369 | self.accRollCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
380 | self.accRollCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
370 | self.accRollCb.SetValue(1) |
381 | self.accRollCb.SetValue(1) |
- | 382 | self.accNickCb.SetMinSize((100, -1)) |
|
371 | self.accNickCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
383 | self.accNickCb.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
372 | self.label_3.SetMinSize((110, -1)) |
384 | self.label_3.SetMinSize((110, -1)) |
373 | self.label_3.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
385 | self.label_3.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
374 | self.label_4.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
386 | self.label_4.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) |
375 | self.speedCtrl.SetToolTipString("e.g. \n 100 \n 100,150 \n 100-200:10 \n 50,100-200:10 \n 5*100,5*200") |
387 | self.speedCtrl.SetToolTipString("e.g. \n 100 \n 100,150 \n 100-200:10 \n 50,100-200:10 \n 5*100,5*200") |
Line 395... | Line 407... | ||
395 | sizer_17 = wx.BoxSizer(wx.VERTICAL) |
407 | sizer_17 = wx.BoxSizer(wx.VERTICAL) |
396 | sizer_9 = wx.BoxSizer(wx.HORIZONTAL) |
408 | sizer_9 = wx.BoxSizer(wx.HORIZONTAL) |
397 | sizer_7 = wx.BoxSizer(wx.HORIZONTAL) |
409 | sizer_7 = wx.BoxSizer(wx.HORIZONTAL) |
398 | sizer_13 = wx.BoxSizer(wx.VERTICAL) |
410 | sizer_13 = wx.BoxSizer(wx.VERTICAL) |
399 | sizer_16 = wx.BoxSizer(wx.HORIZONTAL) |
411 | sizer_16 = wx.BoxSizer(wx.HORIZONTAL) |
400 | sizer_15 = wx.BoxSizer(wx.HORIZONTAL) |
412 | sizer_10 = wx.BoxSizer(wx.HORIZONTAL) |
- | 413 | sizer_18 = wx.BoxSizer(wx.VERTICAL) |
|
- | 414 | sizer_20 = wx.BoxSizer(wx.HORIZONTAL) |
|
- | 415 | sizer_19 = wx.BoxSizer(wx.HORIZONTAL) |
|
401 | sizer_14 = wx.BoxSizer(wx.HORIZONTAL) |
416 | sizer_14 = wx.BoxSizer(wx.HORIZONTAL) |
402 | sizer_3.Add((20, 20), 0, 0, 0) |
417 | sizer_3.Add((20, 20), 0, 0, 0) |
403 | sizer_8.Add((20, 20), 0, 0, 0) |
418 | sizer_8.Add((20, 20), 0, 0, 0) |
404 | sizer_14.Add(self.label_1, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
419 | sizer_14.Add(self.label_1, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
405 | sizer_14.Add((20, 20), 0, 0, 0) |
420 | sizer_14.Add((20, 20), 0, 0, 0) |
406 | sizer_14.Add(self.descrCtrl, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
421 | sizer_14.Add(self.descrCtrl, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
407 | sizer_13.Add(sizer_14, 1, wx.EXPAND, 0) |
422 | sizer_13.Add(sizer_14, 0, 0, 0) |
408 | sizer_13.Add((20, 5), 0, 0, 0) |
423 | sizer_13.Add((20, 5), 0, 0, 0) |
- | 424 | sizer_10.Add(self.label_1_copy, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) |
|
- | 425 | sizer_10.Add((20, 20), 0, 0, 0) |
|
- | 426 | sizer_19.Add(self.gyroYawCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
|
- | 427 | sizer_19.Add((20, 20), 0, 0, 0) |
|
409 | sizer_15.Add(self.label_2, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
428 | sizer_19.Add(self.gyroRollCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
410 | sizer_15.Add((20, 20), 0, 0, 0) |
429 | sizer_19.Add((20, 20), 0, 0, 0) |
- | 430 | sizer_19.Add(self.gyroNickCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
|
- | 431 | sizer_18.Add(sizer_19, 1, wx.EXPAND, 0) |
|
411 | sizer_15.Add(self.accTopCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
432 | sizer_20.Add(self.accTopCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
412 | sizer_15.Add((20, 20), 0, 0, 0) |
433 | sizer_20.Add((20, 20), 0, 0, 0) |
413 | sizer_15.Add(self.accRollCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
434 | sizer_20.Add(self.accRollCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
414 | sizer_15.Add((20, 20), 0, 0, 0) |
435 | sizer_20.Add((20, 20), 0, 0, 0) |
415 | sizer_15.Add(self.accNickCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
436 | sizer_20.Add(self.accNickCb, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
- | 437 | sizer_18.Add(sizer_20, 1, wx.EXPAND, 0) |
|
- | 438 | sizer_10.Add(sizer_18, 1, wx.EXPAND, 0) |
|
416 | sizer_13.Add(sizer_15, 1, wx.EXPAND, 0) |
439 | sizer_13.Add(sizer_10, 1, wx.EXPAND, 0) |
417 | sizer_13.Add((20, 5), 0, 0, 0) |
440 | sizer_13.Add((20, 5), 0, 0, 0) |
418 | sizer_16.Add(self.label_3, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
441 | sizer_16.Add(self.label_3, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
419 | sizer_16.Add((20, 20), 0, 0, 0) |
442 | sizer_16.Add((20, 20), 0, 0, 0) |
420 | sizer_16.Add(self.motorsCtrl, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
443 | sizer_16.Add(self.motorsCtrl, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
421 | sizer_16.Add((50, 20), 0, 0, 0) |
444 | sizer_16.Add((50, 20), 0, 0, 0) |
422 | sizer_16.Add(self.label_4, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) |
445 | sizer_16.Add(self.label_4, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) |
423 | sizer_16.Add((20, 20), 0, 0, 0) |
446 | sizer_16.Add((20, 20), 0, 0, 0) |
424 | sizer_16.Add(self.speedCtrl, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
447 | sizer_16.Add(self.speedCtrl, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
425 | sizer_13.Add(sizer_16, 1, wx.EXPAND, 0) |
448 | sizer_13.Add(sizer_16, 0, wx.EXPAND, 0) |
426 | sizer_7.Add(sizer_13, 1, wx.EXPAND, 0) |
449 | sizer_7.Add(sizer_13, 1, wx.EXPAND, 0) |
427 | sizer_7.Add((20, 20), 0, 0, 0) |
450 | sizer_7.Add((20, 20), 0, 0, 0) |
428 | sizer_7.Add((20, 20), 0, 0, 0) |
451 | sizer_7.Add((20, 20), 0, 0, 0) |
429 | sizer_9.Add(sizer_7, 1, wx.EXPAND, 0) |
452 | sizer_9.Add(sizer_7, 0, 0, 0) |
430 | sizer_9.Add(self.bitmap_button_1, 0, 0, 0) |
453 | sizer_9.Add(self.bitmap_button_1, 0, 0, 0) |
431 | sizer_8.Add(sizer_9, 0, 0, 0) |
454 | sizer_8.Add(sizer_9, 0, 0, 0) |
432 | sizer_17.Add((20, 20), 0, 0, 0) |
455 | sizer_17.Add((20, 20), 0, 0, 0) |
433 | sizer_17.Add(self.static_line_1, 0, wx.EXPAND, 0) |
456 | sizer_17.Add(self.static_line_1, 0, wx.EXPAND, 0) |
434 | sizer_17.Add((20, 20), 0, 0, 0) |
457 | sizer_17.Add((20, 20), 0, 0, 0) |
Line 692... | Line 715... | ||
692 | if (motor<1) or (motor>MOTOR_MAX): |
715 | if (motor<1) or (motor>MOTOR_MAX): |
693 | raise Exception("Motor number should be between 1 and %d" % MOTOR_MAX) |
716 | raise Exception("Motor number should be between 1 and %d" % MOTOR_MAX) |
Line 694... | Line 717... | ||
694 | 717 | ||
695 | decoding = "Channel(s)" |
718 | decoding = "Channel(s)" |
- | 719 | mp.channels = [] |
|
- | 720 | if self.gyroYawCb.IsChecked(): mp.channels.append(0) |
|
- | 721 | if self.gyroRollCb.IsChecked(): mp.channels.append(1) |
|
696 | mp.channels = [] |
722 | if self.gyroNickCb.IsChecked(): mp.channels.append(2) |
697 | if self.accTopCb.IsChecked(): mp.channels.append(5) |
723 | if self.accTopCb.IsChecked(): mp.channels.append(5) |
698 | if self.accRollCb.IsChecked(): mp.channels.append(6) |
724 | if self.accRollCb.IsChecked(): mp.channels.append(6) |
Line 699... | Line 725... | ||
699 | if self.accNickCb.IsChecked(): mp.channels.append(7) |
725 | if self.accNickCb.IsChecked(): mp.channels.append(7) |
Line 776... | Line 802... | ||
776 | def onAbout(self, event): # wxGlade: MainFrame.<event_handler> |
802 | def onAbout(self, event): # wxGlade: MainFrame.<event_handler> |
777 | # First we create and fill the info object |
803 | # First we create and fill the info object |
778 | print "about" |
804 | print "about" |
779 | info = wx.AboutDialogInfo() |
805 | info = wx.AboutDialogInfo() |
780 | info.Name = "MK Vibration Test - " |
806 | info.Name = "MK Vibration Test - " |
781 | info.Version = "v1.0 ($Rev: 661 $)".replace("$","") |
807 | info.Version = "v1.1 (EXPERIMENTAL) ($Rev: 683 $)".replace("$","") |
782 | info.Copyright = "" |
808 | info.Copyright = "" |
783 | info.Developers=["Frederic Goddeeris (Frederic@rc-flight.be)"] |
809 | info.Developers=["Frederic Goddeeris (Frederic@rc-flight.be)"] |
784 | info.Description = "Please consult the WIKI page for a complete description of the tool:" |
810 | info.Description = "Please consult the WIKI page for a complete description of the tool:" |
785 | info.WebSite = ("http://www.mikrokopter.de/ucwiki/en/VibrationTest", "VibrationTest WIKI page") |
811 | info.WebSite = ("http://www.mikrokopter.de/ucwiki/en/VibrationTest", "VibrationTest WIKI page") |
786 | wx.AboutBox(info) |
812 | wx.AboutBox(info) |