예제 #1
0
        public void TestTheTackIsBeingSetCorrectly()
        {
            NavigationReadings navigationReadings = new NavigationReadings();

            navigationReadings.WindDirection = 0;

            navigationReadings.SetTack(45);

            Assert.AreEqual(navigationReadings.Tack, NmeaParser.Constants.Tack.Port);

            navigationReadings.SetTack(170);
            Assert.AreEqual(navigationReadings.Tack, NmeaParser.Constants.Tack.PortRun);

            navigationReadings.SetTack(345);
            Assert.AreEqual(navigationReadings.Tack, NmeaParser.Constants.Tack.StarBoard);

            navigationReadings.SetTack(200);
            Assert.AreEqual(navigationReadings.Tack, NmeaParser.Constants.Tack.StarBoardRun);

            navigationReadings.WindDirection = 230;
            navigationReadings.SetTack(280);
            Assert.AreEqual(navigationReadings.Tack, NmeaParser.Constants.Tack.Port);
            navigationReadings.SetTack(170);
            Assert.AreEqual(navigationReadings.Tack, NmeaParser.Constants.Tack.StarBoard);
        }
예제 #2
0
 public TackReading(NavigationReadings navReading)
 {
     TimeOfReading     = navReading.TimeOfReading;
     CurrentTack       = navReading.Tack;
     ReadingNow        = navReading.CogNow;
     ReadingShort      = navReading.CogFast;
     ReadingLong       = navReading.CogSlow;
     ReadingSpeedShort = navReading.SogFast;
     ReadingSpeedLong  = navReading.SogSlow;
 }