public override void DrawContents(DataRecord rec) { if (rec != null) { if (rec.content[0] == 0x01) { xspp = (rec.content[1] - 128) / 10.0; yspp = (rec.content[2] - 128) / 10.0; } } xsp = 0.8 * xsp + 0.2 * xspp; ysp = 0.8 * ysp + 0.2 * yspp; RendererWrapper.DrawCoordinate(boundingbox, new RGBAColor(1, 1, 1, 0.3)); RendererWrapper.DrawArrow(boundingbox, new Point2D(boundingbox.Width / 2, boundingbox.Height / 2), new Point2D(boundingbox.Width / 2 + 7 * xsp, boundingbox.Height / 2 + 7 * ysp), Globals.emgchannelcols[8], thickness: 2, headsize: 25); }
public override void DrawContents(DataRecord rec) { if (rec != null) //new record { if (rec.content[0] == 0x09) //check appuid { if (rec.content[1] == 0x01) //mouse enabled { xspp = AppUtils.ValueMapToDouble(rec.content[2], -15, 15); yspp = AppUtils.ValueMapToDouble(rec.content[3], -15, 15); } mxspp = -AppUtils.ValueMapToDouble(rec.content[4], -15, 15); myspp = AppUtils.ValueMapToDouble(rec.content[5], -15, 15); mxsoff = -AppUtils.ValueMapToDouble(rec.content[6], -15, 15); mysoff = AppUtils.ValueMapToDouble(rec.content[7], -15, 15); } } xsp = 0.8 * xsp + 0.2 * xspp; ysp = 0.8 * ysp + 0.2 * yspp; mxsp = 0.8 * mxsp + 0.2 * mxspp; mysp = 0.8 * mysp + 0.2 * myspp; RendererWrapper.DrawCoordinate(boundingbox, new RGBAColor(1, 1, 1, 0.3)); List <Point2D> mpts = new List <Point2D>(); mpts.Add(new Point2D(boundingbox.Width / 2 + 7 * mxsoff, boundingbox.Height / 2)); mpts.Add(new Point2D(boundingbox.Width / 2, boundingbox.Height / 2 + 7 * mysoff)); RendererWrapper.DrawMarkers(boundingbox, mpts, Globals.emgchannelcols[7], 0, 10); RendererWrapper.DrawArrow(boundingbox, new Point2D(boundingbox.Width / 2, boundingbox.Height / 2), new Point2D(boundingbox.Width / 2 + 7 * mxsp - 7 * mxsoff, boundingbox.Height / 2), Globals.emgchannelcols[7], thickness: 2, headsize: 10); RendererWrapper.DrawArrow(boundingbox, new Point2D(boundingbox.Width / 2, boundingbox.Height / 2), new Point2D(boundingbox.Width / 2, boundingbox.Height / 2 + 7 * mysp - 7 * mysoff), Globals.emgchannelcols[7], thickness: 2, headsize: 10); RendererWrapper.DrawArrow(boundingbox, new Point2D(boundingbox.Width / 2, boundingbox.Height / 2), new Point2D(boundingbox.Width / 2 + 7 * xsp, boundingbox.Height / 2 + 7 * ysp), Globals.emgchannelcols[8], thickness: 2, headsize: 25); }