private void Message(AgEUtLogMsgType severity, String msgStr) { if (m_UPS != null) { m_UPS.Message(severity, msgStr); } }
private void Message(AgEUtLogMsgType severity, string msg) { if (m_Site != null) { m_Site.Message(severity, msg); } }
private void Message(AgEUtLogMsgType msgType, String msg) { if ((msgType == AgEUtLogMsgType.eUtLogMsgDebug) && (!_DebugMode)) { return; } if (_AgUtPluginSite != null) { _AgUtPluginSite.Message(msgType, msg); } }
public void ReadEphemeris(AgAsEphemFileReaderPluginResultEphem Result) { if (Result != null) { Result.CentralBody = "Earth"; Result.CoordinateSystem = "Fixed"; Result.InterpolationMethod = AgEAsEphemInterpolationMethod.eAsEphemInterpolationMethodLagrange; Result.InterpolationOrder = 5; Result.CovarianceRepresentation = AgEAsCovRep.eAsCovRepRIC; Result.SetUnits(AgEAsEphemFileDistanceUnit.eAsEphemFileDistanceUnitKilometer, AgEAsEphemFileTimeUnit.eAsEphemFileTimeUnitSecond); string[] fileLines = File.ReadAllLines(Result.Filename); bool readHeader = false; bool readSeparator = false; int numPointsRead = 0; // Go through each line in the data report and parse it foreach (string fileLine in fileLines) { string[] elements = fileLine.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); if (elements.Length == 7) { if (!readHeader) { readHeader = true; continue; } if (!readSeparator) { readSeparator = true; continue; } DateTime time = DateTime.Parse(elements[0], CultureInfo.InvariantCulture); double x = double.Parse(elements[1], CultureInfo.InvariantCulture); double y = double.Parse(elements[2], CultureInfo.InvariantCulture); double z = double.Parse(elements[3], CultureInfo.InvariantCulture); double vx = double.Parse(elements[4], CultureInfo.InvariantCulture); double vy = double.Parse(elements[5], CultureInfo.InvariantCulture); double vz = double.Parse(elements[6], CultureInfo.InvariantCulture); bool added = Result.AddEphemerisOnDate( AgEUtTimeScale.eUtTimeScaleUTC, time.Year, time.Month, time.Day, time.Hour, time.Minute, time.Second, x, y, z, vx, vy, vz, null); if (added) { numPointsRead++; } else { m_site.Message(AgEUtLogMsgType.eUtLogMsgWarning, "Could not add point #" + numPointsRead); } } } string message = string.Format("ECF Data Report Reader read {0} points", numPointsRead); m_site.Message(AgEUtLogMsgType.eUtLogMsgInfo, message); } }