public void Start() { tracker.RegisterOnETEvent(delegate(GetPoint point) { if (stop.WaitOne(0)) { OnStatusChanged(this, new EventArgs()); tracker.Disable(null); Thread.CurrentThread.Abort(); // Shutting down this thread. return; } if (Listen) { EriverProtocol proto = new EriverProtocol(); proto.Kind = Command.GetPoint; proto.GetPoint = point; Send(proto); } }); tracker.Enable(null); using (log4net.ThreadContext.Stacks["NDC"].Push("Run")) { Run(); } //Finalize calibration if disconnecting during calibration. tracker.GetState(delegate(int state, int error) { if ((state & 2) != 0) { tracker.ClearCalibration(delegate(int res, int err) { tracker.EndCalibration(null); }); } }); }
public void Start() { tracker.RegisterOnETEvent(delegate(GetPoint point) { if (stop.WaitOne(0)) { OnStatusChanged(this, new EventArgs()); tracker.Disable(null); Thread.CurrentThread.Abort(); // Shutting down this thread. return; } EriverProtocol proto = new EriverProtocol(); proto.Kind = Command.GetPoint; proto.GetPoint = point; Send(proto); }); tracker.Enable(null); using (log4net.ThreadContext.Stacks["NDC"].Push("Run")) { Run(); } }
public void TearDown() { tracker.Disable(null); tracker.EndCalibration(null); tracker = null; }