示例#1
0
        public override void Empty()
        {
            base.Empty();

            DeccaChainID = 0;
            Red.Empty();
            Green.Empty();
            Purple.Empty();
            RedLineNavigationUse             = Boolean.Unknown;
            GreenLineNavigationUse           = Boolean.Unknown;
            PurpleLineNavigationUse          = Boolean.Unknown;
            PositionUncertaintyNauticalMiles = 0.0D;
            Basis = FixDataBasis.Unknown;
        }
示例#2
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** DCN - Decca Position
            **                                      11  13      16
            **        1  2  3   4 5  6   7 8  9   10| 12| 14  15| 17
            **        |  |  |   | |  |   | |  |   | | | | |   | | |
            ** $--DCN,xx,cc,x.x,A,cc,x.x,A,cc,x.x,A,A,A,A,x.x,N,x*hh<CR><LF>
            **
            **  1) Decca chain identifier
            **  2) Red Zone Identifier
            **  3) Red Line Of Position
            **  4) Red Master Line Status
            **  5) Green Zone Identifier
            **  6) Green Line Of Position
            **  7) Green Master Line Status
            **  8) Purple Zone Identifier
            **  9) Purple Line Of Position
            ** 10) Purple Master Line Status
            ** 11) Red Line Navigation Use
            ** 12) Green Line Navigation Use
            ** 13) Purple Line Navigation Use
            ** 14) Position Uncertainity
            ** 15) N = Nautical Miles
            ** 16) Fix Data Basis
            **     1 = Normal Pattern
            **     2 = Lane Identification Pattern
            **     3 = Lane Identification Transmissions
            ** 17) Checksum
            */

            /*
            ** First we check the checksum...
            */

            if (sentence.IsChecksumBad() == Boolean.True)
            {
                Empty();
                return(false);
            }

            DeccaChainID = sentence.Integer(1);
            Red.Parse(2, sentence);
            Green.Parse(5, sentence);
            Purple.Parse(8, sentence);
            RedLineNavigationUse             = sentence.Boolean(11);
            GreenLineNavigationUse           = sentence.Boolean(12);
            PurpleLineNavigationUse          = sentence.Boolean(13);
            PositionUncertaintyNauticalMiles = sentence.Double(14);

            int temp_integer = sentence.Integer(16);

            switch (temp_integer)
            {
            case 1:

                Basis = FixDataBasis.NormalPattern;
                break;

            case 2:

                Basis = FixDataBasis.LaneIdentificationPattern;
                break;

            case 3:

                Basis = FixDataBasis.LaneIdentificationTransmissions;
                break;

            default:

                Basis = FixDataBasis.Unknown;
                break;
            }

            return(true);
        }