General Purpose Geodetic Library
SgVlbiHistory.cpp
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) 2010-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 #include <iostream>
24 #include <stdlib.h>
25 
26 
27 #include <SgDbhImage.h>
28 #include <SgDbhFormat.h>
29 #include <SgLogger.h>
30 #include <SgVersion.h>
31 #include <SgVlbiHistory.h>
32 
33 
34 
35 
36 
37 
38 /*=======================================================================================================
39 *
40 * SgVlbiHistory's METHODS:
41 *
42 *======================================================================================================*/
44 {
45  if (size())
46  {
47  for (int i=0; i<size(); i++)
48  delete at(i);
49  clear();
51  ": importDbhHistoryBlock(): the list is cleared");
52  };
53  for (int i=0; i<image->historyList().size(); i++)
54  {
55  SgDbhHistoryEntry *e = image->historyList().at(i);
57  append(rec);
58  };
59  // put fingerprint: (should it be here?)
60  append(new SgVlbiHistoryRecord(SgMJD::currentMJD().toUtc(), image->currentVersion(),
61  libraryVersion.name() + ": data have been read from Mk3 database"));
62  // R1619: GSFC Analysis -DG-
63 };
64 
65 
66 
67 //
69 {
70  for (int i=0; i<size(); i++)
71  {
72  SgVlbiHistoryRecord *rec=at(i);
73  image->addHistoryEntry(rec->getText(), rec->getEpoch());
74  };
75 };
76 
77 
78 
79 //
80 void SgVlbiHistory::addHistoryRecord(const QString& record, const SgMJD& t)
81 {
82  append(new SgVlbiHistoryRecord(t, -1, record, false));
83 };
84 /*=====================================================================================================*/
85 
86 /*=====================================================================================================*/
SgLogger * logger
Definition: SgLogger.cpp:231
SgVersion libraryVersion("SgLib", 0, 7, 5, "Tuscarora (rc1)", SgMJD(2022, 2, 18, 17, 34))
SgMJD getEpoch() const
Definition: SgDbhFormat.h:504
const QString & getText()
Definition: SgDbhFormat.h:502
int currentVersion() const
Definition: SgDbhImage.h:331
void addHistoryEntry(const QString &text, const SgMJD &t=SgMJD::currentMJD().toUtc())
Definition: SgDbhImage.cpp:238
const QList< SgDbhHistoryEntry * > & historyList()
Definition: SgDbhImage.h:192
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_DBH
Definition: SgLogger.h:67
Definition: SgMJD.h:59
static SgMJD currentMJD()
Definition: SgMJD.cpp:118
QString name(NameFormat fmt=NF_Human) const
Definition: SgVersion.cpp:54
const SgMJD & getEpoch() const
const QString & getText() const
const QString className() const
void importDbhHistoryBlock(SgDbhImage *)
void addHistoryRecord(const QString &, const SgMJD &t)
void export2DbhHistoryBlock(SgDbhImage *)