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  {
51  SgVlbiBaselineInfo *bln=it.value();
52  NsScrPrx4Baseline *blnProxy=new NsScrPrx4Baseline(*bln);
53  prxBaselines_ << blnProxy;
54  // per band baselines:
55  for (int i=0; i<bln->observables().size(); i++)
56  blnProxy->prxObservations_ << new NsScrPrx4VlbiObservation(*bln->observables().at(i)->owner(), sessionProxy);
57  //
58  };
59  // sources:
60  for (SourcesByName_it it=bnd()->sourcesByName().begin();
61  it!=bnd()->sourcesByName().end(); ++it)
62  prxSources_ << new NsScrPrx4Source(*it.value());
63 };
64 /*=====================================================================================================*/
65 
66 
67 
68 
69 
70 
71 /*=======================================================================================================
72 *
73 * NsScrPrx4Station's METHODS:
74 *
75 *======================================================================================================*/
77 {
78  switch (s)
79  {
83  else
84  return false;
85  break;
89  else
90  return false;
91  break;
95  else
96  return false;
97  break;
99  default:
101  break;
102  };
103  return true;
104 };
105 /*=====================================================================================================*/
106 
107 
108 
109 
110 
111 
112 /*=======================================================================================================
113 *
114 * NsScrPrx4Session's METHODS:
115 *
116 *======================================================================================================*/
118 {
119  prxBands_.clear();
120  prxStations_.clear();
121  prxBaselines_.clear();
122  prxSources_.clear();
123  stationsByKey_.clear();
124  baselinesByKey_.clear();
125  sourcesByKey_.clear();
126  // bands:
127  for (int i=0; i<session_->bands().size(); i++)
128  {
129  NsScrPrx4Band *bnd=new NsScrPrx4Band(*session_->bands().at(i));
130  bnd->postLoad(this);
131  prxBands_ << bnd;
132  if (session_->bands().at(i)->isAttr(SgVlbiBand::Attr_PRIMARY))
133  primaryBandIdx_ = i;
134  };
135  // stations:
136  for (StationsByName_it it=session_->stationsByName().begin();
137  it!=session_->stationsByName().end(); ++it)
138  {
139  SgVlbiStationInfo *si=it.value();
140  NsScrPrx4Station *proxy=new NsScrPrx4Station(*si);
141  prxStations_ << proxy;
142  //
143  proxy->prxAuxes_.clear();
144  for (QMap<QString, SgVlbiAuxObservation*>::iterator jt=si->auxObservationByScanId()->begin();
145  jt!=si->auxObservationByScanId()->end(); ++jt)
146  proxy->prxAuxes_ << new NsScrPrx4VlbiAuxObservation(*jt.value(), proxy);
147  //
148  };
149  // baselines:
150  for (BaselinesByName_it it=session_->baselinesByName().begin();
151  it!=session_->baselinesByName().end(); ++it)
152  prxBaselines_ << new NsScrPrx4Baseline(*it.value());
153  // sources:
154  for (SourcesByName_it it=session_->sourcesByName().begin();
155  it!=session_->sourcesByName().end(); ++it)
156  prxSources_ << new NsScrPrx4Source(*it.value());
157  // obs:
158  for (int i=0; i<session_->observations().size(); i++)
160  //
161  // fill the maps:
162  for (int i=0; i<prxStations_.size(); i++)
163  stationsByKey_.insert(prxStations_.at(i)->getKey(), prxStations_.at(i));
164  for (int i=0; i<prxBaselines_.size(); i++)
165  baselinesByKey_.insert(prxBaselines_.at(i)->getKey(), prxBaselines_.at(i));
166  for (int i=0; i<prxSources_.size(); i++)
167  sourcesByKey_.insert(prxSources_.at(i)->getKey(), prxSources_.at(i));
168 };
169 
170 
171 
172 //
174 {
175  for (QMap<QString, SgVlbiStationInfo*>::iterator it = session_->stationsByName().begin();
176  it!=session_->stationsByName().end(); ++it)
177  {
178  SgVlbiStationInfo *si=it.value();
179  si->pcClocks()->setPMode(mode);
180  };
181 };
182 
183 
184 
185 //
187 {
188  for (QMap<QString, SgVlbiStationInfo*>::iterator it = session_->stationsByName().begin();
189  it!=session_->stationsByName().end(); ++it)
190  {
191  SgVlbiStationInfo *si=it.value();
192  si->pcZenith()->setPMode(mode);
193  };
194 };
195 /*=====================================================================================================*/
196 
197 
198 
199 
200 
201 
202 
203 /*=======================================================================================================
204 *
205 * FRIENDS:
206 *
207 *======================================================================================================*/
208 //
209 
210 
211 
212 
213 
214 
215 
216 
217 
218 
219 
220 
221 
222 
223 
224 
225 
226 
227 /*=====================================================================================================*/
228 //
229 // constants:
230 //
231 
232 
233 /*=====================================================================================================*/
234 
235 
236 
237 
238 
239 /*=====================================================================================================*/
240 
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()
void postLoad(NsScrPrx4Session *)
QList< NsScrPrx4VlbiObservation * > prxObservations_
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_
SgVlbiStationInfo * stn()
QList< NsScrPrx4VlbiAuxObservation * > prxAuxes_
bool setFlybyCableCalSource(NsScrPrx4TaskConfig::CableCalSource s)
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< SgVlbiObservable * > & observables()
QList< SgVlbiBand * > & bands()
QMap< QString, SgVlbiStationInfo * > & stationsByName()
QList< SgVlbiObservation * > & observations()
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
void setFlybyCableCalSource(SgTaskConfig::CableCalSource s)
@ Attr_HAS_CCC_FSLG
a station has cable calibrations from FS log file
@ Attr_HAS_CCC_CDMS
a station has cable calibrations from CDMS
@ Attr_HAS_CCC_PCMT
a station has cable calibrations from PCMT
SgParameterCfg * pcZenith()
SgParameterCfg * pcClocks()