@@ -347,6 +347,7 @@ OptDialog::OptDialog(QWidget *parent, int opts)
347347
348348 if (options == PostOptions) {
349349 refPosModel->item (6 )->setFlags (refPosModel->item (6 )->flags () & ~Qt::ItemIsEnabled); // disable "RTCM/Raw Antenna Position"
350+ rovPosModel->item (6 )->setFlags (refPosModel->item (6 )->flags () & ~Qt::ItemIsEnabled); // disable "RTCM/Raw Antenna Position"
350351 } else if (options == NaviOptions) {
351352 refPosModel->item (4 )->setFlags (refPosModel->item (4 )->flags () & ~Qt::ItemIsEnabled); // disable "Get from Position File"
352353 refPosModel->item (5 )->setFlags (refPosModel->item (5 )->flags () & ~Qt::ItemIsEnabled); // disable "RINEX Header Position"
@@ -656,7 +657,7 @@ void OptDialog::updateOptions()
656657 QLineEdit *editu[] = {ui->lERoverPosition1 , ui->lERoverPosition2 , ui->lERoverPosition3 };
657658 QLineEdit *editr[] = {ui->lEReferencePosition1 , ui->lEReferencePosition2 , ui->lEReferencePosition3 };
658659 pcvs_t pcvr;
659- pcv_t *pcv, pcv0;
660+ pcv_t pcv0;
660661 gtime_t time = timeget ();
661662
662663 memset (&pcvr, 0 , sizeof (pcvs_t ));
@@ -775,53 +776,53 @@ void OptDialog::updateOptions()
775776 processingOptions.rovpos = POSOPT_POS_LLH;
776777 if (ui->cBRoverPositionType ->currentIndex () < 2 ) processingOptions.rovpos = POSOPT_POS_LLH;
777778 else if (ui->cBRoverPositionType ->currentIndex () == 2 ) processingOptions.rovpos = POSOPT_POS_XYZ;
778- else if (options == PostOptions) {
779+ else if (options == NaviOptions) {
780+ if (ui->cBRoverPositionType ->currentIndex () == 6 ) processingOptions.rovpos = POSOPT_RTCM;
781+ } else if (options == PostOptions) {
779782 processingOptions.rovpos = ui->cBRoverPositionType ->currentIndex () - 1 ; /* 2:single, 3:posfile, 4:rinex */
780783 }
781784
785+ processingOptions.antdel [0 ][0 ] = ui->sBRoverAntennaE ->value ();
786+ processingOptions.antdel [0 ][1 ] = ui->sBRoverAntennaN ->value ();
787+ processingOptions.antdel [0 ][2 ] = ui->sBRoverAntennaU ->value ();
782788 if (ui->cBRoverAntennaPcv ->isChecked ()) {
783789 strncpy (processingOptions.anttype [0 ], qPrintable (ui->cBRoverAntenna ->currentText ()), 63 );
784- processingOptions.antdel [0 ][0 ] = ui->sBRoverAntennaE ->value ();
785- processingOptions.antdel [0 ][1 ] = ui->sBRoverAntennaN ->value ();
786- processingOptions.antdel [0 ][2 ] = ui->sBRoverAntennaU ->value ();
787790 } else {
788791 strncpy (processingOptions.anttype [0 ], " " , sizeof (processingOptions.anttype [0 ]) - 1 );
789- processingOptions.antdel [0 ][0 ] = 0 ;
790- processingOptions.antdel [0 ][1 ] = 0 ;
791- processingOptions.antdel [0 ][2 ] = 0 ;
792792 }
793793
794+ processingOptions.antdel [1 ][0 ] = ui->sBReferenceAntennaE ->value ();
795+ processingOptions.antdel [1 ][1 ] = ui->sBReferenceAntennaN ->value ();
796+ processingOptions.antdel [1 ][2 ] = ui->sBReferenceAntennaU ->value ();
794797 if (ui->cBReferenceAntennaPcv ->isChecked ()) {
795798 strncpy (processingOptions.anttype [1 ], qPrintable (ui->cBReferenceAntenna ->currentText ()), 63 );
796- processingOptions.antdel [1 ][0 ] = ui->sBReferenceAntennaE ->value ();
797- processingOptions.antdel [1 ][1 ] = ui->sBReferenceAntennaN ->value ();
798- processingOptions.antdel [1 ][2 ] = ui->sBReferenceAntennaU ->value ();
799799 } else {
800800 strncpy (processingOptions.anttype [1 ], " " , sizeof (processingOptions.anttype [1 ]) - 1 );
801- processingOptions.antdel [1 ][0 ] = 0 ;
802- processingOptions.antdel [1 ][1 ] = 0 ;
803- processingOptions.antdel [1 ][2 ] = 0 ;
804801 }
805802
806803 processingOptions.pcvr [0 ] = processingOptions.pcvr [1 ] = pcv0; // initialize antenna PCV
807- if ((ui->cBRoverAntennaPcv ->isChecked () || ui->cBReferenceAntennaPcv ->isChecked ()) && !readpcv (fileOptions.rcvantp , &pcvr)) {
804+ if ((ui->cBRoverAntennaPcv ->isChecked () || ui->cBReferenceAntennaPcv ->isChecked ()) &&
805+ fileOptions.rcvantp [0 ] != ' \0 ' && !readpcv (fileOptions.rcvantp , &pcvr)) {
808806 QMessageBox::warning (this , tr (" Error" ), tr (" Antenna file read error: \" %1\" " ).arg (fileOptions.rcvantp ));
809807 return ;
810808 }
811- if (ui->cBRoverAntennaPcv ->isChecked () && (processingOptions.anttype [0 ] != QStringLiteral (" *" ))) {
812- if ((pcv = searchpcv (0 , processingOptions.anttype [0 ], time, &pcvr)))
809+ if (ui->cBRoverAntennaPcv ->isChecked () && processingOptions.anttype [0 ] != QStringLiteral (" " ) &&
810+ processingOptions.anttype [0 ] != QStringLiteral (" *" )) {
811+ pcv_t *pcv = searchpcv (0 , processingOptions.anttype [0 ], time, &pcvr);
812+ if (pcv)
813813 processingOptions.pcvr [0 ] = *pcv;
814814 else
815815 QMessageBox::warning (this , tr (" Error" ), tr (" No rover antenna PCV: \" %1\" " ).arg (processingOptions.anttype [0 ]));
816816 }
817- if (ui->cBReferenceAntennaPcv ->isChecked ()&& (processingOptions.anttype [1 ] != QStringLiteral (" *" ))) {
818- if ((pcv = searchpcv (0 , processingOptions.anttype [1 ], time, &pcvr)))
817+ if (ui->cBReferenceAntennaPcv ->isChecked () && processingOptions.anttype [1 ] != QStringLiteral (" " ) &&
818+ processingOptions.anttype [1 ] != QStringLiteral (" *" )) {
819+ pcv_t *pcv = searchpcv (0 , processingOptions.anttype [1 ], time, &pcvr);
820+ if (pcv)
819821 processingOptions.pcvr [1 ] = *pcv;
820822 else
821823 QMessageBox::warning (this , tr (" Error" ), tr (" No reference station antenna PCV: \" %1\" " ).arg (processingOptions.anttype [1 ]));
822824 }
823- if (ui->cBRoverAntennaPcv ->isChecked () || ui->cBReferenceAntennaPcv ->isChecked ())
824- free (pcvr.pcv );
825+ free_pcvs (&pcvr);
825826 fillExcludedSatellites (&processingOptions, ui->lEExcludedSatellites ->text ());
826827 processingOptions.maxaveep = ui->sBMaxAveEp ->value ();
827828 processingOptions.initrst = ui->cBInitRestart ->isChecked ();
@@ -946,6 +947,7 @@ void OptDialog::updateUi(const prcopt_t &prcopt, const solopt_t &solopt, const f
946947 ui->cBRoverPositionType ->setCurrentIndex (0 );
947948 if (prcopt.rovpos == POSOPT_POS_LLH) ui->cBRoverPositionType ->setCurrentIndex (0 );
948949 else if (prcopt.rovpos == POSOPT_POS_XYZ) ui->cBRoverPositionType ->setCurrentIndex (2 );
950+ else if (prcopt.rovpos == POSOPT_RTCM) ui->cBRoverPositionType ->setCurrentIndex (6 );
949951
950952 ui->cBReferencePositionType ->setCurrentIndex (0 );
951953 if (prcopt.refpos == POSOPT_POS_LLH) ui->cBReferencePositionType ->setCurrentIndex (0 );
@@ -1143,14 +1145,18 @@ void OptDialog::save(const QString &file)
11431145 else if (options == PostOptions)
11441146 procOpts.sbassatsel = ui->sBSbasSat ->value ();
11451147
1146- procOpts.rovpos = ui->cBRoverPositionType ->currentIndex () < 2 ? POSOPT_POS_LLH : ui->cBRoverPositionType ->currentIndex () == 2 ? POSOPT_POS_XYZ : ui->cBRoverPositionType ->currentIndex () - 1 ;
11471148 if (options == NaviOptions) {
1149+ procOpts.rovpos = POSOPT_POS_LLH;
1150+ if (ui->cBRoverPositionType ->currentIndex () < 2 ) procOpts.rovpos = POSOPT_POS_LLH;
1151+ else if (ui->cBRoverPositionType ->currentIndex () == 2 ) procOpts.rovpos = POSOPT_POS_XYZ;
1152+ else if (ui->cBRoverPositionType ->currentIndex () == 6 ) procOpts.rovpos = POSOPT_RTCM;
11481153 procOpts.refpos = POSOPT_POS_LLH;
11491154 if (ui->cBReferencePositionType ->currentIndex () < 2 ) procOpts.refpos = POSOPT_POS_LLH;
11501155 else if (ui->cBReferencePositionType ->currentIndex () == 2 ) procOpts.refpos = POSOPT_POS_XYZ;
11511156 else if (ui->cBReferencePositionType ->currentIndex () == 3 ) procOpts.refpos = POSOPT_SINGLE;
11521157 else if (ui->cBReferencePositionType ->currentIndex () == 6 ) procOpts.refpos = POSOPT_RTCM;
11531158 } else if (options == PostOptions) {
1159+ procOpts.rovpos = ui->cBRoverPositionType ->currentIndex () < 2 ? POSOPT_POS_LLH : ui->cBRoverPositionType ->currentIndex () == 2 ? POSOPT_POS_XYZ : ui->cBRoverPositionType ->currentIndex () - 1 ;
11541160 procOpts.refpos = ui->cBReferencePositionType ->currentIndex () < 2 ? POSOPT_POS_LLH : ui->cBReferencePositionType ->currentIndex () == 2 ? POSOPT_POS_XYZ : ui->cBReferencePositionType ->currentIndex () - 1 ;
11551161 }
11561162 procOpts.eratio [0 ] = ui->sBMeasurementErrorR1 ->value ();
@@ -1741,6 +1747,7 @@ void OptDialog::updateEnable()
17411747 ui->sBBaselineLen ->setEnabled (ui->cBBaselineConstrain ->isChecked () && ui->cBPositionMode ->currentIndex () == PMODE_MOVEB);
17421748 ui->sBBaselineSig ->setEnabled (ui->cBBaselineConstrain ->isChecked () && ui->cBPositionMode ->currentIndex () == PMODE_MOVEB);
17431749 ui->cBRoverPositionType ->setEnabled (ui->cBPositionMode ->currentIndex () == PMODE_FIXED || ui->cBPositionMode ->currentIndex () == PMODE_PPP_FIXED);
1750+ setComboBoxItemEnabled (ui->cBRoverPositionType , 6 , options == NaviOptions);
17441751 ui->lERoverPosition1 ->setEnabled (ui->cBRoverPositionType ->isEnabled () && ui->cBRoverPositionType ->currentIndex () <= 2 );
17451752 ui->lERoverPosition2 ->setEnabled (ui->cBRoverPositionType ->isEnabled () && ui->cBRoverPositionType ->currentIndex () <= 2 );
17461753 ui->lERoverPosition3 ->setEnabled (ui->cBRoverPositionType ->isEnabled () && ui->cBRoverPositionType ->currentIndex () <= 2 );
@@ -1756,21 +1763,37 @@ void OptDialog::updateEnable()
17561763 ui->btnReferencePosition ->setEnabled (ui->cBReferencePositionType ->isEnabled () && ui->cBReferencePositionType ->currentIndex () <= 2 );
17571764 ui->cBRoverAntennaPcv ->setEnabled (rel || ppp);
17581765 ui->cBRoverAntenna ->setEnabled ((rel || ppp) && ui->cBRoverAntennaPcv ->isChecked ());
1759- ui->sBRoverAntennaE ->setEnabled ((rel || ppp) && ui->cBRoverAntennaPcv ->isChecked () && ui->cBRoverAntenna ->currentText ()!=" *" );
1760- ui->sBRoverAntennaN ->setEnabled ((rel || ppp) && ui->cBRoverAntennaPcv ->isChecked () && ui->cBRoverAntenna ->currentText ()!=" *" );
1761- ui->sBRoverAntennaU ->setEnabled ((rel || ppp) && ui->cBRoverAntennaPcv ->isChecked () && ui->cBRoverAntenna ->currentText ()!=" *" );
1762- ui->lblRoverAntennaD ->setEnabled ((rel || ppp) && ui->cBRoverAntennaPcv ->isChecked () && ui->cBRoverAntenna ->currentText ()!=" *" );
17631766 ui->cBReferenceAntennaPcv ->setEnabled (rel);
17641767 ui->cBReferenceAntenna ->setEnabled (rel && ui->cBReferenceAntennaPcv ->isChecked ());
1765- ui->sBReferenceAntennaE ->setEnabled (rel && ui->cBReferenceAntennaPcv ->isChecked () && ui->cBReferenceAntenna ->currentText ()!=" *" );
1766- ui->sBReferenceAntennaN ->setEnabled (rel && ui->cBReferenceAntennaPcv ->isChecked () && ui->cBReferenceAntenna ->currentText ()!=" *" );
1767- ui->sBReferenceAntennaU ->setEnabled (rel && ui->cBReferenceAntennaPcv ->isChecked () && ui->cBReferenceAntenna ->currentText ()!=" *" );
1768- ui->lblReferenceAntennaD ->setEnabled (rel && ui->cBReferenceAntennaPcv ->isChecked () && ui->cBReferenceAntenna ->currentText ()!=" *" );
17691768 if (options == NaviOptions) {
1769+ // For rtknavi the delta can be supplied even when antenna selection is
1770+ // automated, in which case the delta fills in until overwritten when
1771+ // the antenna and it's delta are known.
1772+ ui->sBRoverAntennaE ->setEnabled (rel || ppp);
1773+ ui->sBRoverAntennaN ->setEnabled (rel || ppp);
1774+ ui->sBRoverAntennaU ->setEnabled (rel || ppp);
1775+ ui->lblRoverAntennaD ->setEnabled (rel || ppp);
1776+ ui->sBReferenceAntennaE ->setEnabled (rel);
1777+ ui->sBReferenceAntennaN ->setEnabled (rel);
1778+ ui->sBReferenceAntennaU ->setEnabled (rel);
1779+ ui->lblReferenceAntennaD ->setEnabled (rel);
17701780 ui->lblMaxAveEp ->setVisible (ui->cBReferencePositionType ->currentIndex () == 3 );
17711781 ui->sBMaxAveEp ->setVisible (ui->cBReferencePositionType ->currentIndex () == 3 );
17721782 ui->cBInitRestart ->setVisible (ui->cBReferencePositionType ->currentIndex () == 3 );
17731783 } else {
1784+ // For rtkpost, and when setting the antenna and delta automatically,
1785+ // this should occur before processing, so disable the delta setting
1786+ // here in that case.
1787+ int rovp = !ui->cBRoverAntennaPcv ->isChecked () || ui->cBRoverAntenna ->currentText () != " *" ;
1788+ ui->sBRoverAntennaE ->setEnabled ((rel || ppp) && rovp);
1789+ ui->sBRoverAntennaN ->setEnabled ((rel || ppp) && rovp);
1790+ ui->sBRoverAntennaU ->setEnabled ((rel || ppp) && rovp);
1791+ ui->lblRoverAntennaD ->setEnabled ((rel || ppp) && rovp);
1792+ int refp = !ui->cBReferenceAntennaPcv ->isChecked () || ui->cBReferenceAntenna ->currentText () != " *" ;
1793+ ui->sBReferenceAntennaE ->setEnabled (rel && refp);
1794+ ui->sBReferenceAntennaN ->setEnabled (rel && refp);
1795+ ui->sBReferenceAntennaU ->setEnabled (rel && refp);
1796+ ui->lblReferenceAntennaD ->setEnabled (rel && refp);
17741797 ui->lblMaxAveEp ->setVisible (false );
17751798 ui->sBMaxAveEp ->setVisible (false );
17761799 ui->cBInitRestart ->setVisible (false );
@@ -1936,8 +1959,6 @@ void OptDialog::readAntennaList()
19361959 QString currentRoverAntenna, currentReferenceAntenna;
19371960 int i;
19381961
1939- if (!readpcv (qPrintable (ui->lEAntennaPcvFile ->text ()), &pcvs)) return ;
1940-
19411962 /* Save currently defined antennas */
19421963 currentRoverAntenna = ui->cBRoverAntenna ->currentText ();
19431964 currentReferenceAntenna = ui->cBReferenceAntenna ->currentText ();
@@ -1949,21 +1970,22 @@ void OptDialog::readAntennaList()
19491970 ui->cBRoverAntenna ->addItem (" " ); ui->cBReferenceAntenna ->addItem (" " );
19501971 ui->cBRoverAntenna ->addItem (" *" ); ui->cBReferenceAntenna ->addItem (" *" );
19511972
1952- for (int i = 0 ; i < pcvs.n ; i++) {
1973+ if (readpcv (qPrintable (ui->lEAntennaPcvFile ->text ()), &pcvs)) {
1974+ for (int i = 0 ; i < pcvs.n ; i++) {
19531975 if (pcvs.pcv [i].sat ) continue ;
19541976 if ((p = strchr (pcvs.pcv [i].type , ' ' ))) *p = ' \0 ' ;
19551977 if (i > 0 && !strcmp (pcvs.pcv [i].type , pcvs.pcv [i - 1 ].type )) continue ;
19561978 ui->cBRoverAntenna ->addItem (pcvs.pcv [i].type );
19571979 ui->cBReferenceAntenna ->addItem (pcvs.pcv [i].type );
1980+ }
1981+ free_pcvs (&pcvs);
19581982 }
19591983
19601984 /* Restore previously defined antennas */
19611985 i = ui->cBRoverAntenna ->findText (currentRoverAntenna);
19621986 ui->cBRoverAntenna ->setCurrentIndex (i == -1 ? 0 : i);
19631987 i = ui->cBReferenceAntenna ->findText (currentReferenceAntenna);
19641988 ui->cBReferenceAntenna ->setCurrentIndex (i == -1 ? 0 : i);
1965-
1966- free (pcvs.pcv );
19671989}
19681990// ---------------------------------------------------------------------------
19691991void OptDialog::showKeyDialog ()
0 commit comments