Exemple #1
0
        public IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            TaskQueue.Dispose();

            DefaultDropHandler(drop);
            yield break;
        }
        public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
        {
            SetSafePositions();

            base.DefaultDropHandler(drop);
            yield break;
        }
        public IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            base.DefaultDropHandler(drop);

            _state.Synthesizer.Dispose();
            yield break;
        }
        public virtual IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            SetSafePositions();

            base.DefaultDropHandler(drop);
            yield break;
        }
Exemple #5
0
        public IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            Srv1Controller.Dispose();

            base.DefaultDropHandler(drop);
            yield break;
        }
 /// <summary>
 /// Drop handler
 /// </summary>
 /// <param name="drop"></param>
 /// <returns></returns>
 public IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
 {
     base.DefaultDropHandler(drop);
     // Stop & dispose recognition engine
     this.state.Recognizer.Dispose();
     yield break;
 }
 public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
 {
     // Close connection and Dispose() serial port.
     CloseConnection(true);
     drop.ResponsePort.Post(DefaultDropResponseType.Instance);
     yield break;
 }
        /// <summary>
        /// Post Dssp Default Drop and return the response port.
        /// </summary>
        public virtual PortSet <DefaultDropResponseType, Fault> DsspDefaultDrop()
        {
            DropRequestType body = new DropRequestType();
            DsspDefaultDrop op   = new DsspDefaultDrop(body);

            this.PostUnknownType(op);
            return(op.ResponsePort);
        }
Exemple #9
0
        public IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            _clockPort.DsspDefaultDrop();
            _localClockPort.DsspDefaultDrop();

            base.DefaultDropHandler(drop);
            yield break;
        }
        public virtual IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            LogInfo("TrackRoamerDriveService:DropHandler()");

            base.DefaultDropHandler(drop);

            yield break;
        }
Exemple #11
0
        public virtual IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            _legoBrickPort.Detach(ServiceInfo.Service);

            // drop the service
            base.DefaultDropHandler(drop);
            yield break;
        }
        public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
        {
            LogInfo("TrackRoamerBumper:DropHandler()");

            base.DefaultDropHandler(drop);

            yield break;
        }
        public IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            // cancel any active tasks that are still active
            TaskQueue.Dispose();

            DefaultDropHandler(drop);
            yield break;
        }
Exemple #14
0
 public void DropHandler(DsspDefaultDrop drop)
 {
     // Currently it is not possible to activate a handler that returns
     // IEnumerator<ITask> in a teardown group. Thus we have to spawn the iterator ourselves
     // to acheive the same effect.
     // This issue will be addressed in upcomming releases.
     SpawnIterator(drop, DoDrop);
 }
Exemple #15
0
        /// <summary>
        /// Post DsspDefaultDrop and return the response port.
        /// </summary>
        /// <returns></returns>
        public virtual PortSet <DefaultDropResponseType, Fault> DsspDefaultDrop()
        {
            DsspDefaultDrop op = new DsspDefaultDrop();

            op.Body = new DropRequestType();
            this.Post(op);
            return(op.ResponsePort);
        }
Exemple #16
0
 void DropHandler(DsspDefaultDrop drop)
 {
     if (_state.Selected != null &&
         _state.Selected.FrameGrabber != null)
     {
         _state.Selected.FrameGrabber.Dispose();
     }
     base.DefaultDropHandler(drop);
 }
Exemple #17
0
        public void DropHandler(DsspDefaultDrop drop)
        {
#if !URT_MINCLR
            ShutdownInternalService();
#endif
            QuitClient();

            base.DefaultDropHandler(drop);
        }
Exemple #18
0
        public virtual IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            LogInfo("TrackRoamerBrickPowerService:DropHandler()");

            _state.Dropping = true;     // makes sure the command loop is not calling controller

            _brickConnection.Close();
            base.DefaultDropHandler(drop);

            yield break;
        }
