1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
/***********************************************/
/**
* @file platformSelector.h
*
* @brief Selected platforms.
*
* @author Torsten Mayer-Guerr
* @date 2021-01-23
*
*/
/***********************************************/
#ifndef __GROOPS_PLATFORMSELECTOR__
#define __GROOPS_PLATFORMSELECTOR__
// Latex documentation
#ifdef DOCSTRING_PlatformSelector
static const char *docstringPlatformSelector = R"(
\section{PlatformSelector}\label{platformSelectorType}
Select a list of platforms (stations, satellites, ...).
In a first step all platforms are selected if first selector \config{exclude}s platforms
otherwise all platforms excluded. When every selector from top to bottom selects or deselects
(with \config{exclude}) the matching platforms.
See also \program{GnssProcessing} or \program{SlrProcessing}.
)";
#endif
/***********************************************/
#include "base/import.h"
#include "config/config.h"
#include "files/filePlatform.h"
/**
* @defgroup platformSelectorGroup PlatformSelector
* @brief Selected platforms.
* @ingroup classesGroup
* The interface is given by @ref PlatformSelector. */
/// @{
/***** TYPES ***********************************/
class PlatformSelector;
class PlatformSelectorBase;
typedef std::shared_ptr<PlatformSelector> PlatformSelectorPtr;
/***** CLASS ***********************************/
/** @brief Selected platforms.
* An instance of this class can be created with @ref readConfig. */
class PlatformSelector
{
std::vector<std::unique_ptr<PlatformSelectorBase>> bases;
public:
/// Constructor.
PlatformSelector(Config &config, const std::string &name);
/** @brief returns a boolean vector which platforms are selected. */
std::vector<Byte> select(const Time &timeStart, const Time &timeEnd, const std::vector<const Platform*> &platforms) const;
/** @brief creates an derived instance of this class. */
static PlatformSelectorPtr create(Config &config, const std::string &name) {return PlatformSelectorPtr(new PlatformSelector(config, name));}
};
/***** FUNCTIONS *******************************/
/** @brief Creates an instance of the class PlatformSelector.
* Search for a node with @a name in the Config node.
* if @a name is not found the function returns FALSE and an class without points is created.
* @param config The config node which includes the node with the options for this class
* @param name Tag name in the config.
* @param[out] var Created class.
* @param mustSet If is MUSTSET and @a name is not found, this function throws an exception instead of returning with FALSE.
* @param defaultValue Ignored at the moment.
* @param annotation Description of the function of this class.
* @relates PlatformSelector */
template<> Bool readConfig(Config &config, const std::string &name, PlatformSelectorPtr &var, Config::Appearance mustSet, const std::string &defaultValue, const std::string &annotation);
/// @}
/***** CLASS ***********************************/
// Internal class
class PlatformSelectorBase
{
public:
Bool exclude;
virtual ~PlatformSelectorBase() {}
virtual void select(const Time &timeStart, const Time &timeEnd, const std::vector<const Platform*> &platforms, std::vector<Byte> &selected) const = 0;
};
/***********************************************/
#endif
|