本文整理汇总了C#中LogEntry.HasField方法的典型用法代码示例。如果您正苦于以下问题:C# LogEntry.HasField方法的具体用法?C# LogEntry.HasField怎么用?C# LogEntry.HasField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogEntry
的用法示例。
在下文中一共展示了LogEntry.HasField方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogEntryGPS
public LogEntryGPS(LogEntry entry)
{
if (entry.HasField("TimeUS"))
{
// perhaps it is the old format with GWk and TimeUS
// "QBIHBcLLeeEefB"
GPSTime = entry.GetField<UInt64>("TimeUS"); // Q
//byte Status = entry.GetField<byte>("Status"); // B
//uint GMS = entry.GetField<UInt32>("GMS"); // I
ushort GWk = entry.GetField<UInt16>("GWk"); // H
nSat = entry.GetField<byte>("NSats"); // B
EPH = (float)entry.GetField<double>("HDop"); // c
Lat = entry.GetField<double>("Lat"); // L
Lon = entry.GetField<double>("Lng"); // L
//double RAlt = entry.GetField<double>("RAlt"); // e
Alt = (float)entry.GetField<double>("Alt"); // e
//double spd = entry.GetField<double>("Spd"); // E
//double gcrs = entry.GetField<float>("GCrs"); // e
//double vz = entry.GetField<float>("VZ"); // f
//byte u = entry.GetField<byte>("U"); // B
}
else if (entry.HasField("GPSTime"))
{
GPSTime = entry.GetField<UInt64>("GPSTime");
Fix = entry.GetField<byte>("Fix");
EPH = entry.GetField<float>("EPH");
EPV = entry.GetField<float>("EPV");
Lat = (double)entry.GetField<Int32>("Lat") / 1E7;
Lon = (double)entry.GetField<UInt64>("Lon") / 1E7;
Alt = entry.GetField<float>("Alt");
VelN = entry.GetField<float>("VelN");
VelE = entry.GetField<float>("VelE");
VelD = entry.GetField<float>("VelD");
Cog = entry.GetField<float>("Cog");
nSat = entry.GetField<byte>("nSat");
SNR = entry.GetField<UInt16>("SNR");
N = entry.GetField<UInt16>("N");
J = entry.GetField<UInt16>("J");
}
else if (entry.HasField("time_usec"))
{
GPSTime = entry.GetField<UInt64>("time_usec") / 1000;
Fix = entry.GetField<byte>("fix_type");
EPH = entry.GetField<float>("eph");
EPV = entry.GetField<float>("epv");
Lat = (double)entry.GetField<Int32>("lat") / 1E7;
Lon = (double)entry.GetField<UInt64>("lon") / 1E7;
Alt = entry.GetField<float>("alt");
VelN = entry.GetField<float>("Vel");
Cog = entry.GetField<float>("cog");
nSat = entry.GetField<byte>("satellites_visible");
}
}