private void ParseGSAData(string[] Data) { int SatCount = 0; int i; // Fix selection Manual/Automatic if (Data[1] == string.Empty || Data[1] == "M") { if (_fixMode != FixModes.Manual) { _fixMode = FixModes.Manual; OnFixModeChanged(this, _fixMode); } } else { if (_fixMode != FixModes.Automatic) { _fixMode = FixModes.Automatic; OnFixModeChanged(this, _fixMode); } } // GSAMode if (Data[2] == string.Empty || Data[2] == "1") { if (_gsaMode != GSAModes.NoFix) { _gsaMode = GSAModes.NoFix; OnGSAModeChanged(this, _gsaMode); } } else if (Data[2] == "2") { if (_gsaMode != GSAModes.Fix2D) { _gsaMode = GSAModes.Fix2D; OnGSAModeChanged(this, _gsaMode); } } else { if (_gsaMode != GSAModes.Fix3D) { _gsaMode = GSAModes.Fix3D; OnGSAModeChanged(this, _gsaMode); } } // Satellites used for (i = 3; i < 15; i++) { if (Data[i] != string.Empty) SatCount += 1; else break; } // Move to array _gsaSatellites = new int[SatCount]; for (i = 0; i < SatCount; i++) _gsaSatellites[i] = int.Parse(Data[i + 3]); // Position Dilution of Precision if (Data[15] != string.Empty) _POD = double.Parse(Data[15]); // Horizontal Dilution of Precision if (Data[16] != string.Empty) _HOD = double.Parse(Data[16]); // Vertical Dilution of Precision if (Data[17] != string.Empty) _VOD = double.Parse(Data[17]); }
protected virtual void OnFixModeChanged(MTK3339 sender, FixModes e) { if (FixModeChanged != null) FixModeChanged(sender, e); }