Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 650 → Rev 651

/VibrationTest/trunk/VibrationTest/VibrationTestGui.py
26,6 → 26,8
 
 
CHANNEL_NAMES = ["GyroYaw", "GyroRoll", "GyroNick", "Pressure", "Batt", "AccTop", "AccRoll", "AccNick"]
MOTOR_MAX = 16
 
FS = 11111
pi = 3.14
COLOR_YELLOW = wx.Colour(255, 240, 0)
681,15 → 683,25
def onStartMeasure(self, event): # wxGlade: MainFrame.<event_handler>
# Collect measure parameters
mp = MeasureParameters()
decoding = ""
try:
decoding = "Description"
mp.descr = self.descrCtrl.GetValue()
 
decoding = "Motor(s)"
mp.motors = map(int,self.motorsCtrl.GetValue().split(','))
for motor in mp.motors:
if (motor<1) or (motor>MOTOR_MAX):
raise Exception("Motor number should be between 1 and %d" % MOTOR_MAX)
 
decoding = "Channel(s)"
mp.channels = []
if self.accTopCb.IsChecked(): mp.channels.append(5)
if self.accRollCb.IsChecked(): mp.channels.append(6)
if self.accNickCb.IsChecked(): mp.channels.append(7)
 
decoding = "Speed(s)"
mp.speeds = []
for speedTxt in self.speedCtrl.GetValue().split(","):
if speedTxt.count("-") == 1:
707,8 → 719,12
mp.speeds.append(int(speedTxt[1]))
else:
mp.speeds.append(int(speedTxt))
for speed in mp.speeds:
if (speed<0) or (speed>255):
raise Exception("Speed values should be between 0 and 255")
 
except Exception,e:
dial = wx.MessageDialog(None, 'Invalid paramters', 'Error', wx.OK |
dial = wx.MessageDialog(None, 'Invalid paramter \"%s\"\n\n%s' % (decoding, str(e)), 'Error', wx.OK |
wx.ICON_ERROR)
dial.ShowModal()
raise e
764,10 → 780,10
# First we create and fill the info object
print "about"
info = wx.AboutDialogInfo()
info.Name = "- MK Vibration Test - "
info.Version = "v0.9 RC2"
info.Name = "MK Vibration Test - "
info.Version = "v0.9 RC2 ($Rev$)".replace("$","")
info.Copyright = ""
info.Developers=["Frederic Goddeeris Frederic@rc-flight.be"]
info.Developers=["Frederic Goddeeris (Frederic@rc-flight.be)"]
info.Description = "Please consult the WIKI page for a complete description of the tool:"
info.WebSite = ("http://www.mikrokopter.de/ucwiki/en/VibrationTest", "VibrationTest WIKI page")
wx.AboutBox(info)
832,7 → 848,7
wx.PostEvent(self.evtConsumer, evt)
 
def _setMotorSpeed(self, speed, settlingTime):
speeds = [0,0,0,0]
speeds = [0]*MOTOR_MAX
for motor in self.param.motors:
speeds[motor-1] = speed