[hamradio-commits] [gnss-sdr] 268/303: Add header

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Mon Feb 13 22:36:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

carles_fernandez-guest pushed a commit to branch master
in repository gnss-sdr.

commit 59e3ffe1674721a231195f219e5f484ead537470
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Thu Feb 2 20:05:15 2017 +0100

    Add header
---
 .../signal-processing-blocks/libs/CMakeLists.txt   |   2 +-
 .../libs/tlm_dump_reader.cc                        | 109 ++++++++++++-------
 .../libs/tlm_dump_reader.h                         |  40 +++++--
 .../libs/tracking_dump_reader.cc                   | 118 +++++++++++++--------
 .../libs/tracking_dump_reader.h                    |  38 +++++--
 .../libs/tracking_true_obs_reader.cc               | 111 ++++++++++++-------
 .../libs/tracking_true_obs_reader.h                |  40 +++++--
 7 files changed, 322 insertions(+), 136 deletions(-)

diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt
index 82d4d76..3e68bc0 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2015  (see AUTHORS file for a list of contributors)
+# Copyright (C) 2012-2017  (see AUTHORS file for a list of contributors)
 #
 # This file is part of GNSS-SDR.
 #
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc
index 9cfb645..3cf8993 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc
@@ -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();
+        }
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h
index 0b64d19..a3afec2 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h
@@ -1,9 +1,35 @@
-//
-// Created by javier on 23/1/2017.
-//
-
-#ifndef GNSS_SIM_tlm_dump_reader_H
-#define GNSS_SIM_tlm_dump_reader_H
+/*!
+ * \file tlm_dump_reader.h
+ * \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/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef GNSS_SDR_tlm_dump_reader_H
+#define GNSS_SDR_tlm_dump_reader_H
 
 #include <iostream>
 #include <fstream>
@@ -31,4 +57,4 @@ private:
 
 };
 
-#endif //GNSS_SIM_tlm_dump_reader_H
+#endif //GNSS_SDR_tlm_dump_reader_H
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc
index 90b46b0..ac4120e 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc
@@ -1,12 +1,38 @@
-//
-// Created by javier on 1/2/2017.
-//
+/*!
+ * \file tracking_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 "tracking_dump_reader.h"
 
 bool tracking_dump_reader::read_binary_obs()
-    {
-        try {
+{
+    try {
             d_dump_file.read((char *) &abs_E, sizeof(float));
             d_dump_file.read((char *) &abs_P, sizeof(float));
             d_dump_file.read((char *) &abs_L, sizeof(float));
@@ -27,22 +53,26 @@ bool tracking_dump_reader::read_binary_obs()
             d_dump_file.read((char *) &aux1, sizeof(double));
             d_dump_file.read((char *) &aux2, sizeof(double));
 
-        }
-        catch (const std::ifstream::failure &e) {
+    }
+    catch (const std::ifstream::failure &e)
+    {
             return false;
-        }
-        return true;
     }
+    return true;
+}
 
-bool tracking_dump_reader::restart() {
+bool tracking_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 tracking_dump_reader::num_epochs()
@@ -50,44 +80,48 @@ long int tracking_dump_reader::num_epochs()
     std::ifstream::pos_type size;
     int number_of_double_vars=11;
     int number_of_float_vars=5;
-    int epoch_size_bytes=sizeof(unsigned long int)+
-            sizeof(double)*number_of_double_vars+
-            sizeof(float)*number_of_float_vars;
+    int epoch_size_bytes=sizeof(unsigned long int) +
+            sizeof(double) * number_of_double_vars +
+            sizeof(float) * number_of_float_vars;
     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;
+            long int nepoch = size / epoch_size_bytes;
             return nepoch;
-        }else{
+        }
+    else
+        {
             return 0;
         }
 }
 
-bool tracking_dump_reader::open_obs_file(std::string out_file) {
+bool tracking_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 << "Tracking dump enabled, Log file: " << d_dump_filename.c_str()<< std::endl;
-            return true;
-        }
-        catch (const std::ifstream::failure & e)
         {
-            std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str()<< std::endl;
-            return 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 << "Tracking dump enabled, Log file: " << d_dump_filename.c_str() << std::endl;
+                    return true;
+            }
+            catch (const std::ifstream::failure & e)
+            {
+                    std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str() << std::endl;
+                    return false;
+            }
+        }else{
+                return false;
         }
-    }else{
-        return false;
-    }
 }
 
-tracking_dump_reader::~tracking_dump_reader() {
+tracking_dump_reader::~tracking_dump_reader()
+{
     if (d_dump_file.is_open() == true)
-    {
-        d_dump_file.close();
-    }
+        {
+            d_dump_file.close();
+        }
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h
index a72315c..9f145ec 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h
@@ -1,9 +1,35 @@
-//
-// Created by javier on 23/1/2017.
-//
+/*!
+ * \file tracking_dump_reader.h
+ * \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/>.
+ *
+ * -------------------------------------------------------------------------
+ */
 
