Esempio n. 1
0
    public void ResumeWhileTargetFound()
    {
        if (specsPanelDisplayed == true)
        {
            ARPanel.DOAnchorPos(new Vector2(-320, 0), 0.25f, false);

            SpecificationsPanel.DOAnchorPos(new Vector2(-25, -40), 0.25f, false);
        }
    }
Esempio n. 2
0
    public void PauseWhileTargetFound()
    {
        if (specsPanelDisplayed == true)
        {
            ARPanel.DOAnchorPos(new Vector2(-320, -150), 0.125f, false);

            SpecificationsPanel.DOAnchorPos(new Vector2(500, -40), 0.25f, false);
        }
    }
Esempio n. 3
0
        private void PositionStation(ARPanel arPanel)
        {
            this.Model.Positions = new List <StationStat>(this.Model.Positions.Where(c => c.End.Time > DateTime.Now));

            var forecast      = this.Model.Positions[0];
            var startPosition = forecast.Start;
            var topPosition   = forecast.Top;
            var endPosition   = forecast.End;

            //  double angle = GetPositionAngle(forecast, startPosition);
            AddMarker(forecast, startPosition, Color.FromArgb(100, 0, 200, 0));
            AddMarker(forecast, topPosition, Color.FromArgb(100, 255, 255, 0));
            AddMarker(forecast, endPosition, Color.FromArgb(100, 200, 0, 0));
        }
    object OnPanelOpened(object sender, object args)
    {
        ARGUIPanel panel;

        if (args is ARGUIPanel)
        {
            panel = (ARGUIPanel)args;

            foreach (var ARPanel in ARGUIPanels)
            {
                ARPanel.SetActive(false);
            }

            panel.SetActive(true);

            switch (panel.panelType)
            {
            case PanelType.Camera:
                _PanelTargetPos = panel.GetInversedInitialPos();
                LaunchFeed();
                break;

            case PanelType.PatientDetails:
            case PanelType.Radiographs:
            case PanelType.SurgeryMovement:
            case PanelType.SurgicalSimulation:
                StopFeed();
                _currentDetailPanel = panel.GetComponent <ARDetailPanel>();
                _PanelTargetPos     = panel.GetInversedInitialPos();
                break;

            case PanelType.Video:
                StopFeed();
                _PanelTargetPos = panel.GetInversedInitialPos();
                break;

            case PanelType.Home:
                StopFeed();
                _HomeTargetPos = Vector2.zero;
                break;
            }

            _currentPanelIdx = Array.IndexOf(ARGUIPanels, panel);

            string msg = panel.panelHeader;
            Core.BroadcastEvent("OnUpdateHeader", this, msg);
        }

        return(null);
    }
Esempio n. 5
0
        private void PositionStars(ARPanel arPanel, GeoCoordinate coordinates)
        {
            foreach (var star in Model.Data.Data)
            {
                var point = StarUtils.CalculatePosition(coordinates, star);

                if (point.X > 0)
                {
                    var   starBightness = 6 - star.Mag;
                    Color color         = StarUtils.GetStarColor(star.Color);
                    var   ellipse       = new Ellipse {
                        Fill = new SolidColorBrush(color), Width = starBightness, Height = starBightness, Stroke = new SolidColorBrush(color)
                        {
                            Opacity = 0.5
                        }, StrokeThickness = 1
                    };

                    arPanel.Children.Add(ellipse);
                    ARPanel.SetDirection(ellipse, point);
                }
            }
        }
Esempio n. 6
0
    public void OnTrackableStateChanged(
        TrackableBehaviour.Status previousStatus,
        TrackableBehaviour.Status newStatus)
    {
        if (newStatus == TrackableBehaviour.Status.DETECTED ||
            newStatus == TrackableBehaviour.Status.TRACKED)
        {
            SpecificationsTextMesh.gameObject.SetActive(true);

            SpecificationsPanel.DOAnchorPos(new Vector2(-25, -40), 0.25f, false);   // slide in specs

            ARPanel.DOAnchorPos(new Vector2(-320, 0), 0.25f, false);                // slide in buttons

            SpecificationsTextMesh.DOAnchorPos(new Vector2(-15, 50), 0.30f, false); // slide in specs text - TEXTMESH SPECS

            specsPanelDisplayed = true;

            HideSpecsPanelButton.gameObject.SetActive(true);

            ShowSpecsPanelButton.gameObject.SetActive(false);
        }

        else
        {
            SpecificationsPanel.DOAnchorPos(new Vector2(500, -40), 0.125f, false);     // slide out specs panel

            ARPanel.DOAnchorPos(new Vector2(-320, -150), 0.125f, false);               // slide out panel

            SpecificationsTextMesh.DOAnchorPos(new Vector2(-15, -485), 0.125f, false); // slide out text - TEXTMESH SPECS

            specsPanelDisplayed = false;

            HideSpecsPanelButton.gameObject.SetActive(true);

            ShowSpecsPanelButton.gameObject.SetActive(false);

            SpecificationsTextMesh.gameObject.SetActive(false);
        }
    }
Esempio n. 7
0
        //private double GetPositionAngle(StationStat forecast, ISSPosition position)
        //{

        //}

        private void AddMarker(StationStat forecast, ISSPosition startPosition, Color color)
        {
            SpotData spotData;
            // ArrorMarkerControl rectangle;
            Point point;

            spotData = this.GetSpotData(forecast.Start, forecast.Brightness);

            var rectangle = new ArrorMarkerControl {
                Width = 120, Height = 450
            };                                                                    // new Rectangle { Width = 90, Height = 90, RadiusX = 90, RadiusY = 60, Fill = new SolidColorBrush(color) };

            //   var rectangle =new Rectangle { Width = 90, Height = 90, RadiusX = 90, RadiusY = 60, Fill = new SolidColorBrush(color) };
            arPanel.Children.Add(rectangle);


            point = new Point(startPosition.Altitute, startPosition.Azimuth);
            ARPanel.SetDirection(rectangle, point);
            rectangle.DataContext = spotData;
            //rectangle.Tap += (s, e) =>
            //{

            //};
        }
Esempio n. 8
0
        private void AddHeadingDots(ARPanel panel)
        {
            var textForeground = new SolidColorBrush(Color.FromArgb(255, 96, 96, 96));

            //Go 360 along the horizon to display heading text
            for (double azimuth = 20; azimuth < 360; azimuth += 20)
            {
                if (azimuth % 90 == 0)
                {
                    continue;                    //skip cardinal directions, since we already added markers for those in xaml
                }
                TextBlock tb = new TextBlock()
                {
                    Text = string.Format("{0}°", azimuth), Foreground = textForeground
                };
                ARPanel.SetDirection(tb, new Point(0, azimuth));
                panel.Children.Add(tb);
            }
            //Display an up/down angle for each cardinal direction
            for (int i = 0; i < 360; i += 180)
            {
                for (int alt = -80; alt < 90; alt += 10)
                {
                    if (alt == 0)
                    {
                        continue;           //skip cardinal directions, since we already added markers for those in xaml
                    }
                    TextBlock tb = new TextBlock()
                    {
                        Text = string.Format("{0}", alt), Foreground = textForeground
                    };
                    ARPanel.SetDirection(tb, new Point(alt, i));
                    panel.Children.Add(tb);
                }
            }
        }