Rev 602 | Rev 607 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 602 | Rev 606 | ||
---|---|---|---|
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 | import sys |
|
5 | import sys |
6 | import os |
6 | import wx |
7 | import wx |
7 | import wx.lib |
8 | import wx.lib |
Line 8... | Line 9... | ||
8 | import wx.lib.plot |
9 | import wx.lib.plot |
Line 285... | Line 286... | ||
285 | def onNewTest(self, test): |
286 | def onNewTest(self, test): |
286 | index = self.TestListCtrl.InsertStringItem(sys.maxint, test.descr) |
287 | index = self.TestListCtrl.InsertStringItem(sys.maxint, test.descr) |
287 | self.TestListCtrl.SetStringItem(index, 1, str(test.speed)) |
288 | self.TestListCtrl.SetStringItem(index, 1, str(test.speed)) |
288 | self.TestListCtrl.SetStringItem(index, 2, test.channel) |
289 | self.TestListCtrl.SetStringItem(index, 2, test.channel) |
289 | self.TestListCtrl.SetStringItem(index, 3, str(test.getVibValue())) |
290 | self.TestListCtrl.SetStringItem(index, 3, str(test.getVibValue())) |
- | 291 | if (index == 0): |
|
- | 292 | self.TestListCtrl.Select(index) |
|
Line 290... | Line 293... | ||
290 | 293 | ||
291 | 294 | ||
292 | def OnTestSelected(self, event): |
295 | def OnTestSelected(self, event): |
Line 333... | Line 336... | ||
333 | self.client.Draw(wx.lib.plot.PlotGraphics([line,markers], title, "Freq (Hz)", "Acc"), xAxis=(0,200), yAxis= (-0,y)) |
336 | self.client.Draw(wx.lib.plot.PlotGraphics([line,markers], title, "Freq (Hz)", "Acc"), xAxis=(0,200), yAxis= (-0,y)) |
334 | self.client.SetEnableGrid(True) |
337 | self.client.SetEnableGrid(True) |
Line 335... | Line 338... | ||
335 | 338 | ||
- | 339 | ||
- | 340 | def OnImport(self, event): # wxGlade: MainFrame.<event_handler> |
|
- | 341 | dlg = wx.FileDialog( |
|
- | 342 | self, message="Choose a file", |
|
- | 343 | defaultDir=os.getcwd(), |
|
- | 344 | defaultFile="*.txt", |
|
- | 345 | wildcard="", |
|
- | 346 | style=wx.OPEN | wx.CHANGE_DIR |
|
- | 347 | ) |
|
336 | 348 | if dlg.ShowModal() == wx.ID_OK: |
|
- | 349 | paths = dlg.GetPaths(); |
|
Line 337... | Line 350... | ||
337 | def OnImport(self, event): # wxGlade: MainFrame.<event_handler> |
350 | self.app.Import(paths[0]) |
338 | self.app.Import() |
351 | dlg.Destroy() |
Line 339... | Line 352... | ||
339 | 352 | ||
Line 404... | Line 417... | ||
404 | def __init__(self, par): |
417 | def __init__(self, par): |
405 | self.VibTests = [] |
418 | self.VibTests = [] |
Line 406... | Line 419... | ||
406 | 419 | ||
Line -... | Line 420... | ||
- | 420 | wx.App.__init__(self, par) |
|
- | 421 | ||
- | 422 | if len(sys.argv)>1: |
|
Line 407... | Line 423... | ||
407 | wx.App.__init__(self, par) |
423 | self.Import(sys.argv[1]) |
408 | 424 | ||
409 | 425 | ||
410 | def AddTest(self, descr, motor, speed, channel, rawData): |
426 | def AddTest(self, descr, motor, speed, channel, rawData): |
Line 422... | Line 438... | ||
422 | self.SetTopWindow(self.frame_1) |
438 | self.SetTopWindow(self.frame_1) |
Line 423... | Line 439... | ||
423 | 439 | ||
424 | self.frame_1.Show() |
440 | self.frame_1.Show() |
Line 425... | Line 441... | ||
425 | return 1 |
441 | return 1 |
426 | - | ||
427 | def Import(self): |
- | |
428 | - | ||
429 | #filePath = "./unbal150.txt" |
- | |
430 | #filePath = "./nikivan.txt" |
- | |
431 | #filePath = "./MK1_unbal.txt" |
- | |
Line 432... | Line 442... | ||
432 | filePath = "./MK1_bal.txt" |
442 | |
Line 433... | Line 443... | ||
433 | 443 | def Import(self, filePath): |
|
434 | 444 | ||
Line 435... | Line 445... | ||
435 | print "Import %s" % filePath |
445 | print "Importing file \"%s\"" % filePath |