void ReleaseDesignerOutlets()
        {
            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }

            if (AvgSpeedLabel != null)
            {
                AvgSpeedLabel.Dispose();
                AvgSpeedLabel = null;
            }

            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AddressLabel != null)
            {
                AddressLabel.Dispose();
                AddressLabel = null;
            }

            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (PostalCodeLabel != null)
            {
                PostalCodeLabel.Dispose();
                PostalCodeLabel = null;
            }
        }
Beispiel #3
0
        public void Count()
        {
            while (ShouldCount)
            {
                long beginTime = DateTime.Now.Ticks;
                try
                {
                    CurrentTime.Timer();
                    TimeLabel.Invoke(new Action(() => TimeLabel.Text = CurrentTime.ToString()));

                    Distance += (Speed / 3600);
                    DistanceLabel.Invoke(new Action(() => DistanceLabel.Text = $"{Distance:f2}"));

                    RPM = Speed * 2.8;
                    RpmLabel.Invoke(new Action(() => RpmLabel.Text = RPM.ToString()));

                    Pulse = 90 + (int)((Power / 6) * (Speed / 10));
                    PulseLabel.Invoke(new Action(() => PulseLabel.Text = Pulse.ToString()));


                    SpeedTrackbar.Invoke(new Action(() => SpeedTrackbar.Value = (int)Speed));
                    SpeedLabel.Invoke(new Action(() => SpeedLabel.Text        = Speed.ToString()));
                    PowerTrackbar.Invoke(new Action(() => PowerTrackbar.Value = (int)Power));
                    PowerLabel.Invoke(new Action(() => PowerLabel.Text        = Power.ToString()));
                }
                catch (Exception e)
                {
                }

                Wait1s(beginTime);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (CaloriesLabel != null)
            {
                CaloriesLabel.Dispose();
                CaloriesLabel = null;
            }

            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (DurationLabel != null)
            {
                DurationLabel.Dispose();
                DurationLabel = null;
            }

            if (WorkoutLabel != null)
            {
                WorkoutLabel.Dispose();
                WorkoutLabel = null;
            }
        }
Beispiel #5
0
        void ReleaseDesignerOutlets()
        {
            if (AccuracyLabel != null)
            {
                AccuracyLabel.Dispose();
                AccuracyLabel = null;
            }

            if (AnimationImage != null)
            {
                AnimationImage.Dispose();
                AnimationImage = null;
            }

            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (OpenMapButton != null)
            {
                OpenMapButton.Dispose();
                OpenMapButton = null;
            }

            if (TaskDescLabel != null)
            {
                TaskDescLabel.Dispose();
                TaskDescLabel = null;
            }
        }
Beispiel #6
0
        void ReleaseDesignerOutlets()
        {
            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (placeButton != null)
            {
                placeButton.Dispose();
                placeButton = null;
            }

            if (RatingLabel != null)
            {
                RatingLabel.Dispose();
                RatingLabel = null;
            }

            if (StarImageView != null)
            {
                StarImageView.Dispose();
                StarImageView = null;
            }
        }
Beispiel #7
0
        public void Count()
        {
            while (ShouldCount)
            {
                try
                {
                    CurrentTime.Timer();
                    TimeLabel.Invoke(new Action(() => TimeLabel.Text = CurrentTime.ToString()));

                    Distance += (Speed / 3600);
                    DistanceLabel.Invoke(new Action(() => DistanceLabel.Text = $"{Distance:f2}"));

                    RPM = Speed * 2.8;
                    RpmLabel.Invoke(new Action(() => RpmLabel.Text = RPM.ToString()));

                    Pulse = 90 + (int)((Power / 6) * (Speed / 20));
                    PulseLabel.Invoke(new Action(() => PulseLabel.Text = Pulse.ToString()));


                    SpeedTrackbar.Invoke(new Action(() => SpeedTrackbar.Value = (int)Speed));
                    SpeedLabel.Invoke(new Action(() => SpeedLabel.Text        = Speed.ToString()));
                    PowerTrackbar.Invoke(new Action(() => PowerTrackbar.Value = (int)Power));
                    PowerLabel.Invoke(new Action(() => PowerLabel.Text        = Power.ToString()));
                }
                catch (Exception e)
                {
                }

                Thread.Sleep(1000);
            }
        }
Beispiel #8
0
 internal static extern void cvDistTransform(
     Arr src,
     Arr dst,
     DistanceType distance_type,
     int mask_size,
     float[] mask,
     Arr labels,
     DistanceLabel labelType);
        void ReleaseDesignerOutlets()
        {
            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (MapView != null)
            {
                MapView.Dispose();
                MapView = null;
            }

            if (PhotosButton != null)
            {
                PhotosButton.Dispose();
                PhotosButton = null;
            }

            if (RatingLabel != null)
            {
                RatingLabel.Dispose();
                RatingLabel = null;
            }

            if (ReviewsButton != null)
            {
                ReviewsButton.Dispose();
                ReviewsButton = null;
            }

            if (StartImage != null)
            {
                StartImage.Dispose();
                StartImage = null;
            }

            if (PlaceNameLabel != null)
            {
                PlaceNameLabel.Dispose();
                PlaceNameLabel = null;
            }
        }
Beispiel #10
0
    /// <summary>创建锚点</summary>
    public void CreateAnchor()
    {
        GameObject item = GameObject.CreatePrimitive(PrimitiveType.Sphere);

        item.transform.parent     = m_AnchorParent;
        item.transform.localScale = Vector3.one * 0.006f;
        item.transform.position   = m_TakeAim.transform.position;
        Material material = new Material(Shader.Find("Unlit/Color"));

        item.GetComponent <Renderer>().material = material;
        m_ListPoint.Add(item);

        //创建模型为单数的时候开始绘制线
        if (m_ListPoint.Count % 2 != 0)
        {
            DrawMeasureline drawline = DrawMeasureline.Create();
            drawline.Add(item);
            drawline.Add(m_TakeAim);
            m_ListDrawline.Add(drawline);

            item.GetComponent <Renderer>().material.color = Color.green;

            GameObject    label         = new GameObject(GetTimeStampToMilliseconds().ToString());
            DistanceLabel distanceLabel = label.AddComponent <DistanceLabel>();
            distanceLabel.m_StartObject = item;
            distanceLabel.m_EndObject   = m_TakeAim;
            distanceLabels.Add(distanceLabel);
        }
        else
        {
            m_ListDrawline[m_ListDrawline.Count - 1].Remove(m_TakeAim);
            m_ListDrawline[m_ListDrawline.Count - 1].Add(item);
            m_ListDrawline[m_ListDrawline.Count - 1].DrawComplete();

            distanceLabels[distanceLabels.Count - 1].m_EndObject = item;
            distanceLabels[distanceLabels.Count - 1].DrawComplete();

            m_ListPoint[m_ListPoint.Count - 1].GetComponent <Renderer>().material.color = Color.white;
            m_ListPoint[m_ListPoint.Count - 2].GetComponent <Renderer>().material.color = Color.white;
        }

        SetDeleteButtonInteractable();
        SetRevokeButtonInteractable();
    }
        public override void Awake(NSObject context)
        {
            viewModel = ServiceContainer.Resolve <DetailsViewModel> ();

            RatingLabel.SetText(viewModel.Place.Rating.ToString());
            DistanceLabel.SetText(CoffeeFilterViewModel.GetDistanceToPlace(viewModel.Place, viewModel.Position));
            PlaceNameLabel.SetText(viewModel.Place.Name);

            SetMapRegion();
            AddMapAnnotation();
            EnableButtons(false);
            UpdatePlaceInfo();

                        #if !DEBUG
            Xamarin.Insights.Track("AppNav", new Dictionary <string, string> {
                { "page", "details" },
                { "name", viewModel.Place.Name }
            });
                        #endif
        }
Beispiel #12
0
        void ReleaseDesignerOutlets()
        {
            if (CaloriesLabel != null)
            {
                CaloriesLabel.Dispose();
                CaloriesLabel = null;
            }

            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (DurationLabel != null)
            {
                DurationLabel.Dispose();
                DurationLabel = null;
            }

            if (MarkerButton != null)
            {
                MarkerButton.Dispose();
                MarkerButton = null;
            }

            if (MarkerLabel != null)
            {
                MarkerLabel.Dispose();
                MarkerLabel = null;
            }

            if (PauseResumeButton != null)
            {
                PauseResumeButton.Dispose();
                PauseResumeButton = null;
            }
        }
 void ReleaseDesignerOutlets()
 {
     if (CommentsView != null)
     {
         CommentsView.Dispose();
         CommentsView = null;
     }
     if (CommentTextBox != null)
     {
         CommentTextBox.Dispose();
         CommentTextBox = null;
     }
     if (CostLabel != null)
     {
         CostLabel.Dispose();
         CostLabel = null;
     }
     if (DateLabel != null)
     {
         DateLabel.Dispose();
         DateLabel = null;
     }
     if (DistanceLabel != null)
     {
         DistanceLabel.Dispose();
         DistanceLabel = null;
     }
     if (DriverLabel != null)
     {
         DriverLabel.Dispose();
         DriverLabel = null;
     }
     if (EndLabel != null)
     {
         EndLabel.Dispose();
         EndLabel = null;
     }
     if (FromLabel != null)
     {
         FromLabel.Dispose();
         FromLabel = null;
     }
     if (MakerLabel != null)
     {
         MakerLabel.Dispose();
         MakerLabel = null;
     }
     if (ModelLabel != null)
     {
         ModelLabel.Dispose();
         ModelLabel = null;
     }
     if (RateLabel != null)
     {
         RateLabel.Dispose();
         RateLabel = null;
     }
     if (ResumeView != null)
     {
         ResumeView.Dispose();
         ResumeView = null;
     }
     if (SegmentedControl != null)
     {
         SegmentedControl.Dispose();
         SegmentedControl = null;
     }
     if (StartLabel != null)
     {
         StartLabel.Dispose();
         StartLabel = null;
     }
     if (ToLabel != null)
     {
         ToLabel.Dispose();
         ToLabel = null;
     }
     if (VehicleImage != null)
     {
         VehicleImage.Dispose();
         VehicleImage = null;
     }
 }
Beispiel #14
0
        protected override async void OnAppearing()
        {
            if (Navigator != null)
            {
                return;
            }

            await Application.Current.MainPage.Navigation.PushModalAsync(new LookingForGpsPage());

            Route route = null;

            try
            {
                route = await _routeTask;
            } catch (Exception e)
            {
                var properties = new Dictionary <string, string>
                {
                    { "Category", "Route parsing" }
                };
                Crashes.TrackError(e, properties);

                return;
            }

            try
            {
                MapView.Info += async(sender, args) =>
                {
                    args.Handled = true;
                    if (args.MapInfo.Feature is PointOfInterestFeature poif)
                    {
                        await poif.OnClick();
                    }
                };

                var routeLayer = new PathLayer(
                    route.GetEnumerable(route.Waypoints.First(), Direction.Forward),
                    Consts.MainPathLayerName
                    );
                routeLayer.Style = null;
                routeLayer.feature.Styles.Add(
                    new VectorStyle()
                {
                    Line = new Pen(Color.FromArgb(255, 48, 78, 130))
                    {
                        PenStyle = PenStyle.Solid,
                        Width    = 15d
                    }
                }
                    );
                routeLayer.feature.Styles.Add(
                    new VectorStyle()
                {
                    Line = new Pen(Color.FromArgb(255, 45, 115, 200))
                    {
                        PenStyle = PenStyle.Solid,
                        Width    = 12d
                    }
                }
                    );

                MapView.Map.Layers.Add(routeLayer);
            } catch (Exception e)
            {
                var properties = new Dictionary <string, string>
                {
                    { "Category", "Map styling" }
                };
                Crashes.TrackError(e, properties);

                return;
            }

            try
            {
                NavigationStats = new NavigationStats(route);
                Navigator       = new Navigator(MapView, route, CrossGeolocator.Current, NavigationStats);

                DistanceLabel.SetBinding(Label.TextProperty, new Binding("Progress", source: NavigationStats));

                if (await Navigator.StartNavigation())
                {
                    await Application.Current.MainPage.Navigation.PopModalAsync();
                }
            } catch (Exception e)
            {
                var properties = new Dictionary <string, string>
                {
                    { "Category", "Navigation" }
                };
                Crashes.TrackError(e, properties);

                return;
            }
        }