private void doStartPositioning(RemoteControlActionType remoteControlAction)
        {
            _logger.LogInfoMessage($"doStopPositioning doStartPositioning => rcAction={remoteControlAction}, IsManualControl={IsManualControl}");

            if (!IsManualControl)
            {
                return;
            }

            var deviceAddress = _settingsManager.GetAppSettings().PTZDeviceAddress;

            switch (remoteControlAction)
            {
            case RemoteControlActionType.PanLeft:
                _ptzController.Pan(deviceAddress, PanDirection.Left, 100);
                break;

            case RemoteControlActionType.PanRight:
                _ptzController.Pan(deviceAddress, PanDirection.Right, 100);
                break;

            case RemoteControlActionType.TiltUp:
                _ptzController.Tilt(deviceAddress, TiltDirection.Up, 100);
                break;

            case RemoteControlActionType.TiltDown:
                _ptzController.Tilt(deviceAddress, TiltDirection.Down, 100);
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
 private static bool isRemoteControlPositioningAction(RemoteControlActionType rcActionType)
 {
     return(rcActionType == RemoteControlActionType.PanLeft ||
            rcActionType == RemoteControlActionType.PanRight ||
            rcActionType == RemoteControlActionType.TiltUp ||
            rcActionType == RemoteControlActionType.TiltDown);
 }
Exemplo n.º 3
0
        private static bool getRemoteControlButtonAction(RoutedEventArgs args, out RemoteControlActionType rcActionType)
        {
            rcActionType = RemoteControlActionType.Stop;
            var sourceButton = args.Source as Button;

            if (sourceButton == null && args.Source is ILogical logicalSender)
            {
                sourceButton = logicalSender.GetLogicalParent <Button>();
            }

            if (sourceButton == null)
            {
                return(false);
            }

            rcActionType = (RemoteControlActionType)
                           (sourceButton.CommandParameter ?? RemoteControlActionType.Stop);
            return(true);
        }