General Purpose Geodetic Library
SgAPrioriData.h
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2012-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef SG_A_PRIORI_DATA_H
24 #define SG_A_PRIORI_DATA_H
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 
32 #include <QtCore/QMap>
33 #include <QtCore/QMultiMap>
34 #include <QtCore/QString>
35 
36 #include <SgVector.h>
37 
38 #include <SgMJD.h>
39 
40 
41 
42 // this is a preliminary realizaion of accessing to a priori files, should be reworked later.
43 
44 class QTextStream;
45 
46 /***===================================================================================================*/
52 {
53 public:
54  //
55  // constructors/destructors:
56  //
61 
65  inline ~SgAPrioriRecComponent() {dValues_.clear(); bValues_.clear();};
66 
67  //
68  // Interfaces:
69  //
70  // gets:
71  inline double getDvalue(const QString& idx) const {return dValues_[idx];};
72  inline bool getBvalue(const QString& idx) const {return bValues_[idx];};
73 
74  // sets:
75  inline void setDvalue(const QString& idx, double v) {dValues_[idx] = v;};
76  inline void setBvalue(const QString& idx, bool b) {bValues_[idx] = b;};
77  //
78  // Functions:
79  //
82  static const QString className();
83 
84 private:
85  QMap<QString, double> dValues_;
86  QMap<QString, bool> bValues_;
87 };
88 /*=====================================================================================================*/
89 
90 
91 
92 
93 
94 
95 /***===================================================================================================*/
100 class SgAPrioriRec : public QList<SgAPrioriRecComponent>
101 {
102 public:
103  //
104  // constructors/destructors:
105  //
109  inline SgAPrioriRec() : key_("NONAME"), tSince_(tInf), comments_("") {};
110 
111 
115  inline ~SgAPrioriRec() {clear();};
116 
117 
118  //
119  // Interfaces:
120  //
121  // gets:
122  inline const QString& getKey() const;
123  inline const SgMJD& getTsince() const;
124  inline const QString& getComments() const {return comments_;};
125 
126  // sets:
127  inline void setKey(const QString&);
128  inline void setTsince(const SgMJD&);
129  inline void setComments(const QString& str) {comments_ = str;};
130 
131  //
132  // Functions:
133  //
136  static const QString className();
137 
138 private:
139  QString key_;
141  QString comments_;
142 };
143 /*=====================================================================================================*/
144 
145 
146 
147 
148 
149 /***===================================================================================================*/
154 class SgAPriories : public QMultiMap<QString, SgAPrioriRec*>
155 {
156 public:
157  enum DataType
158  {
159  DT_UNDEF = 0,
166  };
167  //
168  // constructors/destructors:
169  //
173  inline SgAPriories(DataType=DT_UNDEF);
174 
178  inline ~SgAPriories();
179 
180  //
181  // Interfaces:
182  //
183  // gets:
184  inline DataType getDataType() const;
185 
186  inline const QString& getFileName() const;
187 
188  inline const SgMJD& getT0() const;
189 
190  // sets:
191  inline void setDataType(DataType);
192 
193  inline void setT0(const SgMJD&);
194 
195  //
196  // Functions:
197  //
200  static const QString className();
201 
202  bool readFile(const QString& fileName, DataType=DT_UNDEF);
203 
204  SgAPrioriRec* lookupApRecord(const QString&, const SgMJD& =tZero);
205 
206 
207 private:
209  QString fileName_;
211 
212  // private finctions:
213  //
214  bool parseString4StnPos(const QString& str, SgAPrioriRec& rec);
215  //
216  bool parseString4StnVel(const QString& str, SgAPrioriRec& rec);
217  //
218  bool parseString4SrcPos(const QString& str, SgAPrioriRec& rec);
219  //
220  bool parseString4AxsOfs(const QString& str, SgAPrioriRec& rec);
221  //
222  bool parseString4StnGrd(const QString& str, SgAPrioriRec& rec);
223  //
224  //bool parseString4SrcSsm(const QString& str, QTextStream& s, SgAPrioriRec& rec);
225  //
226  bool parseFileSrcSsm(QTextStream& s);
227  //
228  void clearStorage();
229 };
230 /*=====================================================================================================*/
231 
232 
233 
234 
235 
236 /*=====================================================================================================*/
237 /* */
238 /* SgAPrioriRec inline members: */
239 /* */
240 /*=====================================================================================================*/
241 
242 
243 //
244 // INTERFACES:
245 //
246 //
247 inline const QString& SgAPrioriRec::getKey() const
248 {
249  return key_;
250 };
251 
252 
253 
254 //
255 inline const SgMJD& SgAPrioriRec::getTsince() const
256 {
257  return tSince_;
258 };
259 
260 
261 // sets:
262 inline void SgAPrioriRec::setKey(const QString& key)
263 {
264  key_ = key;
265 };
266 
267 
268 
269 //
270 inline void SgAPrioriRec::setTsince(const SgMJD& t)
271 {
272  tSince_ = t;
273 };
274 
275 
276 
277 
278 //
279 // FUNCTIONS:
280 //
281 //
282 //
283 
284 // FRIENDS:
285 //
286 //
287 //
288 /*=====================================================================================================*/
289 
290 
291 
292 
293 
294 
295 /*=====================================================================================================*/
296 /* */
297 /* SgAPriories inline members: */
298 /* */
299 /*=====================================================================================================*/
300 //
301 //
302 // CONSTRUCTORS:
303 //
304 // An empty constructor:
306  QMultiMap<QString, SgAPrioriRec*>(),
307  fileName_(""),
308  t0_(tZero)
309 {
310  dataType_ = dataType;
311 };
312 
313 
314 
315 // A destructor:
317 {
318  clearStorage();
319 };
320 
321 
322 
323 //
325 {
326  return dataType_;
327 };
328 
329 
330 
331 //
332 inline const QString& SgAPriories::getFileName() const
333 {
334  return fileName_;
335 };
336 
337 
338 
339 //
340 inline const SgMJD& SgAPriories::getT0() const
341 {
342  return t0_;
343 };
344 
345 
346 
347 //
349 {
350  dataType_ = dataType;
351 };
352 
353 
354 
355 //
356 inline void SgAPriories::setT0(const SgMJD& t)
357 {
358  t0_ = t;
359 };
360 
361 
362 
363 //
364 // FUNCTIONS:
365 //
366 //
367 //
368 
369 // FRIENDS:
370 //
371 //
372 //
373 /*=====================================================================================================*/
374 
375 
376 
377 
378 
379 
380 
381 /*=====================================================================================================*/
382 //
383 // aux functions:
384 //
385 
386 
387 /*=====================================================================================================*/
388 #endif //SG_A_PRIORI_DATA_H
const SgMJD tZero(1957, 10, 4)
const SgMJD tInf(2100, 1, 1)
DataType
Definition: SgWrmsable.h:43
QMap< QString, bool > bValues_
Definition: SgAPrioriData.h:86
void setBvalue(const QString &idx, bool b)
Definition: SgAPrioriData.h:76
QMap< QString, double > dValues_
Definition: SgAPrioriData.h:85
static const QString className()
double getDvalue(const QString &idx) const
Definition: SgAPrioriData.h:71
void setDvalue(const QString &idx, double v)
Definition: SgAPrioriData.h:75
bool getBvalue(const QString &idx) const
Definition: SgAPrioriData.h:72
const QString & getKey() const
const QString & getComments() const
const SgMJD & getTsince() const
static const QString className()
void setComments(const QString &str)
QString comments_
void setTsince(const SgMJD &)
void setKey(const QString &)
const QString & getFileName() const
static const QString className()
void clearStorage()
void setT0(const SgMJD &)
SgAPriories(DataType=DT_UNDEF)
DataType dataType_
bool parseString4StnPos(const QString &str, SgAPrioriRec &rec)
bool parseString4StnGrd(const QString &str, SgAPrioriRec &rec)
bool parseString4AxsOfs(const QString &str, SgAPrioriRec &rec)
SgAPrioriRec * lookupApRecord(const QString &, const SgMJD &=tZero)
bool parseString4SrcPos(const QString &str, SgAPrioriRec &rec)
bool parseString4StnVel(const QString &str, SgAPrioriRec &rec)
bool readFile(const QString &fileName, DataType=DT_UNDEF)
void setDataType(DataType)
bool parseFileSrcSsm(QTextStream &s)
DataType getDataType() const
QString fileName_
const SgMJD & getT0() const
Definition: SgMJD.h:59