General Purpose Geodetic Library
NsScrPrx4Session.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of nuSolve. nuSolve is a part of CALC/SOLVE system
4  * and is designed to perform data analyis of a geodetic VLBI session.
5  * Copyright (C) 2017-2020 Sergei Bolotin.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 #include "nuSolve.h"
22 
23 
24 #include "NsScrPrx4Observation.h"
25 #include "NsScrPrx4Session.h"
26 
27 
28 
29 
30 
31 
32 /*=======================================================================================================
33 *
34 * NsScrPrx4Band's METHODS:
35 *
36 *======================================================================================================*/
38 {
39  prxStations_.clear();
40  prxBaselines_.clear();
41  prxSources_.clear();
42  //
43  // stations:
44  for (StationsByName_it it=bnd()->stationsByName().begin();
45  it!=bnd()->stationsByName().end(); ++it)
46  prxStations_ << new NsScrPrx4Station(*it.value());
47  // baselines:
48  for (BaselinesByName_it it=bnd()->baselinesByName().begin();
49  it!=bnd()->baselinesByName().end(); ++it)
50  prxBaselines_ << new NsScrPrx4Baseline(*it.value());
51  // sources:
52  for (SourcesByName_it it=bnd()->sourcesByName().begin();
53  it!=bnd()->sourcesByName().end(); ++it)
54  prxSources_ << new NsScrPrx4Source(*it.value());
55 };
56 
57 
58 /*=======================================================================================================
59 *
60 * METHODS:
61 *
62 *======================================================================================================*/
64 {
65  prxBands_.clear();
66  prxStations_.clear();
67  prxBaselines_.clear();
68  prxSources_.clear();
69  stationsByKey_.clear();
70  baselinesByKey_.clear();
71  sourcesByKey_.clear();
72  // bands:
73  for (int i=0; i<session_->bands().size(); i++)
74  {
75  NsScrPrx4Band *bnd=new NsScrPrx4Band(*session_->bands().at(i));
76  bnd->postLoad();
77  prxBands_ << bnd;
78  if (session_->bands().at(i)->isAttr(SgVlbiBand::Attr_PRIMARY))
79  primaryBandIdx_ = i;
80  };
81  // stations:
82  for (StationsByName_it it=session_->stationsByName().begin();
83  it!=session_->stationsByName().end(); ++it)
84  {
85  SgVlbiStationInfo *si=it.value();
86  NsScrPrx4Station *proxy=new NsScrPrx4Station(*si);
87  prxStations_ << proxy;
88  //
89  proxy->prxAuxes_.clear();
90  for (QMap<QString, SgVlbiAuxObservation*>::iterator jt=si->auxObservationByScanId()->begin();
91  jt!=si->auxObservationByScanId()->end(); ++jt)
92  proxy->prxAuxes_ << new NsScrPrx4VlbiAuxObservation(*jt.value(), proxy);
93  //
94  };
95  // baselines:
96  for (BaselinesByName_it it=session_->baselinesByName().begin();
97  it!=session_->baselinesByName().end(); ++it)
98  prxBaselines_ << new NsScrPrx4Baseline(*it.value());
99  // sources:
100  for (SourcesByName_it it=session_->sourcesByName().begin();
101  it!=session_->sourcesByName().end(); ++it)
102  prxSources_ << new NsScrPrx4Source(*it.value());
103  // obs:
104  for (int i=0; i<session_->observations().size(); i++)
106  //
107  // fill the maps:
108  for (int i=0; i<prxStations_.size(); i++)
109  stationsByKey_.insert(prxStations_.at(i)->getKey(), prxStations_.at(i));
110  for (int i=0; i<prxBaselines_.size(); i++)
111  baselinesByKey_.insert(prxBaselines_.at(i)->getKey(), prxBaselines_.at(i));
112  for (int i=0; i<prxSources_.size(); i++)
113  sourcesByKey_.insert(prxSources_.at(i)->getKey(), prxSources_.at(i));
114 };
115 
116 
117 
118 //
120 {
121  for (QMap<QString, SgVlbiStationInfo*>::iterator it = session_->stationsByName().begin();
122  it!=session_->stationsByName().end(); ++it)
123  {
124  SgVlbiStationInfo *si=it.value();
125  si->pcClocks()->setPMode(mode);
126  };
127 };
128 
129 
130 
131 //
133 {
134  for (QMap<QString, SgVlbiStationInfo*>::iterator it = session_->stationsByName().begin();
135  it!=session_->stationsByName().end(); ++it)
136  {
137  SgVlbiStationInfo *si=it.value();
138  si->pcZenith()->setPMode(mode);
139  };
140 };
141 
142 
143 
144 
145 
146 
147 
148 
149 /*=======================================================================================================
150 *
151 * FRIENDS:
152 *
153 *======================================================================================================*/
154 //
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 
172 
173 /*=====================================================================================================*/
174 //
175 // constants:
176 //
177 
178 
179 /*=====================================================================================================*/
180 
181 
182 
183 
184 
185 /*=====================================================================================================*/
186 
QMap< QString, SgVlbiBaselineInfo * >::iterator BaselinesByName_it
QMap< QString, SgVlbiSourceInfo * >::iterator SourcesByName_it
QMap< QString, SgVlbiStationInfo * >::iterator StationsByName_it
QList< NsScrPrx4Baseline * > prxBaselines_
QList< NsScrPrx4Source * > prxSources_
QList< NsScrPrx4Station * > prxStations_
SgVlbiBand * bnd()
QMap< QString, NsScrPrx4Baseline * > baselinesByKey_
QList< NsScrPrx4Baseline * > prxBaselines_
QMap< QString, NsScrPrx4Station * > stationsByKey_
void dispatchChangeOfZenithParameterModel(SgParameterCfg::PMode)
QList< NsScrPrx4VlbiObservation * > prxObservations_
void dispatchChangeOfClocksParameterModel(SgParameterCfg::PMode)
QMap< QString, NsScrPrx4Source * > sourcesByKey_
QList< NsScrPrx4Source * > prxSources_
SgVlbiSession * session_
QList< NsScrPrx4Band * > prxBands_
QList< NsScrPrx4Station * > prxStations_
QList< NsScrPrx4VlbiAuxObservation * > prxAuxes_
void setPMode(PMode mode)
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
Definition: SgVlbiBand.h:376
QMap< QString, SgVlbiStationInfo * > & stationsByName()
Definition: SgVlbiBand.h:368
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
Definition: SgVlbiBand.h:384
@ Attr_PRIMARY
the band is a primary band;
Definition: SgVlbiBand.h:60
QList< SgVlbiBand * > & bands()
QMap< QString, SgVlbiStationInfo * > & stationsByName()
QList< SgVlbiObservation * > & observations()
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
SgParameterCfg * pcZenith()
SgParameterCfg * pcClocks()