Ejemplo n.º 1
0
        public static ModeIndicator parseMode(string mode_string)
        {
            ModeIndicator result = ModeIndicator.Data_not_valid;

            if (!String.IsNullOrEmpty(mode_string))
            {
                // (A=Autonomous, D=Differential, E=Estimated, N=Data not valid)
                if (mode_string == "D")
                {
                    result = ModeIndicator.Differential;
                }
                else if (mode_string == "A")
                {
                    result = ModeIndicator.Autonomous;
                }
                else if (mode_string == "E")
                {
                    result = ModeIndicator.Estimated;
                }
                else if (mode_string == "N")
                {
                    result = ModeIndicator.Data_not_valid;
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
        public IndicatorValues(ParametrsForTest _pt, ModeIndicator _mi)
        {
            switch (_mi)
            {
            case ModeIndicator.glassInterest:
                parametrs.Add("glassHeight", _pt.glassHeight);
                parametrs.Add("averageValue", _pt.averageValue);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 3
0
        public GprmcData(string[] sa)
        {
            head = "GPRMC";
            string times      = sa[1];
            string navWarning = sa[2];

            latitude                  = new Latitude(sa[3], sa[4]);
            longitude                 = new Longitude(sa[5], sa[6]);
            speedOverGroundKnots      = Convert.ToDouble(sa[7]);
            courseMadeGoodDegreesTrue = Convert.ToDouble(sa[8]);
            string date = sa[9];
            string mode = sa[12];

            warning           = Enum.GetValues(typeof(NavigationReceiverWarning)).Cast <NavigationReceiverWarning>().FirstOrDefault(a => (char)a == navWarning[0]);
            magneticVariation = MagneticVariation.FromStrings(sa[10], sa[11]);
            dateTime          = Util.DateTimeFromString(date, times);
            modeIndicator     = Enum.GetValues(typeof(ModeIndicator)).Cast <ModeIndicator>().FirstOrDefault(a => (char)a == mode[0]);
        }
Ejemplo n.º 4
0
        public GpvtgData(string[] data)
        {
            head = "GPVTG";

            this.trueCourseOverGroundDeg      = Util.NullableDouble(data[1]);
            this.trueCourseMark               = Convert.ToChar(data[2]);
            this.magneticCourseDeg            = Util.NullableDouble(data[3]);
            this.magneticCourseMark           = Convert.ToChar(data[4]);
            this.groundSpeedKnots             = Util.NullableDouble(data[5]);
            this.knotsSpeedMark               = Convert.ToChar(data[6]);
            this.groundSpeedKilometersPerHour = Util.NullableDouble(data[7]);
            this.kphSpeedMark = Convert.ToChar(data[8]);
            modeIndicator     = Enum.GetValues(typeof(ModeIndicator)).Cast <ModeIndicator>().FirstOrDefault(a => (char)a == data[9][0]);


            //pulling my hair out over this one, can't be bothered to find an elegent solution right now
            this.courseDigits = data[1].Split('.')[1].Length;
            this.knotsDigits  = data[5].Split('.')[1].Length;
            this.kiloDigits   = data[7].Split('.')[1].Length;
        }