General Purpose Geodetic Library
NsScrPrx4ParametersDescriptor.h
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 
22 #ifndef NS_SCR_PRX_4_PARAMETERS_DESCRIPTOR_H
23 #define NS_SCR_PRX_4_PARAMETERS_DESCRIPTOR_H
24 
25 
26 #ifdef HAVE_CONFIG_H
27 # include <config.h>
28 #endif
29 
30 
31 #include <QtCore/QtGlobal>
32 #include <QtCore/QObject>
33 
34 #if 0 < HAVE_SCRIPTS
35 # include <QtScript/QScriptEngine>
36 # include <QtScript/QScriptValue>
37 #endif
38 
39 #include <SgParameterCfg.h>
40 #include <SgParametersDescriptor.h>
41 
42 
43 
44 
45 class QString;
46 
47 extern const QString str_WRONG;
48 
49 extern const QString str_EstimateNo;
50 extern const QString str_EstimateArc;
51 extern const QString str_EstimateLocal;
52 extern const QString str_EstimatePwl;
53 extern const QString str_EstimateStochastic;
54 
55 extern const QString str_Clocks;
56 extern const QString str_Zenith;
57 extern const QString str_AtmGrad;
58 extern const QString str_Cable;
59 extern const QString str_AxisOffset;
60 extern const QString str_StnCoo;
61 extern const QString str_StnVel;
62 extern const QString str_SrcCoo;
63 extern const QString str_SrcSsm;
64 extern const QString str_PolusXy;
65 extern const QString str_PolusXyR;
66 extern const QString str_PolusUt1;
67 extern const QString str_PolusUt1R;
68 extern const QString str_PolusNut;
69 extern const QString str_PolusNutR;
70 extern const QString str_Bl_Clk;
71 extern const QString str_Bl_Length;
72 extern const QString str_Test;
73 
74 
75 
76 /***===================================================================================================*/
83 {
84  Q_OBJECT
85  Q_ENUMS (ParMode ParIdx)
86 
87 public:
88  enum ParMode
89  {
91 // EstimateGlobal = SgParameterCfg::PM_GLB,
96  };
97  enum ParIdx
98  {
117  };
118  //enum StochasticType {ST_WHITENOISE=0, ST_MARKOVPROCESS=1, ST_RANDWALK=2};
119 
120 
122  : QObject(parent) {parametersDescriptor_=&descr;};
123 
125 
126 
127 
128 signals:
131 
132 
133 public slots:
134  inline void unsetAllParameters()
136  inline void unsetParameter (ParIdx idx)
138 
139  void setMode4Parameter (ParIdx idx, ParMode mode);
140 
141  inline double getWhiteNoise(ParIdx idx)
142  {return parametersDescriptor_->
143  parameter((SgParametersDescriptor::ParIdx)idx).getWhiteNoise();};
144 
145 
146  inline void setConvAPriori(ParIdx idx, double d)
148  parameter((SgParametersDescriptor::ParIdx)idx).setConvAPriori(d);};
149  inline void setPwlAPriori(ParIdx idx, double d)
151  parameter((SgParametersDescriptor::ParIdx)idx).setPwlAPriori(d);};
152  inline void setStocAPriori(ParIdx idx, double d)
154  parameter((SgParametersDescriptor::ParIdx)idx).setStocAPriori(d);};
155  inline void setWhiteNoise(ParIdx idx, double d)
157  parameter((SgParametersDescriptor::ParIdx)idx).setWhiteNoise(d);};
158  inline void setArcStep(ParIdx idx, double d)
160  parameter((SgParametersDescriptor::ParIdx)idx).setArcStep(d);};
161  inline void setPwlStep(ParIdx idx, double d)
163  parameter((SgParametersDescriptor::ParIdx)idx).setPwlStep(d);};
164  inline void setPwlNumOfPolynomials(ParIdx idx, int n)
166  parameter((SgParametersDescriptor::ParIdx)idx).setPwlNumOfPolynomials(n);};
167 
168 
169  inline void setMode4Parameters(ParMode mode, const QList<ParIdx>& list)
172  inline void unsetParameters (const QList<ParIdx>& list)
174 
175 
176 
177 
178 
179 private:
181 };
182 /*=====================================================================================================*/
183 
184 
185 
186 
187 #if 0 < HAVE_SCRIPTS
188 
189 Q_DECLARE_METATYPE(NsScrPrx4ParametersDescriptor::ParIdx);
191 Q_DECLARE_METATYPE(NsScrPrx4ParametersDescriptor::ParMode);
192 
193 #endif
194 
195 
196 
197 
198 
199 
200 
201 
202 
203 
204 
205 
206 
207 
208 
209 
210 /*=====================================================================================================*/
211 //
212 // aux functions:
213 //
214 #if 0 < HAVE_SCRIPTS
215 
216 #if QT_VERSION >= 0x040800
217 inline QScriptValue toScriptValue4ParIdx(QScriptEngine */*eng*/,
219 {
220  return
239 };
240 #else
241 inline QScriptValue toScriptValue4ParIdx(QScriptEngine *eng,
243 {
244  return QScriptValue(eng, str_WRONG);
245 };
246 #endif
247 
248 
249 inline void fromScriptValue4ParIdx(const QScriptValue &obj, NsScrPrx4ParametersDescriptor::ParIdx &i)
250 {
251  i = (NsScrPrx4ParametersDescriptor::ParIdx) obj.toInt32();
252 };
253 
254 
255 
256 
257 #if QT_VERSION >= 0x040800
258 inline QScriptValue toScriptValue4ParMode(QScriptEngine */*eng*/,
260 {
261  return
267 };
268 #else
269 inline QScriptValue toScriptValue4ParMode(QScriptEngine *eng,
271 {
272  return QScriptValue(eng, str_WRONG);
273 };
274 #endif
275 
276 
277 inline void fromScriptValue4ParMode(const QScriptValue &obj,
279 {
280  m = (NsScrPrx4ParametersDescriptor::ParMode) obj.toInt32();
281 };
282 
283 
284 #endif // SCRIPT_SUPPORT
285 
286 
287 /*=====================================================================================================*/
288 #endif // NS_SCR_PRX_4_PARAMETERS_DESCRIPTOR_H
const QString str_PolusXyR
const QString str_EstimateStochastic
const QString str_Test
const QString str_Zenith
const QString str_AtmGrad
const QString str_PolusUt1
const QString str_PolusNutR
const QString str_EstimateArc
const QString str_SrcSsm
const QString str_Bl_Clk
const QString str_PolusUt1R
const QString str_PolusXy
const QString str_Clocks
const QString str_SrcCoo
const QString str_AxisOffset
const QString str_WRONG
const QString str_PolusNut
const QString str_EstimateNo
const QString str_StnCoo
const QString str_StnVel
const QString str_EstimatePwl
const QString str_EstimateLocal
const QString str_Bl_Length
const QString str_Cable
NsScrPrx4ParametersDescriptor(SgParametersDescriptor &descr, QObject *parent=0)
void setMode4Parameters(ParMode mode, const QList< ParIdx > &list)
void setMode4Parameter(ParIdx idx, ParMode mode)
SgParametersDescriptor * parametersDescriptor_
void unsetParameters(const QList< ParIdx > &list)
void unsetParameters(const QList< ParIdx > &)
void setMode4Parameters(SgParameterCfg::PMode, const QList< ParIdx > &)
@ Idx_SRCCOO
index for source coordinates
@ Idx_POLUSXY
index for EOP: polar motion
@ Idx_POLUSXYR
index for EOP: polar motion
@ Idx_STNCOO
index for station coordinates
@ Idx_POLUSUT1R
index for EOP: d(UT1-UTC) Rate
@ Idx_ATMGRAD
index for atmospheric gradients
@ Idx_POLUSNUT
index for EOP: nutation angles
@ Idx_POLUSUT1
index for EOP: d(UT1-UTC)
@ Idx_CABLE
index for cable corrections
@ Idx_POLUSNUTR
index for EOP: nutation angles
@ Idx_TEST
index for test purposes
@ Idx_BL_CLK
index for baseline clocks
@ Idx_STNVEL
index for station velocities
@ Idx_SRCSSM
index for source SSM
@ Idx_BL_LENGTH
index for baseline length
@ Idx_ZENITH
index for wet zenith delay
@ Idx_CLOCK_0
index for clocks (order #0)
@ Idx_AXISOFFSET
index for axis offset