internal Sound(CommandRunner runner, Arm arm) { //set fields _runner = runner; _arm = arm; //register responses _runner.RegisterForResponse <SoundPlayNotesResponse>(PlayNotesResponse); _runner.RegisterForResponse <SoundStatusResponse>(StatusResponse); }
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); }
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); }
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); }
internal Led(CommandRunner runner, Arm arm) { //set fields _runner = runner; _arm = arm; //register responses _runner.RegisterForResponse <LedStatusResponse>(StatusResponse); }
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); }