pvt motion

This commit is contained in:
2017-01-04 13:51:18 +01:00
parent 85f20ef491
commit a265d91f2f
7 changed files with 141 additions and 39 deletions

View File

@@ -45,16 +45,16 @@ class MPLCanvasErr(FigureCanvas):
self.fig=fig
self.ax=ax
def InitChild(self,err):
def InitChild(self,meta,err):
fig=self.fig
ax=self.ax
errx,erry,err=err
hl = []
hl += ax.plot(errx, 'g-',label='x-error')
hl += ax.plot(erry, 'y-',label='y-error')
hl += ax.plot(errx, 'b-',label='x-error')
hl += ax.plot(erry, 'g-',label='y-error')
hl += ax.plot(err, 'r-',label='error')
ax.xaxis.set_label_text('time (10x servo cycle)')
ax.xaxis.set_label_text('datapoint (timebase: %g ms per data point)'%meta['timebase'])
ax.yaxis.set_label_text('pos-error um')
legend = ax.legend(loc='upper right', shadow=True)
ax.plot([.5,.5],[0.01, 0.99],'k',transform=ax.transAxes)
@@ -128,6 +128,7 @@ class MAErrorFrame(wx.Frame):
toolbar=ut.AddToolbar(canvas,sizer)
meta = doc.fh['meta'].item()
try:
err=doc.err
except AttributeError:
@@ -136,7 +137,7 @@ class MAErrorFrame(wx.Frame):
erry = abs(rec[:, 2] - rec[:, 5])
errxy = np.sqrt(errx ** 2 + erry ** 2)
doc.err = err = (errx, erry, errxy)
canvas.InitChild(err)
canvas.InitChild(meta,err)
self.Centre()