Example #1
0
        public DeviceControl(PairableDevice pairableDevice, IADevice iaDevice)
        {
            InitializeComponent();

            this.iaDevice = iaDevice;
            this.pairableDevice = pairableDevice;

            deviceRotationControl = new DeviceRotationControl();
            deviceRotationControl.onSliderValueChanged += new EventHandler<RotationSliderEventArgs>(onOrientationSliderChanged);
            canvas.Children.Add(deviceRotationControl);
            Canvas.SetLeft(deviceRotationControl, -170);
            Canvas.SetTop(deviceRotationControl, -40);

            //Setup Events
            pairableDevice.LocationChanged += onLocationChanged;
            pairableDevice.OrientationChanged += onOrientationChanged;
            pairableDevice.PairingStateChanged += onPairingStateChanged;

            LeftLine.StrokeThickness = DrawingResources.DEVICE_FOV_WIDTH;
            RightLine.StrokeThickness = DrawingResources.DEVICE_FOV_WIDTH;

            //Setup Display
            DeviceNameLabel.Text = pairableDevice.Identifier;
            InnerBorder.BorderBrush = DrawingResources.unpairedBrush;

            // If it supports this route, then we know it's a surface
            if (iaDevice.SupportedRoutes.Contains(Routes.GetLocationRoute))
            {
                MyDisplayState = DisplayState.UnlocatedAndOnStackPanel;
            }
            // Likewise, if it supports this route, we know it's a pairable device
            else if (iaDevice.SupportedRoutes.Contains(Routes.BecomePairedRoute))
            {
                MyDisplayState = DisplayState.UnpairedAndOnStackPanel;
            }

            formatForStackPanel();
        }
        public DeviceControl(PairableDevice pairableDevice, IADevice iaDevice)
        {
            InitializeComponent();

            this.iaDevice       = iaDevice;
            this.pairableDevice = pairableDevice;

            deviceRotationControl = new DeviceRotationControl();
            deviceRotationControl.onSliderValueChanged += new EventHandler <RotationSliderEventArgs>(onOrientationSliderChanged);
            canvas.Children.Add(deviceRotationControl);
            Canvas.SetLeft(deviceRotationControl, -170);
            Canvas.SetTop(deviceRotationControl, -40);

            //Setup Events
            pairableDevice.LocationChanged     += onLocationChanged;
            pairableDevice.OrientationChanged  += onOrientationChanged;
            pairableDevice.PairingStateChanged += onPairingStateChanged;

            LeftLine.StrokeThickness  = DrawingResources.DEVICE_FOV_WIDTH;
            RightLine.StrokeThickness = DrawingResources.DEVICE_FOV_WIDTH;

            //Setup Display
            DeviceNameLabel.Text    = pairableDevice.Identifier;
            InnerBorder.BorderBrush = DrawingResources.unpairedBrush;

            // If it supports this route, then we know it's a surface
            if (iaDevice.SupportedRoutes.Contains(Routes.GetLocationRoute))
            {
                MyDisplayState = DisplayState.UnlocatedAndOnStackPanel;
            }
            // Likewise, if it supports this route, we know it's a pairable device
            else if (iaDevice.SupportedRoutes.Contains(Routes.BecomePairedRoute))
            {
                MyDisplayState = DisplayState.UnpairedAndOnStackPanel;
            }

            formatForStackPanel();
        }
Example #3
0
        public TrackerControl(Tracker tracker)
        {
            this._Tracker = tracker;

            InitializeComponent();

            deviceRotationControl = new DeviceRotationControl();
            deviceRotationControl.onSliderValueChanged += new EventHandler<RotationSliderEventArgs>(onOrientationSliderChanged);
            canvas.Children.Add(deviceRotationControl);
            Canvas.SetLeft(deviceRotationControl, -150);
            Canvas.SetTop(deviceRotationControl, -10);
            deviceRotationControl.Opacity = 0;

            TrackerNameLabel.Text = tracker.Identifier;
            LeftLine.StrokeThickness = DrawingResources.TRACKER_FOV_WIDTH;
            RightLine.StrokeThickness = DrawingResources.TRACKER_FOV_WIDTH;

            tracker.LocationChanged += onLocationChanged;
            tracker.OrientationChanged += onOrientationChanged;
            tracker.FOVChanged += onFOVChanged;
            tracker.RangeChanged += onRangeChanged;

            //formatForStackPanel();
        }
Example #4
0
        public TrackerControl(Tracker tracker)
        {
            this._Tracker = tracker;

            InitializeComponent();

            deviceRotationControl = new DeviceRotationControl();
            deviceRotationControl.onSliderValueChanged += new EventHandler <RotationSliderEventArgs>(onOrientationSliderChanged);
            canvas.Children.Add(deviceRotationControl);
            Canvas.SetLeft(deviceRotationControl, -150);
            Canvas.SetTop(deviceRotationControl, -10);
            deviceRotationControl.Opacity = 0;

            TrackerNameLabel.Text     = tracker.Identifier;
            LeftLine.StrokeThickness  = DrawingResources.TRACKER_FOV_WIDTH;
            RightLine.StrokeThickness = DrawingResources.TRACKER_FOV_WIDTH;

            tracker.LocationChanged    += onLocationChanged;
            tracker.OrientationChanged += onOrientationChanged;
            tracker.FOVChanged         += onFOVChanged;
            tracker.RangeChanged       += onRangeChanged;

            //formatForStackPanel();
        }