-#ifndef GNSS_SIM_tracking_dump_reader_H
-#define GNSS_SIM_tracking_dump_reader_H
+#ifndef GNSS_SDR_tracking_dump_reader_H
+#define GNSS_SDR_tracking_dump_reader_H
 
 #include <iostream>
 #include <fstream>
@@ -60,4 +86,4 @@ private:
 
 };
 
-#endif //GNSS_SIM_tracking_dump_reader_H
+#endif //GNSS_SDR_tracking_dump_reader_H
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc
index cc843e7..90a31cc 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc
@@ -1,75 +1,112 @@
-//
-// Created by javier on 1/2/2017.
-//
+/*!
+ * \file tracking_true_obs_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 "tracking_true_obs_reader.h"
 
 bool tracking_true_obs_reader::read_binary_obs()
+{
+    try
     {
-        try {
             d_dump_file.read((char *) &signal_timestamp_s, sizeof(double));
             d_dump_file.read((char *) &acc_carrier_phase_cycles, sizeof(double));
             d_dump_file.read((char *) &doppler_l1_hz, sizeof(double));
             d_dump_file.read((char *) &prn_delay_chips, sizeof(double));
             d_dump_file.read((char *) &tow, sizeof(double));
-        }
-        catch (const std::ifstream::failure &e) {
+    }
+    catch (const std::ifstream::failure &e)
+    {
             return false;
-        }
-        return true;
     }
+    return true;
+}
 
-bool tracking_true_obs_reader::restart() {
+bool tracking_true_obs_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 tracking_true_obs_reader::num_epochs()
 {
     std::ifstream::pos_type size;
-    int number_of_vars_in_epoch=5;
-    int epoch_size_bytes=sizeof(double)*number_of_vars_in_epoch;
+    int number_of_vars_in_epoch = 5;
+    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;
+            long int  nepoch = size / epoch_size_bytes;
             return nepoch;
-        }else{
+        }
+    else
+        {
             return 0;
         }
 }
 
-bool tracking_true_obs_reader::open_obs_file(std::string out_file) {
+bool tracking_true_obs_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 << "Observables 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 << "Observables dump enabled, Log file: " << d_dump_filename.c_str() << std::endl;
+                    return true;
+            }
+            catch (const std::ifstream::failure & e)
+            {
+                    std::cout << "Problem opening Observables dump Log file: " << d_dump_filename.c_str() << std::endl;
+                    return false;
+            }
         }
-        catch (const std::ifstream::failure & e)
+    else
         {
-            std::cout << "Problem opening Observables dump Log file: " << d_dump_filename.c_str()<< std::endl;
             return false;
         }
-    }else{
-        return false;
-    }
 }
 
-tracking_true_obs_reader::~tracking_true_obs_reader() {
+tracking_true_obs_reader::~tracking_true_obs_reader()
+{
     if (d_dump_file.is_open() == true)
-    {
-        d_dump_file.close();
-    }
+        {
+            d_dump_file.close();
+        }
 }
diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h
index de46648..c7f1e64 100644
--- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h
+++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h
@@ -1,9 +1,35 @@
-//
-// Created by javier on 23/1/2017.
-//
-
-#ifndef GNSS_SIM_tracking_true_obs_reader_H
-#define GNSS_SIM_tracking_true_obs_reader_H
+/*!
+ * \file tracking_true_obs_reader.h
+ * \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/>.
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef GNSS_SDR_tracking_true_obs_reader_H
+#define GNSS_SDR_tracking_true_obs_reader_H
 
 #include <iostream>
 #include <fstream>
@@ -33,4 +59,4 @@ private:
 
 };
 
-#endif //GNSS_SIM_tracking_true_obs_reader_H
+#endif //GNSS_SDR_tracking_true_obs_reader_H

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git



More information about the pkg-hamradio-commits mailing list