General Purpose Geodetic Library
SgGuiVlbiBaselineList.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 <SgGuiVlbiBaselineList.h>
24 
25 #if QT_VERSION >= 0x050000
26 # include <QtWidgets/QBoxLayout>
27 # include <QtWidgets/QCheckBox>
28 # include <QtWidgets/QGridLayout>
29 # include <QtWidgets/QGroupBox>
30 # include <QtWidgets/QLabel>
31 # include <QtWidgets/QLineEdit>
32 # include <QtWidgets/QPushButton>
33 #else
34 # include <QtGui/QBoxLayout>
35 # include <QtGui/QCheckBox>
36 # include <QtGui/QGridLayout>
37 # include <QtGui/QGroupBox>
38 # include <QtGui/QLabel>
39 # include <QtGui/QLineEdit>
40 # include <QtGui/QPushButton>
41 #endif
42 
43 
44 
45 
46 #include <SgLogger.h>
47 #include <SgTaskConfig.h>
48 #include <SgVlbiBand.h>
49 #include <SgVlbiSession.h>
50 
51 
52 
53 
54 
56 {
58  BCI_NAME = 1,
61  //
72 // BCI_S_WRMS_RAT = 6,
73 // BCI_S_SIG0_RAT = 8,
74  //
83 };
84 
85 
86 
87 
88 /*=======================================================================================================
89 *
90 * SgGuiVlbiBaselineItem METHODS:
91 *
92 *======================================================================================================*/
94 {
95  int column=treeWidget()->sortColumn();
96  double dL, dR;
97  bool isOk;
98  const SgVlbiBaselineInfo *oBl=((const SgGuiVlbiBaselineItem&)other).getBlInfo();
99  //
100  // sort by normalized value of the estimated clock offset:
101  if (column == BCI_S_CLK_EST && blInfo_ && oBl)
102  {
103  if (blInfo_->dClockSigma()==0.0 && oBl->dClockSigma()!=0.0)
104  return true;
105  else if (blInfo_->dClockSigma()!=0.0 && oBl->dClockSigma()==0.0)
106  return false;
107  else if (blInfo_->dClockSigma()!=0.0 && oBl->dClockSigma()!=0.0)
108  return fabs(blInfo_->dClock()/blInfo_->dClockSigma()) < fabs(oBl->dClock()/oBl->dClockSigma());
109  };
110  //
111  // if can be converted to double sort by value:
112  dL = text(column).toDouble(&isOk);
113  if (isOk)
114  {
115  dR = other.text(column).toDouble(&isOk);
116  if (isOk)
117  return dL < dR;
118  };
119  // otherwice, do as usual:
120  return QTreeWidgetItem::operator<(other);
121 };
122 /*=====================================================================================================*/
123 
124 
125 
126 
127 /*=======================================================================================================
128 *
129 * SgGuiVlbiBaselineList METHODS:
130 *
131 *======================================================================================================*/
133  SgObjectBrowseMode mode, QMap<QString, SgVlbiBaselineInfo*>* aMap,
134  QWidget* parent, Qt::WindowFlags f)
135  : QWidget(parent, f),
136  ownerName_(session->getName()),
137  refClockStations_(),
138  bClockShiftStrong_(QColor( 0,105,205)),
139  bClockShiftOk_ (QColor( 0, 0, 0)),
140  bClockShiftWeak_ (QColor(240,160, 20)),
141  bClockShiftBad_ (QColor(240, 15, 90))
142 // bClockShiftStrong_(QColor( 0,160, 20)),
143 {
144  session_ = session;
145  cfg_ = cfg;
146  QString str;
147  QBoxLayout *layout=new QVBoxLayout(this);
148  double d;
149  scl4delay_ = 1.0e12;
150  scl4rate_ = 1.0e15;
151  browseMode_ = mode;
152  baselinesByName_ = aMap;
153  constColumns_ = -1;
154 
155  QStringList headerLabels;
156  headerLabels
157  << "Idx"
158  << "Name"
159  << "Tot.Obs"
160  << "Prc.Obs"
161  ;
162  switch (browseMode_)
163  {
164  case OBM_BAND:
165  // constColumns_ = 12;
166  headerLabels
167  << "Disp(ps)"
168  << "Disp(fs/s)"
169  << "Sig0(ps)"
170  << "Sig0(fs/s)"
171  << "WRMS(ps)"
172  << "WRMS(fs/s)"
173  << "Ambig.Spc"
174  << "#Channels"
175  ;
176  break;
177  case OBM_SESSION:
178  constColumns_ = 9;
179  headerLabels
180  << "length(m)"
181  << "WRMS(ps)"
182 // << "WRMS(fs/s)"
183  << "Sig0(ps)"
184 // << "Sig0(fs/s)"
185  << "Est.Clk"
186  << "ClkVal"
187  << "ClkSig"
188  << "Omit"
189  << "IonGrd"
190  << "IonPhd"
191 // << "Bind ZDel"
192  ;
193  break;
194  case OBM_PROJECT:
195  break;
196  };
197 
199  tweBaselines_->setColumnCount(headerLabels.count());
200  tweBaselines_->setHeaderLabels(headerLabels);
201 
202  QMap<QString, SgVlbiBaselineInfo*>::const_iterator i = baselinesByName_->constBegin();
203  for (; i!=baselinesByName_->constEnd(); ++i)
204  {
205  SgVlbiBaselineInfo* blInfo = i.value();
206 
208  item->setBlInfo(blInfo);
209  item->setText (BCI_NUMBER, str.sprintf("%4d", blInfo->getIdx()));
210  item->setData (BCI_NUMBER, Qt::TextAlignmentRole, Qt::AlignRight);
211 
212  item->setText (BCI_NAME, blInfo->getKey());
213 
214  item->setText (BCI_TOT_OBS, str.sprintf("%7d", blInfo->numTotal(DT_DELAY)));
215  item->setData (BCI_TOT_OBS, Qt::TextAlignmentRole, Qt::AlignRight);
216 
217  item->setText (BCI_PRC_OBS, str.sprintf("%7d", blInfo->numProcessed(DT_DELAY)));
218  item->setData (BCI_PRC_OBS, Qt::TextAlignmentRole, Qt::AlignRight);
219 
221  {
222  item->setText (BCI_S_LENGTH, str.sprintf("%12.1f", blInfo->getLength()));
223  item->setData (BCI_S_LENGTH, Qt::TextAlignmentRole, Qt::AlignRight);
224 
225  item->setText (BCI_S_WRMS_DEL, str.sprintf("%11.1f", blInfo->wrms(DT_DELAY)*scl4delay_));
226  item->setData (BCI_S_WRMS_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
227 
228 // item->setText (BCI_S_WRMS_RAT, str.sprintf("%11.1f", blInfo->wrms(DT_RATE)*scl4rate_));
229 // item->setData (BCI_S_WRMS_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
230 
231  item->setText (BCI_S_SIG0_DEL, str.sprintf("%11.1f", blInfo->getSigma2add(DT_DELAY)*scl4delay_));
232  item->setData (BCI_S_SIG0_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
233 
234 // item->setText (BCI_S_SIG0_RAT, str.sprintf("%11.1f", blInfo->getSigma2add(DT_RATE)*scl4rate_));
235 // item->setData (BCI_S_SIG0_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
236 
237  item->setText (BCI_S_CLK_VAL, str.sprintf("%.1f", blInfo->dClock()*scl4delay_));
238  item->setData (BCI_S_CLK_VAL, Qt::TextAlignmentRole, Qt::AlignRight);
239 
240  item->setText (BCI_S_CLK_SIG, str.sprintf("%.1f", blInfo->dClockSigma()*scl4delay_));
241  item->setData (BCI_S_CLK_SIG, Qt::TextAlignmentRole, Qt::AlignRight);
242 
243  d = blInfo->dClockSigma()==0.0?1.0:fabs(blInfo->dClock()/blInfo->dClockSigma());
244  if (blInfo->dClockSigma()==0.0 || d>=3.0)
245  {
246  if (fabs(blInfo->dClock())>10.0e-12)
247  item->setForeground(BCI_S_CLK_EST, bClockShiftStrong_);
248  else
249  item->setForeground(BCI_S_CLK_EST, bClockShiftOk_);
250  }
251  else if (1.0<=d && d<3.0)
252  item->setForeground(BCI_S_CLK_EST, bClockShiftWeak_);
253  else
254  item->setForeground(BCI_S_CLK_EST, bClockShiftBad_);
255  QFont font(item->font(7));
256  font.setBold(true);
257 
258  item->setFont(BCI_S_CLK_EST, font);
259  item->setText(BCI_S_CLK_EST, blInfo->isAttr(SgVlbiBaselineInfo::Attr_ESTIMATE_CLOCKS)? "Y" : "");
260  item->setData(BCI_S_CLK_EST, Qt::TextAlignmentRole, Qt::AlignCenter);
261 
262  item->setText (BCI_S_IGNORE, blInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID)? "X" : "");
263  item->setData (BCI_S_IGNORE, Qt::TextAlignmentRole, Qt::AlignCenter);
264 
265  item->setText(BCI_S_IONO4GRD, blInfo->isAttr(SgVlbiBaselineInfo::Attr_USE_IONO4GRD)? "Y" : "");
266  item->setData(BCI_S_IONO4GRD, Qt::TextAlignmentRole, Qt::AlignCenter);
267  item->setText(BCI_S_IONO4PHD, blInfo->isAttr(SgVlbiBaselineInfo::Attr_USE_IONO4PHD)? "Y" : "");
268  item->setData(BCI_S_IONO4PHD, Qt::TextAlignmentRole, Qt::AlignCenter);
269 // item->setText(BCI_S_BIND_TRP, blInfo->isAttr(SgVlbiBaselineInfo::Attr_BIND_TROPOSPHERE)? "Y" : "");
270 // item->setData(BCI_S_BIND_TRP, Qt::TextAlignmentRole, Qt::AlignCenter);
271  }
272  else if (browseMode_==OBM_BAND)
273  {
274  item->setText (BCI_B_DISP_DEL, str.sprintf("%.1f", blInfo->dispersion(DT_DELAY)*scl4delay_));
275  item->setData (BCI_B_DISP_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
276 
277  item->setText (BCI_B_DISP_RAT, str.sprintf("%.1f", blInfo->dispersion(DT_RATE)*scl4rate_));
278  item->setData (BCI_B_DISP_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
279 
280  item->setText (BCI_B_SIG0_DEL, str.sprintf("%.1f", blInfo->getSigma2add(DT_DELAY)*scl4delay_));
281  item->setData (BCI_B_SIG0_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
282 
283  item->setText (BCI_B_SIG0_RAT, str.sprintf("%.1f", blInfo->getSigma2add(DT_RATE)*scl4rate_));
284  item->setData (BCI_B_SIG0_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
285 
286  item->setText (BCI_B_WRMS_DEL, str.sprintf("%.1f", blInfo->wrms(DT_DELAY)*scl4delay_));
287  item->setData (BCI_B_WRMS_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
288 
289  item->setText (BCI_B_WRMS_RAT, str.sprintf("%.1f", blInfo->wrms(DT_RATE)*scl4rate_));
290  item->setData (BCI_B_WRMS_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
291 
292  item->setText (BCI_B_AMBIG_SP, str.sprintf("%.2f", blInfo->getTypicalGrdAmbigSpacing()*1.0e9));
293  item->setData (BCI_B_AMBIG_SP, Qt::TextAlignmentRole, Qt::AlignRight);
294 
295  item->setText (BCI_B_NUM_CHAN, str.sprintf("%d", blInfo->getTypicalNumOfChannels()));
296  item->setData (BCI_B_NUM_CHAN, Qt::TextAlignmentRole, Qt::AlignRight);
297  };
298  };
299 
300  tweBaselines_->header()->resizeSections(QHeaderView::ResizeToContents);
301 #if QT_VERSION >= 0x050000
302  tweBaselines_->header()->setSectionResizeMode(QHeaderView::Interactive);
303 #else
304  tweBaselines_->header()->setResizeMode(QHeaderView::Interactive);
305 #endif
306  tweBaselines_->header()->setStretchLastSection(false);
307 
308  tweBaselines_->setSortingEnabled(true);
309  tweBaselines_->setUniformRowHeights(true);
310  tweBaselines_->sortByColumn(1, Qt::AscendingOrder);
311  tweBaselines_->setFocus();
312  tweBaselines_->setItemsExpandable(false);
313  tweBaselines_->setAllColumnsShowFocus(true);
314 
315  layout->addWidget(tweBaselines_);
316 
317  if (browseMode_!=OBM_BAND)
318  connect(tweBaselines_,
319  SIGNAL(moveUponItem(QTreeWidgetItem*, int, Qt::MouseButton, Qt::KeyboardModifiers)),
320  SLOT (toggleEntryMoveEnable(QTreeWidgetItem*, int, Qt::MouseButton, Qt::KeyboardModifiers)));
321  connect(tweBaselines_,
322  SIGNAL(itemDoubleClicked (QTreeWidgetItem*, int)),
323  SLOT (entryDoubleClicked(QTreeWidgetItem*, int)));
324 };
325 
326 
327 
328 //
329 void SgGuiVlbiBaselineList::addRefClockStation(const QString& stName)
330 {
331  bool isContains=false;
332  for (int i=0; i<refClockStations_.size(); i++)
333  if (refClockStations_.at(i) == stName)
334  isContains = true;
335  if (isContains)
336  {
338  "addRefClockStation(): the station " + stName +
339  " already is in the reference clock stations list");
340  return;
341  };
342  refClockStations_.append(stName);
343 };
344 
345 
346 
347 //
348 void SgGuiVlbiBaselineList::delRefClockStation(const QString& stName)
349 {
350  bool isContains=false;
351  isContains = refClockStations_.removeOne(stName);
352  if (!isContains)
353  {
355  "delRefClockStation(): cannot remove the station " + stName +
356  " from the reference clock stations list");
357  return;
358  };
359 };
360 
361 
362 
363 //
365  Qt::MouseButton /* mouseButtonState */, Qt::KeyboardModifiers /* modifiers */)
366 {
367  if (!item) // may be NULL
368  return;
369 
370  bool isTmp;
371  SgVlbiBaselineInfo* blInfo=((SgGuiVlbiBaselineItem*)item)->getBlInfo();
372 
373  switch (n)
374  {
375  case BCI_S_IGNORE:
377  item->setText(n, blInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID)? "X" : "");
378  break;
379  case BCI_S_CLK_EST:
380  isTmp = false;
381  for (int i=0; i<refClockStations_.size(); i++)
382  if (blInfo->getKey().contains(refClockStations_.at(i)))
383  isTmp = true;
384  if (!isTmp || blInfo->isAttr(SgVlbiBaselineInfo::Attr_ESTIMATE_CLOCKS)) // we are able to deselect
385  {
387  item->setText(n, blInfo->isAttr(SgVlbiBaselineInfo::Attr_ESTIMATE_CLOCKS)? "Y" : "");
388  };
389  break;
390  case BCI_S_IONO4GRD:
392  item->setText(n, blInfo->isAttr(SgVlbiBaselineInfo::Attr_USE_IONO4GRD)? "Y" : "");
393  break;
394  case BCI_S_IONO4PHD:
396  item->setText(n, blInfo->isAttr(SgVlbiBaselineInfo::Attr_USE_IONO4PHD)? "Y" : "");
397  break;
398 // case BCI_S_BIND_TRP:
399 // blInfo->xorAttr(SgVlbiBaselineInfo::Attr_BIND_TROPOSPHERE);
400 // item->setText(n, blInfo->isAttr(SgVlbiBaselineInfo::Attr_BIND_TROPOSPHERE)? "Y" : "");
401 // break;
402  default:
403  //std::cout << "default, n=" << n << "\n";
404  break;
405  };
406 };
407 
408 
409 
410 //
412 {
413  if (!item || column>=constColumns_)
414 // if (!item)
415  return;
416  SgVlbiBaselineInfo *blInfo = ((SgGuiVlbiBaselineItem*)item)->getBlInfo();
417  if (blInfo)
418  {
420  ownerName_, this);
421  connect(biEditor, SIGNAL(contentModified(bool)), SLOT(modifyBaselineInfo(bool)));
422  biEditor->show();
423  };
424 };
425 
426 
427 
428 //
430 {
431  if (isModified)
432  updateContent();
433 };
434 
435 
436 
437 //
439 {
440  QString str;
441  SgVlbiBaselineInfo *blInfo=NULL;
442  SgGuiVlbiBaselineItem *item=NULL;
443  QTreeWidgetItemIterator it(tweBaselines_);
444  double d;
445  while (*it)
446  {
447  item = (SgGuiVlbiBaselineItem*)(*it);
448  blInfo = item->getBlInfo();
449  item->setText(BCI_NUMBER, str.sprintf("%4d", blInfo->getIdx()));
450  item->setText(BCI_NAME, blInfo->getKey());
451  item->setText(BCI_TOT_OBS, str.sprintf("%7d", blInfo->numTotal(DT_DELAY)));
452  item->setText(BCI_PRC_OBS, str.sprintf("%7d", blInfo->numProcessed(DT_DELAY)));
453  //
455  {
456  item->setText(BCI_S_WRMS_DEL, str.sprintf("%11.1f", blInfo->wrms(DT_DELAY)*scl4delay_));
457 // item->setText(BCI_S_WRMS_RAT, str.sprintf("%11.1f", blInfo->wrms(DT_RATE)*scl4rate_));
458 
459  item->setText(BCI_S_SIG0_DEL, str.sprintf("%11.1f", blInfo->getSigma2add(DT_DELAY)*scl4delay_));
460 // item->setText(BCI_S_SIG0_RAT, str.sprintf("%11.1f", blInfo->getSigma2add(DT_RATE )*scl4rate_));
461 
462  item->setText(BCI_S_CLK_VAL, str.sprintf("%.1f", blInfo->dClock()*scl4delay_));
463  item->setText(BCI_S_CLK_SIG, str.sprintf("%.1f", blInfo->dClockSigma()*scl4delay_));
464 
465  item->setText(BCI_S_IGNORE, blInfo->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID)? "X" : "");
466  //
467  d = blInfo->dClockSigma()==0.0?1.0:fabs(blInfo->dClock()/blInfo->dClockSigma());
468  if (blInfo->dClockSigma()==0.0 || d>=3.0)
469  {
470  if (fabs(blInfo->dClock())>10.0e-12)
471  item->setForeground(BCI_S_CLK_EST, bClockShiftStrong_);
472  else
473  item->setForeground(BCI_S_CLK_EST, bClockShiftOk_);
474  }
475  else if (1.0<=d && d<3.0)
476  item->setForeground(BCI_S_CLK_EST, bClockShiftWeak_);
477  else
478  item->setForeground(BCI_S_CLK_EST, bClockShiftBad_);
479  item->setText(BCI_S_CLK_EST, blInfo->isAttr(SgVlbiBaselineInfo::Attr_ESTIMATE_CLOCKS)? "Y" : "");
480  item->setText(BCI_S_IONO4GRD, blInfo->isAttr(SgVlbiBaselineInfo::Attr_USE_IONO4GRD)? "Y" : "");
481  item->setText(BCI_S_IONO4PHD, blInfo->isAttr(SgVlbiBaselineInfo::Attr_USE_IONO4PHD)? "Y" : "");
482 // item->setText(BCI_S_BIND_TRP, blInfo->isAttr(SgVlbiBaselineInfo::Attr_BIND_TROPOSPHERE)? "Y" : "");
483  }
484  else if (browseMode_==OBM_BAND)
485  {
486  item->setText (BCI_B_DISP_DEL, str.sprintf("%.1f", blInfo->dispersion(DT_DELAY)*scl4delay_));
487  item->setText (BCI_B_DISP_RAT, str.sprintf("%.1f", blInfo->dispersion(DT_RATE)*scl4rate_));
488  item->setText (BCI_B_SIG0_DEL, str.sprintf("%.1f", blInfo->getSigma2add(DT_DELAY)*scl4delay_));
489  item->setText (BCI_B_SIG0_RAT, str.sprintf("%.1f", blInfo->getSigma2add(DT_RATE)*scl4rate_));
490  item->setText (BCI_B_WRMS_DEL, str.sprintf("%.1f", blInfo->wrms(DT_DELAY)*scl4delay_));
491  item->setText (BCI_B_WRMS_RAT, str.sprintf("%.1f", blInfo->wrms(DT_RATE)*scl4rate_));
492  };
493  ++it;
494  };
495 };
496 /*=====================================================================================================*/
497 
498 
499 
500 
501 /*=======================================================================================================
502 *
503 * SgGuiVlbiBlnInfoEditor METHODS:
504 *
505 *======================================================================================================*/
507  SgVlbiBaselineInfo* blnInfo, SgObjectBrowseMode mode, const QString& ownerName,
508  QWidget* parent, Qt::WindowFlags flags)
509  : QDialog(parent, flags)
510 {
511  static const QString attrNames[] =
512  {
513  QString("Ignore the baseline"),
514  QString("Estimate the clock shift for the baseline"),
515  QString("Use ionosphere correction for group delay (if available)"),
516  QString("Use ionosphere correction for phase delay (if available)"),
517  QString("Bind the zenith delays of the two stations"),
518  QString("Do not perform weight corrections for this baseline"),
519  };
520  QSize btnSize;
521  QBoxLayout *mainLayout, *vLayout, *hLayout;
522  QGroupBox *gbox;
523 
524  session_ = session;
525  cfg_ = cfg;
526  baselineInfo_ = blnInfo;
527  browseMode_ = mode;
528  isModified_ = false;
529 
530  switch (browseMode_)
531  {
532  case OBM_BAND:
533  setWindowTitle("The baseline " + baselineInfo_->getKey() + " at the " + ownerName + "-Band");
534  break;
535  case OBM_SESSION:
536  setWindowTitle("The baseline " + baselineInfo_->getKey() + " at the " + ownerName + " session");
537  break;
538  case OBM_PROJECT:
539  setWindowTitle("The baseline " + baselineInfo_->getKey() + " in the " + ownerName + " project");
540  break;
541  };
542 
543  //
544  mainLayout = new QVBoxLayout(this);
545  //
546  // attributes:
547  gbox = new QGroupBox("Attributes of Baseline", this);
548  vLayout = new QVBoxLayout(gbox);
549  for (int i=0; i<6; i++)
550  {
551  cbAttributes_[i] = new QCheckBox(attrNames[i], gbox);
552  cbAttributes_[i]->setMinimumSize(cbAttributes_[i]->sizeHint());
553  vLayout->addWidget(cbAttributes_[i]);
554  };
561  mainLayout->addWidget(gbox, 10);
562  //
563  // aux sigmas:
564  gbox = new QGroupBox("Sigmas for rewighting", this);
565  QGridLayout *grid = new QGridLayout(gbox);
566 
567  grid->addWidget(new QLabel("Additional sigma for delays (ps):", gbox), 0, 0);
568  leAuxSigma4Delay_ = new QLineEdit(gbox);
569  leAuxSigma4Delay_->setText(QString("").sprintf("%.2f", baselineInfo_->getSigma2add(DT_DELAY)*1.0E12));
570  grid->addWidget(leAuxSigma4Delay_, 0, 1);
571 
572  grid->addWidget(new QLabel("Additional sigma for rates (fs/s):", gbox), 1, 0);
573  leAuxSigma4Rate_ = new QLineEdit(gbox);
574  leAuxSigma4Rate_->setText(QString("").sprintf("%.2f", baselineInfo_->getSigma2add(DT_RATE)*1.0E15));
575  grid->addWidget(leAuxSigma4Rate_, 1, 1);
576 
577  mainLayout->addWidget(gbox, 10);
578  //
579  // estimation of baseline clock shift:
580  gbox = new QGroupBox("Esimtation of baseline clock shift", this);
581  grid = new QGridLayout(gbox);
582  grid->addWidget(new QLabel("Value of clocks offset (ps):", gbox), 0, 0);
583  grid->addWidget(
584  new QLabel(QString("").sprintf("%.2f", baselineInfo_->dClock()*1.0e12), gbox), 0, 1);
585  grid->addWidget(new QLabel("Std.dev of clocks offset (ps):", gbox), 1, 0);
586  grid->addWidget(
587  new QLabel(QString("").sprintf("%.2f", baselineInfo_->dClockSigma()*1.0e12), gbox), 1, 1);
588 
589  mainLayout->addWidget(gbox, 10);
590 
591  //
592  //
593  QPushButton *bOk = new QPushButton("OK", this);
594  QPushButton *bCancel = new QPushButton("Cancel", this);
595  bOk->setDefault(true);
596 
597  bCancel->setMinimumSize((btnSize=bCancel->sizeHint()));
598  bOk->setMinimumSize(btnSize);
599  //
600 
601  hLayout = new QHBoxLayout();
602  mainLayout->addSpacing(15);
603  mainLayout->addStretch(1);
604  mainLayout->addLayout(hLayout);
605 
606  hLayout->addStretch(1);
607  hLayout->addWidget(bOk);
608  hLayout->addWidget(bCancel);
609 
610  connect(bOk, SIGNAL(clicked()), SLOT(accept()));
611  connect(bCancel, SIGNAL(clicked()), SLOT(reject()));
612  mainLayout->activate();
613 };
614 
615 
616 
617 //
619 {
620  session_ = NULL;
621  cfg_ = NULL;
622  baselineInfo_ = NULL;
624 };
625 
626 
627 
628 //
630 {
631  acquireData();
632  QDialog::accept();
633  deleteLater();
634 };
635 
636 
637 
638 //
640 {
641  // Attributes:
643  {
645  isModified_ = true;
646  };
648  {
650  isModified_ = true;
651  };
653  {
655  isModified_ = true;
656  };
658  {
660  isModified_ = true;
661  };
663  {
665  isModified_ = true;
666  };
668  {
670  isModified_ = true;
671  };
672  //
673  QString str;
674  bool isOk;
675  double d;
676  str = leAuxSigma4Delay_->text();
677  d = str.toDouble(&isOk);
678  if (isOk && d!=baselineInfo_->getSigma2add(DT_DELAY)*1.0E12)
679  {
680  baselineInfo_->setSigma2add(DT_DELAY, d*1.0E-12);
681  isModified_ = true;
682  // propagate the value to its right place, @band:
683  if (session_ && cfg_)
684  {
686  if (band && band->baselinesByName().contains(baselineInfo_->getKey()))
687  {
688  SgVlbiBaselineInfo *bandBi=band->baselinesByName().value(baselineInfo_->getKey());
689  bandBi->setSigma2add(DT_DELAY, d*1.0E-12);
691  "::acquireData(): the additional delay std.devs were propagated to the " + band->getKey() +
692  "-band for the baseline [" + baselineInfo_->getKey() + "]");
693  }
694  else
695  {
697  "::acquireData(): cannot find baseline [" + baselineInfo_->getKey() + "] for the " +
698  (band?band->getKey():"NULL") + "-band");
699  };
700  }
701  else
703  "::acquireData(): session or config is NULL for the baseline [" +
704  baselineInfo_->getKey() + "]");
705  };
706  str = leAuxSigma4Rate_->text();
707  d = str.toDouble(&isOk);
708  if (isOk && d!=baselineInfo_->getSigma2add(DT_RATE)*1.0E15)
709  {
710  baselineInfo_->setSigma2add(DT_RATE, d*1.0E-15);
711  isModified_ = true;
712  // propagate the value to its right place, @band:
713  if (session_ && cfg_)
714  {
716  if (band && band->baselinesByName().contains(baselineInfo_->getKey()))
717  {
718  SgVlbiBaselineInfo *bandBi=band->baselinesByName().value(baselineInfo_->getKey());
719  bandBi->setSigma2add(DT_RATE, d*1.0E-15);
721  "::acquireData(): the additional rate std.devs were propagated to the " + band->getKey() +
722  "-band for the baseline [" + baselineInfo_->getKey() + "]");
723  }
724  else
725  {
727  "::acquireData(): cannot find baseline [" + baselineInfo_->getKey() + "] for the " +
728  (band?band->getKey():"NULL") + "-band");
729  };
730  }
731  else
733  "::acquireData(): session or config is NULL for the baseline [" +
734  baselineInfo_->getKey() + "]");
735  };
736 };
737 
738 
739 
740 //
742 {
743  isModified_ = isModified_ || isModified;
744 };
745 /*=====================================================================================================*/
746 
747 
748 
749 
750 
751 
752 
753 /*=====================================================================================================*/
@ BCI_B_NUM_CHAN
@ BCI_S_IONO4GRD
@ BCI_B_SIG0_RAT
@ BCI_B_DISP_DEL
@ BCI_B_SIG0_DEL
@ BCI_B_WRMS_RAT
@ BCI_B_AMBIG_SP
@ BCI_B_WRMS_DEL
@ BCI_S_SIG0_DEL
@ BCI_S_IONO4PHD
@ BCI_B_DISP_RAT
@ BCI_S_BIND_TRP
@ BCI_S_WRMS_DEL
SgLogger * logger
Definition: SgLogger.cpp:231
bool operator<(const SgMJD &T1, const SgMJD &T2)
Definition: SgMJD.h:554
SgObjectBrowseMode
Definition: SgObjectInfo.h:46
@ OBM_BAND
Definition: SgObjectInfo.h:46
@ OBM_PROJECT
Definition: SgObjectInfo.h:46
@ OBM_SESSION
Definition: SgObjectInfo.h:46
@ DT_DELAY
Definition: SgWrmsable.h:44
@ DT_RATE
Definition: SgWrmsable.h:45
bool isAttr(uint a) const
Definition: SgAttribute.h:226
void xorAttr(uint a)
Definition: SgAttribute.h:218
void setBlInfo(SgVlbiBaselineInfo *info)
SgVlbiBaselineInfo * getBlInfo()
virtual bool operator<(const QTreeWidgetItem &other) const
SgVlbiBaselineInfo * blInfo_
void delRefClockStation(const QString &)
void entryDoubleClicked(QTreeWidgetItem *, int)
void addRefClockStation(const QString &)
QMap< QString, SgVlbiBaselineInfo * > * baselinesByName_
QList< QString > refClockStations_
SgObjectBrowseMode browseMode_
virtual QString className() const
SgGuiVlbiBaselineList(SgVlbiSession *session, SgTaskConfig *cfg, SgObjectBrowseMode, QMap< QString, SgVlbiBaselineInfo * > *, QWidget *=0, Qt::WindowFlags=0)
void toggleEntryMoveEnable(QTreeWidgetItem *, int, Qt::MouseButton, Qt::KeyboardModifiers)
SgGuiQTreeWidgetExt * tweBaselines_
SgObjectBrowseMode browseMode_
SgVlbiBaselineInfo * baselineInfo_
SgGuiVlbiBlnInfoEditor(SgVlbiSession *session, SgTaskConfig *cfg, SgVlbiBaselineInfo *, SgObjectBrowseMode, const QString &, QWidget *=0, Qt::WindowFlags=0)
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ STATION
Definition: SgLogger.h:75
int getIdx() const
Definition: SgObjectInfo.h:335
double dispersion(DataType, bool=false) const
Definition: SgObjectInfo.h:439
double getSigma2add(DataType) const
Definition: SgObjectInfo.h:367
const QString & getKey() const
Definition: SgObjectInfo.h:319
int numProcessed(DataType dType) const
Definition: SgObjectInfo.h:351
void setSigma2add(DataType dType, double d)
Definition: SgObjectInfo.h:471
double wrms(DataType) const
Definition: SgObjectInfo.h:567
int numTotal(DataType dType) const
Definition: SgObjectInfo.h:343
int getActiveBandIdx() const
Definition: SgTaskConfig.h:873
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
Definition: SgVlbiBand.h:376
@ Attr_USE_IONO4GRD
use ionosphere corrections for group delays;
@ Attr_USE_IONO4PHD
use ionosphere corrections for phase delays;
@ Attr_ESTIMATE_CLOCKS
estimate baseline clocks;
@ Attr_NOT_VALID
omit the baseline;
@ Attr_SKIP_WC
do not make weight corrections for this baseline;
@ Attr_BIND_TROPOSPHERE
the troposphere parameters should be tied between the stations;
int getTypicalNumOfChannels() const
double dClockSigma() const
double getLength() const
double getTypicalGrdAmbigSpacing() const
QList< SgVlbiBand * > & bands()