Exemple #19
0
        public virtual IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            if (_state.Connected)
            {
                _chrConnection.Close();
                _state.Connected = false;
            }

            base.DefaultDropHandler(drop);
            yield break;
        }
Exemple #20
0
        public virtual IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            // Close the serial port
            Close close = new Close();

            _commOpenClosePort.Post(close);
            yield return(Arbiter.Choice(close.ResponsePort,
                                        EmptyHandler <DefaultSubmitResponseType>,
                                        EmptyHandler <Fault>));

            drop.ResponsePort.Post(DefaultDropResponseType.Instance);
            yield break;
        }
Exemple #21
0
 void DropHandler(DsspDefaultDrop drop)
 {
     try
     {
         if (_link != null)
         {
             // release dispatcher queue resource
             ResourceManagerPort.Post(new FreeExecutionResource(_link.TaskQueue));
             _link.Close();
             _link = null;
         }
     }
     finally
     {
         base.DefaultDropHandler(drop);
     }
 }
        public void DropHandler(DsspDefaultDrop drop)
        {
            if (_form != null)
            {
                WinFormsServicePort.FormInvoke(
                    delegate()
                    {
                        if (!_form.IsDisposed)
                        {
                            _form.Dispose();
                        }
                    }
                );
            }

            base.DefaultDropHandler(drop);
        }
Exemple #23
0
        public IEnumerator <ITask> DropHandler(DsspDefaultDrop drop)
        {
            // Update our state, but only wait for one second.
            PortSet <DefaultUpdateResponseType, Fault> responsePort = UpdateServiceStatus(LegoNxtBumperStatus.ShuttingDown);

            yield return(Arbiter.Choice(
                             Arbiter.Receive <DefaultUpdateResponseType>(false, responsePort,
                                                                         delegate(DefaultUpdateResponseType response) { }),
                             Arbiter.Receive <Fault>(false, responsePort,
                                                     delegate(Fault fault) { }),
                             Arbiter.Receive <DateTime>(false, TimeoutPort(1000),
                                                        delegate(DateTime timeout) { })));

            base.DefaultDropHandler(drop);

            yield break;
        }
        public void DropHandler(DsspDefaultDrop drop)
        {
            if (_form != null)
            {
                WinFormsServicePort.FormInvoke(
                    delegate()
                {
                    if (!_form.IsDisposed)
                    {
                        _form.Dispose();
                    }
                }
                    );
            }

            base.DefaultDropHandler(drop);
        }
        /// <summary>
        /// Drop Handler shuts down SimpleDashboard
        /// </summary>
        /// <param name="drop"></param>
        void DropHandler(DsspDefaultDrop drop)
        {
            PerformShutdown(ref _laserShutdown);
            PerformShutdown(ref _motorShutdown);
            if (_driveControl != null)
            {
                DriveControl drive = _driveControl;
                _driveControl = null;

                WinFormsServicePort.FormInvoke(
                    delegate()
                {
                    if (!drive.IsDisposed)
                    {
                        drive.Dispose();
                    }
                }
                    );
            }

            base.DefaultDropHandler(drop);
        }
Exemple #26
0
        IEnumerator <ITask> DoDrop(DsspDefaultDrop drop)
        {
            if (_state.IsActive)
            {
                LogInfo("Explorer service is being dropped while moving, Requesting Stop.");

                yield return(Arbiter.Choice(
                                 StopMoving(),
                                 delegate(DefaultUpdateResponseType response) { },
                                 delegate(Fault fault) { }
                                 ));

                yield return(Arbiter.Choice(
                                 DisableMotor(),
                                 delegate(DefaultUpdateResponseType response) { },
                                 delegate(Fault fault) { }
                                 ));
            }

            LogInfo("Dropping Explorer.");

            base.DefaultDropHandler(drop);
        }
