Beispiel #1
0
        private IEnumerator <ITask> StartIterator(Port <bool> successPort)
        {
            bool success = false;

            InitController init = new InitController();

            _controllerPort.Post(init);
            yield return(Arbiter.Choice(
                             init.ResponsePort,
                             delegate(DefaultSubmitResponseType response)
            {
                // The controller initialized successfully.
                _srv1 = srv1srv.Srv1Service.Srv1Controller;
                success = true;
            },
                             delegate(Fault fault) { }
                             ));

            if (!success)
            {
                successPort.Post(false);
                yield break;
            }

            // Activate service handlers.
            StartBehavior();
            successPort.Post(true);
            yield break;
        }
Beispiel #2
0
        public IEnumerator <ITask> ReplaceHandler(Replace replace)
        {
            int comPort = replace.Body.ComPort;

            if (comPort > 0)
            {
                Srv1Controller.PortName = "COM" + comPort;
                Srv1Controller          = Srv1Controller.Srv1Factory();

                _subMgrPort.Post(new submgr.Submit(_state, DsspActions.ReplaceRequest));
                _state = replace.Body;
            }
            yield break;
        }
Beispiel #3
0
        public void InitControllerInternal()
        {
            int comPort = this._state.ComPort;

            if (comPort > 0)
            {
                Srv1Controller.PortName = "COM" + comPort;
                Srv1Controller          = Srv1Controller.Srv1Factory();
            }
            else
            {
                LogError("Surveyor SRV-1 Controller failed to initialize. Please configure the COM port.");
                throw new Exception();
            }
        }
Beispiel #4
0
        private FrameGrabber(Camera camera)
        {
            this._camera   = camera;
            this._scanMode = camera.Path.Contains("radar");
            _srv1          = srv1srv.Srv1Service.Srv1Controller;
            // Set the default resolution to 160x128
            this.Format = this.Formats[1];

            Dispatcher dispatcher = new Dispatcher(0, "FrameGrabber");

            this._taskQueue = new DispatcherQueue("FrameGrabber DispatcherQueue", dispatcher);

            this.StartBehavior();

            while (_srv1 == null)
            {
                System.Threading.Thread.Sleep(500);
            }
        }