本文整理汇总了C++中NMEAInfo::UpdateClock方法的典型用法代码示例。如果您正苦于以下问题:C++ NMEAInfo::UpdateClock方法的具体用法?C++ NMEAInfo::UpdateClock怎么用?C++ NMEAInfo::UpdateClock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NMEAInfo
的用法示例。
在下文中一共展示了NMEAInfo::UpdateClock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void
Simulator::Touch(NMEAInfo &basic)
{
assert(is_simulator());
basic.UpdateClock();
basic.alive.Update(basic.clock);
basic.gps.simulator = true;
basic.gps.real = false;
basic.location_available.Update(basic.clock);
basic.track_available.Update(basic.clock);
basic.ground_speed_available.Update(basic.clock);
basic.gps_altitude_available.Update(basic.clock);
basic.time_available.Update(basic.clock);
basic.time += fixed(1);
basic.date_time_utc = basic.date_time_utc + 1;
}
示例2: assert
void
Simulator::Touch(NMEAInfo &basic)
{
assert(is_simulator());
basic.UpdateClock();
basic.connected.Update(basic.clock);
basic.gps.simulator = true;
basic.gps.real = false;
basic.location_available.Update(basic.clock);
basic.track_available.Update(basic.clock);
basic.ground_speed_available.Update(basic.clock);
basic.gps_altitude_available.Update(basic.clock);
basic.time_available.Update(basic.clock);
basic.time += fixed_one;
(BrokenTime &)basic.date_time_utc =
BrokenTime::FromSecondOfDayChecked((unsigned)basic.time);
}
示例3: FindLatitudeLongitude
void
Simulator::Process(NMEAInfo &basic)
{
if (!is_simulator())
return;
basic.UpdateClock();
basic.connected.Update(basic.clock);
basic.gps.satellites_used = -1;
basic.gps.simulator = true;
basic.gps.real = false;
#ifdef ANDROID
basic.gps.android_internal_gps = false;
#endif
basic.location = FindLatitudeLongitude(basic.location, basic.track,
basic.ground_speed);
basic.location_available.Update(basic.clock);
basic.gps_altitude_available.Update(basic.clock);
basic.track_available.Update(basic.clock);
basic.ground_speed_available.Update(basic.clock);
basic.time_available.Update(basic.clock);
basic.time += fixed_one;
(BrokenTime &)basic.date_time_utc =
BrokenTime::FromSecondOfDayChecked((unsigned)basic.time);
// use this to test FLARM parsing/display
if (is_debug() && !is_altair())
GenerateFLARMTraffic(basic);
// clear Airspeed as it is not available in simulation mode
basic.airspeed_available.Clear();
basic.airspeed_real = false;
}
示例4: args
int
main(int argc, char *argv[])
{
Args args(argc, argv, "HOST KEY");
const char *host = args.ExpectNext();
const char *key = args.ExpectNext();
SocketAddress address;
if (!address.Lookup(host, "5597", SOCK_DGRAM)) {
fprintf(stderr, "Failed to look up: %s\n", host);
return EXIT_FAILURE;
}
#ifdef HAVE_SKYLINES_TRACKING_HANDLER
InitialiseIOThread();
#endif
SkyLinesTracking::Client client;
#ifdef HAVE_SKYLINES_TRACKING_HANDLER
client.SetIOThread(io_thread);
Handler handler;
client.SetHandler(&handler);
#endif
client.SetKey(ParseUint64(key, NULL, 16));
if (!client.Open(address)) {
fprintf(stderr, "Failed to create client\n");
return EXIT_FAILURE;
}
if (args.IsEmpty() || StringIsEqual(args.PeekNext(), "fix")) {
NMEAInfo basic;
basic.Reset();
basic.UpdateClock();
basic.time = fixed(1);
basic.time_available.Update(basic.clock);
return client.SendFix(basic) ? EXIT_SUCCESS : EXIT_FAILURE;
} else if (StringIsEqual(args.PeekNext(), "ping")) {
client.SendPing(1);
#ifdef HAVE_SKYLINES_TRACKING_HANDLER
handler.Wait();
#endif
} else if (StringIsEqual(args.PeekNext(), "traffic")) {
client.SendTrafficRequest(true, true);
#ifdef HAVE_SKYLINES_TRACKING_HANDLER
handler.Wait();
#endif
} else {
DebugReplay *replay = CreateDebugReplay(args);
if (replay == NULL)
return EXIT_FAILURE;
while (replay->Next()) {
client.SendFix(replay->Basic());
usleep(100000);
}
}
#ifdef HAVE_SKYLINES_TRACKING_HANDLER
client.Close();
DeinitialiseIOThread();
#endif
return EXIT_SUCCESS;
}