General Purpose Geodetic Library
SgObjectInfo.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 <QtCore/QDataStream>
28 
29 #include <SgObjectInfo.h>
30 #include <SgLogger.h>
31 #include <SgTaskConfig.h>
32 
33 /*=======================================================================================================
34 *
35 * METHODS:
36 *
37 *======================================================================================================*/
38 //
39 // static first:
40 const QString SgObjectInfo::className()
41 {
42  return "SgObjectInfo";
43 };
44 //
45 
46 
47 
48 
49 //
51 {
54 //if (true || cfg->getUseRateType() != SgTaskConfig::VR_NONE)
56 };
57 
58 
59 
60 
61 
62 //
64 {
65  s << getKey() << getAttributes() << getAka() << getIdx();
68  if (s.status() != QDataStream::Ok)
69  {
71  "::saveIntermediateResults(): error writting data");
72  return false;
73  };
74  return s.status() == QDataStream::Ok;
75 };
76 
77 
78 
79 //
81 {
82  QString key, aka;
83  unsigned int attributes;
84  int idx;
85  s >> key >> attributes >> aka >> idx;
86  if (s.status() != QDataStream::Ok)
87  {
89  "::loadIntermediateResults(): error reading data: " +
90  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
91  return false;
92  };
95  //
96  if (getKey() != key)
97  {
99  "::loadIntermediateResults(): error reading data: wrong order, key mismatch: got [" + key +
100  "], expected [" + getKey() + "]");
101  return false;
102  };
103  setAttributes(attributes);
104  //
105  return s.status()==QDataStream::Ok;
106 };
107 /*=====================================================================================================*/
108 //
109 // FRIENDS:
110 //
111 /*=====================================================================================================*/
112 //
113 
114 /*=====================================================================================================*/
115 //
116 // aux functions:
117 //
118 
119 /*=====================================================================================================*/
120 //
121 // constants:
122 //
123 
124 /*=====================================================================================================*/
SgLogger * logger
Definition: SgLogger.cpp:231
void setAttributes(unsigned int a)
Definition: SgAttribute.h:191
unsigned int getAttributes() const
Definition: SgAttribute.h:183
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_BIN
Definition: SgLogger.h:64
bool loadIntermediateResults(QDataStream &)
int getIdx() const
Definition: SgObjectInfo.h:335
SgWrmsable delayWrms_
local (session) index;
Definition: SgObjectInfo.h:248
SgWrmsable rateWrms_
Definition: SgObjectInfo.h:249
const QString & getKey() const
Definition: SgObjectInfo.h:319
const QString & getAka() const
Definition: SgObjectInfo.h:327
void recalcSigma2add(const SgTaskConfig *cfg)
bool saveIntermediateResults(QDataStream &) const
static const QString className()
double getMinAuxSigma4Rate() const
Definition: SgTaskConfig.h:230
VlbiDelayType getUseDelayType() const
Definition: SgTaskConfig.h:857
double getMinAuxSigma4Delay() const
Definition: SgTaskConfig.h:229
void recalcSigma2add(double minSigma)
Definition: SgWrmsable.cpp:95