General Purpose Geodetic Library
SgGuiVlbiStationList.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 
24 #include <SgGuiVlbiStationList.h>
25 
26 
27 #if QT_VERSION >= 0x050000
28 # include <QtWidgets/QBoxLayout>
29 # include <QtWidgets/QButtonGroup>
30 # include <QtWidgets/QGroupBox>
31 # include <QtWidgets/QLabel>
32 # include <QtWidgets/QLineEdit>
33 # include <QtWidgets/QMessageBox>
34 # include <QtWidgets/QPushButton>
35 # include <QtWidgets/QRadioButton>
36 #else
37 # include <QtGui/QBoxLayout>
38 # include <QtGui/QGroupBox>
39 # include <QtGui/QLabel>
40 # include <QtGui/QLineEdit>
41 # include <QtGui/QMessageBox>
42 # include <QtGui/QPushButton>
43 #endif
44 
45 
46 
47 
48 #include <SgGuiParameterCfg.h>
49 #include <SgLogger.h>
50 #include <SgParametersDescriptor.h>
51 
52 
53 
54 
55 
57 {
59  SCI_NAME = 1,
62  //
65  SCI_S_ACM = 6,
70 
73 
76  SCI_S_LC = 15,
77  SCI_S_LZ = 16,
81  //
89 };
90 
91 const QString sCableCalOrigs[] = {"Default", "FSLog", "CDMS", "PCMT"};
92 
93 
94 
95 /*=======================================================================================================
96 *
97 * SgGuiVlbiStationItem METHODS:
98 *
99 *======================================================================================================*/
101 {
102  int column=treeWidget()->sortColumn();
103  double dL, dR;
104  bool isOk;
105  dL = text(column).toDouble(&isOk);
106  if (isOk)
107  {
108  dR = other.text(column).toDouble(&isOk);
109  if (isOk)
110  return dL < dR;
111  };
112  return QTreeWidgetItem::operator<(other);
113 };
114 /*=====================================================================================================*/
115 
116 
117 
118 
119 /*=======================================================================================================
120 *
121 * SgGuiVlbiStationList METHODS:
122 *
123 *======================================================================================================*/
125  QMap<QString, SgVlbiStationInfo*>* map, const SgMJD& t0, QWidget* parent, Qt::WindowFlags f)
126  : QWidget(parent, f)
127 {
128  scl4delay_ = 1.0e12;
129  scl4rate_ = 1.0e15;
130  constColumns_ = -1;
131  t0_ = t0;
132  browseMode_ = mode;
133  stationsByName_ = map;
134  ownerName_ = ownerName;
135  QString str;
136  QBoxLayout *layout = new QVBoxLayout(this);
137  QStringList headerLabels;
138  headerLabels
139  << "Idx"
140  << "Name"
141  << "Tot.Obs"
142  << "Prc.Obs"
143  ;
144  switch (browseMode_)
145  {
146  case OBM_BAND:
147  constColumns_ = 11;
148  headerLabels
149  << "Disp(ps)"
150  << "Disp(fs/s)"
151  << "Sig0(ps)"
152  << "Sig0(fs/s)"
153  << "WRMS(ps)"
154  << "WRMS(fs/s)"
155  << "Clk.Brks"
156  ;
157  break;
158  case OBM_SESSION:
159  constColumns_ = 9;
160  headerLabels
161  << "Scans"
162  << "WRMS(ps)"
163  << "ACM"
164  << "Clk:Brk"
165  << "Clk:n"
166  << "Clk:Ref"
167  << "Omit"
168  << "Cab.Orig"
169  << "Cab.Sgn"
170  << "Cab.Cal"
171  << "Flags"
172  << "LC"
173  << "LZ"
174  << "R:Est"
175  << "R:C"
176  << "AxO:Est"
177  ;
178  break;
179  case OBM_PROJECT:
180  break;
181  };
182  //
183  tweStations_ = new SgGuiQTreeWidgetExt(this);
184  tweStations_->setColumnCount(headerLabels.count());
185  tweStations_->setHeaderLabels(headerLabels);
186  //
187  QMap<QString, SgVlbiStationInfo*>::const_iterator i = stationsByName_->constBegin();
188  for (; i!=stationsByName_->constEnd(); ++i)
189  {
190  SgVlbiStationInfo* stInfo = i.value();
191 
193  item->setStInfo(stInfo);
194  item->setText(SCI_NUMBER, str.sprintf("%4d", stInfo->getIdx()));
195  item->setData(SCI_NUMBER, Qt::TextAlignmentRole, Qt::AlignRight);
196  item->setToolTip(SCI_NUMBER, "Index of a station");
197 
198  item->setText(SCI_NAME, stInfo->getKey());
199  item->setData(SCI_NAME, Qt::TextAlignmentRole, Qt::AlignLeft);
200 
201  item->setText(SCI_TOT_OBS, str.sprintf("%7d", stInfo->numTotal(DT_DELAY)));
202  item->setData(SCI_TOT_OBS, Qt::TextAlignmentRole, Qt::AlignRight);
203 
204  item->setText(SCI_PRC_OBS, str.sprintf("%7d", stInfo->numProcessed(DT_DELAY)));
205  item->setData(SCI_PRC_OBS, Qt::TextAlignmentRole, Qt::AlignRight);
206 
207  if (browseMode_==OBM_BAND)
208  {
209  item->setText(SCI_B_DISP_DEL, str.sprintf("%11.1f", stInfo->dispersion(DT_DELAY)*scl4delay_));
210  item->setData(SCI_B_DISP_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
211  item->setText(SCI_B_DISP_RAT, str.sprintf("%11.1f", stInfo->dispersion(DT_RATE)*scl4rate_));
212  item->setData(SCI_B_DISP_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
213 
214  item->setText(SCI_B_SIG0_DEL, str.sprintf("%11.1f", stInfo->getSigma2add(DT_DELAY)*scl4delay_));
215  item->setData(SCI_B_SIG0_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
216  item->setText(SCI_B_SIG0_RAT, str.sprintf("%11.1f", stInfo->getSigma2add(DT_RATE)*scl4rate_));
217  item->setData(SCI_B_SIG0_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
218 
219  item->setText(SCI_B_WRMS_DEL, str.sprintf("%11.1f", stInfo->wrms(DT_DELAY)*scl4delay_));
220  item->setData(SCI_B_WRMS_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
221  item->setText(SCI_B_WRMS_RAT, str.sprintf("%11.1f", stInfo->wrms(DT_RATE)*scl4rate_));
222  item->setData(SCI_B_WRMS_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
223 
224  item->setText(SCI_B_CLK_BRKS, str.sprintf("%d", stInfo->clockBreaks().size()));
225  item->setData(SCI_B_CLK_BRKS, Qt::TextAlignmentRole, Qt::AlignCenter);
226  //
227  };
229  {
230  item->setText(SCI_S_SCANS, str.sprintf("%7d", stInfo->auxObservationByScanId()->size()));
231  item->setData(SCI_S_SCANS, Qt::TextAlignmentRole, Qt::AlignRight);
232 
233  item->setText(SCI_S_WRMS_DEL, str.sprintf("%11.1f", stInfo->wrms(DT_DELAY)*scl4delay_));
234  item->setData(SCI_S_WRMS_DEL, Qt::TextAlignmentRole, Qt::AlignRight);
235 // item->setText(SCI_S_WRMS_RAT, str.sprintf("%11.1f", stInfo->wrms(DT_RATE)*scl4rate_));
236 // item->setData(SCI_S_WRMS_RAT, Qt::TextAlignmentRole, Qt::AlignRight);
237 
238  item->setText(SCI_S_CLK_BRKS, str.sprintf("%d", stInfo->clockBreaks().size()));
239  item->setData(SCI_S_CLK_BRKS, Qt::TextAlignmentRole, Qt::AlignCenter);
240 
241  item->setText(SCI_S_ACM, stInfo->getNeed2useAPrioriClocks()? "Y" : "");
242  item->setData(SCI_S_ACM, Qt::TextAlignmentRole, Qt::AlignCenter);
243  //
244  //
245  item->setText(SCI_S_IGNORE, stInfo->isAttr(SgVlbiStationInfo::Attr_NOT_VALID)? "X" : "");
246  item->setData(SCI_S_IGNORE, Qt::TextAlignmentRole, Qt::AlignCenter);
247  //
248  item->setText(SCI_S_CBL_ORI, sCableCalOrigs[stInfo->getFlybyCableCalSource()]);
249  item->setData(SCI_S_CBL_ORI, Qt::TextAlignmentRole, Qt::AlignCenter);
250  //
251  item->setText(SCI_S_CBL_SGN, stInfo->getCableCalMultiplierDBCal()==-1.0?"-":
252  (stInfo->getCableCalMultiplierDBCal()==1.0?"+":" "));
253  item->setData(SCI_S_CBL_SGN, Qt::TextAlignmentRole, Qt::AlignCenter);
254  //
255  item->setText(SCI_S_CLK_TERMS, str.sprintf("%2d", stInfo->getClocksModelOrder()));
256  item->setData(SCI_S_CLK_TERMS, Qt::TextAlignmentRole, Qt::AlignRight);
257  //
258  item->setText(SCI_S_REF_CLK, stInfo->isAttr(SgVlbiStationInfo::Attr_REFERENCE_CLOCKS)? "R" : "");
259  item->setData(SCI_S_REF_CLK, Qt::TextAlignmentRole, Qt::AlignCenter);
260  //
261  item->setText(SCI_S_CBL_CAL, stInfo->isAttr(SgVlbiStationInfo::Attr_IGNORE_CABLE_CAL)? "" :
262  (stInfo->isAttr(SgVlbiStationInfo::Attr_INVERSE_CABLE)? "-Y" : "Y"));
263  item->setData(SCI_S_CBL_CAL, Qt::TextAlignmentRole, Qt::AlignCenter);
264  //
265  item->setText(SCI_S_FLAGS,
266  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_BAD_METEO)? "m" : "") +
267  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_ART_METEO)? "a" : "") +
268  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_DONT_ESTIMATE_TRPS)? "-Z" : "")
269  );
270  item->setData(SCI_S_FLAGS, Qt::TextAlignmentRole, Qt::AlignCenter);
271  //
272  item->setText(SCI_S_LC, stInfo->isAttr(SgVlbiStationInfo::Attr_USE_LOCAL_CLOCKS)? "Y" : "");
273  item->setData(SCI_S_LC, Qt::TextAlignmentRole, Qt::AlignCenter);
274  //
275  item->setText(SCI_S_LZ, stInfo->isAttr(SgVlbiStationInfo::Attr_USE_LOCAL_ZENITH)? "Y" : "");
276  item->setData(SCI_S_LZ, Qt::TextAlignmentRole, Qt::AlignCenter);
277  //
278  item->setText(SCI_S_COO_EST, stInfo->isAttr(SgVlbiStationInfo::Attr_ESTIMATE_COO)? "Y" : "");
279  item->setData(SCI_S_COO_EST, Qt::TextAlignmentRole, Qt::AlignCenter);
280  //
281  item->setText(SCI_S_COO_CON, stInfo->isAttr(SgVlbiStationInfo::Attr_CONSTRAIN_COO)? "*" : "");
282  item->setData(SCI_S_COO_CON, Qt::TextAlignmentRole, Qt::AlignCenter);
283  //
284  item->setText(SCI_S_AXO_EST, stInfo->isAttr(SgVlbiStationInfo::Attr_ESTIMATE_AXO)? "Y" : "");
285  item->setData(SCI_S_AXO_EST, Qt::TextAlignmentRole, Qt::AlignCenter);
286  };
287  };
288 
289  tweStations_->header()->resizeSections(QHeaderView::ResizeToContents);
290 #if QT_VERSION >= 0x050000
291  tweStations_->header()->setSectionResizeMode(QHeaderView::Interactive);
292 #else
293  tweStations_->header()->setResizeMode(QHeaderView::Interactive);
294 #endif
295 
296  tweStations_->header()->setStretchLastSection(false);
297 
298  tweStations_->setSortingEnabled(true);
299  tweStations_->setUniformRowHeights(true);
300  tweStations_->sortByColumn(1, Qt::AscendingOrder);
301  tweStations_->setFocus();
302  tweStations_->setItemsExpandable(false);
303  tweStations_->setAllColumnsShowFocus(true);
304  layout->addWidget(tweStations_);
305 
306  if (browseMode_!=OBM_BAND)
307  {
308  connect(tweStations_,
309  SIGNAL(moveUponItem(QTreeWidgetItem*, int, Qt::MouseButton, Qt::KeyboardModifiers)),
310  SLOT (toggleEntryMoveEnable(QTreeWidgetItem*, int, Qt::MouseButton, Qt::KeyboardModifiers))
311  );
312  };
313  connect(tweStations_,
314  SIGNAL(itemDoubleClicked (QTreeWidgetItem*, int)),
315  SLOT (entryDoubleClicked(QTreeWidgetItem*, int))
316  );
317 };
318 
319 
320 
321 //
323  Qt::MouseButton mouseButtonState, Qt::KeyboardModifiers modifiers)
324 {
325  if (!item) // may be NULL
326  return;
327 
328  int n;
329  QString str;
330  SgVlbiStationInfo *stInfo=((SgGuiVlbiStationItem*)item)->getStInfo();
331  switch (column)
332  {
333  case SCI_S_IGNORE:
335  item->setText(SCI_S_IGNORE, stInfo->isAttr(SgVlbiStationInfo::Attr_NOT_VALID)? "X" : "");
336  break;
337  case SCI_S_CLK_TERMS:
338  n = stInfo->getClocksModelOrder();
339  switch (mouseButtonState)
340  {
341  case Qt::LeftButton:
342  if (n>0)
343  n--;
344  break;
345  case Qt::RightButton:
346  if (n<10)
347  n++;
348  break;
349  default:
350  n = 3;
351  break;
352  };
353  stInfo->setClocksModelOrder(n);
354  item->setText(SCI_S_CLK_TERMS, str.sprintf("%2d", stInfo->getClocksModelOrder()));
355  break;
356  case SCI_S_REF_CLK:
359  {
360  item->setText(SCI_S_REF_CLK, "R");
361  emit refClockStationSelected(stInfo->getKey());
362  }
363  else
364  {
365  item->setText(SCI_S_REF_CLK, "");
366  emit refClockStationDeselected(stInfo->getKey());
367  };
368  break;
369  case SCI_S_CBL_CAL:
370  if (modifiers == Qt::ControlModifier)
372  else
375  (stInfo->isAttr(SgVlbiStationInfo::Attr_INVERSE_CABLE)? "-Y" : "Y"));
376  break;
377  case SCI_S_FLAGS:
379  item->setText(SCI_S_FLAGS,
380  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_BAD_METEO)? "m" : "") +
381  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_ART_METEO)? "a" : "") +
382  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_DONT_ESTIMATE_TRPS)? "-Z" : "")
383  );
384  break;
385  case SCI_S_LC:
387  item->setText(SCI_S_LC, stInfo->isAttr(SgVlbiStationInfo::Attr_USE_LOCAL_CLOCKS)? "Y" : "");
388  break;
389  case SCI_S_LZ:
391  item->setText(SCI_S_LZ, stInfo->isAttr(SgVlbiStationInfo::Attr_USE_LOCAL_ZENITH)? "Y" : "");
392  break;
393  case SCI_S_COO_EST:
395  item->setText(SCI_S_COO_EST, stInfo->isAttr(SgVlbiStationInfo::Attr_ESTIMATE_COO)? "Y" : "");
396  break;
397  case SCI_S_COO_CON:
399  item->setText(SCI_S_COO_CON, stInfo->isAttr(SgVlbiStationInfo::Attr_CONSTRAIN_COO)? "*" : "");
400  break;
401  case SCI_S_AXO_EST:
403  item->setText(SCI_S_AXO_EST, stInfo->isAttr(SgVlbiStationInfo::Attr_ESTIMATE_AXO)? "Y" : "");
404  break;
405  default:
406  // std::cout << "default, n=" << n << "\n";
407  break;
408  };
409 };
410 
411 
412 
413 //
415 {
416  if (!item || column>=constColumns_)
417 // if (!item)
418  return;
419  SgVlbiStationInfo *stInfo = ((SgGuiVlbiStationItem*)item)->getStInfo();
420  // std::cout << " column=" << column << ", station: " << qPrintable(stInfo->getKey()) << "\n";
421  if (stInfo)
422  {
424  t0_, this);
425  connect(siEditor, SIGNAL(contentModified(bool)), SLOT(modifyStationInfo(bool)));
426  siEditor->show();
427  };
428 };
429 
430 
431 
432 //
434 {
435  if (isModified)
436  updateContent();
437 };
438 
439 
440 
441 //
443 {
444  QString str;
445  SgVlbiStationInfo *stInfo=NULL;
446  SgGuiVlbiStationItem *item=NULL;
447  QTreeWidgetItemIterator it(tweStations_);
448  while (*it)
449  {
450  item = (SgGuiVlbiStationItem*)(*it);
451  stInfo = item->getStInfo();
452  item->setText(SCI_NUMBER, str.sprintf("%4d", stInfo->getIdx()));
453  item->setText(SCI_NAME, stInfo->getKey());
454  item->setText(SCI_TOT_OBS, str.sprintf("%7d", stInfo->numTotal(DT_DELAY)));
455  item->setText(SCI_PRC_OBS, str.sprintf("%7d", stInfo->numProcessed(DT_DELAY)));
456  if (browseMode_==OBM_BAND)
457  {
458  item->setText(SCI_B_DISP_DEL, str.sprintf("%11.1f", stInfo->dispersion(DT_DELAY)*scl4delay_));
459  item->setText(SCI_B_DISP_RAT, str.sprintf("%11.1f", stInfo->dispersion(DT_RATE )*scl4rate_));
460  item->setText(SCI_B_SIG0_DEL, str.sprintf("%11.1f", stInfo->getSigma2add(DT_DELAY)*scl4delay_));
461  item->setText(SCI_B_SIG0_RAT, str.sprintf("%11.1f", stInfo->getSigma2add(DT_RATE )*scl4rate_));
462  item->setText(SCI_B_WRMS_DEL, str.sprintf("%11.1f", stInfo->wrms(DT_DELAY)*scl4delay_));
463  item->setText(SCI_B_WRMS_RAT, str.sprintf("%11.1f", stInfo->wrms(DT_RATE )*scl4rate_));
464  item->setText(SCI_B_CLK_BRKS, str.sprintf("%d", stInfo->clockBreaks().size()));
465  };
467  {
468  item->setText(SCI_S_SCANS, str.sprintf("%7d", stInfo->auxObservationByScanId()->size()));
469  item->setText(SCI_S_WRMS_DEL, str.sprintf("%11.1f", stInfo->wrms(DT_DELAY)*scl4delay_));
470 // item->setText(SCI_S_WRMS_RAT, str.sprintf("%11.1f", stInfo->wrms(DT_RATE)*scl4rate_));
471  item->setText(SCI_S_CLK_BRKS, str.sprintf("%d", stInfo->clockBreaks().size()));
472  item->setText(SCI_S_ACM, stInfo->getNeed2useAPrioriClocks()? "Y" : "");
473  item->setText(SCI_S_IGNORE, stInfo->isAttr(SgVlbiStationInfo::Attr_NOT_VALID)? "X" : "");
474  item->setText(SCI_S_CBL_ORI, sCableCalOrigs[stInfo->getFlybyCableCalSource()]);
475  item->setText(SCI_S_CLK_TERMS,str.sprintf("%2d", stInfo->getClocksModelOrder()));
476  item->setText(SCI_S_REF_CLK, stInfo->isAttr(SgVlbiStationInfo::Attr_REFERENCE_CLOCKS)? "R" : "");
477  item->setText(SCI_S_CBL_CAL, stInfo->isAttr(SgVlbiStationInfo::Attr_IGNORE_CABLE_CAL)? "" :
478  (stInfo->isAttr(SgVlbiStationInfo::Attr_INVERSE_CABLE)? "-Y" : "Y"));
479  item->setText(SCI_S_FLAGS,
480  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_BAD_METEO)? "m" : "") +
481  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_ART_METEO)? "a" : "") +
482  QString(stInfo->isAttr(SgVlbiStationInfo::Attr_DONT_ESTIMATE_TRPS)? "-Z" : "")
483  );
484  item->setText(SCI_S_LC, stInfo->isAttr(SgVlbiStationInfo::Attr_USE_LOCAL_CLOCKS)? "Y" : "");
485  item->setText(SCI_S_LZ, stInfo->isAttr(SgVlbiStationInfo::Attr_USE_LOCAL_ZENITH)? "Y" : "");
486  item->setText(SCI_S_COO_EST, stInfo->isAttr(SgVlbiStationInfo::Attr_ESTIMATE_COO)? "Y" : "");
487  item->setText(SCI_S_COO_CON, stInfo->isAttr(SgVlbiStationInfo::Attr_CONSTRAIN_COO)? "*" : "");
488  item->setText(SCI_S_AXO_EST, stInfo->isAttr(SgVlbiStationInfo::Attr_ESTIMATE_AXO)? "Y" : "");
489  };
490  ++it;
491  };
492 };
493 /*=====================================================================================================*/
494 
495 
496 
497 
498 
499 
500 /*=======================================================================================================
501 *
502 * SgGuiVlbiStnInfoEditor METHODS:
503 *
504 *======================================================================================================*/
506  const QString& ownerName, const SgMJD& t0, QWidget* parent, Qt::WindowFlags flags)
507  : QDialog(parent, flags)
508 {
509  static const QString attrNames[] =
510  {
511  QString("Ignore the station"),
512  QString("Clocks of the station are the reference ones"),
513  QString("The station has a bad cable calibration"),
514  QString("The station has an inverted cable calibration"),
515  QString("Metheo data on the station are wrong"),
516  QString("Metheo data on the station are artificial or suspicious"),
517  QString("Do not estimate tropospheric refraction parameters"),
518  };
519  QString str;
520  QSize btnSize;
521  stationInfo_ = stnInfo;
522  browseMode_ = mode;
524  t0_ = t0;
526  bModel_.setT0(t0_);
527 
528  isModified_ = false;
529 
530  switch (browseMode_)
531  {
532  case OBM_BAND:
533  setWindowTitle("The station " + stationInfo_->getKey() + " on the " + ownerName + "-Band");
534  break;
535  case OBM_SESSION:
536  setWindowTitle("The station " + stationInfo_->getKey() + " at " + ownerName + " session");
537  break;
538  case OBM_PROJECT:
539  setWindowTitle("The station " + stationInfo_->getKey() + " of " + ownerName + " project");
540  break;
541  };
542 
543  //
544  QVBoxLayout *mainLayout=new QVBoxLayout(this);
545 
546  // clock breaks:
547  QGroupBox *gBox=new QGroupBox("List of Clock Break Events", this);
548  QBoxLayout *layout=new QVBoxLayout(gBox);
549 
550  QStringList headerLabels;
551  headerLabels
552  << "Epoch of a clock break "
553  << "Jump (ns)"
554  << "Sigma (ns)"
555  << "Dynamic"
556  ;
557  twClockBreaks_ = new QTreeWidget(gBox);
558  twClockBreaks_->setColumnCount(2);
559  twClockBreaks_->setHeaderLabels(headerLabels);
560  //
561  //
562  for (int i=0; i<bModel_.size(); i++)
563  {
564  SgParameterBreak *b=bModel_.at(i);
566  item->setClockBreak(b);
567  item->setText( 0, b->toString(SgMJD::F_YYYYMMDDHHMMSSSS));
568  item->setData( 0, Qt::TextAlignmentRole, Qt::AlignRight);
569  item->setText( 1, QString("").sprintf("%.1f", b->getA0()));
570  item->setData( 1, Qt::TextAlignmentRole, Qt::AlignRight);
571  item->setText( 2, QString("").sprintf("%.1f", b->getS0()));
572  item->setData( 2, Qt::TextAlignmentRole, Qt::AlignRight);
573  item->setText( 3, b->isAttr(SgParameterBreak::Attr_DYNAMIC)?"Y":"N");
574  item->setData( 3, Qt::TextAlignmentRole, Qt::AlignCenter);
575  };
576  twClockBreaks_->header()->resizeSections(QHeaderView::ResizeToContents);
577 #if QT_VERSION >= 0x050000
578  twClockBreaks_->header()->setSectionResizeMode(QHeaderView::Interactive);
579 #else
580  twClockBreaks_->header()->setResizeMode(QHeaderView::Interactive);
581 #endif
582 
583  twClockBreaks_->header()->setStretchLastSection(false);
584  twClockBreaks_->setSortingEnabled(true);
585  twClockBreaks_->setUniformRowHeights(true);
586  twClockBreaks_->sortByColumn(0, Qt::AscendingOrder);
587  twClockBreaks_->setFocus();
588  twClockBreaks_->setItemsExpandable(false);
589  twClockBreaks_->setAllColumnsShowFocus(true);
590  twClockBreaks_->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
591  twClockBreaks_->setMinimumSize(twClockBreaks_->sizeHint());
592  layout->addWidget(twClockBreaks_);
593 
594  QPushButton *bAdd =new QPushButton("Add", this);
595  QPushButton *bEdit =new QPushButton("Edit", this);
596  QPushButton *bDelete=new QPushButton("Delete", this);
597 
598  bDelete->setMinimumSize((btnSize=bDelete->sizeHint()));
599  bAdd->setMinimumSize(btnSize);
600  bEdit->setMinimumSize(btnSize);
601 
602  QBoxLayout *subLayout=new QHBoxLayout();
603  layout->addLayout(subLayout);
604  subLayout->addStretch(1);
605  subLayout->addSpacing(3*btnSize.width());
606  subLayout->addWidget(bAdd);
607  subLayout->addWidget(bEdit);
608  subLayout->addWidget(bDelete);
609 
610  mainLayout->addWidget(gBox);
611 
612  // attributes:
613  if (browseMode_ == OBM_SESSION)
614  {
615  QPushButton *bLClocks=new QPushButton("Edit Clocks", this);
616  QPushButton *bLZenith=new QPushButton("Edit Zenith", this);
617  QGroupBox *gboxAttr=new QGroupBox("Attributes of Station", this);
618  layout = new QVBoxLayout(gboxAttr);
619  layout->setSpacing(layout->spacing()/2);
620  for (int i=0; i<7; i++)
621  {
622  cbAttributes_[i] = new QCheckBox(attrNames[i], gboxAttr);
623  cbAttributes_[i]->setMinimumSize(cbAttributes_[i]->sizeHint());
624  layout->addWidget(cbAttributes_[i]);
625  };
633 
634  // options:
635  mainLayout->addSpacing(15);
636  mainLayout->addWidget(gboxAttr, 10);
637 
638  QRadioButton *rbCccSource[4];
639  QGroupBox *gbox=new QGroupBox("Source of cable calibration correction:", this);
640  QButtonGroup *bgFlybySrcCcc = new QButtonGroup(gbox);
641  layout = new QVBoxLayout(gbox);
642  layout->setSpacing(layout->spacing()/2);
643  for (int i=0; i<4; i++)
644  {
645  rbCccSource[i] = new QRadioButton("Use cable calibration correction from: " +
646  sCableCalSourceNames[i], gbox);
647  rbCccSource[i]->setMinimumSize(rbCccSource[i]->sizeHint());
648  bgFlybySrcCcc->addButton(rbCccSource[i], i);
649  layout->addWidget(rbCccSource[i]);
650  };
652  bgFlybySrcCcc->buttons()[1]->setEnabled(false);
654  bgFlybySrcCcc->buttons()[2]->setEnabled(false);
656  bgFlybySrcCcc->buttons()[3]->setEnabled(false);
657  rbCccSource[stationInfo_->getFlybyCableCalSource()]->setChecked(true);
658  connect(bgFlybySrcCcc, SIGNAL(buttonClicked(int)), SLOT(flybySourceCccFModified(int)));
659  mainLayout->addWidget(gbox, 10);
660 
661 
662  QGridLayout *grid=new QGridLayout();
663  QLabel *label;
664  mainLayout->addLayout(grid);
665  //
666  cbUseAPrioriClocks_ = new QCheckBox("Use user specified a priori clocks", this);
668  cbUseAPrioriClocks_->setMinimumSize(cbUseAPrioriClocks_->sizeHint());
669  grid->addWidget(cbUseAPrioriClocks_, 0,0);
670 
671  label = new QLabel("Offset (s):", this);
672  label->setMinimumSize(label->sizeHint());
673  grid->addWidget(label, 0, 1);
674 
675  leAPrioriClockTerm_0_ = new QLineEdit(str.sprintf("%g", stationInfo_->getAPrioriClockTerm_0()), this);
676  leAPrioriClockTerm_0_->setMinimumWidth(leAPrioriClockTerm_0_->fontMetrics().width("WWWWW"));
677  grid->addWidget(leAPrioriClockTerm_0_, 0,2);
678 
679  label = new QLabel("Rate (s/s):", this);
680  label->setMinimumSize(label->sizeHint());
681  grid->addWidget(label, 1, 1);
682 
683  leAPrioriClockTerm_1_ = new QLineEdit(str.sprintf("%g", stationInfo_->getAPrioriClockTerm_1()), this);
684  leAPrioriClockTerm_1_->setMinimumWidth(leAPrioriClockTerm_1_->fontMetrics().width("WWWWW"));
685  grid->addWidget(leAPrioriClockTerm_1_, 1,2);
686  //
687  //
688  label = new QLabel("Number of polynomials for a clock model:", this);
689  label->setMinimumSize(label->sizeHint());
690  grid->addWidget(label, 2, 0);
691 
692  sbOrder_ = new QSpinBox(this);
693  sbOrder_->setRange( 0, 10);
695  sbOrder_->setMinimumSize(sbOrder_->sizeHint());
696  grid->addWidget(sbOrder_, 2,1, 1,2);
697 
698  switch (stationInfo_->pcClocks()->getPMode())
699  {
700  default:
702  str="No";
703  break;
705  str="Arc";
706  break;
708  str="PWL";
709  break;
711  str="Stc";
712  break;
713  };
714  cbUseLocalClocks_ = new QCheckBox("Use local setup of parameters for clocks (" + str + ")", this);
716  cbUseLocalClocks_->setMinimumSize(cbUseLocalClocks_->sizeHint());
717  grid->addWidget(cbUseLocalClocks_, 3,0);
718 
719  switch (stationInfo_->pcZenith()->getPMode())
720  {
721  default:
723  str="No";
724  break;
726  str="Arc";
727  break;
729  str="PWL";
730  break;
732  str="Stc";
733  break;
734  };
735  cbUseLocalZenith_ = new QCheckBox("Use local setup of parameters for zenith delays (" + str + ")",
736  this);
738  cbUseLocalZenith_->setMinimumSize(cbUseLocalZenith_->sizeHint());
739  grid->addWidget(cbUseLocalZenith_, 4,0);
740 
741  bLClocks->setMinimumSize(bLClocks->sizeHint());
742  grid->addWidget(bLClocks, 3,1, 1,2);
743 
744  bLZenith->setMinimumSize(bLZenith->sizeHint());
745  grid->addWidget(bLZenith, 4,1, 1,2);
746 
747  connect(bLClocks,SIGNAL(clicked()), SLOT(editLocalClocks()));
748  connect(bLZenith,SIGNAL(clicked()), SLOT(editLocalZenith()));
749  };
750 
751  //
752  //
753  //---
754  subLayout = new QHBoxLayout();
755  mainLayout->addSpacing(15);
756  mainLayout->addStretch(1);
757  mainLayout->addLayout(subLayout);
758 
759  QPushButton *bOk=new QPushButton("OK", this);
760  QPushButton *bCancel=new QPushButton("Cancel", this);
761  bOk->setDefault(true);
762 
763  bCancel->setMinimumSize((btnSize=bCancel->sizeHint()));
764  bOk->setMinimumSize(btnSize);
765 
766  subLayout->addStretch(1);
767  subLayout->addWidget(bOk);
768  subLayout->addWidget(bCancel);
769 
770 
771  connect(twClockBreaks_, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),
773 
774  connect(bOk, SIGNAL(clicked()), SLOT(accept()));
775  connect(bAdd, SIGNAL(clicked()), SLOT(insertClockBreakRecord()));
776  connect(bEdit, SIGNAL(clicked()), SLOT(editClockBreakRecord()));
777  connect(bDelete, SIGNAL(clicked()), SLOT(deleteClockBreakRecord()));
778  connect(bCancel, SIGNAL(clicked()), SLOT(reject()));
779 
780  mainLayout->activate();
781 };
782 
783 
784 
785 //
787 {
788  stationInfo_ = NULL;
790 };
791 
792 
793 
794 //
796 {
797  acquireData();
798  QDialog::accept();
799  deleteLater();
800 };
801 
802 
803 
804 //
806 {
807  switch (n)
808  {
809  default:
810  case 0:
812  break;
813  case 1:
815  break;
816  case 2:
818  break;
819  case 3:
821  break;
822  };
823 };
824 
825 
826 
827 //
829 {
830  bool isOk;
831  if (isModified_) // now, the flag could be changed only by clock break editor
833 
834  int l=0;
835  if (browseMode_ == OBM_SESSION)
836  {
837  // Attributes:
839  {
841  isModified_ = true;
842  };
844  {
846  isModified_ = true;
847  };
849  {
851  isModified_ = true;
852  };
854  {
856  isModified_ = true;
857  };
859  {
861  isModified_ = true;
862  };
864  {
866  isModified_ = true;
867  };
868  if (cbAttributes_[6]->isChecked() !=
870  {
872  isModified_ = true;
873  };
874 
876  {
879  isModified_ = true;
880  };
882  {
883  double d;
884  d = leAPrioriClockTerm_0_->text().toDouble(&isOk);
885  if (isOk && d!=stationInfo_->getAPrioriClockTerm_0())
886  {
889  isModified_ = true;
890  };
891  d = leAPrioriClockTerm_1_->text().toDouble(&isOk);
892  if (isOk && d!=stationInfo_->getAPrioriClockTerm_1())
893  {
896  isModified_ = true;
897  };
898  };
899  // Peculiar parameters:
901  {
903  isModified_ = true;
904  };
906  {
908  isModified_ = true;
909  };
910  if ((l=sbOrder_->value()) != stationInfo_->getClocksModelOrder())
911  {
913  isModified_ = true;
914  };
916  {
918  isModified_ = true;
919  };
920  };
921 };
922 
923 
924 
925 //
927 {
928  if (item && column>-1)
929  {
932  connect (cbEditor, SIGNAL(clockBreakModified(bool)), SLOT(updateModifyStatus(bool)));
933  cbEditor->show();
934  };
935 };
936 
937 
938 
939 //
941 {
944  connect (e, SIGNAL(valueModified(bool)), SLOT(updateModifyStatus(bool)));
945  connect (e, SIGNAL(valueModified(bool)), SLOT(updateLClocksMode(bool)));
946  e->show();
947 };
948 
949 
950 
951 //
953 {
956  connect (e, SIGNAL(valueModified(bool)), SLOT(updateModifyStatus(bool)));
957  connect (e, SIGNAL(valueModified(bool)), SLOT(updateLZenithMode(bool)));
958  e->show();
959 };
960 
961 
962 
963 //
965 {
966  isModified_ = isModified_ || isModified;
967 };
968 
969 
970 
971 //
973 {
974  if (isModified)
975  {
976  QString str;
977  switch (stationInfo_->pcClocks()->getPMode())
978  {
979  default:
981  str="No";
982  break;
984  str="Arc";
985  break;
987  str="PWL";
988  break;
990  str="Stc";
991  break;
992  };
993  cbUseLocalClocks_->setText("Use local setup of parameters for clocks (" + str + ")");
994  };
995 };
996 
997 
998 
999 //
1001 {
1002  if (isModified)
1003  {
1004  QString str;
1005  switch (stationInfo_->pcZenith()->getPMode())
1006  {
1007  default:
1009  str="No";
1010  break;
1012  str="Arc";
1013  break;
1015  str="PWL";
1016  break;
1018  str="Stc";
1019  break;
1020  };
1021  cbUseLocalZenith_->setText("Use local setup of parameters for zenith delays (" + str + ")");
1022  };
1023 };
1024 
1025 
1026 
1027 //
1029 {
1030  if (b && bModel_.addBreak(b))
1031  {
1033  cbItem->setClockBreak(b);
1034  cbItem->setText( 0, b->toString(SgMJD::F_YYYYMMDDHHMMSSSS));
1035  cbItem->setData( 0, Qt::TextAlignmentRole, Qt::AlignRight);
1036  cbItem->setText( 1, QString("").sprintf("%.1f", b->getA0()));
1037  cbItem->setData( 1, Qt::TextAlignmentRole, Qt::AlignRight);
1038  cbItem->setText( 2, QString("").sprintf("%.1f", b->getS0()));
1039  cbItem->setData( 2, Qt::TextAlignmentRole, Qt::AlignRight);
1040  cbItem->setText( 3, b->isAttr(SgParameterBreak::Attr_DYNAMIC)?"Y":"N");
1041  cbItem->setData( 3, Qt::TextAlignmentRole, Qt::AlignCenter);
1042  twClockBreaks_->resizeColumnToContents(0);
1043  twClockBreaks_->resizeColumnToContents(1);
1044  twClockBreaks_->resizeColumnToContents(2);
1045  twClockBreaks_->resizeColumnToContents(3);
1046  };
1047 };
1048 
1049 
1050 
1051 //
1053 {
1054  if (twClockBreaks_->selectedItems().size())
1055  {
1056  SgGuiVlbiStnClockBreakEditor *cbEditor=
1058  (SgGuiVlbiClockBreakItem*)(twClockBreaks_->selectedItems().at(0)), this);
1059  connect (cbEditor, SIGNAL(clockBreakModified(bool)), SLOT(updateModifyStatus(bool)));
1060  cbEditor->show();
1061  };
1062 };
1063 
1064 
1065 
1066 //
1068 {
1069  if (twClockBreaks_->selectedItems().size())
1070  {
1071  SgGuiVlbiClockBreakItem *cbItem=(SgGuiVlbiClockBreakItem*)(twClockBreaks_->selectedItems().at(0));
1072  SgParameterBreak *b=cbItem->getClockBreak();
1073  if (QMessageBox::warning(this, "Delete?",
1074  "Are you sure to delete clock break happened on\n \"" +
1075  b->toString() + "\"?\n",
1076  QMessageBox::No | QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes)
1077  {
1078  delete cbItem;
1079  bModel_.delBreak(*b);
1080  isModified_ = true;
1081  };
1082  };
1083 };
1084 
1085 
1086 
1087 //
1089 {
1091  NULL, this);
1092  connect (cbEditor, SIGNAL(clockBreakModified(bool)), SLOT(updateModifyStatus(bool)));
1093  connect (cbEditor, SIGNAL(clockBreakCreated(SgParameterBreak*)),
1095  cbEditor->show();
1096 };
1097 /*=====================================================================================================*/
1098 
1099 
1100 
1101 
1102 
1103 
1104 /*=======================================================================================================
1105 *
1106 * SgGuiVlbiStnClockBreakEditor METHODS:
1107 *
1108 *======================================================================================================*/
1110  SgGuiVlbiClockBreakItem* cbItem, QWidget *parent, Qt::WindowFlags flags)
1111  : QDialog(parent, flags)
1112 {
1113  browseMode_ = mode;
1114  cbModel_ = model;
1115  cbItem_ = cbItem;
1116  clockBreak_ = cbItem?cbItem->getClockBreak():NULL;
1117 // twClockBreaks_ = cbItem_?cbItem_->treeWidget():NULL;
1118 
1119  isModified_ = false;
1120  isNewClockBreak_ = false;
1121  setWindowTitle("Clock Break Editor");
1122 
1123  QLabel *label;
1124  QGroupBox *gbox;
1125  QBoxLayout *layout, *subLayout;
1126  QGridLayout *grid;
1127 
1128  QString str;
1129  int yr=0, mo=0, dy=0, hr=0, mi=0;
1130  double se=0.0, valA0=0.0, sigA0=0.0;
1131 
1132  if (!clockBreak_)
1133  {
1136  isModified_ = true;
1137  isNewClockBreak_ = true;
1138  };
1139 
1140  SgMJD::MJD_reverse(clockBreak_->getDate(), clockBreak_->getTime(), yr, mo, dy, hr, mi, se);
1141 
1142  valA0 = clockBreak_->getA0();
1143  sigA0 = clockBreak_->getS0();
1144 
1145  gbox = new QGroupBox("Clock Break", this);
1146  grid = new QGridLayout(gbox);
1147 
1148  label= new QLabel("Epoch:", gbox);
1149  label->setMinimumSize(label->sizeHint());
1150  grid ->addWidget(label, 1, 0, Qt::AlignLeft | Qt::AlignVCenter);
1151 
1152  label= new QLabel("Value (ns):", gbox);
1153  label->setMinimumSize(label->sizeHint());
1154  grid ->addWidget(label, 2, 0, Qt::AlignLeft | Qt::AlignVCenter);
1155 
1156  label= new QLabel("Sigma (ns):", gbox);
1157  label->setMinimumSize(label->sizeHint());
1158  grid ->addWidget(label, 3, 0, Qt::AlignLeft | Qt::AlignVCenter);
1159 
1160  //
1161  label= new QLabel("YYYY", gbox);
1162  label->setMinimumSize(label->sizeHint());
1163  grid ->addWidget(label, 0, 1);
1164 
1165  label= new QLabel("/", gbox);
1166  label->setMinimumSize(label->sizeHint());
1167  grid ->addWidget(label, 1, 2);
1168 
1169  label= new QLabel("MM", gbox);
1170  label->setMinimumSize(label->sizeHint());
1171  grid ->addWidget(label, 0, 3);
1172 
1173  label= new QLabel("/", gbox);
1174  label->setMinimumSize(label->sizeHint());
1175  grid ->addWidget(label, 1, 4);
1176 
1177  label= new QLabel("DD", gbox);
1178  label->setMinimumSize(label->sizeHint());
1179  grid ->addWidget(label, 0, 5);
1180 
1181  label= new QLabel("HH", gbox);
1182  label->setMinimumSize(label->sizeHint());
1183  grid ->addWidget(label, 0, 7);
1184 
1185  label= new QLabel(":", gbox);
1186  label->setMinimumSize(label->sizeHint());
1187  grid ->addWidget(label, 1, 8);
1188 
1189  label= new QLabel("MM", gbox);
1190  label->setMinimumSize(label->sizeHint());
1191  grid ->addWidget(label, 0, 9);
1192 
1193  label= new QLabel(":", gbox);
1194  label->setMinimumSize(label->sizeHint());
1195  grid ->addWidget(label, 1,10);
1196 
1197  label= new QLabel("SS.SS", gbox);
1198  label->setMinimumSize(label->sizeHint());
1199  grid ->addWidget(label, 0,11);
1200 
1201  //
1202  leYr_ = new QLineEdit(str.sprintf("%04d", yr), gbox);
1203  leYr_->setFixedWidth(leYr_->fontMetrics().width("YYYY") + 10);
1204  grid ->addWidget(leYr_, 1, 1);
1205 
1206  leMn_ = new QLineEdit(str.sprintf("%02d", mo), gbox);
1207  leMn_->setFixedWidth(leMn_->fontMetrics().width("MM") + 10);
1208  grid ->addWidget(leMn_, 1, 3);
1209 
1210  leDy_ = new QLineEdit(str.sprintf("%02d", dy), gbox);
1211  leDy_->setFixedWidth(leDy_->fontMetrics().width("MM") + 10);
1212  grid ->addWidget(leDy_, 1, 5);
1213 
1214  leHr_ = new QLineEdit(str.sprintf("%02d", hr), gbox);
1215  leHr_->setFixedWidth(leHr_->fontMetrics().width("MM") + 10);
1216  grid ->addWidget(leHr_, 1, 7);
1217 
1218  leMi_ = new QLineEdit(str.sprintf("%02d", mi), gbox);
1219  leMi_->setFixedWidth(leMi_->fontMetrics().width("MM") + 10);
1220  grid ->addWidget(leMi_, 1, 9);
1221 
1222  leSc_ = new QLineEdit(str.sprintf("%5.2f", se), gbox);
1223  leSc_->setFixedWidth(leSc_->fontMetrics().width("SS.SS") + 10);
1224  grid ->addWidget(leSc_, 1,11);
1225 
1226  //
1227  leA0_ = new QLineEdit(str.sprintf("%.2f", valA0), gbox);
1228  leA0_->setMinimumSize(leA0_->sizeHint());
1229  grid ->addWidget(leA0_, 2,1, 1,5);
1230  //grid->addColSpacing(6, 15);
1231 
1232  //
1233  leS0_ = new QLineEdit(str.sprintf("%.2f", sigA0), gbox);
1234  leS0_->setMinimumSize(leS0_->sizeHint());
1235  grid ->addWidget(leS0_, 3,1, 1,5);
1236 
1237  grid->addItem(new QSpacerItem(15, 0), 0, 6);
1238 
1239 
1240  //---
1241  layout = new QVBoxLayout(this);
1242  layout -> addWidget(gbox);
1243 
1244  cbIsDynamic_ = new QCheckBox("Estimate clock break parameters in a common solution", this);
1245  if (browseMode_ == OBM_SESSION) // for session-wide only:
1247  cbIsDynamic_->setMinimumSize(cbIsDynamic_->sizeHint());
1248  layout->addWidget(cbIsDynamic_);
1249  layout->addSpacing(15);
1250  // prevent a user from modification of this attribute for band-dependent clock breaks:
1251  if (browseMode_ != OBM_SESSION)
1252  cbIsDynamic_->setEnabled(false);
1253 
1254  subLayout = new QHBoxLayout();
1255  layout->addLayout(subLayout);
1256  subLayout->addStretch(1);
1257 
1258  QPushButton *bOk=new QPushButton("OK", this);
1259  QPushButton *bCancel=new QPushButton("Cancel", this);
1260  bOk->setDefault(true);
1261  QSize btnSize;
1262 
1263  bCancel->setMinimumSize((btnSize=bCancel->sizeHint()));
1264  bOk->setMinimumSize(btnSize);
1265  subLayout->addWidget(bOk);
1266  subLayout->addWidget(bCancel);
1267  connect(bOk, SIGNAL(clicked()), SLOT(accept()));
1268  connect(bCancel, SIGNAL(clicked()), SLOT(reject()));
1269 };
1270 
1271 
1272 
1273 //
1275 {
1276  acquireData();
1277  QDialog::accept();
1278  if (isNewClockBreak_)
1280  else if (isModified_)
1281  {
1283  cbItem_->setText( 1, QString("").sprintf("%.1f", clockBreak_->getA0()));
1284  cbItem_->setText( 2, QString("").sprintf("%.1f", clockBreak_->getS0()));
1285  cbItem_->setText( 3, clockBreak_->isAttr(SgParameterBreak::Attr_DYNAMIC)?"Y":"N");
1286 // twClockBreaks_->resizeColumnToContents(0);
1287 // twClockBreaks_->resizeColumnToContents(1);
1288  };
1290  deleteLater();
1291 };
1292 
1293 
1294 
1295 //
1297 {
1298  emit clockBreakModified(false);
1299  QDialog::reject();
1301  delete clockBreak_;
1302  deleteLater();
1303 };
1304 
1305 
1306 
1307 //
1309 {
1310  if (!clockBreak_)
1311  return;
1312 
1313  bool isOK=true;
1314  int yr=0;
1315  int mn=0;
1316  int dy=0;
1317  int hr=0;
1318  int mi=0;
1319  double d=0.0;
1320 
1321  if (isOK)
1322  yr = leYr_->text().toInt(&isOK);
1323  if (isOK)
1324  mn = leMn_->text().toInt(&isOK);
1325  if (isOK)
1326  dy = leDy_->text().toInt(&isOK);
1327  if (isOK)
1328  hr = leHr_->text().toInt(&isOK);
1329  if (isOK)
1330  mi = leMi_->text().toInt(&isOK);
1331  if (isOK)
1332  d = leSc_->text().toDouble(&isOK);
1333 
1334  SgMJD t(yr, mn, dy, hr, mi, d);
1335  if (isOK && t!=*clockBreak_)
1336  {
1337  isModified_ = true;
1338  *(SgMJD*)clockBreak_ = t;
1339  };
1340  if (isOK)
1341  d = leA0_->text().toDouble(&isOK);
1342  if (isOK && d!=clockBreak_->getA0())
1343  {
1344  isModified_ = true;
1345  clockBreak_->setA0(d);
1346  };
1347  if (isOK)
1348  d = leS0_->text().toDouble(&isOK);
1349  if (isOK && d!=clockBreak_->getS0() && d>=0.0)
1350  {
1351  isModified_ = true;
1352  clockBreak_->setS0(d);
1353  };
1354  if (isOK && cbIsDynamic_->isChecked()!=clockBreak_->isAttr(SgParameterBreak::Attr_DYNAMIC))
1355  {
1356  if (cbIsDynamic_->isChecked())
1358  else
1360  isModified_ = true;
1361  };
1362 };
1363 /*=====================================================================================================*/
1364 
1365 
1366 
1367 /*=====================================================================================================*/
StationColumnIndex
@ SCI_S_COO_EST
@ SCI_S_WRMS_DEL
@ SCI_B_DISP_DEL
@ SCI_B_WRMS_RAT
@ SCI_B_CLK_BRKS
@ SCI_S_REF_CLK
@ SCI_S_CLK_BRKS
@ SCI_S_COO_CON
@ SCI_B_SIG0_DEL
@ SCI_S_CBL_CAL
@ SCI_B_SIG0_RAT
@ SCI_S_CBL_SGN
@ SCI_S_CBL_ORI
@ SCI_S_CLK_TERMS
@ SCI_S_IGNORE
@ SCI_S_AXO_EST
@ SCI_B_DISP_RAT
@ SCI_B_WRMS_DEL
const QString sCableCalOrigs[]
bool operator<(const SgMJD &T1, const SgMJD &T2)
Definition: SgMJD.h:552
SgObjectBrowseMode
Definition: SgObjectInfo.h:46
@ OBM_BAND
Definition: SgObjectInfo.h:46
@ OBM_PROJECT
Definition: SgObjectInfo.h:46
@ OBM_SESSION
Definition: SgObjectInfo.h:46
const QString sCableCalSourceNames[4]
@ 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 delAttr(uint a)
Definition: SgAttribute.h:210
void addAttr(uint a)
Definition: SgAttribute.h:202
void setT0(const SgMJD &t)
Definition: SgBreakModel.h:540
bool delBreak(const SgMJD &t)
bool addBreak(const SgMJD &t, double a0=0.0, double a1=0.0, double a2=0.0, bool isDynamic=false)
const SgMJD & getT0() const
Definition: SgBreakModel.h:532
SgParameterBreak * getClockBreak()
void setClockBreak(SgParameterBreak *clockBreak)
void setStInfo(SgVlbiStationInfo *info)
virtual bool operator<(const QTreeWidgetItem &other) const
SgVlbiStationInfo * getStInfo()
void refClockStationSelected(const QString &)
void entryDoubleClicked(QTreeWidgetItem *, int)
QMap< QString, SgVlbiStationInfo * > * stationsByName_
void refClockStationDeselected(const QString &)
SgGuiQTreeWidgetExt * tweStations_
SgObjectBrowseMode browseMode_
SgGuiVlbiStationList(SgObjectBrowseMode, const QString &, QMap< QString, SgVlbiStationInfo * > *, const SgMJD &t=tZero, QWidget *=0, Qt::WindowFlags=0)
void toggleEntryMoveEnable(QTreeWidgetItem *, int, Qt::MouseButton, Qt::KeyboardModifiers)
SgGuiVlbiStnClockBreakEditor(SgBreakModel *, SgObjectBrowseMode, SgGuiVlbiClockBreakItem *, QWidget *=0, Qt::WindowFlags=0)
void clockBreakCreated(SgParameterBreak *)
SgGuiVlbiClockBreakItem * cbItem_
SgVlbiStationInfo * stationInfo_
void editClockBreakRecordItem(QTreeWidgetItem *, int)
SgGuiVlbiStnInfoEditor(SgVlbiStationInfo *, SgObjectBrowseMode, const QString &, const SgMJD &, QWidget *=0, Qt::WindowFlags=0)
SgObjectBrowseMode browseMode_
void addNewClockBreak(SgParameterBreak *)
SgTaskConfig::CableCalSource flybyCableCalSource_
Definition: SgMJD.h:59
double getTime() const
Definition: SgMJD.h:455
@ F_YYYYMMDDHHMMSSSS
Long verbose: Fri, the 2nd of Apr, 2010; 17hr 02min 43.6400sec.
Definition: SgMJD.h:67
QString toString(Format format=F_Verbose) const
Definition: SgMJD.cpp:1008
int getDate() const
Definition: SgMJD.h:447
static void MJD_reverse(int date, double time, int &nYear, int &nMonth, int &nDay, int &nHour, int &nMin, double &dSec)
Definition: SgMJD.cpp: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
double wrms(DataType) const
Definition: SgObjectInfo.h:567
int numTotal(DataType dType) const
Definition: SgObjectInfo.h:343
void setS0(double a)
Definition: SgBreakModel.h:443
double getS0() const
Definition: SgBreakModel.h:387
double getA0() const
Definition: SgBreakModel.h:363
void setA0(double a)
Definition: SgBreakModel.h:419
@ Attr_DYNAMIC
parameters supposed to be estimated during the common solution;
Definition: SgBreakModel.h:60
@ Attr_MODIFIED
parameters were modified;
Definition: SgBreakModel.h:59
PMode getPMode() const
@ Idx_ZENITH
index for wet zenith delay
@ Idx_CLOCK_0
index for clocks (order #0)
void setNeed2useAPrioriClocks(bool)
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
void setFlybyCableCalSource(SgTaskConfig::CableCalSource s)
@ Attr_ESTIMATE_AXO
estimate axis offset;
@ Attr_NOT_VALID
omit the station;
@ Attr_HAS_CCC_FSLG
a station has cable calibrations from FS log file
@ Attr_INVERSE_CABLE
cable calibration correction has wrong sign;
@ Attr_ART_METEO
indicates that the station has artificial meteo parameters;
@ Attr_CONSTRAIN_COO
constrain station position in estimation;
@ Attr_REFERENCE_CLOCKS
the clocks are the reference ones;
@ Attr_DONT_ESTIMATE_TRPS
do not estimate parameters of troposphere delay for station;
@ Attr_IGNORE_CABLE_CAL
do not apply cable calibration;
@ Attr_ESTIMATE_COO
estimate station position;
@ Attr_USE_LOCAL_ZENITH
use its own setup for the zenith delay parameter;
@ Attr_USE_LOCAL_CLOCKS
use its own setup for the clock parameter;
@ Attr_BAD_METEO
indicates that the station has bad meteo parameters;
@ Attr_HAS_CCC_CDMS
a station has cable calibrations from CDMS
@ Attr_HAS_CCC_PCMT
a station has cable calibrations from PCMT
SgParameterCfg * pcZenith()
void setAPrioriClockTerm_1(double)
SgParameterCfg * pcClocks()
double getCableCalMultiplierDBCal() const
SgTaskConfig::CableCalSource getFlybyCableCalSource() const
SgBreakModel & clockBreaks()
double getAPrioriClockTerm_1() const
void setClocksModelOrder(int n)
int getClocksModelOrder() const
void setAPrioriClockTerm_0(double)
bool getNeed2useAPrioriClocks() const
double getAPrioriClockTerm_0() const