General Purpose Geodetic Library
SgStnLogCollector.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) 2016-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_STN_LOG_COLLECTOR_H
24 #define SG_STN_LOG_COLLECTOR_H
25 
26 #include <map>
27 
28 
29 #ifdef HAVE_CONFIG_H
30 # include <config.h>
31 #endif
32 
33 
34 
35 
36 #include <QtCore/QByteArray>
37 #include <QtCore/QString>
38 #include <QtCore/QList>
39 #include <QtCore/QMap>
40 #include <QtCore/QRegularExpression>
41 #include <QtCore/QTextStream>
42 #include <QtCore/QVector>
43 
44 
45 #include <SgLogger.h>
46 #include <SgMJD.h>
47 #include <SgMeteoData.h>
48 #include <SgVector.h>
49 #include <SgVex.h>
50 
51 
52 
54 class SgVlbiStationInfo;
55 class SgOnSourceRecord;
56 
57 
59 {
60  AOD_NONE = 0,
61  AOD_DATA_ON = 1 << 0,
62  AOD_CABLE_SIGN = 1 << 1,
63  AOD_CABLE_CAL = 1 << 2,
64  AOD_METEO = 1 << 3,
65  AOD_TSYS = 1 << 4,
66  AOD_TPI = 1 << 5,
67  AOD_PCAL = 1 << 6,
68  AOD_FMTGPS = 1 << 7,
69  AOD_DBBC3TP = 1 << 8,
70  AOD_SEFD = 1 << 9,
74 };
75 
76 
77 
78 
79 /***===================================================================================================*/
86 {
87 public:
88  // Statics:
91  static const QString className();
92 
93  // Constructors/Destructors:
94  //
98  inline SgCableCalReading() : t_(tZero) {v_=0.0; isOk_=false; osRec_=NULL;};
99  inline SgCableCalReading(const SgMJD& t, double v) : t_(t) {v_=v; isOk_=true; osRec_=NULL;};
100  inline SgCableCalReading(const SgCableCalReading& cr) : t_(cr.getT())
101  {setV(cr.getV()); setIsOk(cr.getIsOk()); osRec_ = cr.osRec_;};
102 
106  inline ~SgCableCalReading() {osRec_=NULL;};
107 
108  //
109  // Interfaces:
110  //
111  inline const SgMJD& getT() const {return t_;};
112  inline double getV() const {return v_;};
113  inline bool getIsOk() const {return isOk_;};
114  inline const SgOnSourceRecord* getOsRec() const {return osRec_;};
115 
116  inline void setT(const SgMJD& t) {t_=t;};
117  inline void setV(double v) {v_=v;};
118  inline void setIsOk(bool isOk) {isOk_=isOk;};
119  inline void setOsRec(SgOnSourceRecord* os) {osRec_ = os;};
120 
121  //
122  // Functions:
123  //
124  inline bool operator==(const SgCableCalReading& cab) const
125  {
126  return
127  cab.t_ == t_ &&
128  cab.v_ == v_ &&
129  cab.isOk_ == isOk_ &&
130  cab.osRec_ == osRec_; // point to the same osRec
131  };
132 
133  //
134  // Friends:
135  //
136 
137  //
138  // I/O:
139  //
140  // ...
141 private:
143  double v_;
144  bool isOk_;
146 };
147 /*=====================================================================================================*/
148 
149 
150 
151 
152 
153 
154 
155 /***===================================================================================================*/
162 {
163 public:
164  // Statics:
167  static const QString className();
168 
169  // Constructors/Destructors:
170  //
174  inline SgMeteoReading() : t_(tZero), m_() {isOk_=false; osRec_=NULL;};
175  inline SgMeteoReading(const SgMJD& t, const SgMeteoData& m) : t_(t), m_(m) {isOk_=true; osRec_=NULL;};
176  inline SgMeteoReading(const SgMeteoReading& mr)
177  : t_(mr.getT()), m_(mr.getM()) {setIsOk(mr.getIsOk()); osRec_=mr.osRec_;};
178  inline SgMeteoReading(const SgMJD& t, double temp, double pres, double rho)
179  : t_(t), m_(temp, pres, rho) {isOk_=true; osRec_=NULL;};
180 
181 
185  inline ~SgMeteoReading() {osRec_=NULL;};
186 
187  //
188  // Interfaces:
189  //
190  inline const SgMJD& getT() const {return t_;};
191  inline const SgMeteoData& getM() const {return m_;};
192  inline bool getIsOk() const {return isOk_;};
193  inline const SgOnSourceRecord* getOsRec() const {return osRec_;};
194 
195  inline void setT(const SgMJD& t) {t_=t;};
196  inline void setM(const SgMeteoData& m) {m_=m;};
197  inline void setIsOk(bool isOk) {isOk_=isOk;};
198  inline void setOsRec(SgOnSourceRecord* os) {osRec_ = os;};
199 
200  //
201  // Functions:
202  //
203  inline bool operator==(const SgMeteoReading& met) const
204  {
205  return
206  met.t_ == t_ &&
207  met.m_ == m_ &&
208  met.isOk_ == isOk_;
209  };
210 
211  //
212  // Friends:
213  //
214 
215  //
216  // I/O:
217  //
218  // ...
219 private:
222  bool isOk_;
224 };
225 /*=====================================================================================================*/
226 
227 
228 
229 
230 
231 
232 /***===================================================================================================*/
239 {
240 public:
241  // Statics:
244  static const QString className();
245 
246  // Constructors/Destructors:
247  //
251  inline SgTraklReading() : t_(tZero) {az_=azv_=el_=elv_=0.0;};
252  inline SgTraklReading(const SgMJD& t, float az, float azv, float el, float elv)
253  : t_(t) {az_=az; azv_=azv; el_=el; elv_=elv;};
254  inline SgTraklReading(const SgTraklReading& r)
255  : t_(r.getT()) {setAz(r.getAz()); setAzv(r.getAzv()); setEl(r.getEl()); setElv(r.getElv());};
256 
260  inline ~SgTraklReading() {};
261 
262  //
263  // Interfaces:
264  //
265  inline const SgMJD& getT() const {return t_;};
266  inline float getAz() const {return az_;};
267  inline float getAzv() const {return azv_;};
268  inline float getEl() const {return el_;};
269  inline float getElv() const {return elv_;};
270 
271  inline void setT(const SgMJD& t) {t_=t;};
272  inline void setAz(float az) {az_=az;};
273  inline void setAzv(float azv) {azv_=azv;};
274  inline void setEl(float el) {el_=el;};
275  inline void setElv(float elv) {elv_=elv;};
276 
277  //
278  // Functions:
279  //
280 
281  //
282  // Friends:
283  //
284 
285  //
286  // I/O:
287  //
288  // ...
289 private:
291  float az_;
292  float azv_;
293  float el_;
294  float elv_;
295 };
296 /*=====================================================================================================*/
297 
298 
299 
300 
301 
302 
303 /***===================================================================================================*/
310 {
311 public:
312  // Statics:
315  static const QString className();
316 
317  // Constructors/Destructors:
318  //
322  inline SgTsysReading() : t_(tZero), tsys_(), tpcont_(), trakls_()
323  {isOk_=isOnSource_=isDataOn_=false; osRec_=NULL;};
324 // inline SgTsysReading(const SgMJD& t, const QMap<QString, float>& tsys,
325 // QMap<QString, QVector<int> > tpcont, bool isDataOn)
326 // : t_(t), tsys_(tsys), tpcont_(tpcont), trakls_() {isOk_=true; isDataOn_=isDataOn; osRec_=NULL;};
327  inline SgTsysReading(const SgTsysReading& tsr)
328  : t_(tsr.getT()), tsys_(), tpcont_(), trakls_()
329  {addTsyses(tsr.getTsys()); addTpconts(tsr.getTpcont());
330  for (int i=0; i<tsr.getTrakls().size(); i++)
331  trakls_.append(tsr.getTrakls().at(i));
333 
337  inline ~SgTsysReading() {osRec_=NULL; trakls_.clear(); tsys_.clear(); tpcont_.clear();};
338 
339  //
340  // Interfaces:
341  //
342  inline const SgMJD& getT() const {return t_;};
343 /*
344  inline const QMap<const QString*, float>& getTsys() const {return tsys_;};
345  inline const QMap<const QString*, QVector<int> >& getTpcont() const {return tpcont_;};
346  inline QMap<const QString*, float>& tsys() {return tsys_;};
347  inline QMap<const QString*, QVector<int> >& tpcont() {return tpcont_;};
348 */
349  inline const QMap<QString, float>& getTsys() const {return tsys_;};
350  inline const QMap<QString, QVector<int> >& getTpcont() const {return tpcont_;};
351  inline QMap<QString, float>& tsys() {return tsys_;};
352  inline QMap<QString, QVector<int> >& tpcont() {return tpcont_;};
353  inline bool getIsOk() const {return isOk_;};
354  inline bool getIsDataOn() const {return isDataOn_;};
355  inline bool getIsOnSource() const {return isOnSource_;};
356  inline const SgOnSourceRecord* getOsRec() const {return osRec_;};
357  inline const QList<SgTraklReading*>& getTrakls() const {return trakls_;};
358 
359  inline void setT(const SgMJD& t) {t_=t;};
360  inline void setIsOk(bool isOk) {isOk_=isOk;};
361  inline void setIsDataOn(bool isDataOn) {isDataOn_=isDataOn;};
362  inline void setIsOnSource(bool isOnSource) {isOnSource_=isOnSource;};
363  inline void setOsRec(SgOnSourceRecord* os) {osRec_ = os;};
364  inline SgOnSourceRecord* &osRec() {return osRec_;};
365  inline QList<SgTraklReading*>& trakls() {return trakls_;};
366 
367  //
368  // Functions:
369  //
370 /*
371  void addTsyses(const QMap<const QString*, float>& tsys);
372  void addTpconts(const QMap<const QString*, QVector<int> >& tpcont);
373 */
374  void addTsyses(const QMap<QString, float>& tsys);
375  void addTpconts(const QMap<QString, QVector<int> >& tpcont);
376 
377  //
378  // Friends:
379  //
380 
381  //
382  // I/O:
383  //
384  // ...
385 private:
387 /*
388  QMap<const QString*, float> tsys_;
389  QMap<const QString*, QVector<int> >
390  tpcont_;
391 */
392  QMap<QString, float> tsys_;
393  QMap<QString, QVector<int> > tpcont_;
394 
395 //std::map<std::string, int*> tpcont2_;
396  bool isOk_;
397  bool isDataOn_;
401 };
402 /*=====================================================================================================*/
403 
404 
405 
406 
407 
408 
409 /***===================================================================================================*/
416 {
417 public:
418 
419  class TpRecord
420  {
421  public:
422  inline TpRecord() : sensorId_(""), boardId_(""), agc_("")
424  inline TpRecord(const TpRecord& tpr) :
425  sensorId_(tpr.sensorId_), boardId_(tpr.boardId_), agc_(tpr.agc_)
426  {bw_=tpr.bw_; gainU_=tpr.gainU_; gainL_=tpr.gainL_; tpOffU_=tpr.tpOffU_;
427  tpOffL_=tpr.tpOffL_; tpOnU_=tpr.tpOnU_; tpOnL_=tpr.tpOnL_;
428  sefdU_=tpr.sefdU_; sefdL_=tpr.sefdL_;};
429  inline TpRecord& operator=(const TpRecord& tpr)
430  {sensorId_=tpr.sensorId_; boardId_=tpr.boardId_; agc_=tpr.agc_; bw_=tpr.bw_;
431  gainU_=tpr.gainU_; gainL_=tpr.gainL_; tpOffU_=tpr.tpOffU_; tpOffL_=tpr.tpOffL_;
432  tpOnU_=tpr.tpOnU_; tpOnL_=tpr.tpOnL_; sefdU_=tpr.sefdU_; sefdL_=tpr.sefdL_;
433  return *this;};
434 
435  QString sensorId_;
436  QString boardId_;
437  double bw_;
438  QString agc_;
439  double gainU_;
440  double gainL_;
441  double tpOffU_;
442  double tpOffL_;
443  double tpOnU_;
444  double tpOnL_;
445  double sefdU_;
446  double sefdL_;
447  };
448 
449  // Statics:
452  static const QString className();
453 
454  // Constructors/Destructors:
455  //
460  {isDataOn_=false; isOnSource_=false; osRec_=NULL;};
461  inline SgDbbc3TpReading(const SgDbbc3TpReading& tps)
462  : t_(tps.getT()), tpBySensor_(tps.tpBySensor_)
464 
468  inline ~SgDbbc3TpReading() {osRec_=NULL; tpBySensor_.clear();};
469 
470  //
471  // Interfaces:
472  //
473  inline const SgMJD& getT() const {return t_;};
474  inline const QMap<QString, TpRecord>& getTpBySensor() const {return tpBySensor_;};
475  inline QMap<QString, TpRecord>& tpBySensor() {return tpBySensor_;};
476  inline bool getIsOnSource() const {return isOnSource_;};
477  inline bool getIsDataOn() const {return isDataOn_;};
478  inline const SgOnSourceRecord* getOsRec() const {return osRec_;};
479 
480  inline void setT(const SgMJD& t) {t_=t;};
481  inline void setIsOnSource(bool isOnSource) {isOnSource_=isOnSource;};
482  inline void setIsDataOn(bool isDataOn) {isDataOn_=isDataOn;};
483  inline void setOsRec(SgOnSourceRecord* os) {osRec_ = os;};
484  inline SgOnSourceRecord* &osRec() {return osRec_;};
485 
486  //
487  // Functions:
488  //
489  inline void addRecord(const QString& sensorId, const QString& boardId, double bw,
490  const QString& agc, double gainU, double gainL, double tpOffU, double tpOffL,
491  double tpOnU, double tpOnL, double sefdU, double sefdL)
492  {
493  TpRecord rec;
494  rec.sensorId_ = sensorId;
495  rec.boardId_ = boardId;
496  rec.bw_ = bw;
497  rec.agc_ = agc;
498  rec.gainU_ = gainU;
499  rec.gainL_ = gainL;
500  rec.tpOffU_ = tpOffU;
501  rec.tpOffL_ = tpOffL;
502  rec.tpOnU_ = tpOnU;
503  rec.tpOnL_ = tpOnL;
504  rec.sefdU_ = sefdU;
505  rec.sefdL_ = sefdL;
506  tpBySensor_.insert(sensorId, rec);
507  };
508 
509 
510  //
511  // Friends:
512  //
513 
514  //
515  // I/O:
516  //
517  // ...
518 private:
520  QMap<QString, TpRecord> tpBySensor_;
522  bool isDataOn_;
524 };
525 /*=====================================================================================================*/
526 
527 
528 
529 
530 
531 
532 /***===================================================================================================*/
539 {
540 public:
541  // Statics:
544  static const QString className();
545 
546  // Constructors/Destructors:
547  //
551  inline SgPcalReading() : t_(tZero), pcal_() {isOk_=false; osRec_=NULL;};
552  inline SgPcalReading(const SgPcalReading& pcr) : t_(pcr.getT()), pcal_()
553  {addPcals(pcr.getPcal()); setIsOk(pcr.getIsOk()); osRec_=pcr.osRec_;};
554 
558  inline ~SgPcalReading()
559  {
560  for (QMap<QString, float*>::iterator it=pcal_.begin(); it!=pcal_.end(); ++it)
561  delete[] it.value();
562  pcal_.clear(); osRec_=NULL;
563  };
564 
565  //
566  // Interfaces:
567  //
568  inline const SgMJD& getT() const {return t_;};
569  inline const QMap<QString, float*>& getPcal() const {return pcal_;};
570  inline QMap<QString, float*>& pcal() {return pcal_;};
571  inline bool getIsOk() const {return isOk_;};
572  inline const SgOnSourceRecord* getOsRec() const {return osRec_;};
573 
574  inline void setT(const SgMJD& t) {t_=t;};
575  inline void setIsOk(bool isOk) {isOk_=isOk;};
576  inline void setOsRec(SgOnSourceRecord* os) {osRec_ = os;};
577  inline SgOnSourceRecord* &osRec() {return osRec_;};
578 
579  //
580  // Functions:
581  //
582  inline bool addPcals(const QMap<QString, float*>& pcals)
583  {
584  bool isOk=true;
585  for (QMap<QString, float*>::const_iterator it=pcals.begin(); it!=pcals.end(); ++it)
586  {
587  if (pcal_.contains(it.key()))
588  {
589  isOk = false;
591  "::addPcals(): the key \"" + it.key() + "\" is already in the map");
592  };
593  float *f = new float[2];
594  *f = *it.value();
595  *(f + 1) = *(it.value() + 1);
596  pcal_.insert(it.key(), f);
597  };
598  return isOk;
599  };
600 
601  //
602  // Friends:
603  //
604 
605  //
606  // I/O:
607  //
608  // ...
609 private:
611  QMap<QString, float*> pcal_;
612  bool isOk_;
614 };
615 /*=====================================================================================================*/
616 
617 
618 
619 
620 
621 
622 /***===================================================================================================*/
629 {
630 public:
631  // Statics:
634  static const QString className();
635 
636  // Constructors/Destructors:
637  //
641  inline SgSefdReading() : t_(tZero), srcName_(""), valByChanKey_() {isOk_=false; az_=el_=-10000.0;};
642 
643  inline SgSefdReading(const SgSefdReading& sr) : t_(sr.getT()), srcName_(sr.getSrcName()),
644  az_(sr.getAz()), el_(sr.getEl())
645  {
646  for (QMap<QString, QVector<double>*>::const_iterator it=sr.getValByChanKey().begin();
647  it!=sr.getValByChanKey().end(); ++it)
648  valByChanKey_.insert(it.key(), new QVector<double>(*it.value()));
649  setIsOk(sr.getIsOk());
650  };
651 
655  inline ~SgSefdReading()
656  {
657  for (QMap<QString, QVector<double>*>::iterator it=valByChanKey_.begin(); it!=valByChanKey_.end();
658  ++it)
659  delete[] it.value();
660  valByChanKey_.clear();
661  };
662 
663  //
664  // Interfaces:
665  //
666  inline const SgMJD& getT() const {return t_;};
667  inline const QString& getSrcName() const {return srcName_;};
668  inline double getAz() const {return az_;};
669  inline double getEl() const {return el_;};
670 
671  inline const QMap<QString, QVector<double>*>& getValByChanKey() const {return valByChanKey_;};
672  inline QMap<QString, QVector<double>*>& valByChanKey() {return valByChanKey_;};
673  inline bool getIsOk() const {return isOk_;};
674 
675  inline void setT(const SgMJD& t) {t_=t;};
676  inline void setIsOk(bool isOk) {isOk_=isOk;};
677  inline void setSrcName(const QString& name) {srcName_=name;};
678  inline void setAz(double d) {az_=d;};
679  inline void setEl(double d) {el_=d;};
680 
681  //
682  // Functions:
683  //
684  bool addValByChanKey(const SgMJD& t, const QString& srcName, double az, double el,
685  const QString& chanKey, const QVector<double>& val);
686 
687  //
688  // Friends:
689  //
690 
691  //
692  // I/O:
693  //
694  // ...
695 private:
697  QString srcName_;
698  double az_;
699  double el_;
700  QMap<QString, QVector<double>*>
702  bool isOk_;
703 };
704 /*=====================================================================================================*/
705 
706 
707 
708 
709 /***===================================================================================================*/
716 {
717 public:
718  // Statics:
721  static const QString className();
722 
723  // Constructors/Destructors:
724  //
728  inline SgDot2xpsReading() : t_(tZero), dot2gpsByBrd_() {osRec_=NULL;};
730  {osRec_=d2r.osRec_;};
731 
735  inline ~SgDot2xpsReading() {dot2gpsByBrd_.clear(); osRec_=NULL;};
736 
737  //
738  // Interfaces:
739  //
740  inline const SgMJD& getT() const {return t_;};
741  inline const SgOnSourceRecord* getOsRec() const {return osRec_;};
742  inline const QMap<QString, float>& getDot2gpsByBrd() const {return dot2gpsByBrd_;};
743 //inline const QMap<QByteArray, float>& getDot2gpsByBrd() const {return dot2gpsByBrd_;};
744 
745  inline void setT(const SgMJD& t) {t_ = t;};
746  inline void setOsRec(SgOnSourceRecord* os) {osRec_ = os;};
747  inline SgOnSourceRecord* &osRec() {return osRec_;};
748 
749  inline bool addDot2gpsByBrd(const QString& key, float v)
750 //inline bool addDot2gpsByBrd(const QByteArray& key, float v)
751  {bool isOk=!dot2gpsByBrd_.contains(key); dot2gpsByBrd_.insert(key, v); return isOk;};
752 
753  //
754  // Friends:
755  //
756 
757  //
758  // I/O:
759  //
760  // ...
761 private:
763  QMap<QString, float> dot2gpsByBrd_;
765 };
766 /*=====================================================================================================*/
767 
768 
769 
770 
771 
772 
773 
774 /***===================================================================================================*/
781 {
782 public:
783  // Statics:
786  static const QString className();
787 
788  // Constructors/Destructors:
789  //
795  meteoPars_(), tSyses_(), dbbc3Tps_() {idx_=0;};
796 
800  inline ~SgOnSourceRecord() {cableCals_.clear(); meteoPars_.clear(); tSyses_.clear(); dbbc3Tps_.clear();};
801 
802  //
803  // Interfaces:
804  //
805  inline const SgMJD& getTstart() const {return tStart_;};
806  inline const SgMJD& getTfinis() const {return tFinis_;};
807  inline const SgMJD& getTdataOn() const {return tDataOn_;};
808  inline const QString& getScanName() const {return scanName_;};
809  inline const QString& getSourceName() const {return sourceName_;};
810  inline int getIdx() const {return idx_;};
811  inline void setTstart(const SgMJD& t) {tStart_=t;};
812  inline void setTfinis(const SgMJD& t) {tFinis_=t;};
813  inline void setTdataOn(const SgMJD& t) {tDataOn_=t;};
814  inline void setSourceName(const QString& str) {sourceName_=str;};
815  inline void setScanName(const QString& str) {scanName_=str;};
816  inline void setIdx(int i) {idx_=i;};
817 
820  inline QList<SgTsysReading*>& tSyses() {return tSyses_;};
822 
823  inline SgMJD& tStart() {return tStart_;};
824  inline SgMJD& tFinis() {return tFinis_;};
825  inline SgMJD& tDataOn() {return tDataOn_;};
826 
827  //
828  // Functions:
829  //
832  inline bool isSameArgs(const SgOnSourceRecord& rec) const
833  {
834  return
835  rec.tStart_ == tStart_ &&
836  rec.tFinis_ == tFinis_ &&
837  rec.tDataOn_ == tDataOn_ &&
838  rec.scanName_ == scanName_ &&
839  rec.sourceName_ == sourceName_;
840  };
841 
842  inline bool operator==(const SgOnSourceRecord& rec) const
843  {
844  if (!isSameArgs(rec))
845  return false;
846  if (rec.cableCals_.size() != cableCals_.size())
847  return false;
848  if (rec.meteoPars_.size() != meteoPars_.size())
849  return false;
850  if (rec.tSyses_.size() != tSyses_.size())
851  return false;
852  if (rec.dbbc3Tps_.size() != dbbc3Tps_.size())
853  return false;
854  for (int i=0; i<cableCals_.size(); i++)
855  if (rec.cableCals_.at(i) != cableCals_.at(i))
856  return false;
857  for (int i=0; i<meteoPars_.size(); i++)
858  if (rec.meteoPars_.at(i) != meteoPars_.at(i))
859  return false;
860  for (int i=0; i<tSyses_.size(); i++)
861  if (rec.tSyses_.at(i) != tSyses_.at(i))
862  return false;
863  for (int i=0; i<dbbc3Tps_.size(); i++)
864  if (rec.dbbc3Tps_.at(i) != dbbc3Tps_.at(i))
865  return false;
866  return true;
867  };
868 
871 // inline bool operator!=(const SgOnSourceRecord& rec) const {return !(*this==rec);};
872 
873  //
874  // Friends:
875  //
876 
877  //
878  // I/O:
879  //
880  // ...
881 private:
885  QString scanName_;
886  QString sourceName_;
891  int idx_;
892 };
893 /*=====================================================================================================*/
894 
895 
896 
897 
898 
899 
900 /***===================================================================================================*/
907 {
908 public:
909  enum HwType
910  {
911  HT_UNDEF = 0,
912  HT_VC = 1,
913  HT_BBC = 2,
914  HT_NN = 3,
915  HT_VGOS = 4,
916  };
918  {
920  BET_NONE = 1,
921  BET_DBBC = 2,
923  BET_RDBE = 4,
925  };
926 
927  // Statics:
930  static const QString className();
931  static double calcSkyFreq(double loFreq, double bbcFreq, double width,
932  SgChannelSideBand loSideBand, SgChannelSideBand ifSideBand);
933 
934  // Constructors/Destructors:
935  //
948 
952  inline ~SgChannelSetup() {};
953 
954  //
955  // Interfaces:
956  //
957  inline HwType getHwType() const {return hwType_;};
958  inline BackEndType getBackEndType() const {return backEndType_;};
959  inline bool isOk() const {return isOk_;};
960 
961  inline QMap<int, double>& bbcFreqByIdx() {return bbcFreqByIdx_;};
962  inline QMap<int, double>& bbcBandwidthByIdx() {return bbcBandwidthByIdx_;};
963  inline QMap<int, QString>& loIdByIdx() {return loIdByIdx_;};
964  inline QMap<QString, QString>& loIdByCid() {return loIdByCid_;};
965  inline QMap<QString, double>& loFreqById() {return loFreqById_;};
966  inline QMap<QString, SgChannelSideBand>& loSideBandById() {return loSideBandById_;};
967  inline QMap<QString, SgChannelPolarization>& loPolarizationById() {return loPolarizationById_;};
968  inline QMap<QString, QString>& loIdBySensorKey() {return loIdBySensorKey_;};
969  inline QMap<QString, double>& loFreqBySensorKey() {return loFreqBySensorKey_;};
970  inline QMap<QString, SgChannelSideBand>& loSideBandBySensorKey() {return loSideBandBySensorKey_;};
971  inline QMap<QString, SgChannelPolarization>& loPolarizationBySensorKey() {return loPolarizationBySensorKey_;};
972  inline QMap<QString, double>& ifFreqBySensorKey() {return ifFreqBySensorKey_;};
973  inline QMap<QString, double>& ifBandwidthBySensorKey() {return ifBandwidthBySensorKey_;};
974  inline QMap<QString, SgChannelPolarization>& ifPolarizationById() {return ifPolarizationById_;};
975  inline QMap<QString, int>& ifIdxById() {return ifIdxById_;};
976  inline QMap<QString, SgChannelSideBand>& ifSideBandById() {return ifSideBandById_;};
977  inline QMap<int, double>& ifFreqByIdx() {return ifFreqByIdx_;};
978  inline QMap<QString, QList<QString> >& origSensorIdById() {return origSensorIdById_;};
979  inline QMap<QString, QString>& ifIdBySensorKey() {return ifIdBySensorKey_;};
980 
981  inline QMap<QString, QString>& pcalIdByKey() {return pcalIdByKey_;};
982  inline QMap<QString, SgChannelPolarization>& pcalPolarizationById() {return pcalPolarizationById_;};
983  inline QMap<QString, QString>& xpsIdByKey() {return xpsIdByKey_;};
984 
985  inline void setHwType(HwType tp) {hwType_ = tp;};
986  inline void setBackEndType(BackEndType tp) {backEndType_ = tp;};
987 
988  //
989  // Functions:
990  //
991  bool selfCheck(const QString& stnKey);
992  //
993  // Friends:
994  //
995 
996  //
997  // I/O:
998  //
999  // ...
1000 private:
1001  QMap<int, double> bbcFreqByIdx_;
1002  QMap<int, double> bbcBandwidthByIdx_;
1003  // LOs:
1004  QMap<int, QString> loIdByIdx_;
1005  QMap<QString, QString> loIdByCid_;
1006  QMap<QString, double> loFreqById_;
1007  QMap<QString, SgChannelSideBand>
1009  QMap<QString, SgChannelPolarization>
1011  // 4VGOS, variable setup:
1012  QMap<QString, QString> loIdBySensorKey_;
1013  QMap<QString, double> loFreqBySensorKey_;
1014  QMap<QString, SgChannelSideBand>
1016  QMap<QString, SgChannelPolarization>
1018  QMap<QString, double> ifFreqBySensorKey_;
1019  QMap<QString, double> ifBandwidthBySensorKey_;
1020  QMap<QString, QString> ifIdBySensorKey_;
1021 
1022  //
1023  // IFs:
1024  QMap<QString, SgChannelPolarization>
1026  QMap<QString, int> ifIdxById_; // 1u -> 1
1027  QMap<QString, SgChannelSideBand>
1028  ifSideBandById_; // 1u -> USB
1029 
1030  QMap<int, double> ifFreqByIdx_; // 1 -> frq
1031  // splitted by SideBand sensors:
1032  QMap<QString, QList<QString> >origSensorIdById_;
1033  //
1034  // 4 pcal:
1035  QMap<QString, QString> pcalIdByKey_;
1036  QMap<QString, SgChannelPolarization>
1038 
1039  QMap<QString, QString> xpsIdByKey_;
1040 
1041  bool isOk_;
1044 };
1045 /*=====================================================================================================*/
1046 
1047 
1048 
1049 
1050 
1051 
1052 /***===================================================================================================*/
1059 {
1060 public:
1061  // Statics:
1064  static const QString className();
1065 
1066  // Constructors/Destructors:
1067  //
1072  {isOk_=false;};
1073 
1077  inline ~SgChannelSkeded() {stnCfgByKey_.clear();};
1078 
1079  //
1080  // Interfaces:
1081  //
1082  inline bool isOk() const {return isOk_;};
1083 
1084  //
1085  // Functions:
1086  //
1087  bool parseSkdFile(const QString& fileName);
1088 
1089  //
1090  // Friends:
1091  //
1092 
1093  //
1094  // I/O:
1095  //
1096  // ...
1097 private:
1098  class ChanCfg
1099  {
1100  public:
1104  ChanCfg(const QString& bandKey, int cIdx, double skyFrq, double bandWidth,
1105  const QList<SgChannelSideBand>& sideBands) :
1106  bandKey_(bandKey), sideBands_(sideBands) {skyFrq_=skyFrq; bandWidth_=bandWidth; chanIdx_=cIdx;};
1107  ~ChanCfg() {sideBands_.clear();};
1108 
1109  inline int getChanIdx() const {return chanIdx_;};
1110  inline const QString& getBandKey() const {return bandKey_;};
1111  inline double getSkyFrq() const {return skyFrq_;};
1112  inline double getBandWidth() const {return bandWidth_;};
1113  inline const QList<SgChannelSideBand>& getSideBands() const {return sideBands_;};
1114 
1115  private:
1117  QString bandKey_;
1118  double skyFrq_;
1119  double bandWidth_;
1121  };
1122  class StnCfg
1123  {
1124  public:
1125  StnCfg() : stnKey_(""), channelCfgs_() {};
1126  StnCfg(const QString& key) : stnKey_(key), channelCfgs_() {};
1127  ~StnCfg() {channelCfgs_.clear();};
1128  inline const QString& getStnKey() const {return stnKey_;};
1129  inline const QList<ChanCfg>& getChannelCfgs() const {return channelCfgs_;};
1131  inline void setStnKey(const QString& key) {stnKey_ = key;};
1132  private:
1133  QString stnKey_;
1135  };
1136 
1137  QMap<QString, StnCfg> stnCfgByKey_;
1138  bool isOk_;
1139  friend class SgStnLogReadings;
1140 };
1141 /*=====================================================================================================*/
1142 
1143 
1144 
1145 
1146 
1147 
1148 
1149 
1150 
1151 /***===================================================================================================*/
1158 {
1159 public:
1161  {
1163  IT_FSLG = 1, // field system log
1164  IT_CDMS = 2, // CDMS
1165  IT_PCMT = 3, // PCMT
1166  IT_METE = 4, // auxiliary meteo data
1167  };
1168 
1169  // Statics:
1172  static const QString className();
1173 
1174  // Constructors/Destructors:
1175  //
1179  SgStnLogReadings();
1180 
1184  SgStnLogReadings(const QString& stationName);
1185 
1190 
1191  //
1192  // Interfaces:
1193  inline InputType getItType() const {return itType_;};
1194  inline double getCableCalAmbig() const {return cableCalAmbig_;};
1195  inline int getCableSign() const {return cableSign_;};
1203  inline QList<SgPcalReading*>& pcals() {return pcals_;}
1204  inline QList<SgSefdReading*>& sefds() {return sefds_;}
1206 
1207  inline bool areMeteosPresent() const {return areMeteosPresent_;};
1208  inline bool areCableCalsPresent() const {return areCableCalsPresent_;};
1209  inline const QString& getExperimentName() const {return experimentName_;};
1210  inline const QString& getFsVersionLabel() const {return fsVersionLabel_;};
1211  inline const QString& getBackEndInfo() const {return backEndInfo_;};
1212  inline const QString& getRecorderInfo() const {return recorderInfo_;};
1213 
1214  inline const SgChannelSetup& getChannelSetup() const {return channelSetup_;};
1216 
1217  inline void setItType(InputType t) {itType_ = t;};
1218  inline void setCableCalAmbig(double a) {cableCalAmbig_ = a;};
1219  inline void setCableSign(int n) {cableSign_ = n;};
1220  inline void setStationName(const QString& name) {stationName_ = name;};
1221  inline void setExperimentName(const QString& name) {experimentName_ = name;};
1222  inline void setFsVersionLabel(const QString& ver) {fsVersionLabel_ = ver;};
1223  inline void setBackEndInfo(const QString& info) {backEndInfo_ = info;};
1224  inline void setRecorderInfo(const QString& info) {recorderInfo_ = info;};
1225 
1226  // inline const QList<SgOnSourceRecord*>& onSourceRecords() const {return onSourceRecords_;}
1227  // inline const QList<SgCableCalReading*>& cableCals() const {return cableCals_;}
1228  // inline const QList<SgCableCalReading*>& cableLongs() const {return cableLongs_;}
1229  // inline const QList<SgMeteoReading*>& meteoPars() const {return meteoPars_;}
1230 
1231  //
1232  // Functions:
1233  //
1234  void verifyReadings(SgVlbiStationInfo* stn, const QMap<QString, int> *defaultCableSignByStn);
1235  bool propagateData(SgVlbiStationInfo* stn);
1236  void allocateCableReadings();
1237 
1238  bool createAntabFile(const QString& inputLogFileName, const QString& outputFileName,
1239  const QString& stnKey, const SgChannelSkeded *channelSkeded, bool useSkededChannelSetup,
1240  bool have2overwrite, bool reportAllTsysData);
1241  bool createAntCalFile(const QString& inputLogFileName, const QString& outputFileName,
1242  const QString& stnKey, const SgChannelSkeded *channelSkeded, bool useSkededChannelSetup,
1243  bool have2overwrite, bool reportAllReadings, bool supressNonUsedSensors, int antcalOutputData,
1244  const QString& ext4compress, const QString& userCommand);
1245 
1246  //
1247  // Friends:
1248  //
1249 
1250  //
1251  // I/O:
1252  //
1253  // ...
1254 private:
1262  QString stationName_;
1265  QString backEndInfo_;
1266  QString recorderInfo_;
1277  static const QString sFiller_;
1278  static const int nFiller_;
1279  static const double dFiller_;
1280 
1281 
1282  QMap<QString, SgOnSourceRecord*>
1285 
1286  // functions:
1287  void removeCableCalReadings();
1288  void removeMeteoReadings();
1289  void removeTsysReadings();
1290 
1292  void lookupScanName(SgOnSourceRecord* osRec, const QMap<QString, SgVlbiAuxObservation*> &auxObsByScan);
1293  void cleanCableCalibrations();
1294  void cleanMeteoParameters();
1296 
1297  void export2antabFrqs_nativeSetup(QTextStream& s);
1298  void export2antabFrqs_vgosSetup(QTextStream& s);
1299  void export2antabFrqs_skededSetup(QTextStream& s, const SgChannelSkeded::StnCfg& sCfg);
1300  void export2antabFrqs_missedSetup(QTextStream& s);
1301 
1302  void export2antCalFrqs_nativeSetup(QTextStream& s);
1303  void export2antCalFrqs_vgosSetup(QTextStream& s);
1304 // void export2antCalFrqs_dbbc3Setup(QTextStream& s);
1305  void export2antCalFrqs_skededSetup(QTextStream& s, const SgChannelSkeded::StnCfg& sCfg);
1306  void export2antCalPcal_vgosSetup(QTextStream& s);
1307 
1310 };
1311 /*=====================================================================================================*/
1312 
1313 
1314 
1315 
1316 
1317 
1318 
1319 
1320 
1321 
1322 
1323 /***===================================================================================================*/
1329 // typedefs:
1330 //
1331 //
1333 {
1334 public:
1336  {
1338  FSEF_OLD = 1, // DDDHHMMSS
1339  FSEF_NEW = 2, // YYDDDHHMMSSss
1340  FSEF_NEWEST = 3, // YYYY.DDD.HH.MM.SS.ss
1341  FSEF_PCMT = 4, // YYYY M D H M S
1342  FSEF_MET = 5, // YYYY M D H M S T P Rh
1343  };
1345  {
1346  public:
1347  inline Procedure() : name_(""), content_() {numOfExpanded_=0;};
1348  inline Procedure(const QString& name) : name_(name), content_() {numOfExpanded_=0;};
1349  inline Procedure(const Procedure& p) : name_(p.name_), content_(p.content_)
1351  inline ~Procedure() {content_.clear();};
1352  // get/set:
1353  inline const QString& getName() const {return name_;};
1354  inline const QList<QString>& getContent() const {return content_;};
1355  inline int getNumOfExpanded() const {return numOfExpanded_;};
1356  inline void setName(const QString& name) {name_ = name;};
1357  inline QList<QString>& content() {return content_;};
1358  //
1359  inline void incNumOfExpanded() {numOfExpanded_++;};
1360  inline bool hasContent() const {return 0<content_.size();};
1361  private:
1362  QString name_;
1365  };
1366 
1367  // indices of contents:
1368  static int fsContentStartsAt_[];
1369 
1370  // Statics:
1373  static const QString className();
1374 
1375  // Constructors/Destructors:
1376  //
1381 
1386 
1387 
1388  //
1389  // Interfaces:
1390  //
1391  inline const QString& getStationName() const {return stationName_;};
1392  inline FieldSystemEpochFormat fsFmt() const {return fsFmt_;};
1393  inline int getAntcalOutputData() const {return antcalOutputData_;};
1394 
1395  inline const QMap<QString, int>* getDefaultCableSignByStn() const {return defaultCableSignByStn_;};
1396 
1397  inline bool hasCableRecord() const {return hasCableRecord_;};
1398  inline bool hasTsysRecord() const {return hasTsysRecord_;};
1399  inline bool hasCdmsRecord() const {return hasCdmsRecord_;};
1400  inline bool getUseSkededChannelSetup() const {return useSkededChannelSetup_;};
1401  inline const SgChannelSkeded* getChannelSkeded() const {return channelSkeded_;};
1402  inline const QString& getUserCommand() {return userCommand_;};
1403 
1404  //
1405  inline void setStationName(const QString& name) {stationName_ = name;};
1406  inline void setAntcalOutputData(int outputData) {antcalOutputData_ = outputData;};
1407  inline void setDefaultCableSignByStn(const QMap<QString, int>* map) {defaultCableSignByStn_ = map;};
1408 
1409  inline void setRinexFileNameByStn(const QMap<QString, QString>* map) {rinexFileNameByStn_ = map;};
1410  inline void setRinexPressureOffsetByStn(const QMap<QString, double>* map)
1411  {rinexPressureOffsetByStn_ = map;};
1412 
1413  inline void setUseSkededChannelSetup(bool use) {useSkededChannelSetup_ = use;};
1416  //
1418  inline void setUserCommand(const QString& str) {userCommand_ = str;};
1419  inline QMap<QString, Procedure*>& procedureByName() {return procedureByName_;}
1420 
1421  //
1422  // Functions:
1423  //
1424  bool readLogFile(const QString& fileName, const QString& stnName,
1425  const SgMJD& tFirst, const SgMJD& tLast,
1426  const QString& orderOfMeteo);
1427  bool readDbbc3DumpFile(const QString& fileName);
1428  // just a shortcut:
1429  bool propagateData(SgVlbiStationInfo* stn, bool createAntabFile, bool overwriteAntabFile,
1430  bool reportAllTsysData);
1431 
1432  inline bool createAntabFile(const QString& stnKey, const QString& outputFileName, bool have2owrt,
1433  bool reportAllTsysData)
1434  {
1435  return
1437  useSkededChannelSetup_, have2owrt, reportAllTsysData);
1438  };
1439  inline bool createAntCalFile(const QString& stnKey, const QString& outputFileName, bool have2owrt,
1440  bool reportAllReadings, bool supressNonUsedSensors, const QString& ext4compress)
1441  {
1442  return
1444  useSkededChannelSetup_, have2owrt, reportAllReadings, supressNonUsedSensors,
1445  antcalOutputData_, ext4compress, userCommand_);
1446  };
1447 
1448  //
1449  // Friends:
1450  //
1451 
1452  //
1453  // I/O:
1454  //
1455  // ...
1456 
1457 
1458 private:
1459  QString stationName_;
1462  int inYear_;
1464  static const QRegularExpression
1466  static const QRegularExpression
1468  static const QRegularExpression
1470  static const QRegularExpression
1472  static const QRegularExpression
1474 /*
1475  static const QRegExp reFsOld_;
1476  static const QRegExp reFsNew_;
1477  static const QRegExp reFsNewest_;
1478  static const QRegExp rePcmt_;
1479  static const QRegExp reMet_;
1480 */
1481  const QMap<QString, int> *defaultCableSignByStn_;
1482  const QMap<QString, QString> *rinexFileNameByStn_;
1483  const QMap<QString, double> *rinexPressureOffsetByStn_;
1490  QString userCommand_;
1491  QMap<QString, Procedure*> procedureByName_;
1492 
1493 
1494  FieldSystemEpochFormat guessFsFormat(const QString& str);
1495  bool extractEpoch(const QString& str, SgMJD& t);
1496  bool extractContent(const QString& str, QString& content);
1497  bool extractMeteoReading(const QString& str, const QRegularExpression& reMeteo, SgMJD& t,
1498  SgMeteoData& m, const int* oom);
1499 
1500  bool extractTsysReading(const QString& str, const QRegularExpression& reTsys, SgMJD& t,
1501  QMap<QString, float>& tSys, const SgMJD& tAtTheBegin);
1502 /*
1503  bool extractTsysVgosReading(const QString& str, const QRegExp& reTsys, SgMJD& t,
1504  QMap<QString, double>& tSys, const SgMJD& tAtTheBegin);
1505 */
1506  bool extractTsysVgosReading(const QString& str, const QRegularExpression& reTsys, SgMJD& t,
1507  QMap<QString, float>& tSys, const SgMJD& tAtTheBegin);
1508 /*
1509  bool extractTraklReading(const QString& str, const QRegExp& reTrakl, SgMJD& t,
1510  SgTraklReading&, const SgMJD& tAtTheBegin);
1511 */
1512 
1513  bool extractTpcontVgosReading(const QString& str, const QRegularExpression& reTpcont, SgMJD& t,
1514  QMap<QString, QVector<int> >& tPcont, const SgMJD& tAtTheBegin);
1515 
1516  bool extractPcalVgosReading(const QString& str, const QRegularExpression& re, SgMJD& t,
1517  QMap<QString, float*>& pcal, const SgMJD& tAtTheBegin);
1518 
1519  bool extractDot2gpsVgosReading(const QString& str, const QRegularExpressionMatch& match, SgMJD& t,
1520  QString& sKey, float& dot2gps, const SgMJD& tAtTheBegin);
1521 
1522  bool extractTraklReading(const QString& str, const QRegularExpressionMatch& match, SgMJD& t,
1523  SgTraklReading&, const SgMJD& tAtTheBegin);
1524 
1525  bool extractSefdReading(const QString& str, const QRegularExpressionMatch& match,
1526  SgMJD& t, QString& sensorId, QString& srcName, double& az, double& de, QVector<double>& vec,
1527  const SgMJD& tAtTheBegin);
1528 
1529  bool extractCableCalibration(const QString& str, const QRegularExpressionMatch& match, SgMJD& t,
1530  double& v);
1531  bool extractCableCalibrationSignByDiff(const QRegularExpressionMatch& match, int& v);
1532  bool checkRinexFile(const QString& fileName, const SgMJD& tStart, const SgMJD& tFinis,
1533  const QString& rinexStnName);
1534  bool extractDataFromPcmtRecord(const QString& str, const QRegularExpressionMatch& match,
1535  SgMJD& t, double& v, QString& source, QString& scan);
1536  bool extractDataFromMetRecord(const QString& str, const QRegularExpressionMatch& match,
1537  SgMJD& t, SgMeteoData& m);
1538 
1539 //bool extractBbcReading(const QString& str, const QRegExp& re, SgMJD& t, const SgMJD& atEnd,
1540  bool extractBbcReading(const QString& str, const QRegularExpressionMatch& match, SgMJD& t,
1541  const SgMJD& atEnd, SgChannelSetup& cs, const SgMJD& tFirst);
1542  bool extractVcReading(const QString& str, const QRegularExpressionMatch& match,
1543  SgMJD& t, const SgMJD& atEnd, SgChannelSetup& cs, const SgMJD& tFirst);
1544  bool extractLoReading(const QString& str, const QRegularExpressionMatch& match,
1545  SgMJD& t, const SgMJD& atEnd, SgChannelSetup& cs, const SgMJD& tFirst);
1546  bool extractLoRxgReading(const QString& str, const QRegularExpressionMatch& match,
1547  SgMJD& t, const SgMJD& atEnd, SgChannelSetup& cs, const SgMJD& tFirst);
1548  bool extractPatchReading(const QString& str, const QRegularExpressionMatch& match,
1549  SgMJD& t, const SgMJD& atEnd, SgChannelSetup& cs, const SgMJD& tFirst);
1550  bool extractChanSkyFrqReading(const QString& str, const QRegularExpressionMatch& match,
1551  SgMJD& t, const SgMJD& atEnd, SgChannelSetup& cs, const SgMJD& tFirst);
1552  bool extractVciReading(const QString& str, const QRegularExpressionMatch& match,
1553  SgMJD& t, const SgMJD& atEnd, SgChannelSetup& cs, const SgMJD& tFirst);
1554  //
1555  // support:
1556  QString setupTpSensor(const QString& sensorTag, const QString& callerName);
1557 };
1558 /*=====================================================================================================*/
1559 
1560 
1561 
1562 
1563 
1564 
1565 #define NUM_OF_VLBA_ENTRIES (15)
1566 /***===================================================================================================*/
1573 {
1574 public:
1575  // Statics:
1578  static const QString className();
1579 
1580  // Constructors/Destructors:
1581  //
1586 
1591 
1592 
1593  //
1594  // Interfaces:
1595  //
1596  const QString& getLogFileName() const {return logFileName_;};
1597  //
1598  // Functions:
1599  //
1600  bool readLogFile(const QString& fileName, int year);
1601 
1602  bool propagateData(SgVlbiStationInfo* stn);
1603 
1604  inline bool isVlba(const QString& key) const {return ivs2vlba_.contains(key);};
1605 
1606  //
1607  // Friends:
1608  //
1609 
1610  //
1611  // I/O:
1612  //
1613  // ...
1614 
1615 
1616 private:
1617  QString logFileName_;
1618  QMap<QString, SgStnLogReadings*>
1621  static const QString ivsStationNames_[NUM_OF_VLBA_ENTRIES];
1622  QMap<QString, QString> ivs2vlba_;
1623 
1624  bool strs2mjd(int nYear, const QString& sDay, const QString& sHr, const QString& sMin,
1625  const QString& sSec, SgMJD& t);
1626 };
1627 /*=====================================================================================================*/
1628 
1629 
1630 
1631 
1632 
1633 /*=====================================================================================================*/
1634 /* */
1635 /* inline members: */
1636 /* */
1637 /*=====================================================================================================*/
1638 //
1639 //
1640 // CONSTRUCTORS:
1641 //
1642 
1643 
1644 
1645 //
1646 // INTERFACES:
1647 //
1648 //
1649 
1650 
1651 
1652 //
1653 // FRIENDS:
1654 //
1655 //
1656 //
1657 
1658 
1659 /*=====================================================================================================*/
1660 
1661 
1662 
1663 
1664 
1665 /*=====================================================================================================*/
1666 //
1667 // aux functions:
1668 //
1669 
1670 
1671 /*=====================================================================================================*/
1672 #endif //SG_STN_LOG_COLLECTOR_H
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
#define NUM_OF_VLBA_ENTRIES
AntcalOutputData
@ AOD_CABLE_CAL
@ AOD_PCAL
@ AOD_CABLE_SIGN
@ AOD_DBBC3TP
@ AOD_FMTGPS
@ AOD_ALL
@ AOD_TPI
@ AOD_METEO
@ AOD_TRADITIONAL
@ AOD_NOVEL
@ AOD_DATA_ON
@ AOD_SEFD
@ AOD_NONE
@ AOD_TSYS
SgChannelSideBand
Definition: SgVex.h:47
static const QString className()
void setV(double v)
void setIsOk(bool isOk)
void setT(const SgMJD &t)
void setOsRec(SgOnSourceRecord *os)
SgCableCalReading(const SgMJD &t, double v)
double getV() const
bool operator==(const SgCableCalReading &cab) const
SgCableCalReading(const SgCableCalReading &cr)
const SgMJD & getT() const
SgOnSourceRecord * osRec_
const SgOnSourceRecord * getOsRec() const
QMap< QString, SgChannelPolarization > pcalPolarizationById_
bool isOk() const
QMap< QString, QString > pcalIdByKey_
QMap< QString, double > & ifFreqBySensorKey()
QMap< QString, SgChannelSideBand > & ifSideBandById()
QMap< QString, int > & ifIdxById()
QMap< QString, QList< QString > > & origSensorIdById()
QMap< QString, SgChannelPolarization > loPolarizationById_
QMap< QString, SgChannelSideBand > & loSideBandById()
QMap< QString, SgChannelPolarization > & loPolarizationById()
QMap< QString, double > & ifBandwidthBySensorKey()
QMap< int, double > ifFreqByIdx_
QMap< QString, SgChannelPolarization > & pcalPolarizationById()
QMap< QString, double > ifBandwidthBySensorKey_
QMap< QString, QString > loIdBySensorKey_
QMap< QString, QString > loIdByCid_
QMap< QString, QString > xpsIdByKey_
QMap< QString, QList< QString > > origSensorIdById_
QMap< QString, SgChannelPolarization > loPolarizationBySensorKey_
QMap< int, double > & bbcBandwidthByIdx()
QMap< QString, SgChannelSideBand > loSideBandBySensorKey_
HwType getHwType() const
void setBackEndType(BackEndType tp)
QMap< QString, QString > & ifIdBySensorKey()
QMap< QString, SgChannelPolarization > ifPolarizationById_
bool selfCheck(const QString &stnKey)
QMap< int, double > & bbcFreqByIdx()
QMap< QString, QString > & xpsIdByKey()
QMap< QString, double > & loFreqById()
QMap< QString, QString > ifIdBySensorKey_
QMap< QString, QString > & pcalIdByKey()
QMap< QString, int > ifIdxById_
static double calcSkyFreq(double loFreq, double bbcFreq, double width, SgChannelSideBand loSideBand, SgChannelSideBand ifSideBand)
QMap< QString, double > ifFreqBySensorKey_
QMap< QString, SgChannelSideBand > loSideBandById_
QMap< QString, QString > & loIdByCid()
QMap< int, QString > loIdByIdx_
static const QString className()
QMap< QString, SgChannelPolarization > & loPolarizationBySensorKey()
QMap< QString, QString > & loIdBySensorKey()
QMap< int, double > bbcFreqByIdx_
QMap< QString, double > loFreqById_
QMap< int, QString > & loIdByIdx()
QMap< QString, double > & loFreqBySensorKey()
BackEndType backEndType_
QMap< QString, double > loFreqBySensorKey_
QMap< QString, SgChannelPolarization > & ifPolarizationById()
QMap< int, double > & ifFreqByIdx()
BackEndType getBackEndType() const
QMap< int, double > bbcBandwidthByIdx_
QMap< QString, SgChannelSideBand > ifSideBandById_
QMap< QString, SgChannelSideBand > & loSideBandBySensorKey()
void setHwType(HwType tp)
const QString & getBandKey() const
QList< SgChannelSideBand > sideBands_
const QList< SgChannelSideBand > & getSideBands() const
ChanCfg(const QString &bandKey, int cIdx, double skyFrq, double bandWidth, const QList< SgChannelSideBand > &sideBands)
ChanCfg(const ChanCfg &cc)
StnCfg(const QString &key)
void setStnKey(const QString &key)
const QList< ChanCfg > & getChannelCfgs() const
const QString & getStnKey() const
QList< ChanCfg > channelCfgs_
QList< ChanCfg > & channelCfgs()
QMap< QString, StnCfg > stnCfgByKey_
static const QString className()
bool parseSkdFile(const QString &fileName)
TpRecord(const TpRecord &tpr)
TpRecord & operator=(const TpRecord &tpr)
void addRecord(const QString &sensorId, const QString &boardId, double bw, const QString &agc, double gainU, double gainL, double tpOffU, double tpOffL, double tpOnU, double tpOnL, double sefdU, double sefdL)
static const QString className()
QMap< QString, TpRecord > & tpBySensor()
bool getIsDataOn() const
void setOsRec(SgOnSourceRecord *os)
const SgOnSourceRecord * getOsRec() const
bool getIsOnSource() const
const SgMJD & getT() const
void setIsOnSource(bool isOnSource)
void setT(const SgMJD &t)
SgOnSourceRecord *& osRec()
const QMap< QString, TpRecord > & getTpBySensor() const
SgOnSourceRecord * osRec_
void setIsDataOn(bool isDataOn)
QMap< QString, TpRecord > tpBySensor_
SgDbbc3TpReading(const SgDbbc3TpReading &tps)
void setT(const SgMJD &t)
QMap< QString, float > dot2gpsByBrd_
const SgOnSourceRecord * getOsRec() const
bool addDot2gpsByBrd(const QString &key, float v)
SgDot2xpsReading(const SgDot2xpsReading &d2r)
const QMap< QString, float > & getDot2gpsByBrd() const
void setOsRec(SgOnSourceRecord *os)
static const QString className()
SgOnSourceRecord * osRec_
const SgMJD & getT() const
SgOnSourceRecord *& osRec()
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
Definition: SgMJD.h:59
const SgMJD & getT() const
const SgOnSourceRecord * getOsRec() const
SgOnSourceRecord * osRec_
void setT(const SgMJD &t)
bool operator==(const SgMeteoReading &met) const
SgMeteoReading(const SgMJD &t, const SgMeteoData &m)
void setOsRec(SgOnSourceRecord *os)
void setIsOk(bool isOk)
SgMeteoReading(const SgMeteoReading &mr)
static const QString className()
void setM(const SgMeteoData &m)
const SgMeteoData & getM() const
SgMeteoReading(const SgMJD &t, double temp, double pres, double rho)
bool getIsOk() const
QList< SgCableCalReading * > & cableCals()
QList< SgTsysReading * > & tSyses()
static const QString className()
const SgMJD & getTdataOn() const
const QString & getScanName() const
void setScanName(const QString &str)
const SgMJD & getTfinis() const
void setSourceName(const QString &str)
bool operator==(const SgOnSourceRecord &rec) const
bool isSameArgs(const SgOnSourceRecord &rec) const
void setTfinis(const SgMJD &t)
QList< SgCableCalReading * > cableCals_
QList< SgDbbc3TpReading * > & dbbc3Tps()
void setTdataOn(const SgMJD &t)
const QString & getSourceName() const
QList< SgMeteoReading * > meteoPars_
const SgMJD & getTstart() const
void setTstart(const SgMJD &t)
QList< SgTsysReading * > tSyses_
QList< SgMeteoReading * > & meteoPars()
QList< SgDbbc3TpReading * > dbbc3Tps_
SgOnSourceRecord *& osRec()
const SgOnSourceRecord * getOsRec() const
SgPcalReading(const SgPcalReading &pcr)
void setT(const SgMJD &t)
void setOsRec(SgOnSourceRecord *os)
SgOnSourceRecord * osRec_
const QMap< QString, float * > & getPcal() const
static const QString className()
QMap< QString, float * > & pcal()
void setIsOk(bool isOk)
const SgMJD & getT() const
bool getIsOk() const
bool addPcals(const QMap< QString, float * > &pcals)
QMap< QString, float * > pcal_
const SgMJD & getT() const
void setAz(double d)
SgSefdReading(const SgSefdReading &sr)
static const QString className()
void setEl(double d)
void setT(const SgMJD &t)
bool addValByChanKey(const SgMJD &t, const QString &srcName, double az, double el, const QString &chanKey, const QVector< double > &val)
double getAz() const
QMap< QString, QVector< double > * > valByChanKey_
void setIsOk(bool isOk)
QMap< QString, QVector< double > * > & valByChanKey()
double getEl() const
void setSrcName(const QString &name)
const QMap< QString, QVector< double > * > & getValByChanKey() const
const QString & getSrcName() const
bool getIsOk() const
const QList< QString > & getContent() const
const QString & getName() const
Procedure(const QString &name)
void setName(const QString &name)
const QMap< QString, double > * rinexPressureOffsetByStn_
QString setupTpSensor(const QString &sensorTag, const QString &callerName)
void setDefaultCableSignByStn(const QMap< QString, int > *map)
const QMap< QString, QString > * rinexFileNameByStn_
const SgChannelSkeded * getChannelSkeded() const
static const QRegularExpression reMet_
void setAntcalOutputData(int outputData)
FieldSystemEpochFormat fsFmt_
void setStationName(const QString &name)
void setRinexPressureOffsetByStn(const QMap< QString, double > *map)
bool extractTraklReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, SgTraklReading &, const SgMJD &tAtTheBegin)
SgStnLogReadings & logReadings()
static const QString className()
bool extractTsysVgosReading(const QString &str, const QRegularExpression &reTsys, SgMJD &t, QMap< QString, float > &tSys, const SgMJD &tAtTheBegin)
static const QRegularExpression reFsOld_
bool extractBbcReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool createAntabFile(const QString &stnKey, const QString &outputFileName, bool have2owrt, bool reportAllTsysData)
static const QRegularExpression rePcmt_
bool hasCdmsRecord() const
bool extractTsysReading(const QString &str, const QRegularExpression &reTsys, SgMJD &t, QMap< QString, float > &tSys, const SgMJD &tAtTheBegin)
SgChannelSkeded * channelSkeded()
bool extractDataFromMetRecord(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, SgMeteoData &m)
const QString & getStationName() const
bool extractVciReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool readDbbc3DumpFile(const QString &fileName)
const QMap< QString, int > * defaultCableSignByStn_
int getAntcalOutputData() const
bool extractCableCalibration(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, double &v)
static int fsContentStartsAt_[]
bool extractCableCalibrationSignByDiff(const QRegularExpressionMatch &match, int &v)
bool propagateData(SgVlbiStationInfo *stn, bool createAntabFile, bool overwriteAntabFile, bool reportAllTsysData)
void setRinexFileNameByStn(const QMap< QString, QString > *map)
bool extractContent(const QString &str, QString &content)
bool extractVcReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
void setUseSkededChannelSetup(bool use)
SgChannelSkeded * channelSkeded_
bool createAntCalFile(const QString &stnKey, const QString &outputFileName, bool have2owrt, bool reportAllReadings, bool supressNonUsedSensors, const QString &ext4compress)
bool extractPatchReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool extractMeteoReading(const QString &str, const QRegularExpression &reMeteo, SgMJD &t, SgMeteoData &m, const int *oom)
FieldSystemEpochFormat guessFsFormat(const QString &str)
void setChannelSkeded(SgChannelSkeded *cs)
bool readLogFile(const QString &fileName, const QString &stnName, const SgMJD &tFirst, const SgMJD &tLast, const QString &orderOfMeteo)
FieldSystemEpochFormat fsFmt() const
bool extractChanSkyFrqReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool extractDot2gpsVgosReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, QString &sKey, float &dot2gps, const SgMJD &tAtTheBegin)
void setUserCommand(const QString &str)
bool getUseSkededChannelSetup() const
bool extractEpoch(const QString &str, SgMJD &t)
bool extractLoReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool extractDataFromPcmtRecord(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, double &v, QString &source, QString &scan)
static const QRegularExpression reFsNewest_
bool extractPcalVgosReading(const QString &str, const QRegularExpression &re, SgMJD &t, QMap< QString, float * > &pcal, const SgMJD &tAtTheBegin)
QMap< QString, Procedure * > procedureByName_
static const QRegularExpression reFsNew_
SgStnLogReadings logReadings_
const QMap< QString, int > * getDefaultCableSignByStn() const
const QString & getUserCommand()
bool hasCableRecord() const
QMap< QString, Procedure * > & procedureByName()
bool checkRinexFile(const QString &fileName, const SgMJD &tStart, const SgMJD &tFinis, const QString &rinexStnName)
bool extractSefdReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, QString &sensorId, QString &srcName, double &az, double &de, QVector< double > &vec, const SgMJD &tAtTheBegin)
bool hasTsysRecord() const
bool extractTpcontVgosReading(const QString &str, const QRegularExpression &reTpcont, SgMJD &t, QMap< QString, QVector< int > > &tPcont, const SgMJD &tAtTheBegin)
bool extractLoRxgReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
const QString & getRecorderInfo() const
QList< SgDbbc3TpReading * > & dbbc3Tps()
static const QString sFiller_
QList< SgTraklReading * > & trakls()
QList< SgDot2xpsReading * > dot2xpses_
QList< SgSefdReading * > sefds_
void export2antabFrqs_vgosSetup(QTextStream &s)
bool createAntabFile(const QString &inputLogFileName, const QString &outputFileName, const QString &stnKey, const SgChannelSkeded *channelSkeded, bool useSkededChannelSetup, bool have2overwrite, bool reportAllTsysData)
void export2antCalFrqs_vgosSetup(QTextStream &s)
QList< SgCableCalReading * > & cableCals()
const QString & getFsVersionLabel() const
void export2antabFrqs_skededSetup(QTextStream &s, const SgChannelSkeded::StnCfg &sCfg)
bool areMeteosPresent() const
QList< SgTsysReading * > & tSyses()
bool createAntCalFile(const QString &inputLogFileName, const QString &outputFileName, const QString &stnKey, const SgChannelSkeded *channelSkeded, bool useSkededChannelSetup, bool have2overwrite, bool reportAllReadings, bool supressNonUsedSensors, int antcalOutputData, const QString &ext4compress, const QString &userCommand)
void interpolateMeteoParameters(SgVlbiAuxObservation *aux)
void setCableCalAmbig(double a)
void export2antabFrqs_nativeSetup(QTextStream &s)
QList< SgPcalReading * > pcals_
static const QString className()
QList< SgSefdReading * > & sefds()
QList< SgDbbc3TpReading * > dbbc3Tps_
void export2antabFrqs_missedSetup(QTextStream &s)
void setCableSign(int n)
static const double dFiller_
QList< SgCableCalReading * > cableCals_
bool compareChannelSetups(const SgChannelSkeded::StnCfg &sCfg)
void lookupScanName(SgOnSourceRecord *osRec, const QMap< QString, SgVlbiAuxObservation * > &auxObsByScan)
QList< SgMeteoReading * > & meteoPars()
const SgChannelSetup & getChannelSetup() const
QList< SgDot2xpsReading * > & dot2xpses()
void setRecorderInfo(const QString &info)
void setStationName(const QString &name)
void setBackEndInfo(const QString &info)
QList< SgOnSourceRecord * > & onSourceRecords()
QList< SgOnSourceRecord * > onSourceRecords_
QList< SgTraklReading * > trakls_
SgChannelSetup & channelSetup()
SgChannelSetup channelSetup_
InputType getItType() const
bool areCableCalsPresent() const
const QString & getExperimentName() const
void setExperimentName(const QString &name)
QList< SgTsysReading * > tSyses_
QList< SgMeteoReading * > meteoPars_
double getCableCalAmbig() const
const QString & getBackEndInfo() const
void export2antCalPcal_vgosSetup(QTextStream &s)
QList< SgCableCalReading * > & cableLongs()
void setFsVersionLabel(const QString &ver)
int getCableSign() const
QList< SgCableCalReading * > cableLongs_
void export2antCalFrqs_skededSetup(QTextStream &s, const SgChannelSkeded::StnCfg &sCfg)
bool compareChannelNumbers(const SgChannelSkeded::StnCfg &sCfg)
bool propagateData(SgVlbiStationInfo *stn)
void verifyReadings(SgVlbiStationInfo *stn, const QMap< QString, int > *defaultCableSignByStn)
static const int nFiller_
QList< SgPcalReading * > & pcals()
QMap< QString, SgOnSourceRecord * > recordByScan_
void setItType(InputType t)
void export2antCalFrqs_nativeSetup(QTextStream &s)
float getAzv() const
static const QString className()
void setT(const SgMJD &t)
void setElv(float elv)
float getEl() const
float getAz() const
void setAzv(float azv)
void setAz(float az)
void setEl(float el)
SgTraklReading(const SgMJD &t, float az, float azv, float el, float elv)
const SgMJD & getT() const
SgTraklReading(const SgTraklReading &r)
float getElv() const
void setOsRec(SgOnSourceRecord *os)
void setT(const SgMJD &t)
SgTsysReading(const SgTsysReading &tsr)
static const QString className()
void addTsyses(const QMap< QString, float > &tsys)
void setIsOnSource(bool isOnSource)
void setIsOk(bool isOk)
const QMap< QString, float > & getTsys() const
QMap< QString, QVector< int > > & tpcont()
QList< SgTraklReading * > & trakls()
const SgOnSourceRecord * getOsRec() const
void setIsDataOn(bool isDataOn)
bool getIsOk() const
QList< SgTraklReading * > trakls_
const QList< SgTraklReading * > & getTrakls() const
const SgMJD & getT() const
QMap< QString, QVector< int > > tpcont_
QMap< QString, float > & tsys()
const QMap< QString, QVector< int > > & getTpcont() const
QMap< QString, float > tsys_
SgOnSourceRecord * osRec_
void addTpconts(const QMap< QString, QVector< int > > &tpcont)
bool getIsOnSource() const
SgOnSourceRecord *& osRec()
bool getIsDataOn() const
static const QString className()
const QString & getLogFileName() const
bool readLogFile(const QString &fileName, int year)
bool strs2mjd(int nYear, const QString &sDay, const QString &sHr, const QString &sMin, const QString &sSec, SgMJD &t)
bool propagateData(SgVlbiStationInfo *stn)
static const QString ivsStationNames_[NUM_OF_VLBA_ENTRIES]
bool isVlba(const QString &key) const
static const QString vlbaStationCodes_[NUM_OF_VLBA_ENTRIES]
QMap< QString, QString > ivs2vlba_
QMap< QString, SgStnLogReadings * > readingsByKey_