예제 #1
0
        internal Sound(CommandRunner runner, Arm arm)
        {
            //set fields
            _runner = runner;
            _arm    = arm;

            //register responses
            _runner.RegisterForResponse <SoundPlayNotesResponse>(PlayNotesResponse);
            _runner.RegisterForResponse <SoundStatusResponse>(StatusResponse);
        }
예제 #2
0
        internal Knob(CommandRunner runner, Arm arm)
        {
            //set fields
            _runner = runner;
            _arm    = arm;

            //register responses
            _runner.RegisterForResponse <KnobPositionChangedResponse>(PositionChangedResponse);
            _runner.RegisterForResponse <KnobPositionResponse>(PositionResponse);
            _runner.RegisterForResponse <KnobRangeResponse>(RangeResponse);
        }
예제 #3
0
        internal Button(CommandRunner runner, Arm arm)
        {
            //set fields
            _runner = runner;
            _arm    = arm;

            //register responses
            _runner.RegisterForResponse <ButtonDownResponse>(DownResponse);
            _runner.RegisterForResponse <ButtonUpResponse>(UpResponse);
            _runner.RegisterForResponse <ButtonStatusResponse>(StatusResponse);
        }
예제 #4
0
        public Arm(ICommunication comm, int servoCount = 5)
        {
            //set fields
            Communication = comm;
            Behaviors     = new BehaviorManager(this);
            _runner       = new CommandRunner(comm);
            Led           = new Led(_runner, this);
            Button        = new Button(_runner, this);
            Knob          = new Knob(_runner, this);
            Sound         = new Sound(_runner, this);
            Servos        = new Servos(_runner, this, servoCount);

            //register responses
            _runner.RegisterForResponse <ErrorResponse>(ErrorResponse);
            _runner.RegisterForResponse <InfoResponse>(InfoResponse);
            _runner.RegisterForResponse <SoftResetResponse>(SoftResetResponse);
        }
예제 #5
0
        internal Led(CommandRunner runner, Arm arm)
        {
            //set fields
            _runner = runner;
            _arm    = arm;

            //register responses
            _runner.RegisterForResponse <LedStatusResponse>(StatusResponse);
        }
예제 #6
0
        internal Servos(CommandRunner runner, Arm arm, int servoCount)
        {
            //set fields
            _runner     = runner;
            _arm        = arm;
            _servoCount = servoCount;

            //add servos
            for (int i = 1; i <= servoCount; i++)
            {
                Add(new Servo(_runner, _arm, i));
            }

            //register responses
            _runner.RegisterForResponse <ServoPositionChangedResponse>(PositionChangedResponse);
            _runner.RegisterForResponse <ServoStatusResponse>(StatusResponse);
            _runner.RegisterForResponse <MoveResponse>(MoveResponse);
            _runner.RegisterForResponse <ServoOnResponse>(OnResponse);
            _runner.RegisterForResponse <ServoOffResponse>(OffResponse);
        }