Exemplo n.º 1
0
        public void AcrossTheEquator()
        {
            Encoder encoder = new Encoder(51);

            encoder.GpsLocationAdd(1, 42.3519f, -87.9094f, 10.0f);

            string bcdText = encoder.Bcd();

            Assert.AreEqual(22, bcdText.Length);

            Assert.AreEqual("018806765FF2960A0003E8", bcdText);
        }
Exemplo n.º 2
0
        public void LatitudeNotTooPositive()
        {
            Encoder encoder = new Encoder(51);

            encoder.GpsLocationAdd(1, 90.0f, 0.00f, 10.0f);

            string bcdText = encoder.Bcd();

            Assert.AreEqual(22, bcdText.Length);

            Assert.AreEqual("0188 0DBBA0 000000 0003E8".Replace(" ", ""), bcdText);
        }
Exemplo n.º 3
0
        public void LatitudeSouthPole()
        {
            Encoder encoder = new Encoder(51);

            encoder.GpsLocationAdd(1, 42.3519f, -87.9094f, 10.0f);

            /*
             * string bcdText = encoder.Bcd();
             *
             * Assert.AreEqual(22, bcdText.Length);
             *
             * Assert.AreEqual("018806765FF2960A0003E8", bcdText);
             */
        }
Exemplo n.º 4
0
        public void AcrossTheAntipodalLine()
        {
            Encoder encoder = new Encoder(121);

            encoder.GpsLocationAdd(5, 0.0f, 0.5f, 10.0f);
            encoder.GpsLocationAdd(4, 0.0f, 0.4f, 10.0f);
            encoder.GpsLocationAdd(3, 0.0f, 0.3F, 10.0f);
            encoder.GpsLocationAdd(2, 0.0f, 0.2f, 10.0f);
            encoder.GpsLocationAdd(1, 0.0f, 0.1f, 10.0f);

            encoder.GpsLocationAdd(0, 0.0f, 0.0f, 10.0f);


            encoder.GpsLocationAdd(1, 0.0f, -0.1f, 10.0f);
            encoder.GpsLocationAdd(2, 0.0f, -0.2f, 10.0f);
            encoder.GpsLocationAdd(3, 0.0f, -0.3f, 10.0f);
            encoder.GpsLocationAdd(4, 0.0f, -0.4f, 10.0f);
            encoder.GpsLocationAdd(5, 0.0f, -0.5f, 10.0f);

            string bcdText = encoder.Bcd();

            Assert.AreEqual(242, bcdText.Length);

            Assert.AreEqual("05880000000013880003E8 0488000000000FA00003E8 0388000000000BB80003E8 02880000000007D00003E8 01880000000003E80003E8 00880000000000000003E8 0188000000FFFC180003E8 0288000000FFF8300003E8 0388000000FFF4480003E80488000000FFF0600003E80588000000FFEC780003E8".Replace(" ", ""), bcdText);
        }
Exemplo n.º 5
0
        public void LatitudeTooPositive()
        {
            Encoder encoder = new Encoder(51);

            encoder.GpsLocationAdd(1, 90.0001f, 0.00f, 10.0f);
        }