/*!
* \file control_thread.cc
* \brief This class implements the receiver control plane
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
*
* GNSS Receiver Control Plane: connects the flowgraph, starts running it,
* and while it does not stop, reads the control messages generated by the blocks,
* process them, and apply the corresponding actions.
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (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 .
*
* -------------------------------------------------------------------------
*/
#if ARMA_NO_BOUND_CHECKING
#define ARMA_NO_DEBUG 1
#endif
#include "control_thread.h"
#include "channel_event.h"
#include "command_event.h"
#include "concurrent_map.h"
#include "configuration_interface.h"
#include "file_configuration.h"
#include "galileo_almanac.h"
#include "galileo_ephemeris.h"
#include "galileo_iono.h"
#include "galileo_utc_model.h"
#include "geofunctions.h"
#include "glonass_gnav_ephemeris.h"
#include "glonass_gnav_utc_model.h"
#include "gnss_flowgraph.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "gps_acq_assist.h" // for Gps_Acq_Assist
#include "gps_almanac.h" // for Gps_Almanac
#include "gps_cnav_ephemeris.h" // for Gps_CNAV_Ephemeris
#include "gps_cnav_utc_model.h" // for Gps_CNAV_Utc_Model
#include "gps_ephemeris.h" // for Gps_Ephemeris
#include "gps_iono.h" // for Gps_Iono
#include "gps_utc_model.h" // for Gps_Utc_Model
#include "pvt_interface.h" // for PvtInterface
#include "rtklib.h" // for gtime_t, alm_t
#include "rtklib_conversions.h" // for alm_to_rtklib
#include "rtklib_ephemeris.h" // for alm2pos, eph2pos
#include "rtklib_rtkcmn.h" // for utc2gpst
#include // for interaction with geofunctions
#include // for steady_clock
#include // for bad_lexical_cast
#include // for LOG
#include // for make_any
#include // for find, min
#include // for array
#include // for milliseconds
#include // for floor, fmod, log
#include // for exception
#include // for operator<<, endl
#include // for numeric_limits
#include