Exemple #1
0
        public void OnMeasurementPointObservationRemoved(int entityId, int pointId, string imageId)
        {
            Measurement measurement = Get(entityId);

            if (measurement?.ContainsKey(pointId) ?? false)
            {
                MeasurementPoint measurementPoint = measurement[pointId];
                measurementPoint.RemoveObservation(imageId);
            }
        }
Exemple #2
0
        public void OnMeasurementPointClosed(int entityId, int pointId)
        {
            Measurement measurement = Get(entityId);

            if (measurement?.ContainsKey(pointId) ?? false)
            {
                MeasurementPoint point = measurement[pointId];
                point.Closed();
            }
        }
Exemple #3
0
        public async void OnMeasurementPointObservationUpdated(int entityId, int pointId, string imageId)
        {
            ObservationMeasurementData observation            = Api.GetMeasurementPointObservationData(entityId, pointId, imageId);
            ApiMeasurementObservation  measurementObservation = observation.measurementObservation;
            Measurement measurement = Get(entityId);

            if (measurement?.ContainsKey(pointId) ?? false)
            {
                MeasurementPoint measurementPoint = measurement[pointId];
                await measurementPoint.UpdateObservationAsync(measurementObservation, null);
            }
        }
Exemple #4
0
        public void OnMeasurementPointOpened(int entityId, int pointId)
        {
            Measurement measurement = Get(entityId);

            if (measurement?.ContainsKey(pointId) ?? false)
            {
                MeasurementPoint point = measurement[pointId];
                point.Opened();

                if ((!measurement.IsPointMeasurement) && (_pointAdded))
                {
                    point.Closed();
                }
            }

            _pointAdded = false;
        }
Exemple #5
0
        public async Task <Measurement> GetAsync(Geometry geometry, bool includeZ)
        {
            Measurement result = null;

            if (geometry != null)
            {
                for (int i = 0; ((i < Count) && (result == null)); i++)
                {
                    var         element     = this.ElementAt(i);
                    Measurement measurement = element.Value;
                    var         ptColl      = await measurement.ToPointCollectionAsync(geometry);

                    int nrPoints = measurement.PointNr;

                    if (ptColl != null)
                    {
                        int msPoints = measurement.Count;

                        if (nrPoints == msPoints)
                        {
                            bool found = true;

                            for (int j = 0; ((j < nrPoints) && found); j++)
                            {
                                MapPoint         point            = ptColl[j];
                                MeasurementPoint measurementPoint = measurement.GetPointByNr(j);

                                if (point != null)
                                {
                                    found = measurementPoint?.IsSame(point, includeZ) ?? true;
                                }
                            }

                            if (found)
                            {
                                result = measurement;
                            }
                        }
                    }
                }
            }

            return(result);
        }
Exemple #6
0
        public MeasurementObservation(MeasurementPoint measurementPoint, string imageId, MapPoint observationPoint, Bitmap match, double xDir, double yDir)
        {
            XDir = xDir;
            YDir = yDir;
            _measurementPoint = measurementPoint;
            ImageId           = imageId;
            Point             = observationPoint;
            Match             = match;
            GlobeSpotter globeSpotter = GlobeSpotter.Current;
            ViewerList   viewerList   = globeSpotter.ViewerList;

            Viewer = viewerList.Get(imageId);

            // event listeners
            _measurementPoint.PropertyChanged += OnPropertyMeasurementPointChanged;
            PropertyChanged += OnPropertyMeasurementObservationChanged;
            MapViewCameraChangedEvent.Subscribe(OnMapViewCameraChanged);
            viewerList.ViewerAdded   += OnViewerAdded;
            viewerList.ViewerRemoved += OnViewerRemoved;
            viewerList.ViewerMoved   += OnViewerMoved;
        }