Exemple #1
0
        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);
                    });
                }
            });
        }
Exemple #2
0
        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();
            }
        }
Exemple #3
0
 public void TearDown()
 {
     tracker.Disable(null);
     tracker.EndCalibration(null);
     tracker = null;
 }