From 0ca063b627236ce7c77ac1193e357791425ae81b Mon Sep 17 00:00:00 2001 From: Stefan Mertl Date: Wed, 31 Jan 2018 17:28:48 +0100 Subject: [PATCH] Output the GPS state to the LCD. --- software/c++/ruwaicom/src/root.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/software/c++/ruwaicom/src/root.cpp b/software/c++/ruwaicom/src/root.cpp index 15f2754..ec223f6 100644 --- a/software/c++/ruwaicom/src/root.cpp +++ b/software/c++/ruwaicom/src/root.cpp @@ -345,7 +345,7 @@ Root::run(void) int max_try = 10; display->print("Starting...", ""); - + // Start the temperature logging thread. syslog(LOG_NOTICE, "[root] Starting the temperature logging thread."); std::thread t_temp_log(log_temperature); @@ -722,14 +722,27 @@ Root::lcd_status(void) char c_time_string[27]; std::string time_string; timestamp_t last_timestamp; - while (true) { + std::stringstream stream; + std::string msg1; + std::string msg2; + last_timestamp = recorder->get_last_timestamp(); ms_hptime2isotimestr(last_timestamp.time, c_time_string, true); time_string = std::string(c_time_string); - display->print(time_string.substr(0, 9), time_string.substr(11)); - std::this_thread::sleep_for(std::chrono::seconds(5)); + display->print(time_string.substr(0, 10), time_string.substr(11)); + + std::this_thread::sleep_for(std::chrono::seconds(2)); + + + stream << "GPS F:" << last_timestamp.gps_fix << " OK:" << last_timestamp.gps_fix_ok; + msg1 = stream.str(); + stream << "SLTS:" << last_timestamp.sec_slts; + msg2 = stream.str(); + display->print(msg1, msg2); + + std::this_thread::sleep_for(std::chrono::seconds(10)); } } -- 2.11.4.GIT