File: gnssProcessingStepWriteUsedStationList.h

package info (click to toggle)
groops 0%2Bgit20240830%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: trixie
  • size: 11,052 kB
  • sloc: cpp: 134,939; fortran: 1,569; makefile: 20
file content (86 lines) | stat: -rw-r--r-- 2,791 bytes parent folder | download | duplicates (2)
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
/***********************************************/
/**
* @file gnssProcessingStepWriteUsedStationList.h
*
* @brief GNSS processing step: WriteUsedStationList.
*
* @author Torsten Mayer-Guerr
* @date 2021-09-05
*
*/
/***********************************************/

#ifndef __GROOPS_GNSSPROCESSINGSTEPWRITEUSEDSTATIONLIST__
#define __GROOPS_GNSSPROCESSINGSTEPWRITEUSEDSTATIONLIST__

// Latex documentation
#ifdef DOCSTRING_GnssProcessingStep
static const char *docstringGnssProcessingStepWriteUsedStationList = R"(
\subsection{WriteUsedStationList}\label{gnssProcessingStepType:writeUsedStationList}
Writes a \file{list}{stringList} of receivers (stations) which are used in the last step and
selected by \configClass{selectReceivers}{platformSelectorType}.
)";
#endif

/***********************************************/

#include "config/config.h"
#include "files/fileStringTable.h"
#include "classes/platformSelector/platformSelector.h"
#include "gnss/gnssProcessingStep/gnssProcessingStep.h"

/***** CLASS ***********************************/

/** @brief GNSS processing step: WriteUsedStationList.
* @ingroup gnssProcessingStepGroup
* @see GnssProcessingStep */
class GnssProcessingStepWriteUsedStationList : public GnssProcessingStepBase
{
  PlatformSelectorPtr selectReceivers;
  FileName            fileNameUsedStationList;

public:
  GnssProcessingStepWriteUsedStationList(Config &config);
  void process(GnssProcessingStep::State &state) override;
};

/***********************************************/

inline GnssProcessingStepWriteUsedStationList::GnssProcessingStepWriteUsedStationList(Config &config)
{
  try
  {
    readConfig(config, "selectReceivers",           selectReceivers,         Config::MUSTSET, "", "subset of used stations");
    readConfig(config, "outputfileUsedStationList", fileNameUsedStationList, Config::MUSTSET, "", "ascii file with names of used stations");
  }
  catch(std::exception &e)
  {
    GROOPS_RETHROW(e)
  }
}

/***********************************************/

inline void GnssProcessingStepWriteUsedStationList::process(GnssProcessingStep::State &state)
{
  try
  {
    if(!Parallel::isMaster(state.normalEquationInfo.comm))
      return;
    auto selectedReceivers = state.gnss->selectReceivers(selectReceivers);
    logStatus<<"write used station list to file <"<<fileNameUsedStationList<<">"<<Log::endl;
    std::vector<std::string> usedStationList;
    for(auto recv : state.gnss->receivers)
      if(selectedReceivers.at(recv->idRecv()) && state.normalEquationInfo.estimateReceiver.at(recv->idRecv()))
        usedStationList.push_back(recv->name());
    writeFileStringList(fileNameUsedStationList, usedStationList);
  }
  catch(std::exception &e)
  {
    GROOPS_RETHROW(e)
  }
}

/***********************************************/

#endif