Exemple #27
0
        void DropHandler(DsspDefaultDrop drop)
        {
            Tracer.Trace("TrackRoamerBrickProximityBoardService::DropHandler()");

            _state.LinkState   = "Dropping service - Closing link to Proximity Board";
            _state.IsConnected = false;

            try
            {
                if (_pbCommander != null)
                {
                    // release dispatcher queue resource
                    ResourceManagerPort.Post(new FreeExecutionResource(_pbCommander.TaskQueue));
                    _pbCommander.Close();
                    _pbCommander       = null;
                    _state.IsConnected = false;
                }
            }
            finally
            {
                base.DefaultDropHandler(drop);
            }
        }
Exemple #28
0
        public void DropHandler(DsspDefaultDrop drop)
        {
            // Collect the state informations and write them in the state
            _state.WindowControlX            = _windowControl.Location.X;
            _state.WindowControlY            = _windowControl.Location.Y;
            _state.WindowPIDTuningX          = _windowPIDTuning.Location.X;
            _state.WindowPIDTuningY          = _windowPIDTuning.Location.Y;
            _state.WindowSimulationSettingsX = _windowSimulationSettings.Location.X;
            _state.WindowSimulationSettingsY = _windowSimulationSettings.Location.Y;
            _state.WindowStatisticsX         = _windowStatistics.Location.X;
            _state.WindowStatisticsY         = _windowStatistics.Location.Y;

            _state.AttitudeP = _multicopterEntity.pidControllerAttitudeX.Kp;
            _state.AttitudeI = _multicopterEntity.pidControllerAttitudeX.Ki;
            _state.AttitudeD = _multicopterEntity.pidControllerAttitudeX.Kd;
            _state.AltitudeP = _multicopterEntity.pidControllerAltitude.Kp;
            _state.AltitudeI = _multicopterEntity.pidControllerAltitude.Ki;
            _state.AltitudeD = _multicopterEntity.pidControllerAltitude.Kd;
            _state.PositionP = _multicopterEntity.pidControllerPositionX.Kp;
            _state.PositionI = _multicopterEntity.pidControllerPositionX.Ki;
            _state.PositionD = _multicopterEntity.pidControllerPositionX.Kd;

            _state.WindSimulationActivated  = _multicopterEntity.windSimulationActivated;
            _state.WindDirection            = _multicopterEntity.settingsWindDirection;
            _state.WindIntensity            = _multicopterEntity.settingsWindIntensity;
            _state.WindDirectionFluctuation = _multicopterEntity.settingsWindDirectionFluctuation;
            _state.WindIntensityFluctuation = _multicopterEntity.settingsWindIntensityFluctuation;

            _state.YScale = _windowStatistics.YScale;

            // Save the state as a file
            base.SaveState(_state);

            // Quit the program
            base.DefaultDropHandler(drop);
        }
        public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
        {
            // Close the Connection to the LEGO
            if (_brickPort != null)
                _brickPort.Close();

            base.DefaultDropHandler(drop);
            yield break;
        }
        public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
        {
            // Close the serial port
            Close close = new Close();
            _commOpenClosePort.Post(close);
            yield return Arbiter.Choice(close.ResponsePort,
                EmptyHandler<DefaultSubmitResponseType>,
                EmptyHandler<Fault>);

            drop.ResponsePort.Post(DefaultDropResponseType.Instance);
            yield break;
        }
Exemple #31
0
 public void DropHandler(DsspDefaultDrop drop)
 {
     DssEnvironment.ControlPanelPort.Shutdown();
     DssEnvironment.Shutdown();
 }
        public virtual IEnumerator<ITask> DualDropHandler(DsspDefaultDrop drop)
        {
            // detach from the brick
            _legoBrickPort.Detach(ServiceInfo.Service);

            base.DefaultDropHandler(drop);
            yield break;
        }
Exemple #33
0
 public virtual void DropHandler(DsspDefaultDrop drop)
 {
     LogInfo(LogGroups.Console, string.Format("Shutting down simulation iRobot: {0}", _state.Name));
     base.DefaultDropHandler(drop);
 }
