diff --git a/kstars/ekos/capture/capture.cpp b/kstars/ekos/capture/capture.cpp --- a/kstars/ekos/capture/capture.cpp +++ b/kstars/ekos/capture/capture.cpp @@ -316,6 +316,11 @@ customPropertiesDialog.get()->show(); customPropertiesDialog.get()->raise(); }); + connect(customPropertiesDialog.get(), &CustomProperties::slotChanged, [&]() + { + const double newGain = getGain(); + if (newGain != -1) GainSpin->setValue(newGain); + }); flatFieldSource = static_cast(Options::calibrationFlatSourceIndex()); flatFieldDuration = static_cast(Options::calibrationFlatDurationIndex()); @@ -2329,6 +2334,8 @@ if (ISOCombo) job->setISOIndex(ISOCombo->currentIndex()); + if (getGain() != -1) job->setGain(getGain()); + job->setTransforFormat(static_cast(transferFormatCombo->currentIndex())); job->setPreview(preview); @@ -2471,12 +2478,17 @@ if (ISOCombo && ISOCombo->currentIndex() != -1) { iso->setText(ISOCombo->currentText()); - jsonJob.insert("ISO", iso->text()); + jsonJob.insert("ISO/Gain", iso->text()); + } + else if (GainSpin && GainSpin->value() != -1) + { + iso->setText(GainSpin->cleanText()); + jsonJob.insert("ISO/Gain", iso->text()); } else { iso->setText("--"); - jsonJob.insert("ISO", "--"); + jsonJob.insert("ISO/Gain", "--"); } iso->setTextAlignment(Qt::AlignHCenter); iso->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); @@ -3791,6 +3803,8 @@ } customPropertiesDialog->setCustomProperties(propertyMap); + const double gain = getGain(); + if (gain != -1) GainSpin->setValue(gain); } else if (!strcmp(tagXMLEle(ep), "Calibration")) { @@ -4167,12 +4181,10 @@ if (ISOCombo) ISOCombo->setCurrentIndex(job->getISOIndex()); - if (GainSpin) - { - double value = getGain(); - if (value > 0) - GainSpin->setValue(value); - } + + double value = getGain(); + if (value != -1) + GainSpin->setValue(value); transferFormatCombo->setCurrentIndex(job->getTransforFormat()); @@ -6590,7 +6602,9 @@ double Capture::getGain() { - QMap > customProps = customPropertiesDialog->getCustomProperties(); + if (!GainSpin) return -1; + + QMap > customProps = customPropertiesDialog->getCustomProperties(); // Gain is manifested in two forms // Property CCD_GAIN and diff --git a/kstars/ekos/capture/capture.ui b/kstars/ekos/capture/capture.ui --- a/kstars/ekos/capture/capture.ui +++ b/kstars/ekos/capture/capture.ui @@ -1572,7 +1572,7 @@ QAbstractItemView::SelectRows - 85 + 80 30 @@ -1604,7 +1604,7 @@ - ISO + ISO/Gain diff --git a/kstars/ekos/capture/customproperties.h b/kstars/ekos/capture/customproperties.h --- a/kstars/ekos/capture/customproperties.h +++ b/kstars/ekos/capture/customproperties.h @@ -27,6 +27,9 @@ QMap > getCustomProperties() const; void setCustomProperties(const QMap > &value); +signals: + void slotChanged(); + private slots: void slotAdd(); void slotRemove(); diff --git a/kstars/ekos/capture/customproperties.cpp b/kstars/ekos/capture/customproperties.cpp --- a/kstars/ekos/capture/customproperties.cpp +++ b/kstars/ekos/capture/customproperties.cpp @@ -128,6 +128,6 @@ } customProperties = newMap; - close(); + emit slotChanged(); }