General Purpose Geodetic Library
NsSessionHandler.h
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of nuSolve. nuSolve is a part of CALC/SOLVE system
4  * and is designed to perform data analyis of a geodetic VLBI session.
5  * Copyright (C) 2010-2020 Sergei Bolotin.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NS_SESSION_HANDLER_H
23 #define NS_SESSION_HANDLER_H
24 
25 
26 #ifdef HAVE_CONFIG_H
27 # include <config.h>
28 #endif
29 
30 
31 #include <SgVlbiSession.h>
32 #include <SgTaskConfig.h>
33 #include <SgParametersDescriptor.h>
34 
35 
36 
37 
38 class SgDbhImage;
39 class SgVgosDb;
40 class SgSolutionReporter;
41 /***===================================================================================================*/
48 {
50 public:
52  {
53  SS_UNDEF = 0,
54  SS_OK = 1,
60  };
61 
62  //
63  // constructors/destructors:
64  //
67  NsSessionHandler(const QString& fileName, const QString& fileNameAux,
69 
71 
75  virtual ~NsSessionHandler();
76 
77 
78  //
79  // Interfaces:
80  //
81  inline bool isImportOk() const {return isImportOk_;};
82 
83  inline const QString& getFileName() const {return fileName_;};
84  inline const QString& getFileNameAux() const {return fileNameAux_;};
85  inline SgVlbiSessionInfo::OriginType getOtype() const {return oType_;};
86  inline const SgTaskConfig* cfg() const {return config_;};
88  inline const SgVlbiSession* session() const {return session_;};
89 
90 
91  inline void setFileName(const QString& f) {fileName_ = f;};
92  inline void setFileNameAux(const QString& f) {fileNameAux_ = f;};
94  inline SgTaskConfig* cfg() {return config_;};
96  inline SgVlbiSession* session() {return session_;};
97 
98  //
99  // Functions:
100  //
101  inline QString className() const {return "NsSessionHandler";};
102 
103  bool importSession(bool guiExpected);
104  bool performPia();
105  bool saveResults();
106  //
107  void process();
108  void calcIono();
109  void zeroIono();
110  void changeActiveBand(int idx);
111  //
112  void generateReport(bool isExtended=false);
113  void generateReport4StcPars();
114  void generateReport4Tzds();
116  void exportDataToNgs();
117 
118  bool exportDataIntoVgosDa(QString output=QString(""));
119  bool exportDataIntoVgosDb(QString output=QString(""));
120 
121  void generateMyReport();
122  void addUserComment(const QString& comment);
123 
124  //
125  // Friends:
126  //
127 
128 
129  //
130  // I/O:
131  //
132  //
133 
134 
135 protected:
136  // I/O generic:
139  QString fileName_;
140  QString fileNameAux_;
141  // DBH stuff:
142  QString path2DbhFiles_;
143  QMap<QString, SgDbhImage*> dbhImageByKey_;
144  QMap<QString, QString> dbhNameByKey_;
145  QMap<QString, QString> dbhPathByKey_;
146  // vgosDb stuff:
147  QString path2VdbFiles_;
151  // vgosDa stuff:
152  QString path2VdaFiles_;
153  // session:
158  // aux:
160 
161  // functions:
162  void initData();
163  bool initSessionFromDbh(bool guiExpected);
164  bool initSessionFromOdb(bool guiExpected);
165  bool initSessionFromVda(bool guiExpected);
166  void setupCatsDbhFileNames(const QString& fName, const QString& fName2);
167  void setupDogsDbhFileNames(const QString& fileName);
168  void setupVgosDbFileNames(const QString& fileName);
169  void setupVgosDaFileNames(const QString& fileName);
170  int inquireCat(const QString&, int, QString&, QString&);
171  int notifyCat(const QString&, bool, QString&);
172  //
173  bool exportDataIntoDbh();
174  inline virtual bool canSave() {return true;};
175  inline void postSave() {};
176 };
177 /*=====================================================================================================*/
178 
179 
180 /*=====================================================================================================*/
181 #endif // NS_SESSION_HANDLER_H
const SgTaskConfig * cfg() const
void setOtype(SgVlbiSessionInfo::OriginType ot)
const SgParametersDescriptor * parametersDescriptor() const
const QString & getFileName() const
void setupVgosDaFileNames(const QString &fileName)
SgSolutionReporter * reporter_
int inquireCat(const QString &, int, QString &, QString &)
void generateReport(bool isExtended=false)
QMap< QString, SgDbhImage * > dbhImageByKey_
bool importSession(bool guiExpected)
bool exportDataIntoVgosDb(QString output=QString(""))
bool initSessionFromDbh(bool guiExpected)
void addUserComment(const QString &comment)
SgVlbiSession * session()
const QString & getFileNameAux() const
bool initSessionFromOdb(bool guiExpected)
SgVlbiSessionInfo::OriginType getOtype() const
void setFileNameAux(const QString &f)
void setupDogsDbhFileNames(const QString &fileName)
SgParametersDescriptor * parametersDescriptor()
QMap< QString, QString > dbhNameByKey_
QMap< QString, QString > dbhPathByKey_
SgVlbiSessionInfo::OriginType oType_
void setupCatsDbhFileNames(const QString &fName, const QString &fName2)
int notifyCat(const QString &, bool, QString &)
SgParametersDescriptor * parametersDescriptor_
const SgVlbiSession * session() const
QString className() const
bool isImportOk() const
bool exportDataIntoVgosDa(QString output=QString(""))
SgTaskConfig * cfg()
SgTaskConfig * config_
bool initSessionFromVda(bool guiExpected)
void changeActiveBand(int idx)
SgVlbiSession * session_
NsSessionHandler(const QString &fileName, const QString &fileNameAux, SgTaskConfig *, SgParametersDescriptor *, SgVlbiSessionInfo::OriginType)
virtual bool canSave()
void setFileName(const QString &f)
SaveStatus saveStatus_
void setupVgosDbFileNames(const QString &fileName)