forked from gnss-sdr/gnss-sdr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rinex_fix' of https://github.com/gnss-sdr/gnss-sdr into…
… rinex_fix
- Loading branch information
Showing
12 changed files
with
411 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*! | ||
* \file signal_generator_flags.h | ||
* \brief Helper file for unit testing | ||
* \author Carles Fernandez-Prades, 2017. cfernandez(at)cttc.es | ||
* | ||
* ------------------------------------------------------------------------- | ||
* | ||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) | ||
* | ||
* GNSS-SDR is a software defined Global Navigation | ||
* Satellite Systems receiver | ||
* | ||
* This file is part of GNSS-SDR. | ||
* | ||
* GNSS-SDR is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* GNSS-SDR is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* ------------------------------------------------------------------------- | ||
*/ | ||
|
||
#ifndef GNSS_SDR_SIGNAL_GENERATOR_FLAGS_H_ | ||
#define GNSS_SDR_SIGNAL_GENERATOR_FLAGS_H_ | ||
|
||
#include <gflags/gflags.h> | ||
|
||
|
||
DEFINE_string(generator_binary, std::string(SW_GENERATOR_BIN), "Path of software-defined signal generator binary"); | ||
DEFINE_string(rinex_nav_file, std::string(DEFAULT_RINEX_NAV), "Input RINEX navigation file"); | ||
DEFINE_int32(duration, 100, "Duration of the experiment [in seconds, max = 300]"); | ||
DEFINE_string(static_position, "30.286502,120.032669,100", "Static receiver position [log,lat,height]"); | ||
DEFINE_string(dynamic_position, "", "Observer positions file, in .csv or .nmea format"); | ||
DEFINE_string(filename_rinex_obs, "sim.16o", "Filename of output RINEX navigation file"); | ||
DEFINE_string(filename_raw_data, "signal_out.bin", "Filename of output raw data file"); | ||
DEFINE_int32(fs_gen_hz, 2600000, "Samppling frequency [Hz]"); | ||
DEFINE_int32(test_satellite_PRN, 1, "PRN of the satellite under test (must be visible during the observation time)"); | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 73 additions & 36 deletions
109
src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,110 @@ | ||
// | ||
// Created by javier on 1/2/2017. | ||
// | ||
/*! | ||
* \file tlm_dump_reader.cc | ||
* \brief Helper file for unit testing | ||
* \author Javier Arribas, 2017. jarribas(at)cttc.es | ||
* | ||
* ------------------------------------------------------------------------- | ||
* | ||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors) | ||
* | ||
* GNSS-SDR is a software defined Global Navigation | ||
* Satellite Systems receiver | ||
* | ||
* This file is part of GNSS-SDR. | ||
* | ||
* GNSS-SDR is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* GNSS-SDR is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* ------------------------------------------------------------------------- | ||
*/ | ||
|
||
#include "tlm_dump_reader.h" | ||
|
||
bool tlm_dump_reader::read_binary_obs() | ||
{ | ||
try | ||
{ | ||
try { | ||
d_dump_file.read((char *) &TOW_at_current_symbol, sizeof(double)); | ||
d_dump_file.read((char *) &Prn_timestamp_ms, sizeof(double)); | ||
d_dump_file.read((char *) &d_TOW_at_Preamble, sizeof(double)); | ||
} | ||
catch (const std::ifstream::failure &e) { | ||
} | ||
catch (const std::ifstream::failure &e) | ||
{ | ||
return false; | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
|
||
bool tlm_dump_reader::restart() { | ||
bool tlm_dump_reader::restart() | ||
{ | ||
if (d_dump_file.is_open()) | ||
{ | ||
d_dump_file.clear(); | ||
d_dump_file.seekg(0, std::ios::beg); | ||
return true; | ||
}else{ | ||
return false; | ||
} | ||
{ | ||
d_dump_file.clear(); | ||
d_dump_file.seekg(0, std::ios::beg); | ||
return true; | ||
} | ||
else | ||
{ | ||
return false; | ||
} | ||
} | ||
|
||
long int tlm_dump_reader::num_epochs() | ||
{ | ||
std::ifstream::pos_type size; | ||
int number_of_vars_in_epoch=3; | ||
int epoch_size_bytes=sizeof(double)*number_of_vars_in_epoch; | ||
int number_of_vars_in_epoch = 3; | ||
int epoch_size_bytes = sizeof(double)*number_of_vars_in_epoch; | ||
std::ifstream tmpfile( d_dump_filename.c_str(), std::ios::binary | std::ios::ate); | ||
if (tmpfile.is_open()) | ||
{ | ||
size = tmpfile.tellg(); | ||
long int nepoch=size / epoch_size_bytes; | ||
return nepoch; | ||
}else{ | ||
} | ||
else | ||
{ | ||
return 0; | ||
} | ||
} | ||
|
||
bool tlm_dump_reader::open_obs_file(std::string out_file) { | ||
bool tlm_dump_reader::open_obs_file(std::string out_file) | ||
{ | ||
if (d_dump_file.is_open() == false) | ||
{ | ||
try | ||
{ | ||
d_dump_filename=out_file; | ||
d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); | ||
d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); | ||
std::cout << "TLM dump enabled, Log file: " << d_dump_filename.c_str()<< std::endl; | ||
return true; | ||
try | ||
{ | ||
d_dump_filename=out_file; | ||
d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit ); | ||
d_dump_file.open(d_dump_filename.c_str(), std::ios::in | std::ios::binary); | ||
std::cout << "TLM dump enabled, Log file: " << d_dump_filename.c_str()<< std::endl; | ||
return true; | ||
} | ||
catch (const std::ifstream::failure & e) | ||
{ | ||
std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str()<< std::endl; | ||
return false; | ||
} | ||
} | ||
catch (const std::ifstream::failure & e) | ||
else | ||
{ | ||
std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str()<< std::endl; | ||
return false; | ||
} | ||
}else{ | ||
return false; | ||
} | ||
} | ||
|
||
tlm_dump_reader::~tlm_dump_reader() { | ||
tlm_dump_reader::~tlm_dump_reader() | ||
{ | ||
if (d_dump_file.is_open() == true) | ||
{ | ||
d_dump_file.close(); | ||
} | ||
{ | ||
d_dump_file.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.