示例#1
0
 public void AvidPathingTest1()
 {
     var launchWindow = new AvidVector(AvidDirection.D, AvidRing.Blue, true, 27);
     var crossingVector = new AvidVector(AvidDirection.EF, AvidRing.Ember, true, 20);
     var result = ServiceFactory.Library.AvidCalculator.GetPossibleLaunchWindows(1, launchWindow, crossingVector);
     result.Length.Should().Be(2);
     result.Should().Contain(new AvidWindow(AvidDirection.DE, AvidRing.Blue, true));
     result.Should().Contain(new AvidWindow(AvidDirection.DE, AvidRing.Ember, true));
 }
        public void UpdateVector(AvidVector vector, bool isVisible)
        {
            IsVisible = !AvidWindow.IsNullOrZero(vector) && isVisible;
            Magnitude = vector != null ? vector.Magnitude : 0;
            Window = vector;

            OnPropertyChanged(Properties.IsVisible);
            OnPropertyChanged(Properties.Magnitude);
            OnPropertyChanged(Properties.Window);
        }
示例#3
0
        public AvidVector ProjectVectorToAvid(HexVector vector)
        {
            var result = new AvidVector
            {
                Magnitude = _rangeAltitudeTable.GetDistance(vector)
            };

            if (result.Magnitude == 0)
            {
                return result;
            }

            result.Ring = _rangeAltitudeTable.GetRing(vector);
            result.AbovePlane = result.Ring == AvidRing.Ember || vector.VerticalComponent.Direction == HexAxis.Up;
            result.Direction = CalculateDirection(vector, result.Ring);

            return result;
        }
示例#4
0
        public void SubmitBearingVerificationResult(AvidWindow verificationResult)
        {
            if (verificationResult == null)
            {
                OnVerificationRequired();
                return;
            }

            var vectorResult = verificationResult as AvidVector;

            int magnitude = vectorResult != null ? vectorResult.Magnitude : 0;

            TargetDistance = new AvidVector(verificationResult.Direction, verificationResult.Ring, verificationResult.AbovePlane, magnitude);
            CourseOffset = _avidCalculator.GetCourseOffset(TargetDistance, CrossingVector);

            OnVectorsUpdated();
            UpdateFiringSolution(null, null, null);
        }
        private void CreateOrUpdateVector(AvidVector originalVector, ref IAvidMark targetVector, int categoryId, bool underlined)
        {
            string markText = originalVector != null ? originalVector.Magnitude.ToString("D") : string.Empty;
            AvidWindow position = originalVector ?? new AvidWindow();

            if (targetVector == null)
            {
                targetVector = _elementBoard.AddMark(categoryId, markText, originalVector != null, underlined, position);
            }
            else
            {
                targetVector.Text = markText;
                targetVector.Window = position;
                targetVector.Visible = !AvidWindow.IsNullOrZero(position);
            }
        }
 private void CreateOrUpdateVelocityVectors(AvidVector targetVector, AvidVector crossingVector)
 {
     CreateOrUpdateVector(targetVector, ref _targetVectorMark, VectorsCategory, false);
     CreateOrUpdateVector(crossingVector, ref _crossingVectorMark, VectorsCategory, true);
 }
示例#7
0
        public void AvidPathingTest6()
        {
            var launchWindow = new AvidVector(AvidDirection.Undefined, AvidRing.Magenta, true, 27);
            var crossingVector = new AvidVector(AvidDirection.Undefined, AvidRing.Magenta, false, 20);
            var result = ServiceFactory.Library.AvidCalculator.GetPossibleLaunchWindows(1, launchWindow, crossingVector);
            result.Length.Should().Be(6);

            result.Should().Contain(new AvidWindow(AvidDirection.A, AvidRing.Green, true));
            result.Should().Contain(new AvidWindow(AvidDirection.B, AvidRing.Green, true));
            result.Should().Contain(new AvidWindow(AvidDirection.C, AvidRing.Green, true));
            result.Should().Contain(new AvidWindow(AvidDirection.D, AvidRing.Green, true));
            result.Should().Contain(new AvidWindow(AvidDirection.E, AvidRing.Green, true));
            result.Should().Contain(new AvidWindow(AvidDirection.F, AvidRing.Green, true));
        }