From 207073a1c10624b5902ad7474370246ee215a12e Mon Sep 17 00:00:00 2001
From: PepMS <jmarti@iri.upc.edu>
Date: Mon, 30 Mar 2020 20:59:16 +0200
Subject: [PATCH] [bug-fix] loag rinex navigation

---
 src/examples/gnss_utils_test.cpp | 4 +---
 src/navigation.cpp               | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/examples/gnss_utils_test.cpp b/src/examples/gnss_utils_test.cpp
index bcbd7dc..814ee44 100644
--- a/src/examples/gnss_utils_test.cpp
+++ b/src/examples/gnss_utils_test.cpp
@@ -30,13 +30,11 @@ int main(int argc, char* argv[])
   gtime_t     t_start{ 0, 0 };  // no limit
   gtime_t     t_end{ 0, 0 };    // no limit
   double      dt  = 0.0;        // no limit
-  const char* opt = "-SYS=G";   // only GPS | GPS+GAL: "-SYS=G,L" | ALL: ""
+  const char* opt = "";         // only GPS | GPS+GAL: "-SYS=G,L" | ALL: ""
 
   // RTKLIB trace
   // char str_file[80];
   // snprintf(str_file, sizeof str_file, "../src/examples/trace");
-  // traceopen(str_file);
-  // tracelevel(4);
 
   // load observations from RINEX file
   observations.loadFromRinex("../src/examples/sample_data.obs", t_start, t_end, dt, opt);
diff --git a/src/navigation.cpp b/src/navigation.cpp
index da5c6d6..398d0a8 100644
--- a/src/navigation.cpp
+++ b/src/navigation.cpp
@@ -120,7 +120,7 @@ void Navigation::clearNavigation()
 void Navigation::loadFromRinex(const std::string& rnx_file, gtime_t t_start, gtime_t t_end, double dt, const char* opt)
 {
   auto stat = readrnxt(rnx_file.c_str(), 1, t_start, t_end, dt, opt, NULL, &nav_, NULL);
-  if (stat == 0)
+  if (stat == 1)
   {
     std::cout << "Navigation file loaded." << std::endl;
     std::cout << "GPS satellites in navigation file: " << nav_.n << std::endl;
-- 
GitLab