General Purpose Geodetic Library
SgExternalWeights.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) 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 #ifndef SG_EXTERNAL_WEIGHTS
24 #define SG_EXTERNAL_WEIGHTS
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 
32 #include <QtCore/QMap>
33 #include <QtCore/QString>
34 
35 #include <SgVlbiBaselineInfo.h>
36 
37 
38 
39 /***===================================================================================================*/
45 {
46 public:
47  //
48  // constructors/destructors:
49  //
53  inline SgBaselineExternalWeight();
54 
59 
64 
65  //
66  // Interfaces:
67  //
68  // gets:
69  //
72  inline const QString& getBaselineName() const;
73 
76  inline double getDelayWeight() const;
77 
80  inline double getRateWeight() const;
81 
84  inline int getDbhVersionNumber() const;
85 
86  // sets:
89  inline void setBaselineName(const QString&);
90 
93  inline void setDelayWeight(double);
94 
97  inline void setRateWeight(double);
98 
101  inline void setDbhVersionNumber(int);
102 
103  //
104  // Functions:
105  //
108  static const QString className();
109 
112  bool parseString(const QString&);
113 
114 private:
115  QString baselineName_;
116  double delayWeight_;
117  double rateWeight_;
119 };
120 /*=====================================================================================================*/
121 
122 
123 
124 
125 /***===================================================================================================*/
131 {
132 public:
133  //
134  // constructors/destructors:
135  //
139  inline SgExternalWeights();
140 
144  inline SgExternalWeights(const QString& sessionName);
145 
149  inline ~SgExternalWeights();
150 
151  //
152  // Interfaces:
153  //
154  // gets:
155  //
158  inline const QString& getFileName() const;
159 
162  inline const QString& getSessionName() const;
163 
166  inline bool isOk() const;
167 
168  // sets:
171  inline void setSessionName(const QString&);
172 
173  //
174  // Functions:
175  //
178  static const QString className();
179 
182  bool readFile(const QString&);
183 
185 
186 private:
187  QString fileName_;
188  QString sessionName_;
189  QMap<QString, SgBaselineExternalWeight*> weights_;
190  bool isOk_;
191 };
192 /*=====================================================================================================*/
193 
194 
195 
196 
197 
198 /*=====================================================================================================*/
199 /* */
200 /* SgBaselineExternalWeight inline members: */
201 /* */
202 /*=====================================================================================================*/
203 //
204 //
205 // CONSTRUCTORS:
206 //
207 //
208 // An empty constructor:
210  baselineName_("A:B")
211 {
212  delayWeight_ = rateWeight_ = 0.0;
213  dbhVersionNumber_ = 0;
214 };
215 
216 
217 
218 // A copy constructor:
220  baselineName_(w.baselineName_)
221 {
225 };
226 
227 
228 
229 // A destructor:
231 {
232  // empty, nothing to do
233 };
234 
235 
236 
237 //
238 // INTERFACES:
239 //
240 //
241 inline const QString& SgBaselineExternalWeight::getBaselineName() const
242 {
243  return baselineName_;
244 };
245 
246 
247 
248 //
250 {
251  return delayWeight_;
252 };
253 
254 
255 
256 //
258 {
259  return rateWeight_;
260 };
261 
262 
263 
264 //
266 {
267  return dbhVersionNumber_;
268 };
269 
270 
271 
272 //
273 inline void SgBaselineExternalWeight::setBaselineName(const QString& name)
274 {
275  baselineName_ = name;
276 };
277 
278 
279 
280 //
282 {
283  delayWeight_ = w;
284 };
285 
286 
287 
288 //
290 {
291  rateWeight_ = w;
292 };
293 
294 
295 
296 //
298 {
299  dbhVersionNumber_ = v;
300 };
301 
302 
303 
304 //
305 // FUNCTIONS:
306 //
307 //
308 //
309 
310 // FRIENDS:
311 //
312 //
313 //
314 /*=====================================================================================================*/
315 
316 
317 
318 
319 
320 
321 
322 
323 /*=====================================================================================================*/
324 /* */
325 /* SgExternalWeights inline members: */
326 /* */
327 /*=====================================================================================================*/
328 //
329 //
330 // CONSTRUCTORS:
331 //
332 //
333 // An empty constructor:
335  fileName_("?"),
336  sessionName_("?"),
337  weights_()
338 {
339  isOk_ = false;
340 };
341 
342 
343 
344 // An empty constructor:
345 inline SgExternalWeights::SgExternalWeights(const QString& sessionName) :
346  fileName_("?"),
347  sessionName_(sessionName),
348  weights_()
349 {
350  isOk_ = false;
351 };
352 
353 
354 
355 // A destructor:
357 {
358  for (QMap<QString, SgBaselineExternalWeight*>::iterator it=weights_.begin(); it!=weights_.end(); ++it)
359  delete it.value();
360  weights_.clear();
361 };
362 
363 
364 
365 //
366 // INTERFACES:
367 //
368 //
369 // gets:
370 inline const QString& SgExternalWeights::getFileName() const
371 {
372  return fileName_;
373 };
374 
375 
376 
377 //
378 inline const QString& SgExternalWeights::getSessionName() const
379 {
380  return sessionName_;
381 };
382 
383 
384 
385 //
386 inline bool SgExternalWeights::isOk() const
387 {
388  return isOk_;
389 }
390 
391 
392 
393 // sets:
394 //
395 inline void SgExternalWeights::setSessionName(const QString& name)
396 {
397  sessionName_ = name;
398 };
399 
400 
401 
402 
403 //
404 // FUNCTIONS:
405 //
406 //
407 //
408 
409 // FRIENDS:
410 //
411 //
412 //
413 /*=====================================================================================================*/
414 
415 
416 
417 
418 
419 
420 
421 
422 
423 
424 
425 
426 
427 
428 
429 
430 
431 
432 
433 
434 
435 
436 
437 /*=====================================================================================================*/
438 //
439 // aux functions:
440 //
441 
442 
443 /*=====================================================================================================*/
444 #endif //SG_EXTERNAL_WEIGHTS
QMap< QString, SgVlbiBaselineInfo * > BaselinesByName
bool parseString(const QString &)
const QString & getBaselineName() const
static const QString className()
void setBaselineName(const QString &)
bool readFile(const QString &)
const QString & getFileName() const
QMap< QString, SgBaselineExternalWeight * > weights_
void setSessionName(const QString &)
const QString & getSessionName() const
static const QString className()
void setupExternalWeights(BaselinesByName &)