Пример #1
0
 public DashboardWindow(IMission mission, IDeployment deployment)
 {
     InitializeComponent();
     Mission       = mission;
     Deployment    = deployment;
     deviceManager = (Application.Current as App).DeviceManager;
     if (deployment.Devices.Count > 0)
     {
         deviceManager.ActiveDevice = deployment.Devices[0];
         deviceManager.ActiveDevice.MessageReceived += ActiveDeviceMessageReceived;
     }
     controllerAxisChangedHandler       = ControllerAxisChanged;
     controllerConnectionChangedHandler = ControllerConnectionChanged;
     bitmapFrameCapturedHandler         = VideoDisplayWindowBitmapFrameCaptured;
     this.Title = String.Format("Dashboard - {0} > {1}", mission.Name, deployment.DateTime.ToString());
     YawOffsetSlider.ValueChanged       += YawOffsetSliderValueChanged;
     PitchOffsetSlider.ValueChanged     += PitchOffsetSliderValueChanged;
     FinRangeSlider.ValueChanged        += FinRangeSliderValueChanged;
     TopFinOffsetSlider.ValueChanged    += TopFinOffsetSliderValueChanged;
     RightFinOffsetSlider.ValueChanged  += RightFinOffsetSliderValueChanged;
     BottomFinOffsetSlider.ValueChanged += BottomFinOffsetSliderValueChanged;
     LeftFinOffsetSlider.ValueChanged   += LeftFinOffsetSliderValueChanged;
     illuminationSlider.ValueChanged    += IlluminationSliderValueChanged;
     focusSlider.ValueChanged           += focusSliderValueChanged;
     buoyancySlider.ValueChanged        += buoyancySliderValueChanged;
 }
 public DashboardWindow(IMission mission, IDeployment deployment)
 {
     InitializeComponent();
     Mission = mission;
     Deployment = deployment;
     deviceManager = (Application.Current as App).DeviceManager;
     if (deployment.Devices.Count > 0)
     {
         deviceManager.ActiveDevice = deployment.Devices[0];
         deviceManager.ActiveDevice.MessageReceived += ActiveDeviceMessageReceived;
     }
     controllerAxisChangedHandler = ControllerAxisChanged;
     controllerConnectionChangedHandler = ControllerConnectionChanged;
     bitmapFrameCapturedHandler = VideoDisplayWindowBitmapFrameCaptured;
     this.Title = String.Format("Dashboard - {0} > {1}", mission.Name, deployment.DateTime.ToString());
     YawOffsetSlider.ValueChanged += YawOffsetSliderValueChanged;
     PitchOffsetSlider.ValueChanged += PitchOffsetSliderValueChanged;
     FinRangeSlider.ValueChanged += FinRangeSliderValueChanged;
     TopFinOffsetSlider.ValueChanged += TopFinOffsetSliderValueChanged;
     RightFinOffsetSlider.ValueChanged += RightFinOffsetSliderValueChanged;
     BottomFinOffsetSlider.ValueChanged += BottomFinOffsetSliderValueChanged;
     LeftFinOffsetSlider.ValueChanged += LeftFinOffsetSliderValueChanged;
     illuminationSlider.ValueChanged += IlluminationSliderValueChanged;
     focusSlider.ValueChanged += focusSliderValueChanged;
     buoyancySlider.ValueChanged += buoyancySliderValueChanged;
 }
Пример #3
0
 private void OnBitmapFrameCaptured(BitmapFrame frame)
 {
     if (BitmapFrameCaptured != null)
     {
         BitmapFrameCapturedHandler eventHandler = BitmapFrameCaptured;
         Delegate[] delegates = eventHandler.GetInvocationList();
         foreach (BitmapFrameCapturedHandler handler in delegates)
         {
             DispatcherObject dispatcherObject = handler.Target as DispatcherObject;
             if (dispatcherObject != null && !dispatcherObject.CheckAccess())
             {
                 dispatcherObject.Dispatcher.Invoke(DispatcherPriority.DataBind, handler, frame);
             }
             else
             {
                 handler(frame);
             }
         }
     }
 }