Exemple #34
0
        IEnumerator<ITask> DoDrop(DsspDefaultDrop drop)
        {
            if (_state.IsActive)
            {
                LogInfo("Explorer service is being dropped while moving, Requesting Stop.");

                yield return Arbiter.Choice(
                    StopMoving(),
                    delegate(DefaultUpdateResponseType response) { },
                    delegate(Fault fault) { }
                );

                yield return Arbiter.Choice(
                    DisableMotor(),
                    delegate(DefaultUpdateResponseType response) { },
                    delegate(Fault fault) { }
                );
            }

            LogInfo("Dropping Explorer.");

            base.DefaultDropHandler(drop);
        }
        public IEnumerator<ITask> DoDrop(DsspDefaultDrop drop)
        {
            Talker.Say(9, "Dropping Drive Behavior Service Base");

            _state.Dropping = true;

            ClearHeadAnimations();

            AllLightsOff();

            // we trust the brick to shutdown gracefully. If we start issuing commands here, the drive and brick will not respond anyway,
            // as they are going down too.

            yield return Timeout(1000);

            //if (_state.IsActive)
            //{
            //    LogInfo("DriveBehaviorServiceBase service is being dropped while moving, Requesting Stop.");

            //    yield return Arbiter.Choice(
            //        StopMoving(),
            //        delegate(DefaultUpdateResponseType response) { },
            //        delegate(Fault fault) { }
            //    );

            //    yield return Arbiter.Choice(
            //        DisableMotor(),
            //        delegate(DefaultUpdateResponseType response) { },
            //        delegate(Fault fault) { }
            //    );
            //}

            LogInfo("Dropping DriveBehaviorServiceBase - calling base.DefaultDropHandler(drop)");

            base.DefaultDropHandler(drop);

            yield break;
        }
        IEnumerator<ITask> DoDrop(DsspDefaultDrop drop)
        {
            if (_mapForm != null)
            {
                MapForm map = _mapForm;
                _mapForm = null;

                WinFormsServicePort.FormInvoke(
                    delegate()
                    {
                        if (!map.IsDisposed)
                        {
                            map.Close();
                            map.Dispose();
                        }
                    }
                );
            }

            if (_state.IsActive)
            {
                LogInfo("ExplorerSimSonar service is being dropped while moving, Requesting Stop.");

                yield return Arbiter.Choice(
                    StopMoving(),
                    delegate(DefaultUpdateResponseType response) { },
                    delegate(Fault fault) { }
                );

                yield return Arbiter.Choice(
                    DisableMotor(),
                    delegate(DefaultUpdateResponseType response) { },
                    delegate(Fault fault) { }
                );
            }

            LogInfo("Dropping ExplorerSimSonar.");

            base.DefaultDropHandler(drop);
        }
        void DropHandler(DsspDefaultDrop drop)
        {
            Tracer.Trace("TrackRoamerBrickProximityBoardService::DropHandler()");

            _state.LinkState = "Dropping service - Closing link to Proximity Board";
            _state.IsConnected = false;

            try
            {
                if (_pbCommander != null)
                {
                    // release dispatcher queue resource
                    ResourceManagerPort.Post(new FreeExecutionResource(_pbCommander.TaskQueue));
                    _pbCommander.Close();
                    _pbCommander = null;
                    _state.IsConnected = false;
                }
            }
            finally
            {
                base.DefaultDropHandler(drop);
            }
        }
        /// <summary>
        /// Drop Handler shuts down SimpleDashboard
        /// </summary>
        /// <param name="drop"></param>
        void DropHandler(DsspDefaultDrop drop)
        {
            PerformShutdown(ref _laserShutdown);
            PerformShutdown(ref _motorShutdown);
            if (_driveControl != null)
            {
                DriveControl drive = _driveControl;
                _driveControl = null;

                WinFormsServicePort.FormInvoke(
                    delegate()
                    {
                        if (!drive.IsDisposed)
                        {
                            drive.Dispose();
                        }
                    }
                );
            }

            base.DefaultDropHandler(drop);
        }
 /// <summary>
 /// Drop Handler shuts down Dashboard
 /// </summary>
 /// <param name="drop"></param>
 void DropHandler(DsspDefaultDrop drop)
 {
     SpawnIterator(drop, DropIterator);
 }
        public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
        {
            _legoBrickPort.Detach(ServiceInfo.Service);

            // drop the service
            base.DefaultDropHandler(drop);
            yield break;
        }
