Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 601 → Rev 602

/VibrationTest/trunk/VibrationTest/VibrationTestGui.py
255,7 → 255,7
self.TestListCtrl.InsertColumn(0, "Description")
self.TestListCtrl.InsertColumn(1, "Speed")
self.TestListCtrl.InsertColumn(2, "Channel")
self.TestListCtrl.InsertColumn(3, "Result")
self.TestListCtrl.InsertColumn(3, "VibrationValue")
 
def DrawPointLabel(self, dc, mDataDict):
"""This is the fuction that defines how the pointLabels are plotted
286,7 → 286,7
index = self.TestListCtrl.InsertStringItem(sys.maxint, test.descr)
self.TestListCtrl.SetStringItem(index, 1, str(test.speed))
self.TestListCtrl.SetStringItem(index, 2, test.channel)
self.TestListCtrl.SetStringItem(index, 3, "OK")
self.TestListCtrl.SetStringItem(index, 3, str(test.getVibValue()))
 
 
def OnTestSelected(self, event):
330,7 → 330,7
markers = wx.lib.plot.PolyMarker(xydata, legend= '', colour='red', marker='circle',size=2)
title = "Spectrum: %s %s %d" %(vibTest.descr, vibTest.channel, vibTest.speed)
self.client.Draw(wx.lib.plot.PlotGraphics([line,markers], title, "Freq (Hz)", "Acc"), xAxis=(0,300), yAxis= (-0,y))
self.client.Draw(wx.lib.plot.PlotGraphics([line,markers], title, "Freq (Hz)", "Acc"), xAxis=(0,200), yAxis= (-0,y))
self.client.SetEnableGrid(True)
 
 
368,6 → 368,8
self.spectrum = None
self.filteredData = None
self.vibValue = None
def getDescr(self):
return self.Descr
 
385,12 → 387,18
def getFilteredData(self):
if self.filteredData == None:
tmpfft = self.fft.copy()
for i in range(0,7):
for i in range(0,5):
tmpfft[i] = 0
for i in range(30, len(tmpfft)):
tmpfft[i] = 0
self.filteredData = _Numeric.fft.irfft(tmpfft)
return self.filteredData
def getVibValue(self):
if self.vibValue == None:
fd = self.getFilteredData();
self.vibValue = max(fd)-min(fd)
return self.vibValue
 
class App(wx.App):
def __init__(self, par):
418,9 → 426,12
 
def Import(self):
 
filePath = "./unbal150.txt"
#filePath = "./unbal150.txt"
#filePath = "./nikivan.txt"
#filePath = "./MK1_unbal.txt"
filePath = "./MK1_bal.txt"
print "Import %s" % filePath
 
logfile = open(filePath, "r")