Exemplo n.º 1
0
 public void SetTemporalMarker(BaseCoordinates coordinates, int id)
 {
     RemoveTemporalMarker();
     temporalAbstractMarker    = markerGenerator.GenerateMarker(coordinates);
     temporalAbstractMarker.Id = id;
     MapImplementation.AddMarker(temporalAbstractMarker);
 }
        public void TestCreateMarkerWithDefaultTexture()
        {
            BaseCoordinates location = NSubstitute.Substitute.For <BaseCoordinates> (1, 1);
            AbstractMarker  marker   = MarkerGeneratorMock.GenerateMarker(location);

            Assert.AreEqual(MarkerGeneratorMock.DefaultTexture, marker.Texture);
        }
    public AbstractMarker GenerateMarker(BaseCoordinates location)
    {
        AbstractMarker markerInstance = CreateMarkerInstance(location);

        markerInstance.Location = location;
        return(markerInstance);
    }
        public void TestTemporalMarkerHasIdSetByUser()
        {
            AbstractMarker argumentUsed = null;

            map.AddMarker(Arg.Do <AbstractMarker> (x => argumentUsed = x));
            mapWrapper.SetTemporalMarker(temporalMarkerLocation, temporalMarkerId);
            Assert.AreEqual(temporalMarkerId, argumentUsed.Id);
        }
        public void TestTemporalMarkerHasLocationSetByUser()
        {
            AbstractMarker argumentUsed = null;

            map.AddMarker(Arg.Do <AbstractMarker> (x => argumentUsed = x));
            mapWrapper.SetTemporalMarker(temporalMarkerLocation);
            Assert.AreSame(temporalMarkerLocation, argumentUsed.Location);
        }
        public void TestMarkerHasCoordinates()
        {
            AbstractMarker argumentUsed = null;

            map.AddMarker(Arg.Do <AbstractMarker> (x => argumentUsed = x));
            mapWrapper.SetMarkerInMap(markerLocation);
            Assert.AreSame(markerLocation, argumentUsed.Location);
        }
Exemplo n.º 7
0
 public void RemoveTemporalMarker()
 {
     if (HasTemporalMarker)
     {
         EraseMarker(temporalAbstractMarker);
     }
     temporalAbstractMarker = null;
 }
Exemplo n.º 8
0
    public void SetMarkerInMap(BaseCoordinates coordinates)
    {
        AbstractMarker marker = markerGenerator.GenerateMarker(coordinates);

        marker.Location = coordinates;
        markers.Add(marker);
        MapImplementation.AddMarker(marker);
    }
        public void TestRemoveTemporalMarkerErasesItFromMap()
        {
            AbstractMarker createdMarker = null;

            map.AddMarker(Arg.Do <AbstractMarker> (x => createdMarker = x));
            mapWrapper.SetTemporalMarker(temporalMarkerLocation);
            mapWrapper.RemoveTemporalMarker();
            map.Received(1).EraseMarker(createdMarker);
        }
        /// <summary>
        /// Updates the marker shape.
        /// </summary>
        private void UpdateMarkerShape()
        {
            if (this.Marker.Shape != null)
            {
                ((AbstractMarker)this.Marker.Shape).OnPositionChanged  -= Marker_OnPositionChanged;
                ((AbstractMarker)this.Marker.Shape).OnSelectionChanged -= Marker_OnSelectionChanged;

                this.Marker.Shape = null;
            }

            AbstractMarker marker = null;

            // Reference Transmitter
            if (this.RFDevice.Id == 0)
            {
                marker = new CircleMarker(this.mcMapControl, this.Marker, GetToolTip());
                //shape.OnPositionChanged += Shape_OnPositionChanged;
                //this.Marker.Shape = shape;
                //return;
            }

            // Receiver
            if (this.RFDevice.Id < 0)
            {
                marker = new RectangleMarker(this.mcMapControl, this.Marker, GetToolTip());
                //shape.OnPositionChanged += Shape_OnPositionChanged;
                //this.Marker.Shape = shape;
                //return;
            }

            // Last but not least all other are transmitters ...
            if (this.RFDevice.Id > 0)
            {
                marker = new TriangleMarker(this.mcMapControl, this.Marker, GetToolTip());
                //shape.OnPositionChanged += Shape_OnPositionChanged;
                //this.Marker.Shape = shape;
            }

#if DEBUG
            if (this.RFDevice.Id == 42)
            {
                marker = new DiamondMarker(this.mcMapControl, this.Marker, GetToolTip());
            }
#endif

            marker.OnPositionChanged  += Marker_OnPositionChanged;
            marker.OnSelectionChanged += Marker_OnSelectionChanged;

            this.Marker.Shape = marker;

            // Das können wir direkt mal aktualisieren da es ja noch nicht gesetzt wurde ...
            UpdateYaw();
            UpdatePitch();
        }
Exemplo n.º 11
0
 private void SetUpSubstitutes()
 {
     map = NSubstitute.Substitute.For <AbstractMap> ();
     temporalMarkerLocation = NSubstitute.Substitute.For <BaseCoordinates> (1, 1);
     marker = NSubstitute.Substitute.For <AbstractMarker>();
 }
    protected override AbstractMarker CreateMarkerInstance(BaseCoordinates location)
    {
        AbstractMarker marker = NSubstitute.Substitute.For <AbstractMarker> ();

        return(marker);
    }
Exemplo n.º 13
0
 public void EraseMarker(AbstractMarker marker)
 {
     map.RemoveMarker(marker as Marker);
 }
Exemplo n.º 14
0
 public void EraseMarker(AbstractMarker marker)
 {
     MapImplementation.EraseMarker(marker);
 }
Exemplo n.º 15
0
 public void AddTemporalMarker()
 {
     markers.Add(temporalAbstractMarker);
     temporalAbstractMarker = null;
 }
Exemplo n.º 16
0
 public void AddMarker(AbstractMarker marker)
 {
 }
 public override void DrawUserLocationMarker()
 {
     AbstractMarker marker = NSubstitute.Substitute.For <AbstractMarker> ();
 }