Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the PTZMainViewModel class.
        /// </summary>
        public PTZMainViewModel(IPTZManager manager)
        {
            m_PtzManager              = manager;
            CameraUp                  = new RelayCommand(CameraUpExecute);
            CameraUpLeft              = new RelayCommand(CameraUpLeftExecute);
            CameraUpRight             = new RelayCommand(CameraUpRightExecute);
            CameraDown                = new RelayCommand(CameraDownExecute);
            CameraDownLeft            = new RelayCommand(CameraDownLeftExecute);
            CameraDownRight           = new RelayCommand(CameraDownRightExecute);
            CameraLeft                = new RelayCommand(CameraLeftExecute);
            CameraRight               = new RelayCommand(CameraRightExecute);
            CameraPanStop             = new RelayCommand(CameraPanStopExecute);
            CameraZoomTele            = new RelayCommand(CameraZoomTeleExecute);
            CameraZoomWide            = new RelayCommand(CameraZoomWideExecute);
            CameraZoomStop            = new RelayCommand(CameraZoomStopExecute);
            CameraFocusModeAuto       = new RelayCommand(CameraFocusModeAutoExecute);
            CameraFocusModeManual     = new RelayCommand(CameraFocusModeManualExecute);
            CameraFocusModeOnePush    = new RelayCommand(CameraFocusModeOnePushExecute);
            CameraFocusOnePushTrigger = new RelayCommand(CameraFocusOnePushTriggerExecute);

            SwitcherCut            = new RelayCommand(SwitcherCutExecute);
            SwitcherMix            = new RelayCommand(SwitcherMixExecute);
            CameraPresetButtonUp   = new RelayCommand <string>(CameraPresetButtonUpExecute);
            CameraPresetButtonDown = new RelayCommand <string>(CameraPresetButtonDownExecute);
            PresetImageChanged     = new RelayCommand <PresetEventArgs>(PresetImageChangedExecute);
            Cameras = new ObservableCollection <CameraViewModel>();

            //Initialize viewModel
            CameraViewModel camvm;
            int             cameraInput = 1;

            foreach (var cam in m_PtzManager.Cameras)
            {
                camvm = new CameraViewModel(m_PtzManager, cam.Parser, cameraInput);
                Cameras.Add(camvm);
                cameraInput++;
            }

            Switcher = new DeviceItemViewModel("ATEM");
            Pad      = new PadViewModel("Pad");

            MessengerInstance.Register <NotificationMessage <CameraStatusMessageArgs> >(this, CameraStatusChange);
            MessengerInstance.Register <NotificationMessage <CameraFocusModeMessageArgs> >(this, CameraFocusModeChange);
            MessengerInstance.Register <NotificationMessage <ISwitcherParser> >(this, SwitcherNotification);
            MessengerInstance.Register <NotificationMessage <IHIDParser> >(this, HIDPNotification);
            MessengerInstance.Register <PresetStatusEnum>(this, PresetStatusNotification);
            MessengerInstance.Register <NotificationMessage <IGamePadHandler> >(this, GamePadNotification);


            //Startup the whole system
            //Multi-thread get issue with ATEM SDK.
            m_PtzManager.StartUp();
            //Task.Factory.StartNew(()=>ptzManager.StartUp());
        }
 public CameraViewModel(IPTZManager manager, ICameraParserModel cam, int index)
 {
     _Manager      = manager;
     _Name         = cam.CameraName;
     _InputIndex   = index;
     _SourceStatus = CameraStatusEnum.Off;
     Connected     = cam.Connected;
     AtemPreview   = new RelayCommand(AtemSetPreviewExecute);
     MessengerInstance.Register <NotificationMessage <ISocketParser> >(this, SocketNotification);
     MessengerInstance.Register <NotificationMessage <CameraStatusMessageArgs> >(this, CameraNotification);
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the PTZMainViewModel class.
 /// </summary>
 public PTZMainViewModel(IPTZManager manager)
 {
     ////if (IsInDesignMode)
     ////{
     ////    // Code runs in Blend --> create design time data.
     ////}
     ////else
     ////{
     ////    // Code runs "for real"
     ////}
     m_PtzManager = manager;
     CameraUp     = new RelayCommand(CameraUpExecute);
 }