Exemple #41
0
 public void DropHandler(DsspDefaultDrop drop)
 {
     // Currently it is not possible to activate a handler that returns
     // IEnumerator<ITask> in a teardown group. Thus we have to spawn the iterator ourselves
     // to acheive the same effect.
     // This issue will be addressed in upcomming releases.
     SpawnIterator(drop, DoDrop);
 }
Exemple #42
0
 public void DropHandler(DsspDefaultDrop drop)
 {
     this.serialPort.Dispose(); // Dispose will close the serial port
     this.DefaultDropHandler(drop);
 }
Exemple #43
0
 /// <summary>
 /// Post(DsspDefaultDrop)
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public void Post(DsspDefaultDrop item)
 {
     base.PostUnknownType(item);
 }
        IEnumerator<ITask> DropIterator(DsspDefaultDrop drop)
        {
            LogInfo("Starting Drop");

            /*
            // Close the WebCam Form
            if (_cameraForm != null)
            {
                WebCamForm cam = _cameraForm;
                _cameraForm = null;

                WinFormsServicePort.FormInvoke(
                    delegate()
                    {
                        if (!cam.IsDisposed)
                        {
                            cam.Dispose();
                        }
                    }
                );
            }
            */

            // Close the Dashboard Form
            if (_driveControl != null)
            {
                DriveControl drive = _driveControl;
                _driveControl = null;

                WinFormsServicePort.FormInvoke(
                    delegate()
                    {
                        if (!drive.IsDisposed)
                        {
                            drive.Dispose();
                        }
                    }
                );
            }


            if (_laserShutdown != null)
            {
                yield return PerformShutdown(ref _laserShutdown);
            }

            if (_motorShutdown != null)
            {
                yield return PerformShutdown(ref _motorShutdown);
            }

            base.DefaultDropHandler(drop);
        }
 public void DropHandler(DsspDefaultDrop drop)
 {
     this.DefaultDropHandler(drop);
 }
        public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
		{
            LogInfo("TrackRoamerBrickPowerService:DropHandler()");

            _state.Dropping = true;     // makes sure the command loop is not calling controller

            _brickConnection.Close();
			base.DefaultDropHandler(drop);

			yield break;
		}
        public virtual IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
        {
            if (_state.Connected)
            {
                _gpsConnection.Close();
                _state.Connected = false;
            }

            base.DefaultDropHandler(drop);
            yield break;
        }
Exemple #48
0
 public void DropHandler(DsspDefaultDrop drop)
 {
     base.DefaultDropHandler(drop);
     base.Shutdown();
 }
Exemple #49
0
        void DropHandler(DsspDefaultDrop drop)
        {
            Tracer.Trace("SickLRF::DropHandler()");

            try
            {
                if (_link != null)
                {
                    // release dispatcher queue resource
                    ResourceManagerPort.Post(new FreeExecutionResource(_link.TaskQueue));
                    _link.Close();
                    _link = null;
                }
            }
            finally
            {
                base.DefaultDropHandler(drop);
            }
        }
Exemple #50
0
        /// <summary>
        /// Handles Drop Messages
        /// </summary>
        /// <param name="drop"></param>
        /// <returns></returns>
        //[ServiceHandler(ServiceHandlerBehavior.Teardown)]
        IEnumerator<ITask> DropHandler(DsspDefaultDrop drop)
        {
            // cancel any active tasks that are still active
            TaskQueue.Dispose();

            DefaultDropHandler(drop);
            yield break;
        }