/// <summary>
 /// DSS SimpleDashboard StateType Constructor
 /// </summary>
 /// <param name="body"></param>
 public Replace(SimpleDashboardState body)
     : base(body)
 {
 }
        /// <summary>
        /// Entry Point for the SimpleDashboard Service
        /// </summary>
        protected override void Start()
        {
            if (_state == null)
            {
                _state = new SimpleDashboardState {
                    TranslateScaleFactor = 1, RotateScaleFactor = .25
                };
            }

            // This service does not use base.Start() because of the way that
            // the handlers are hooked up. Notice the mixture of _mainPort and
            // _eventsPort in the interleave.
            // Also, because the interleave is created explicitly there must be
            // Get and HttpGet handlers instead of using the default ones.
            // Handlers that need write or exclusive access to state go under
            // the exclusive group. Handlers that need read or shared access, and can be
            // concurrent to other readers, go to the concurrent group.
            // Other internal ports can be included in interleave so you can coordinate
            // intermediate computation with top level handlers.
            Activate(Arbiter.Interleave(
                         new TeardownReceiverGroup
                         (
                             Arbiter.Receive <DsspDefaultDrop>(false, _mainPort, DropHandler)
                         ),
                         new ExclusiveReceiverGroup
                         (
                             Arbiter.ReceiveWithIterator <Replace>(true, _mainPort, ReplaceHandler),
                             Arbiter.ReceiveWithIterator <OnLoad>(true, _eventsPort, OnLoadHandler),
                             Arbiter.Receive <OnClosed>(true, _eventsPort, OnClosedHandler),
                             Arbiter.ReceiveWithIterator <OnChangeJoystick>(true, _eventsPort, OnChangeJoystickHandler),
                             Arbiter.Receive <OnLogSetting>(true, _eventsPort, OnLogSettingHandler)
                         ),
                         new ConcurrentReceiverGroup
                         (
                             Arbiter.Receive <DsspDefaultLookup>(true, _mainPort, DefaultLookupHandler),
                             Arbiter.ReceiveWithIterator <Get>(true, _mainPort, GetHandler),

                             Arbiter.ReceiveWithIterator <game.Replace>(true, _gameControllerNotify, JoystickReplaceHandler),
                             Arbiter.ReceiveWithIterator <game.UpdateAxes>(true, _gameControllerNotify, JoystickUpdateAxesHandler),
                             Arbiter.ReceiveWithIterator <game.UpdateButtons>(true, _gameControllerNotify, JoystickUpdateButtonsHandler),
                             Arbiter.ReceiveWithIterator <sicklrf.Replace>(true, _laserNotify, OnLaserReplaceHandler),
                             Arbiter.ReceiveWithIterator <OnConnect>(true, _eventsPort, OnConnectHandler),

                             Arbiter.ReceiveWithIterator <drive.Update>(true, _driveNotify, OnDriveUpdateNotificationHandler),
                             Arbiter.ReceiveWithIterator <OnConnectMotor>(true, _eventsPort, OnConnectMotorHandler),
                             Arbiter.ReceiveWithIterator <OnMove>(true, _eventsPort, OnMoveHandler),
                             Arbiter.ReceiveWithIterator <OnEStop>(true, _eventsPort, OnEStopHandler),

                             Arbiter.ReceiveWithIterator <OnStartService>(true, _eventsPort, OnStartServiceHandler),
                             Arbiter.ReceiveWithIterator <OnConnectSickLRF>(true, _eventsPort, OnConnectSickLRFHandler),
                             Arbiter.Receive <OnDisconnectSickLRF>(true, _eventsPort, OnDisconnectSickLRFHandler),

                             Arbiter.ReceiveWithIterator <OnConnectArticulatedArm>(true, _eventsPort, OnConnectArticulatedArmHandler),
                             Arbiter.ReceiveWithIterator <OnApplyJointParameters>(true, _eventsPort, OnApplyJointParametersHandler)
                         )
                         ));

            DirectoryInsert();

            WinFormsServicePort.Post(new RunForm(CreateForm));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Replace Handler sets SimpleDashboard State
 /// </summary>
 /// <param name="replace"></param>
 IEnumerator <ITask> ReplaceHandler(Replace replace)
 {
     _state = replace.Body;
     replace.ResponsePort.Post(dssp.DefaultReplaceResponseType.Instance);
     yield break;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Replace Handler sets SimpleDashboard State
 /// </summary>
 /// <param name="replace"></param>
 IEnumerator<ITask> ReplaceHandler(Replace replace)
 {
     _state = replace.Body;
     replace.ResponsePort.Post(dssp.DefaultReplaceResponseType.Instance);
     yield break;
 }