1 #include "JigsawSetupDialog.h" 6 #include <QIdentityProxyModel> 9 #include <QSortFilterProxyModel> 10 #include <QStandardItemModel> 11 #include <QItemSelection> 28 #include "ui_JigsawSetupDialog.h" 32 JigsawSetupDialog::JigsawSetupDialog(
Project *project,
bool useLastSettings,
bool readOnly,
54 m_ui->JigsawSetup->setCurrentIndex(0);
68 for (
int i = 0; i < project->
controls().size(); i++) {
70 for (
int j = 0; j < conlist->size(); j++) {
71 Control *control = conlist->at(j);
73 QVariant v = qVariantFromValue((
void*)control);
80 for (
int i = 0; i < numBundles; i++) {
83 QVariant v = qVariantFromValue((
void*)bundleControl);
89 FileName fname =
m_ui->inputControlNetCombo->currentText();
90 m_ui->outputControlNetLineEdit->setText(fname.
baseName() +
"-out.net");
93 createObservationSolveSettingsTreeView();
102 imagesToAdd.append(projItem->
image());
105 for (
int i = 0; i < projItem->rowCount(); i++) {
106 imagesToAdd.append(projItem->
child(i)->
image());
113 if (imagesToAdd.isEmpty()) {
116 for (
int i = 0; i < imgRoot->rowCount(); i++) {
118 for (
int j = 0; j < imglistItem->rowCount(); j++) {
121 imagesToAdd.append(imgItem->
image());
136 foreach (
Image * image, imagesToAdd) {
149 solveSettingsList.append(defaultFramingSettings);
151 solveSettingsList.append(defaultLineScanSettings);
153 m_bundleSettings->setObservationSolveOptions(solveSettingsList);
156 const QStringList positionOptions{
"NONE",
"POSITION",
"VELOCITY",
"ACCELERATION",
"ALL"};
157 m_ui->positionComboBox->insertItems(0, positionOptions);
158 m_ui->positionComboBox->setCurrentIndex(0);
160 const QStringList pointingOptions{
"NONE",
"ANGLES",
"VELOCITY",
"ACCELERATION",
"ALL"};
161 m_ui->pointingComboBox->insertItems(0, pointingOptions);
162 m_ui->pointingComboBox->setCurrentIndex(1);
165 m_ui->spkSolveDegreeSpinBox->setSpecialValueText(
"N/A");
166 m_ui->ckSolveDegreeSpinBox->setSpecialValueText(
"N/A");
170 tableHeaders <<
"coefficients" <<
"description" <<
"units" <<
"a priori sigma";
171 m_ui->positionAprioriSigmaTable->setHorizontalHeaderLabels(tableHeaders);
172 m_ui->pointingAprioriSigmaTable->setHorizontalHeaderLabels(tableHeaders);
175 m_ui->positionAprioriSigmaTable->setColumnWidth(0, fontMetrics().width(tableHeaders.at(0)) + 10);
176 m_ui->positionAprioriSigmaTable->setColumnWidth(1, fontMetrics().width(tableHeaders.at(1)) + 10);
177 m_ui->positionAprioriSigmaTable->setColumnWidth(2, fontMetrics().width(tableHeaders.at(2)) + 10);
178 m_ui->positionAprioriSigmaTable->setColumnWidth(3, fontMetrics().width(tableHeaders.at(3)) + 10);
180 m_ui->pointingAprioriSigmaTable->setColumnWidth(0, fontMetrics().width(tableHeaders.at(0)) + 10);
181 m_ui->pointingAprioriSigmaTable->setColumnWidth(1, fontMetrics().width(tableHeaders.at(1)) + 10);
182 m_ui->pointingAprioriSigmaTable->setColumnWidth(2, fontMetrics().width(tableHeaders.at(2)) + 10);
183 m_ui->pointingAprioriSigmaTable->setColumnWidth(3, fontMetrics().width(tableHeaders.at(3)) + 10);
188 connect(
m_ui->positionAprioriSigmaTable, SIGNAL(itemChanged(QTableWidgetItem *)),
189 this, SLOT(validateSigmaValue(QTableWidgetItem *)));
190 connect(
m_ui->pointingAprioriSigmaTable, SIGNAL(itemChanged(QTableWidgetItem *)),
191 this, SLOT(validateSigmaValue(QTableWidgetItem *)));
196 for (
int i = 0; i < project->
targetBodies().size(); i++) {
199 QVariant v = qVariantFromValue((
void*)target.data());
201 QString name = target->displayProperties()->displayName();
205 "$base/icons/weather-clear-night.png").expanded()), name, v);
206 else if (name ==
"Enceladus")
208 "$base/icons/nasa_enceladus.png").expanded()), name, v);
209 else if (name ==
"Mars")
211 "$base/icons/nasa_mars.png").expanded()), name, v);
212 else if (name ==
"Titan")
214 "$base/icons/nasa_titan.png").expanded()), name, v);
217 "$base/icons/weather-clear-night.png").expanded()), name, v);
220 m_ui->radiiButtonGroup->setId(
m_ui->noneRadiiRadioButton,0);
221 m_ui->radiiButtonGroup->setId(
m_ui->triaxialRadiiRadioButton,1);
222 m_ui->radiiButtonGroup->setId(
m_ui->meanRadiusRadioButton,2);
223 m_ui->noneRadiiRadioButton->setChecked(
true);
226 QDoubleValidator *sigmaValidator =
new QDoubleValidator(0.0, 1.0e+4, 8,
this);
227 sigmaValidator->setNotation(QDoubleValidator::ScientificNotation);
230 QDoubleValidator *raValidator =
new QDoubleValidator(0.0, 360.0, 8,
this);
231 raValidator->setNotation(QDoubleValidator::StandardNotation);
232 m_ui->rightAscensionLineEdit->setValidator(raValidator);
233 m_ui->rightAscensionSigmaLineEdit->setValidator(sigmaValidator);
235 m_ui->rightAscensionVelocityLineEdit->setValidator(raValidator);
236 m_ui->rightAscensionVelocitySigmaLineEdit->setValidator(sigmaValidator);
239 QDoubleValidator *decValidator =
new QDoubleValidator(-90.0, 90.0, 8,
240 m_ui->declinationLineEdit);
241 decValidator->setNotation(QDoubleValidator::StandardNotation);
242 m_ui->declinationLineEdit->setValidator(decValidator);
243 m_ui->declinationSigmaLineEdit->setValidator(sigmaValidator);
245 m_ui->declinationVelocityLineEdit->setValidator(
new QDoubleValidator(0.0, 1.0e+10, 8,
246 m_ui->declinationVelocityLineEdit));
247 m_ui->declinationVelocitySigmaLineEdit->setValidator(sigmaValidator);
249 m_ui->primeMeridianOffsetLineEdit->setValidator(raValidator);
250 m_ui->primeMeridianOffsetSigmaLineEdit->setValidator(sigmaValidator);
253 m_ui->spinRateLineEdit->setValidator(
new QDoubleValidator(0.0, 1.0e+10, 8,
254 m_ui->spinRateLineEdit));
255 m_ui->spinRateSigmaLineEdit->setValidator(sigmaValidator);
257 m_ui->aRadiusLineEdit->setValidator(
new QDoubleValidator(0.0, 1.0e+10, 8,
258 m_ui->aRadiusLineEdit));
259 m_ui->aRadiusSigmaLineEdit->setValidator(sigmaValidator);
261 m_ui->bRadiusLineEdit->setValidator(
new QDoubleValidator(0.0, 1.0e+10, 8,
262 m_ui->bRadiusLineEdit));
263 m_ui->bRadiusSigmaLineEdit->setValidator(sigmaValidator);
265 m_ui->cRadiusLineEdit->setValidator(
new QDoubleValidator(0.0, 1.0e+10, 8,
266 m_ui->cRadiusLineEdit));
267 m_ui->cRadiusSigmaLineEdit->setValidator(sigmaValidator);
269 m_ui->meanRadiusLineEdit->setValidator(
new QDoubleValidator(0.0, 1.0e+10, 8,
270 m_ui->meanRadiusLineEdit));
271 m_ui->meanRadiusSigmaLineEdit->setValidator(sigmaValidator);
277 m_ui->pointLatitudeSigmaLineEdit->setValidator(
new QDoubleValidator(1.0e-10, 1.0e+10, 8,
this));
278 m_ui->pointLongitudeSigmaLineEdit->setValidator(
new QDoubleValidator(1.0e-10, 1.0e+10, 8,
this));
279 m_ui->pointRadiusSigmaLineEdit->setValidator(
new QDoubleValidator(1.0e-10, 1.0e+10, 8,
this));
282 m_ui->outlierRejectionMultiplierLineEdit->setValidator(
283 new QDoubleValidator(1.0e-10, 1.0e+10, 8,
this));
284 m_ui->maximumLikelihoodModel1QuantileLineEdit->setValidator(
285 new QDoubleValidator(1.0e-10, 1.0, 8,
this));
286 m_ui->maximumLikelihoodModel2QuantileLineEdit->setValidator(
287 new QDoubleValidator(1.0e-10, 1.0, 8,
this));
288 m_ui->maximumLikelihoodModel3QuantileLineEdit->setValidator(
289 new QDoubleValidator(1.0e-10, 1.0, 8,
this));
292 m_ui->sigma0ThresholdLineEdit->setValidator(
new QDoubleValidator(1.0e-20, 1.0e+10, 8,
this));
293 m_ui->maximumIterationsLineEdit->setValidator(
new QIntValidator(1, 10000,
this));
300 connect(
m_ui->radiiButtonGroup, SIGNAL(buttonClicked(
int)),
301 this, SLOT(on_radiiButtonGroupClicked(
int)));
302 connect(
m_ui->aRadiusLineEdit, SIGNAL(textChanged(QString)), SLOT(slotTextChanged(QString)));
303 connect(
m_ui->aRadiusLineEdit, SIGNAL(returnPressed()), SLOT(checkIsValid()));
304 connect(
m_ui->aRadiusLineEdit, SIGNAL(editingFinished()), SLOT(checkIsValid()));
305 connect(
m_ui->aRadiusLineEdit, SIGNAL(textChanged(QString)), SLOT(on_aRadiusLineEdit_textChanged(QString)));
310 JigsawSetupDialog::~JigsawSetupDialog() {
320 void JigsawSetupDialog::on_pointRadiusSigmaCheckBox_toggled(
bool checked) {
321 m_ui->pointRadiusSigmaLineEdit->setEnabled(checked);
389 void JigsawSetupDialog::on_maximumLikelihoodModel1ComboBox_currentIndexChanged(
int index) {
391 bool model1Selected = (bool) (index > 0);
394 m_ui->maximumLikelihoodModel1QuantileLineEdit->setEnabled(model1Selected);
395 m_ui->maximumLikelihoodModel2Label->setEnabled(model1Selected);
396 m_ui->maximumLikelihoodModel2ComboBox->setEnabled(model1Selected);
397 m_ui->maximumLikelihoodModel2QuantileLineEdit->setEnabled(
398 m_ui->maximumLikelihoodModel2ComboBox->currentIndex());
401 if (!model1Selected) {
402 m_ui->maximumLikelihoodModel2QuantileLineEdit->setEnabled(
false);
403 m_ui->maximumLikelihoodModel3QuantileLineEdit->setEnabled(
false);
404 m_ui->maximumLikelihoodModel3Label->setEnabled(
false);
405 m_ui->maximumLikelihoodModel3ComboBox->setEnabled(
false);
408 on_maximumLikelihoodModel1QuantileLineEdit_textChanged(
"");
409 on_maximumLikelihoodModel2QuantileLineEdit_textChanged(
"");
410 on_maximumLikelihoodModel3QuantileLineEdit_textChanged(
"");
413 m_ui->outlierRejectionCheckBox->setEnabled(!model1Selected);
417 void JigsawSetupDialog::on_maximumLikelihoodModel2ComboBox_currentIndexChanged(
int index) {
419 bool model2Selected = (bool)(index > 0);
422 m_ui->maximumLikelihoodModel2QuantileLineEdit->setEnabled(model2Selected);
423 m_ui->maximumLikelihoodModel3Label->setEnabled(model2Selected);
424 m_ui->maximumLikelihoodModel3ComboBox->setEnabled(model2Selected);
425 m_ui->maximumLikelihoodModel3QuantileLineEdit->setEnabled(
426 m_ui->maximumLikelihoodModel3ComboBox->currentIndex());
429 if (!model2Selected) {
430 m_ui->maximumLikelihoodModel3QuantileLineEdit->setEnabled(
false);
433 on_maximumLikelihoodModel2QuantileLineEdit_textChanged(
"");
434 on_maximumLikelihoodModel3QuantileLineEdit_textChanged(
"");
438 void JigsawSetupDialog::on_maximumLikelihoodModel3ComboBox_currentIndexChanged(
int index) {
440 bool model3Selected = (bool)(index > 0);
442 m_ui->maximumLikelihoodModel3QuantileLineEdit->setEnabled(model3Selected);
443 on_maximumLikelihoodModel3QuantileLineEdit_textChanged(
"");
448 void JigsawSetupDialog::on_outlierRejectionCheckBox_stateChanged(
int arg1) {
450 on_outlierRejectionMultiplierLineEdit_textChanged(
"");
451 m_ui->outlierRejectionMultiplierLineEdit->setEnabled(arg1);
454 m_ui->CQuantileLabel->setEnabled(!arg1);
455 m_ui->maxLikelihoodEstimationLabel->setEnabled(!arg1);
456 m_ui->maximumLikelihoodModel1ComboBox->setEnabled(!arg1);
457 m_ui->maximumLikelihoodModel1Label->setEnabled(!arg1);
464 m_ui->observationModeCheckBox->setChecked(settings->solveObservationMode());
465 m_ui->pointRadiusSigmaCheckBox->setChecked(settings->solveRadius());
467 m_ui->errorPropagationCheckBox->setChecked(settings->errorPropagation());
468 m_ui->outlierRejectionCheckBox->setChecked(settings->outlierRejection());
469 m_ui->outlierRejectionMultiplierLineEdit->setText(
toString(settings->outlierRejectionMultiplier()));
470 m_ui->sigma0ThresholdLineEdit->setText(
toString(settings->convergenceCriteriaThreshold()));
471 m_ui->maximumIterationsLineEdit->setText(
toString(settings->convergenceCriteriaMaximumIterations()));
474 if ( !
IsNullPixel(settings->globalPointCoord1AprioriSigma()) ) {
475 m_ui->pointLatitudeSigmaLineEdit->setText(
toString(settings->globalPointCoord1AprioriSigma()));
476 m_ui->pointLatitudeSigmaLineEdit->setModified(
true);
478 if ( !
IsNullPixel(settings->globalPointCoord2AprioriSigma()) ) {
479 m_ui->pointLongitudeSigmaLineEdit->setText(
toString(settings->globalPointCoord2AprioriSigma()));
480 m_ui->pointLongitudeSigmaLineEdit->setModified(
true);
482 if ( !
IsNullPixel(settings->globalPointCoord3AprioriSigma()) ) {
483 m_ui->pointRadiusSigmaLineEdit->setText(
toString(settings->globalPointCoord3AprioriSigma()));
484 m_ui->pointRadiusSigmaLineEdit->setModified(
true);
493 for (
auto &solveSettings : defaultSettings) {
495 foreach (QString observationNumber, solveSettings.observationNumbers()) {
497 if (!settings->observationSolveSettings(observationNumber).observationNumbers().isEmpty()) {
498 solveSettings.removeObservationNumber(observationNumber);
502 if (!solveSettings.observationNumbers().isEmpty()) {
503 fillSettings.append(solveSettings);
517 settings->setValidateNetwork(
true);
520 double latitudeSigma = -1.0;
521 double longitudeSigma = -1.0;
522 double radiusSigma = -1.0;
523 if (m_ui->pointLatitudeSigmaLineEdit->isModified()) {
524 latitudeSigma = m_ui->pointLatitudeSigmaLineEdit->text().toDouble();
526 if (m_ui->pointLongitudeSigmaLineEdit->isModified()) {
527 longitudeSigma = m_ui->pointLongitudeSigmaLineEdit->text().toDouble();
529 if (m_ui->pointRadiusSigmaLineEdit->isModified()) {
530 radiusSigma = m_ui->pointRadiusSigmaLineEdit->text().toDouble();
534 settings->setSolveOptions(m_ui->observationModeCheckBox->isChecked(),
537 m_ui->errorPropagationCheckBox->isChecked(),
538 m_ui->pointRadiusSigmaCheckBox->isChecked(),
543 settings->setOutlierRejection(m_ui->outlierRejectionCheckBox->isChecked(),
544 m_ui->outlierRejectionMultiplierLineEdit->text().toDouble());
548 m_ui->sigma0ThresholdLineEdit->text().toDouble(),
549 m_ui->maximumIterationsLineEdit->text().toInt());
552 if (m_ui->maximumLikelihoodModel1ComboBox->currentText().compare(
"NONE") != 0) {
554 settings->addMaximumLikelihoodEstimatorModel(
555 MaximumLikelihoodWFunctions::stringToModel(
556 m_ui->maximumLikelihoodModel1ComboBox->currentText()),
557 m_ui->maximumLikelihoodModel1QuantileLineEdit->text().toDouble());
559 if (m_ui->maximumLikelihoodModel2ComboBox->currentText().compare(
"NONE") != 0) {
561 settings->addMaximumLikelihoodEstimatorModel(
562 MaximumLikelihoodWFunctions::stringToModel(
563 m_ui->maximumLikelihoodModel2ComboBox->currentText()),
564 m_ui->maximumLikelihoodModel2QuantileLineEdit->text().toDouble());
566 if (m_ui->maximumLikelihoodModel3ComboBox->currentText().compare(
"NONE") != 0) {
568 settings->addMaximumLikelihoodEstimatorModel(
569 MaximumLikelihoodWFunctions::stringToModel(
570 m_ui->maximumLikelihoodModel3ComboBox->currentText()),
571 m_ui->maximumLikelihoodModel3QuantileLineEdit->text().toDouble());
577 if (m_ui->poleRaCheckBox->isChecked() ||
578 m_ui->poleRaVelocityCheckBox->isChecked() ||
579 m_ui->poleDecCheckBox->isChecked() ||
580 m_ui->poleDecVelocityCheckBox->isChecked() ||
581 m_ui->primeMeridianOffsetCheckBox->isChecked() ||
582 m_ui->spinRateCheckBox->isChecked() ||
583 !m_ui->noneRadiiRadioButton->isChecked()) {
589 if (m_ui->meanRadiusRadioButton->isChecked())
591 else if (m_ui->triaxialRadiiRadioButton->isChecked())
594 std::set<int> targetParameterSolveCodes;
595 if (m_ui->poleRaCheckBox->isChecked())
596 targetParameterSolveCodes.insert(BundleTargetBody::PoleRA);
597 if (m_ui->poleRaVelocityCheckBox->isChecked())
598 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPoleRA);
599 if (m_ui->poleDecCheckBox->isChecked())
600 targetParameterSolveCodes.insert(BundleTargetBody::PoleDec);
601 if (m_ui->poleDecVelocityCheckBox->isChecked())
602 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPoleDec);
603 if (m_ui->primeMeridianOffsetCheckBox->isChecked())
604 targetParameterSolveCodes.insert(BundleTargetBody::PM);
605 if (m_ui->spinRateCheckBox->isChecked())
606 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPM);
607 if (m_ui->triaxialRadiiRadioButton->isChecked()) {
608 targetParameterSolveCodes.insert(BundleTargetBody::TriaxialRadiusA);
609 targetParameterSolveCodes.insert(BundleTargetBody::TriaxialRadiusB);
610 targetParameterSolveCodes.insert(BundleTargetBody::TriaxialRadiusC);
612 else if (m_ui->meanRadiusRadioButton->isChecked())
613 targetParameterSolveCodes.insert(BundleTargetBody::MeanRadius);
615 double poleRASigma = -1.0;
616 double poleRAVelocitySigma = -1.0;
618 double poleDecSigma = -1.0;
619 double poleDecVelocitySigma = -1.0;
621 double pmSigma = -1.0;
622 double pmVelocitySigma = -1.0;
624 double aRadiusSigma = 0.0;
625 double bRadiusSigma = 0.0;
626 double cRadiusSigma = 0.0;
627 double meanRadiusSigma = 0.0;
629 if (m_ui->rightAscensionSigmaLineEdit->isModified())
630 poleRASigma = m_ui->rightAscensionSigmaLineEdit->text().toDouble();
631 if (m_ui->rightAscensionVelocityLineEdit->isModified())
632 poleRAVelocitySigma = m_ui->rightAscensionVelocityLineEdit->text().toDouble();
635 if (m_ui->declinationSigmaLineEdit->isModified())
636 poleDecSigma = m_ui->declinationSigmaLineEdit->text().toDouble();
637 if (m_ui->declinationVelocitySigmaLineEdit->isModified())
638 poleDecVelocitySigma = m_ui->declinationVelocitySigmaLineEdit->text().toDouble();
641 if (m_ui->primeMeridianOffsetSigmaLineEdit->isModified())
642 pmSigma = m_ui->primeMeridianOffsetSigmaLineEdit->text().toDouble();
643 if (m_ui->spinRateSigmaLineEdit->isModified())
644 pmVelocitySigma = m_ui->spinRateSigmaLineEdit->text().toDouble();
647 if (m_ui->aRadiusSigmaLineEdit->isModified())
648 aRadiusSigma = m_ui->aRadiusSigmaLineEdit->text().toDouble();
649 if (m_ui->bRadiusSigmaLineEdit->isModified())
650 bRadiusSigma = m_ui->bRadiusSigmaLineEdit->text().toDouble();
651 if (m_ui->cRadiusSigmaLineEdit->isModified())
652 cRadiusSigma = m_ui->cRadiusSigmaLineEdit->text().toDouble();
653 if (m_ui->meanRadiusSigmaLineEdit->isModified())
654 meanRadiusSigma = m_ui->meanRadiusSigmaLineEdit->text().toDouble();
656 bundleTargetBody->setSolveSettings(targetParameterSolveCodes,
679 settings->setBundleTargetBody(bundleTargetBody);
692 fillFromSettings(settings);
706 QComboBox &cnetBox = *(m_ui->inputControlNetCombo);
707 int foundControlIndex = cnetBox.findText(
FileName(controlName).name());
709 if (foundControlIndex == -1) {
710 if (cnetBox.count() == 0) {
711 cnetBox.setCurrentIndex(-1);
715 cnetBox.setCurrentIndex(0);
720 cnetBox.setCurrentIndex(foundControlIndex);
725 Control *JigsawSetupDialog::selectedControl() {
727 int nIndex = m_ui->inputControlNetCombo->currentIndex();
729 = (
Control *)(m_ui->inputControlNetCombo->itemData(nIndex).value<
void * >());
730 return selectedControl;
735 QString JigsawSetupDialog::selectedControlName() {
736 return QString(m_ui->inputControlNetCombo->currentText());
752 int ckSolveDegree = m_ui->ckSolveDegreeSpinBox->value();
753 int spkSolveDegree = m_ui->spkSolveDegreeSpinBox->value();
754 int ckDegree = m_ui->ckDegreeSpinBox->value();
755 int spkDegree = m_ui->spkDegreeSpinBox->value();
756 int instrumentPointingSolveOption=m_ui->pointingComboBox->currentIndex();
757 int instrumentPositionSolveOption=m_ui->positionComboBox->currentIndex();
762 double anglesAprioriSigma(-1.0);
763 double angularVelocityAprioriSigma(-1.0);
764 double angularAccelerationAprioriSigma(-1.0);
767 double positionAprioriSigma(-1.0);
768 double velocityAprioriSigma(-1.0);
769 double accelerationAprioriSigma(-1.0);
772 bool solveTwist(
false);
773 bool solvePolynomialOverExisting(
false);
774 bool positionOverHermite(
false);
776 if (m_ui->pointingAprioriSigmaTable->item(0,3))
777 anglesAprioriSigma = m_ui->pointingAprioriSigmaTable->item(0,3)->data(0).toDouble();
779 if (m_ui->pointingAprioriSigmaTable->item(1,3))
780 angularVelocityAprioriSigma = m_ui->pointingAprioriSigmaTable->item(1,3)->data(0).toDouble();
782 if (m_ui->pointingAprioriSigmaTable->item(2,3) )
783 angularAccelerationAprioriSigma = m_ui->pointingAprioriSigmaTable->item(2,3)->data(0).toDouble();
785 if (m_ui->positionAprioriSigmaTable->item(0,3))
786 positionAprioriSigma = m_ui->positionAprioriSigmaTable->item(0,3)->data(0).toDouble();
788 if (m_ui->positionAprioriSigmaTable->item(1,3))
789 velocityAprioriSigma = m_ui->positionAprioriSigmaTable->item(1,3)->data(0).toDouble();
791 if (m_ui->positionAprioriSigmaTable->item(2,3) )
792 accelerationAprioriSigma = m_ui->positionAprioriSigmaTable->item(2,3)->data(0).toDouble();
796 if (spkSolveDegree >2) {
797 for (
int i = 3;i <= spkSolveDegree;i++ ) {
798 if (m_ui->positionAprioriSigmaTable->item(i,3))
799 additionalPositionCoefficients.append(m_ui->positionAprioriSigmaTable->item(i,3)->data(0).toDouble() );
803 if (ckSolveDegree > 2) {
804 for (
int i = 3;i <= ckSolveDegree;i++ ) {
805 if (m_ui->pointingAprioriSigmaTable->item(i,3))
806 additionalAngularCoefficients.append(m_ui->pointingAprioriSigmaTable->item(i,3)->data(0).toDouble() );
812 if (m_ui->twistCheckBox->checkState() == Qt::Checked)
814 if (m_ui->fitOverPointingCheckBox->checkState() == Qt::Checked)
815 solvePolynomialOverExisting =
true;
816 if (m_ui->hermiteSplineCheckBox->checkState() == Qt::Checked)
817 positionOverHermite =
true;
819 switch(instrumentPointingSolveOption) {
821 case 0: pointSolvingOption = BundleObservationSolveSettings::InstrumentPointingSolveOption::NoPointingFactors;
823 case 1:pointSolvingOption = BundleObservationSolveSettings::InstrumentPointingSolveOption::AnglesOnly;
825 case 2:pointSolvingOption = BundleObservationSolveSettings::InstrumentPointingSolveOption::AnglesVelocity;
827 case 3:pointSolvingOption = BundleObservationSolveSettings::InstrumentPointingSolveOption::AnglesVelocityAcceleration;
830 case 4:pointSolvingOption = BundleObservationSolveSettings::InstrumentPointingSolveOption::AllPointingCoefficients;
832 default: pointSolvingOption = BundleObservationSolveSettings::InstrumentPointingSolveOption::NoPointingFactors;
837 switch(instrumentPositionSolveOption) {
839 case 0: positionSolvingOption = BundleObservationSolveSettings::InstrumentPositionSolveOption::NoPositionFactors;
841 case 1:positionSolvingOption = BundleObservationSolveSettings::InstrumentPositionSolveOption::PositionOnly;
843 case 2:positionSolvingOption = BundleObservationSolveSettings::InstrumentPositionSolveOption::PositionVelocity;
845 case 3:positionSolvingOption = BundleObservationSolveSettings::InstrumentPositionSolveOption::PositionVelocityAcceleration;
848 case 4:positionSolvingOption = BundleObservationSolveSettings::InstrumentPositionSolveOption::AllPositionCoefficients;
850 default: positionSolvingOption = BundleObservationSolveSettings::InstrumentPositionSolveOption::NoPositionFactors;
857 positionAprioriSigma,velocityAprioriSigma,accelerationAprioriSigma,
858 &additionalPositionCoefficients);
861 anglesAprioriSigma,angularVelocityAprioriSigma,angularAccelerationAprioriSigma,
862 &additionalAngularCoefficients);
870 QModelIndexList selectedIndexes = m_ui->treeView->selectionModel()->selectedIndexes();
872 foreach (QModelIndex index, selectedIndexes) {
874 QModelIndex sourceix = proxyModel->mapToSource(index);
880 Image * img = projItem->data().value<
Image *>();
891 QString JigsawSetupDialog::outputControlName() {
892 return QString(m_ui->outputControlNetLineEdit->text());
896 void JigsawSetupDialog::makeReadOnly() {
897 m_ui->inputControlNetCombo->setEnabled(
false);
898 m_ui->observationModeCheckBox->setEnabled(
false);
899 m_ui->pointRadiusSigmaCheckBox->setEnabled(
false);
901 m_ui->errorPropagationCheckBox->setEnabled(
false);
902 m_ui->outlierRejectionCheckBox->setEnabled(
false);
903 m_ui->outlierRejectionMultiplierLineEdit->setEnabled(
false);
904 m_ui->sigma0ThresholdLineEdit->setEnabled(
false);
905 m_ui->maximumIterationsLineEdit->setEnabled(
false);
907 m_ui->hermiteSplineCheckBox->setEnabled(
false);
908 m_ui->spkDegreeSpinBox->setEnabled(
false);
909 m_ui->spkSolveDegreeSpinBox->setEnabled(
false);
910 m_ui->twistCheckBox->setEnabled(
false);
912 m_ui->fitOverPointingCheckBox->setEnabled(
false);
913 m_ui->ckDegreeSpinBox->setEnabled(
false);
914 m_ui->ckSolveDegreeSpinBox->setEnabled(
false);
917 m_ui->treeView->setEnabled(
false);
918 m_ui->positionComboBox->setEnabled(
false);
919 m_ui->spkSolveDegreeSpinBox->setEnabled(
false);
920 m_ui->spkDegreeSpinBox->setEnabled(
false);
921 m_ui->hermiteSplineCheckBox->setEnabled(
false);
922 m_ui->positionAprioriSigmaTable->setEnabled(
false);
923 m_ui->pointingComboBox->setEnabled(
false);
924 m_ui->ckSolveDegreeSpinBox->setEnabled(
false);
925 m_ui->ckDegreeSpinBox->setEnabled(
false);
926 m_ui->twistCheckBox->setEnabled(
false);
927 m_ui->fitOverPointingCheckBox->setEnabled(
false);
928 m_ui->pointingAprioriSigmaTable->setEnabled(
false);
929 m_ui->applySettingsPushButton->setEnabled(
false);
932 m_ui->targetBodyComboBox->setEnabled(
false);
933 m_ui->poleRaCheckBox->setEnabled(
false);
934 m_ui->rightAscensionLineEdit->setEnabled(
false);
935 m_ui->rightAscensionSigmaLineEdit->setEnabled(
false);
936 m_ui->rightAscensionVelocityLineEdit->setEnabled(
false);
937 m_ui->rightAscensionVelocitySigmaLineEdit->setEnabled(
false);
938 m_ui->poleDecCheckBox->setEnabled(
false);
939 m_ui->declinationLineEdit->setEnabled(
false);
940 m_ui->declinationSigmaLineEdit->setEnabled(
false);
941 m_ui->declinationVelocityLineEdit->setEnabled(
false);
942 m_ui->declinationVelocitySigmaLineEdit->setEnabled(
false);
943 m_ui->primeMeridianOffsetCheckBox->setEnabled(
false);
944 m_ui->primeMeridianOffsetLineEdit->setEnabled(
false);
945 m_ui->primeMeridianOffsetSigmaLineEdit->setEnabled(
false);
946 m_ui->spinRateCheckBox->setEnabled(
false);
947 m_ui->spinRateLineEdit->setEnabled(
false);
948 m_ui->spinRateSigmaLineEdit->setEnabled(
false);
949 m_ui->radiiGroupBox->setEnabled(
false);
950 m_ui->aRadiusLineEdit->setEnabled(
false);
951 m_ui->aRadiusSigmaLineEdit->setEnabled(
false);
952 m_ui->bRadiusLineEdit->setEnabled(
false);
953 m_ui->bRadiusSigmaLineEdit->setEnabled(
false);
954 m_ui->cRadiusLineEdit->setEnabled(
false);
955 m_ui->cRadiusSigmaLineEdit->setEnabled(
false);
956 m_ui->meanRadiusLineEdit->setEnabled(
false);
957 m_ui->meanRadiusSigmaLineEdit->setEnabled(
false);
963 void Isis::JigsawSetupDialog::on_poleRaCheckBox_stateChanged(
int arg1) {
965 m_ui->rightAscensionLineEdit->setEnabled(
true);
966 m_ui->rightAscensionSigmaLineEdit->setEnabled(
true);
969 m_ui->rightAscensionLineEdit->setEnabled(
false);
970 m_ui->rightAscensionSigmaLineEdit->setEnabled(
false);
977 void Isis::JigsawSetupDialog::on_poleRaVelocityCheckBox_stateChanged(
int arg1) {
979 m_ui->rightAscensionVelocityLineEdit->setEnabled(
true);
980 m_ui->rightAscensionVelocitySigmaLineEdit->setEnabled(
true);
983 m_ui->rightAscensionVelocityLineEdit->setEnabled(
false);
984 m_ui->rightAscensionVelocitySigmaLineEdit->setEnabled(
false);
991 void Isis::JigsawSetupDialog::on_poleDecCheckBox_stateChanged(
int arg1) {
993 m_ui->declinationLineEdit->setEnabled(
true);
994 m_ui->declinationSigmaLineEdit->setEnabled(
true);
997 m_ui->declinationLineEdit->setEnabled(
false);
998 m_ui->declinationSigmaLineEdit->setEnabled(
false);
1005 void Isis::JigsawSetupDialog::on_poleDecVelocityCheckBox_stateChanged(
int arg1) {
1007 m_ui->declinationVelocityLineEdit->setEnabled(
true);
1008 m_ui->declinationVelocitySigmaLineEdit->setEnabled(
true);
1011 m_ui->declinationVelocityLineEdit->setEnabled(
false);
1012 m_ui->declinationVelocitySigmaLineEdit->setEnabled(
false);
1019 void Isis::JigsawSetupDialog::on_spinRateCheckBox_stateChanged(
int arg1) {
1021 m_ui->spinRateLineEdit->setEnabled(
true);
1022 m_ui->spinRateSigmaLineEdit->setEnabled(
true);
1025 m_ui->spinRateLineEdit->setEnabled(
false);
1026 m_ui->spinRateSigmaLineEdit->setEnabled(
false);
1033 void Isis::JigsawSetupDialog::on_primeMeridianOffsetCheckBox_stateChanged(
int arg1) {
1035 m_ui->primeMeridianOffsetLineEdit->setEnabled(
true);
1036 m_ui->primeMeridianOffsetSigmaLineEdit->setEnabled(
true);
1039 m_ui->primeMeridianOffsetLineEdit->setEnabled(
false);
1040 m_ui->primeMeridianOffsetSigmaLineEdit->setEnabled(
false);
1047 void Isis::JigsawSetupDialog::on_radiiButtonGroupClicked(
int arg1) {
1050 m_ui->aRadiusLabel->setEnabled(
false);
1051 m_ui->aRadiusLineEdit->setEnabled(
false);
1052 m_ui->aRadiusSigmaLineEdit->setEnabled(
false);
1053 m_ui->bRadiusLabel->setEnabled(
false);
1054 m_ui->bRadiusLineEdit->setEnabled(
false);
1055 m_ui->bRadiusSigmaLineEdit->setEnabled(
false);
1056 m_ui->cRadiusLabel->setEnabled(
false);
1057 m_ui->cRadiusLineEdit->setEnabled(
false);
1058 m_ui->cRadiusSigmaLineEdit->setEnabled(
false);
1059 m_ui->meanRadiusLineEdit->setEnabled(
false);
1060 m_ui->meanRadiusSigmaLineEdit->setEnabled(
false);
1064 m_ui->pointRadiusSigmaCheckBox->setEnabled(
true);
1066 else if (arg1 == 1) {
1067 m_ui->aRadiusLabel->setEnabled(
true);
1068 m_ui->aRadiusLineEdit->setEnabled(
true);
1069 m_ui->aRadiusSigmaLineEdit->setEnabled(
true);
1070 m_ui->bRadiusLabel->setEnabled(
true);
1071 m_ui->bRadiusLineEdit->setEnabled(
true);
1072 m_ui->bRadiusSigmaLineEdit->setEnabled(
true);
1073 m_ui->cRadiusLabel->setEnabled(
true);
1074 m_ui->cRadiusLineEdit->setEnabled(
true);
1075 m_ui->cRadiusSigmaLineEdit->setEnabled(
true);
1076 m_ui->meanRadiusLineEdit->setEnabled(
false);
1077 m_ui->meanRadiusSigmaLineEdit->setEnabled(
false);
1082 m_ui->pointRadiusSigmaCheckBox->setChecked(
false);
1083 m_ui->pointRadiusSigmaCheckBox->setEnabled(
false);
1085 QMessageBox *msgBox =
new QMessageBox(QMessageBox::Information,
"Triaxial Radii Reminder!",
1086 "Individual point radii and target body triaxial radii can't be solved for" 1087 " simultaneously so we've unchecked and disabled the Radius checkbox under the" 1088 " General Settings tab.", QMessageBox::Ok,
this);
1091 else if (arg1 == 2) {
1092 m_ui->aRadiusLabel->setEnabled(
false);
1093 m_ui->aRadiusLineEdit->setEnabled(
false);
1094 m_ui->aRadiusSigmaLineEdit->setEnabled(
false);
1095 m_ui->bRadiusLabel->setEnabled(
false);
1096 m_ui->bRadiusLineEdit->setEnabled(
false);
1097 m_ui->bRadiusSigmaLineEdit->setEnabled(
false);
1098 m_ui->cRadiusLabel->setEnabled(
false);
1099 m_ui->cRadiusLineEdit->setEnabled(
false);
1100 m_ui->cRadiusSigmaLineEdit->setEnabled(
false);
1101 m_ui->meanRadiusLineEdit->setEnabled(
true);
1102 m_ui->meanRadiusSigmaLineEdit->setEnabled((
true));
1107 m_ui->pointRadiusSigmaCheckBox->setChecked(
false);
1108 m_ui->pointRadiusSigmaCheckBox->setEnabled(
false);
1110 QMessageBox *msgBox =
new QMessageBox(QMessageBox::Information,
"Mean Radius Reminder!",
1111 "Individual point radii and target body mean radius can't be solved for" 1112 " simultaneously so we've unchecked and disabled the Radius checkbox under the" 1113 " General Settings tab.", QMessageBox::Ok,
this);
1121 void Isis::JigsawSetupDialog::checkIsValid() {
1122 if (!m_ui->aRadiusSigmaLineEdit->hasAcceptableInput()) {
1130 void Isis::JigsawSetupDialog::slotTextChanged(
const QString &text) {
1135 void Isis::JigsawSetupDialog::on_aRadiusLineEdit_textChanged(
const QString &arg1) {
1140 void Isis::JigsawSetupDialog::on_targetBodyComboBox_currentIndexChanged(
int index) {
1146 m_ui->targetParametersMessage->hide();
1148 std::vector<Angle> raCoefs = target->poleRaCoefs();
1149 std::vector<Angle> decCoefs = target->poleDecCoefs();
1150 std::vector<Angle> pmCoefs = target->pmCoefs();
1152 showTargetParametersGroupBox();
1154 m_ui->rightAscensionLineEdit->setText(
toString(raCoefs[0].degrees()));
1155 m_ui->rightAscensionVelocityLineEdit->setText(
toString(raCoefs[1].degrees()));
1156 m_ui->declinationLineEdit->setText(
toString(decCoefs[0].degrees()));
1157 m_ui->declinationVelocityLineEdit->setText(
toString(decCoefs[1].degrees()));
1158 m_ui->primeMeridianOffsetLineEdit->setText(
toString(pmCoefs[0].degrees()));
1159 m_ui->spinRateLineEdit->setText(
toString(pmCoefs[1].degrees()));
1164 if (target->displayProperties()->displayName() ==
"MOON") {
1165 msg =
"Target body parameter cannot be solved for the Moon.";
1168 msg =
"The body frame type is unknown. If you want to solve the target body parameters, " 1169 "you must run spiceinit on the cubes.";
1171 m_ui->targetParametersMessage->setText(msg);
1172 m_ui->targetParametersMessage->show();
1173 hideTargetParametersGroupBox();
1176 m_ui->aRadiusLineEdit->setText(
toString(target->radiusA().kilometers()));
1179 m_ui->bRadiusLineEdit->setText(
toString(target->radiusB().kilometers()));
1182 m_ui->cRadiusLineEdit->setText(
toString(target->radiusC().kilometers()));
1185 m_ui->meanRadiusLineEdit->setText(
toString(target->meanRadius().kilometers()));
1191 void Isis::JigsawSetupDialog::on_rightAscensionLineEdit_textChanged(
const QString &arg1) {
1192 if (!m_ui->rightAscensionLineEdit->hasAcceptableInput()) {
1193 m_ui->rightAscensionLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1194 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1197 m_ui->rightAscensionLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1198 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1204 void Isis::JigsawSetupDialog::on_declinationLineEdit_textChanged(
const QString &arg1) {
1205 if (!m_ui->declinationLineEdit->hasAcceptableInput()) {
1206 m_ui->declinationLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1207 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1210 m_ui->declinationLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1211 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1217 void Isis::JigsawSetupDialog::on_rightAscensionVelocityLineEdit_textChanged(
const QString &arg1) {
1218 if (!m_ui->rightAscensionVelocityLineEdit->hasAcceptableInput()) {
1219 m_ui->rightAscensionVelocityLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1220 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1223 m_ui->rightAscensionVelocityLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1224 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1230 void Isis::JigsawSetupDialog::on_declinationVelocityLineEdit_textChanged(
const QString &arg1) {
1231 if (!m_ui->declinationVelocityLineEdit->hasAcceptableInput()) {
1232 m_ui->declinationVelocityLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1233 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1236 m_ui->declinationVelocityLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1237 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1243 void Isis::JigsawSetupDialog::on_primeMeridianOffsetLineEdit_textChanged(
const QString &arg1) {
1244 if (!m_ui->primeMeridianOffsetLineEdit->hasAcceptableInput()) {
1245 m_ui->primeMeridianOffsetLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1246 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1249 m_ui->primeMeridianOffsetLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1250 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1256 void Isis::JigsawSetupDialog::on_spinRateLineEdit_textChanged(
const QString &arg1) {
1257 if (!m_ui->spinRateLineEdit->hasAcceptableInput()) {
1258 m_ui->spinRateLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1259 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1262 m_ui->spinRateLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1263 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1270 void Isis::JigsawSetupDialog::on_pointLatitudeSigmaLineEdit_textChanged(
const QString &arg1) {
1271 if (arg1 ==
"" || m_ui->pointLatitudeSigmaLineEdit->hasAcceptableInput()) {
1272 m_ui->pointLatitudeSigmaLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1273 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1276 m_ui->pointLatitudeSigmaLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1277 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1282 void Isis::JigsawSetupDialog::on_pointLongitudeSigmaLineEdit_textChanged(
const QString &arg1) {
1283 if (arg1 ==
"" || m_ui->pointLongitudeSigmaLineEdit->hasAcceptableInput()) {
1284 m_ui->pointLongitudeSigmaLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1285 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1288 m_ui->pointLongitudeSigmaLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1289 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1295 void Isis::JigsawSetupDialog::on_pointRadiusSigmaLineEdit_textChanged(
const QString &arg1) {
1296 if (arg1 ==
"" || m_ui->pointRadiusSigmaLineEdit->hasAcceptableInput()) {
1297 m_ui->pointRadiusSigmaLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1298 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1301 m_ui->pointRadiusSigmaLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1302 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1308 void Isis::JigsawSetupDialog::on_maximumLikelihoodModel1QuantileLineEdit_textChanged(
const QString &arg1) {
1309 if (!m_ui->maximumLikelihoodModel1QuantileLineEdit->isEnabled() ||
1310 m_ui->maximumLikelihoodModel1QuantileLineEdit->hasAcceptableInput()) {
1311 m_ui->maximumLikelihoodModel1QuantileLineEdit->setStyleSheet(
"");
1312 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1315 m_ui->maximumLikelihoodModel1QuantileLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1316 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1322 void Isis::JigsawSetupDialog::on_maximumLikelihoodModel2QuantileLineEdit_textChanged(
const QString &arg1) {
1323 if (!m_ui->maximumLikelihoodModel2QuantileLineEdit->isEnabled() ||
1324 m_ui->maximumLikelihoodModel2QuantileLineEdit->hasAcceptableInput()) {
1325 m_ui->maximumLikelihoodModel2QuantileLineEdit->setStyleSheet(
"");
1326 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1329 m_ui->maximumLikelihoodModel2QuantileLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1330 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1336 void Isis::JigsawSetupDialog::on_maximumLikelihoodModel3QuantileLineEdit_textChanged(
const QString &arg1) {
1337 if (!m_ui->maximumLikelihoodModel3QuantileLineEdit->isEnabled() ||
1338 m_ui->maximumLikelihoodModel3QuantileLineEdit->hasAcceptableInput()) {
1339 m_ui->maximumLikelihoodModel3QuantileLineEdit->setStyleSheet(
"");
1340 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1343 m_ui->maximumLikelihoodModel3QuantileLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1344 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1351 void Isis::JigsawSetupDialog::on_outlierRejectionMultiplierLineEdit_textChanged(
const QString &arg1) {
1352 if (!m_ui->outlierRejectionCheckBox->isChecked() ||
1353 m_ui->outlierRejectionMultiplierLineEdit->hasAcceptableInput()) {
1354 m_ui->outlierRejectionMultiplierLineEdit->setStyleSheet(
"");
1355 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1358 m_ui->outlierRejectionMultiplierLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1359 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1365 void Isis::JigsawSetupDialog::on_sigma0ThresholdLineEdit_textChanged(
const QString &arg1) {
1366 if (m_ui->sigma0ThresholdLineEdit->hasAcceptableInput()) {
1367 m_ui->sigma0ThresholdLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1368 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1371 m_ui->sigma0ThresholdLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1372 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1378 void Isis::JigsawSetupDialog::on_maximumIterationsLineEdit_textChanged(
const QString &arg1) {
1379 if (m_ui->maximumIterationsLineEdit->hasAcceptableInput()) {
1380 m_ui->maximumIterationsLineEdit->setStyleSheet(
"QLineEdit { background-color: white }");
1381 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
1384 m_ui->maximumIterationsLineEdit->setStyleSheet(
"QLineEdit { background-color: red }");
1385 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
1391 void JigsawSetupDialog::showTargetParametersGroupBox() {
1392 m_ui->targetParametersGroupBox->setEnabled(
true);
1396 void JigsawSetupDialog::hideTargetParametersGroupBox() {
1397 m_ui->targetParametersGroupBox->setEnabled(
false);
1400 void Isis::JigsawSetupDialog::on_inputControlNetCombo_currentTextChanged(
const QString &arg1) {
1402 m_ui->outputControlNetLineEdit->setText(fname.
baseName() +
"-out.net");
1417 if (item->column() != 3) {
1421 int free = item->text().simplified().compare(
"FREE", Qt::CaseInsensitive);
1424 bool convertSuccess =
false;
1425 double sigma = item->text().toDouble(&convertSuccess);
1426 if ((convertSuccess && sigma >= 0.0) || free == 0) {
1427 const QTableWidget *table = item->tableWidget();
1428 item->setData(Qt::UserRole, QVariant(
true));
1430 if (table->alternatingRowColors() && item->row() % 2 != 0) {
1431 item->setBackground(table->palette().color(QPalette::AlternateBase));
1434 item->setBackground(table->palette().color(QPalette::Base));
1438 item->setText(
"FREE");
1442 item->setData(Qt::UserRole, QVariant(
false));
1443 item->setBackground(Qt::red);
1460 bool tablesAreValid =
true;
1464 m_ui->pointingAprioriSigmaTable};
1466 for (
const auto &table : tables) {
1467 for (
int i = 0; i < table->rowCount(); i++) {
1469 const QTableWidgetItem *item = table->item(i,3);
1471 if (item->data(Qt::UserRole).toBool() ==
false) {
1472 tablesAreValid =
false;
1479 m_ui->okCloseButtonBox->button(QDialogButtonBox::Ok)->setEnabled(tablesAreValid);
1480 if (!m_ui->treeView->selectionModel()->selectedRows().isEmpty()) {
1481 m_ui->applySettingsPushButton->setEnabled(tablesAreValid);
1528 QTableWidget *table) {
1529 int rowCount = solveOptionComboBox->currentIndex();
1536 if (rowCount == 4) {
1537 if (solveOptionComboBox == m_ui->positionComboBox) {
1538 rowCount = m_ui->spkSolveDegreeSpinBox->value() + 1;
1541 rowCount = m_ui->ckSolveDegreeSpinBox->value() + 1;
1546 const int oldRowCount = table->rowCount();
1548 table->setRowCount(rowCount);
1549 const int newRowCount = table->rowCount();
1557 QString longUnits(
"N/A");
1558 QString shortUnits(
"N/A");
1559 if (solveOptionComboBox == m_ui->positionComboBox) {
1560 longUnits =
"meters";
1562 solveOptions += {
"POSITION",
"VELOCITY",
"ACCELERATION"};
1565 longUnits =
"degrees";
1567 solveOptions += {
"ANGLES",
"ANGULAR VELOCITY",
"ANGULAR ACCELERATION"};
1571 if (newRowCount > oldRowCount) {
1572 for (
int row = oldRowCount; row < newRowCount; row++) {
1574 QTableWidgetItem *coefficient =
new QTableWidgetItem();
1575 coefficient->setFlags(Qt::ItemIsEnabled);
1576 coefficient->setText(QString::number(row + 1));
1577 table->setItem(row, 0, coefficient);
1579 QTableWidgetItem *description =
new QTableWidgetItem();
1580 description->setFlags(Qt::ItemIsEnabled);
1581 description->setText(
"N/A");
1582 table->setItem(row, 1, description);
1584 QTableWidgetItem *units =
new QTableWidgetItem();
1585 units->setFlags(Qt::ItemIsEnabled);
1586 units->setText(shortUnits +
"/s^" + QString::number(row));
1587 table->setItem(row, 2, units);
1589 QTableWidgetItem *sigma =
new QTableWidgetItem();
1590 sigma->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
1591 sigma->setText(
"0.0");
1592 sigma->setData(Qt::UserRole, QVariant(
true));
1593 table->setItem(row, 3, sigma);
1598 QTableWidgetItem *description = table->item(0, 1);
1599 description->setText(solveOptions.at(row));
1601 QTableWidgetItem *units = table->item(0, 2);
1602 units->setText(longUnits);
1606 else if (row == 1) {
1607 QTableWidgetItem *description = table->item(1, 1);
1608 description->setText(solveOptions.at(row));
1610 QTableWidgetItem *units = table->item(1, 2);
1611 units->setText(shortUnits +
"/s");
1615 else if (row == 2) {
1616 QTableWidgetItem *description = table->item(2, 1);
1617 description->setText(solveOptions.at(row));
1619 QTableWidgetItem *units = table->item(2, 2);
1620 units->setText(shortUnits +
"/s^2");
1625 table->resizeColumnToContents(1);
1626 table->resizeColumnToContents(2);
1640 int solveIndex = m_ui->positionComboBox->currentIndex();
1641 QList<QSpinBox *> spinBoxes{m_ui->spkSolveDegreeSpinBox, m_ui->spkDegreeSpinBox};
1642 for (
auto &spinBox : spinBoxes) {
1646 if (arg1 ==
"ALL") {
1647 spinBox->setValue(solveIndex - 2);
1648 spinBox->setEnabled(
true);
1653 spinBox->setValue(2);
1654 spinBox->setEnabled(
false);
1672 int solveIndex = m_ui->pointingComboBox->currentIndex();
1674 for (
auto &spinBox : spinBoxes) {
1678 if (arg1 ==
"ALL") {
1679 spinBox->setValue(solveIndex - 2);
1680 spinBox->setEnabled(
true);
1685 spinBox->setValue(2);
1686 spinBox->setEnabled(
false);
1695 void JigsawSetupDialog::createObservationSolveSettingsTreeView() {
1702 osspm->setSourceModel(model);
1705 osspm->setSelectedItems(selectedBOSSItems );
1706 m_ui->treeView->setModel(osspm);
1714 m_ui->treeView->setRootIndex(osspm->mapFromSource(imgRoot->index()));
1717 m_ui->treeView->setRootIndex(QModelIndex());
1720 connect(m_ui->treeView->selectionModel(),
1721 SIGNAL(selectionChanged(
const QItemSelection&,
const QItemSelection&)),
1723 SLOT(treeViewSelectionChanged(
const QItemSelection&,
const QItemSelection&)));
1735 void JigsawSetupDialog::treeViewSelectionChanged(
const QItemSelection &selected,
1736 const QItemSelection &deselected) {
1737 QModelIndexList indexList = m_ui->treeView->selectionModel()->selectedRows();
1744 if (!indexList.isEmpty()) {
1745 QModelIndex displayIndex = indexList[0];
1750 QModelIndex sourceIndex = proxyModel->mapToSource(displayIndex);
1754 projItem = projItem->
child(0);
1762 m_ui->spkSolveDegreeSpinBox->setValue(settings.
spkSolveDegree());
1763 m_ui->spkDegreeSpinBox->setValue(settings.
spkDegree());
1767 QTableWidgetItem * sigmaItem = m_ui->positionAprioriSigmaTable->item(row, 3);
1770 sigmaItem->setText(
"FREE");
1773 sigmaItem->setText(QString::number(sigma));
1779 m_ui->ckSolveDegreeSpinBox->setValue(settings.
ckSolveDegree());
1780 m_ui->ckDegreeSpinBox->setValue(settings.
ckDegree());
1781 m_ui->twistCheckBox->setChecked(settings.
solveTwist());
1785 QTableWidgetItem * sigmaItem = m_ui->pointingAprioriSigmaTable->item(row, 3);
1788 sigmaItem->setText(
"FREE");
1791 sigmaItem->setText(QString::number(sigma));
1797 m_ui->applySettingsPushButton->setEnabled(!selected.isEmpty());
1814 QModelIndexList selectedIndexes = m_ui->treeView->selectionModel()->selectedIndexes();
1818 foreach (QModelIndex index, selectedIndexes) {
1819 QModelIndex sourceIndex = proxyModel->mapToSource(index);
1828 if (!selectedObservationNumbers.contains(observationNumber)) {
1829 selectedObservationNumbers.append(observationNumber);
1834 for (
int i = 0; i < proxyModel->rowCount(index); i++) {
1835 QModelIndex childProxyIndex = proxyModel->index(i, 0, index);
1836 QModelIndex childSourceIndex = proxyModel->mapToSource(childProxyIndex);
1848 for (
auto &solveSettings : solveSettingsList) {
1849 foreach (QString observationNumber, selectedObservationNumbers) {
1850 solveSettings.removeObservationNumber(observationNumber);
1857 while (iter < solveSettingsList.count()) {
1858 if (solveSettingsList[iter].observationNumbers().isEmpty() ) {
1859 solveSettingsList.removeAt(iter);
1868 foreach (QString observationNumber, selectedObservationNumbers) {
1877 solveSettingsList.append(solveSettings);
This represents an ISIS control net in a project-based GUI interface.
This class is used to represent a target body in a bundle and how to solve for it.
void updateBundleObservationSolveSettings(BundleObservationSolveSettings &boss)
updateBundleObservationSolveSettings: This function sets the parameters of a BundleObservationSolveSe...
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
Isis specific code for binary pck.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
virtual CameraType GetCameraType() const =0
Returns the type of camera that was created.
const double Null
Value for an Isis Null pixel.
The value of sigma0 will be used to determine that the bundle adjustment has converged.
The main project for ipce.
bool isImage() const
Returns true if an Image is stored in the data of the item.
void loadSettings(const BundleSettingsQsp settings)
Loads the passed bundle settings into the setup dialog.
File name manipulation and expansion.
ProjectItem * itemFromIndex(const QModelIndex &index)
Returns the ProjectItem corresponding to a given QModelIndex.
void selectControl(const QString &controlName)
Selects a control in the control network combo box by trying to find an item with the matching name...
QSet< QString > observationNumbers() const
Returns a list of observation numbers associated with these solve settings.
Camera * camera()
Return a camera associated with the cube.
InstrumentPositionSolveOption instrumentPositionSolveOption() const
Accesses the instrument position solve option.
Maintains a list of Controls so that control nets can easily be copied from one Project to another...
void on_pointingComboBox_currentIndexChanged(const QString &arg1)
Slot that listens for when the Instrument Pointing Solve Option combobox changes. ...
void on_spkSolveDegreeSpinBox_valueChanged(int arg1)
Slot that listens for changes to the SPK Solve Degree spin box.
QSharedPointer< BundleTargetBody > BundleTargetBodyQsp
Definition for BundleTargetBodyQsp, a QSharedPointer to a BundleTargetBody.
QString displayName() const
Returns the display name.
bool solvePositionOverHermite() const
Whether or not the polynomial for solving will be fit over an existing Hermite spline.
The distance is being specified in kilometers.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Solve for pointing angles, their velocities and their accelerations.
void on_positionComboBox_currentIndexChanged(const QString &arg1)
Slot that listens for when the Instrument Position Solve Option combobox changes. ...
void validateSigmaValue(QTableWidgetItem *)
Validates the a priori sigma values for a given QTableWidgetItem.
void on_ckSolveDegreeSpinBox_valueChanged(int arg1)
Slot that listens for changes to the CK Solve Degree spin box.
Distance measurement, usually in meters.
void on_applySettingsPushButton_clicked()
Slot for handling the Observation Solve Settings tab's Apply button.
Provides access to data stored in a Project through Qt's model-view framework.
Isis specific code for unknown frame type.
Planetocentric latitudinal (lat/lon/rad) coordinates.
ProjectItem * findItemData(const QVariant &data, int role=Qt::UserRole+1)
Returns the first item found that contains the given data in the given role or a null pointer if no i...
int ckDegree() const
Accesses the degree of polynomial fit to original camera angles (ckDegree).
InstrumentPointingSolveOption instrumentPointingSolveOption() const
Accesses the instrument pointing solve option.
Directory * directory() const
Returns the directory associated with this Project.
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
int ckSolveDegree() const
Accesses the degree of the camera angles polynomial being fit to in the bundle adjustment (ckSolveDeg...
int spkSolveDegree() const
Accesses the degree of thecamera position polynomial being fit to in the bundle adjustment (spkSolveD...
void addObservationNumber(QString observationNumber)
Associates an observation number with these solve settings.
void updateSolveSettingsSigmaTables(const QComboBox *solveOptionComboBox, QTableWidget *table)
Slot that updates the sigma tables based on the current solve option selection.
TargetRadiiSolveMethod
Enumeration that defines how to solve for target radii.
QSharedPointer< BundleSettings > BundleSettingsQsp
Definition for a BundleSettingsQsp, a shared pointer to a BundleSettings object.
void validateSigmaTables()
Validates the tables in the observation solve settings tab and enables/disables the OK button appropr...
Container class for BundleAdjustment settings.
bool solvePolyOverPointing() const
Whether or not the solve polynomial will be fit over the existing pointing polynomial.
TargetBodyList targetBodies()
Return TargetBodyList in Project.
This represents a cube in a project-based GUI interface.
Image * image() const
Returns the Image stored in the data of the item.
void setInstrumentPositionSettings(InstrumentPositionSolveOption option, int spkDegree=2, int spkSolveDegree=2, bool positionOverHermite=false, double positionAprioriSigma=-1.0, double velocityAprioriSigma=-1.0, double accelerationAprioriSigma=-1.0, QList< double > *additionalPositionSigmas=nullptr)
Sets the instrument pointing settings.
void setInstrumentId(QString instrumentId)
Sets the instrument id for this observation.
QList< ControlList * > controls()
Return controls in project.
QList< double > aprioriPositionSigmas() const
Accesses the a priori position sigmas.
This class is used to modify and manage solve settings for 1 to many BundleObservations.
QString observationNumber()
Returns the observation number of the Cube.
Defines an angle and provides unit conversions.
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
QString baseName() const
Returns the name of the file without the path and without extensions.
QList< BundleSolutionInfo * > bundleSolutionInfo()
Return BundleSolutionInfo objects in Project.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
ProjectItem * child(int row) const
Returns the child item at a given row.
void setInstrumentPointingSettings(InstrumentPointingSolveOption option, bool solveTwist, int ckDegree=2, int ckSolveDegree=2, bool solvePolynomialOverExisting=false, double anglesAprioriSigma=-1.0, double angularVelocityAprioriSigma=-1.0, double angularAccelerationAprioriSigma=-1.0, QList< double > *additionalPointingSigmas=nullptr)
Sets the instrument pointing settings.
QList< ProjectItem * > selectedItems()
Returns a list of the selected items of the internal selection model.
Represents an item of a ProjectItemModel in Qt's model-view framework.
QList< ProjectItem * > selectedBOSSImages()
ProjectItemModel::selectedBOSSImages.
InstrumentPositionSolveOption
Options for how to solve for instrument position.
Namespace for ISIS/Bullet specific routines.
bool IsNullPixel(const double d)
Returns if the input pixel is null.
Cube * cube()
Get the Cube pointer associated with this display property.
The distance is being specified in meters.
InstrumentPointingSolveOption
Options for how to solve for instrument pointing.
int spkDegree() const
Accesses the degree of the polynomial fit to the original camera position (spkDegree).
BundleSettingsQsp m_bundleSettings
The BundleSettings Object created by this dialog.
bool solveTwist() const
Accesses the flag for solving for twist.
QList< double > aprioriPointingSigmas() const
Accesses the a priori pointing sigmas.