private void HandleCommand(object sender, PanTiltSettingCommand command)
        {
            switch (command.Type)
            {
            case PanTiltSettingCommandType.MoveAbsolute:
                MoveAbsolute(command);
                SetMode(ProcessingMode.Static);
                _screen.WriteLine($"{command}");
                break;

            case PanTiltSettingCommandType.MoveRelative:
                MoveRelative(command);
                SetMode(ProcessingMode.Static);
                _screen.WriteLine($"{command}");
                break;

            case PanTiltSettingCommandType.SetRangePursuitLower:
                _autonomousManager.PursuitBoundaryLower = command;
                ReportPursuitBoundaries();
                break;

            case PanTiltSettingCommandType.SetRangePursuitUpper:
                _autonomousManager.PursuitBoundaryUpper = command;
                ReportPursuitBoundaries();
                break;
            }
        }
        public bool HandleKeyPress(char key)
        {
            var handled       = true;
            var captureConfig = new CaptureConfig();

            switch (key)
            {
            case '7':
                captureConfig.Framerate  = 40;
                captureConfig.Resolution = new Resolution(128, 96);
                _serverToCameraBus.InvokeUpdateCapture(captureConfig);
                break;

            case '8':
                captureConfig.Framerate  = 60;
                captureConfig.Resolution = new Resolution(160, 120);
                _serverToCameraBus.InvokeUpdateCapture(captureConfig);
                break;

            case 'a':
                ForceMode(ProcessingMode.Autonomous);
                break;

            case 'f':
                ForceMode(ProcessingMode.FaceDetection);
                break;

            case 'c':
                ForceMode(ProcessingMode.ColourTrackFromFileSettings);
                break;

            case 'q':
                _screen.WriteLine($"P/T={CurrentSetting},M={State}");
                break;

            case 'r':
                var command = new PanTiltSettingCommand();
                command.Type        = PanTiltSettingCommandType.MoveAbsolute;
                command.PanPercent  = 50;
                command.TiltPercent = 50;
                HandleCommand(this, command);
                break;

            default:
                handled = false;
                break;
            }
            return(handled);
        }
        public bool HandleKeyPress(char key)
        {
            var handled       = true;
            var captureConfig = new CaptureConfig();

            switch (key)
            {
            case '7':
                captureConfig.Framerate  = 40;
                captureConfig.Resolution = new Resolution(128, 96);
                _serverToCameraBus.InvokeUpdateCapture(captureConfig);
                break;

            case '8':
                captureConfig.Framerate  = 40;
                captureConfig.Resolution = new Resolution(160, 120);
                _serverToCameraBus.InvokeUpdateCapture(captureConfig);
                break;

            case 'a':
                SetMode(ProcessingMode.Autonomous);
                break;

            case 'r':
                var command = new PanTiltSettingCommand();
                command.Type        = PanTiltSettingCommandType.MoveAbsolute;
                command.PanPercent  = 50;
                command.TiltPercent = 50;
                HandleCommand(this, command);
                break;

            default:
                handled = false;
                break;
            }
            return(handled);
        }
Beispiel #4
0
 public void CameraSendCommand(PanTiltSettingCommand command)
 {
     Camera.SendCommand(command);
 }
Beispiel #5
0
 public void SendCommand(PanTiltSettingCommand command)
 {
     _clients.All.panTiltCommand(command);
 }
Beispiel #6
0
 public void SendCommand(PanTiltSettingCommand command)
 {
     _broker.CameraSendCommand(command);
 }