Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/capture/capture.cpp
Show First 20 Lines • Show All 310 Lines • ▼ Show 20 Line(s) | 51 | { | |||
---|---|---|---|---|---|
311 | }); | 311 | }); | ||
312 | 312 | | |||
313 | customPropertiesDialog.reset(new CustomProperties()); | 313 | customPropertiesDialog.reset(new CustomProperties()); | ||
314 | connect(customValuesB, &QPushButton::clicked, [&]() | 314 | connect(customValuesB, &QPushButton::clicked, [&]() | ||
315 | { | 315 | { | ||
316 | customPropertiesDialog.get()->show(); | 316 | customPropertiesDialog.get()->show(); | ||
317 | customPropertiesDialog.get()->raise(); | 317 | customPropertiesDialog.get()->raise(); | ||
318 | }); | 318 | }); | ||
319 | connect(customPropertiesDialog.get(), &CustomProperties::slotChanged, [&]() | ||||
320 | { | ||||
321 | const double newGain = getGain(); | ||||
322 | if (newGain != -1) GainSpin->setValue(newGain); | ||||
323 | }); | ||||
319 | 324 | | |||
320 | flatFieldSource = static_cast<FlatFieldSource>(Options::calibrationFlatSourceIndex()); | 325 | flatFieldSource = static_cast<FlatFieldSource>(Options::calibrationFlatSourceIndex()); | ||
321 | flatFieldDuration = static_cast<FlatFieldDuration>(Options::calibrationFlatDurationIndex()); | 326 | flatFieldDuration = static_cast<FlatFieldDuration>(Options::calibrationFlatDurationIndex()); | ||
322 | wallCoord.setAz(Options::calibrationWallAz()); | 327 | wallCoord.setAz(Options::calibrationWallAz()); | ||
323 | wallCoord.setAlt(Options::calibrationWallAlt()); | 328 | wallCoord.setAlt(Options::calibrationWallAlt()); | ||
324 | targetADU = Options::calibrationADUValue(); | 329 | targetADU = Options::calibrationADUValue(); | ||
325 | targetADUTolerance = Options::calibrationADUValueTolerance(); | 330 | targetADUTolerance = Options::calibrationADUValueTolerance(); | ||
326 | 331 | | |||
▲ Show 20 Lines • Show All 560 Lines • ▼ Show 20 Line(s) | 889 | { | |||
887 | 892 | | |||
888 | GainSpin = new QDoubleSpinBox(CCDFWGroup); | 893 | GainSpin = new QDoubleSpinBox(CCDFWGroup); | ||
889 | double min, max, step, value, targetCustomGain; | 894 | double min, max, step, value, targetCustomGain; | ||
890 | currentCCD->getGainMinMaxStep(&min, &max, &step); | 895 | currentCCD->getGainMinMaxStep(&min, &max, &step); | ||
891 | GainSpin->setRange(min, max); | 896 | GainSpin->setRange(min, max); | ||
892 | GainSpin->setSingleStep(step); | 897 | GainSpin->setSingleStep(step); | ||
893 | currentCCD->getGain(&value); | 898 | currentCCD->getGain(&value); | ||
894 | 899 | | |||
895 | targetCustomGain = getGain(); | 900 | targetCustomGain = getGain(); | ||
yurchor: Shouldn't this be 'i18n("--")' instead of 'tr("--"))'? | |||||
896 | 901 | | |||
897 | // Set the custom gain if we have one | 902 | // Set the custom gain if we have one | ||
898 | // otherwise just put the current ccd actual gain value | 903 | // otherwise just put the current ccd actual gain value | ||
899 | if (targetCustomGain > 0) | 904 | if (targetCustomGain > 0) | ||
900 | GainSpin->setValue(targetCustomGain); | 905 | GainSpin->setValue(targetCustomGain); | ||
901 | else | 906 | else | ||
902 | GainSpin->setValue(value); | 907 | GainSpin->setValue(value); | ||
903 | 908 | | |||
▲ Show 20 Lines • Show All 1420 Lines • ▼ Show 20 Line(s) | 2295 | { | |||
2324 | { | 2329 | { | ||
2325 | qWarning() << "Job is nullptr!" << endl; | 2330 | qWarning() << "Job is nullptr!" << endl; | ||
2326 | return false; | 2331 | return false; | ||
2327 | } | 2332 | } | ||
2328 | 2333 | | |||
2329 | if (ISOCombo) | 2334 | if (ISOCombo) | ||
2330 | job->setISOIndex(ISOCombo->currentIndex()); | 2335 | job->setISOIndex(ISOCombo->currentIndex()); | ||
2331 | 2336 | | |||
2337 | if (getGain() != -1) job->setGain(getGain()); | ||||
2338 | | ||||
2332 | job->setTransforFormat(static_cast<ISD::CCD::TransferFormat>(transferFormatCombo->currentIndex())); | 2339 | job->setTransforFormat(static_cast<ISD::CCD::TransferFormat>(transferFormatCombo->currentIndex())); | ||
2333 | 2340 | | |||
2334 | job->setPreview(preview); | 2341 | job->setPreview(preview); | ||
2335 | 2342 | | |||
2336 | if (temperatureIN->isEnabled()) | 2343 | if (temperatureIN->isEnabled()) | ||
2337 | { | 2344 | { | ||
2338 | double currentTemperature; | 2345 | double currentTemperature; | ||
2339 | currentCCD->getTemperature(¤tTemperature); | 2346 | currentCCD->getTemperature(¤tTemperature); | ||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | |||||
2466 | exp->setTextAlignment(Qt::AlignHCenter); | 2473 | exp->setTextAlignment(Qt::AlignHCenter); | ||
2467 | exp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); | 2474 | exp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); | ||
2468 | jsonJob.insert("Exp", exp->text()); | 2475 | jsonJob.insert("Exp", exp->text()); | ||
2469 | 2476 | | |||
2470 | QTableWidgetItem * iso = m_JobUnderEdit ? queueTable->item(currentRow, 5) : new QTableWidgetItem(); | 2477 | QTableWidgetItem * iso = m_JobUnderEdit ? queueTable->item(currentRow, 5) : new QTableWidgetItem(); | ||
2471 | if (ISOCombo && ISOCombo->currentIndex() != -1) | 2478 | if (ISOCombo && ISOCombo->currentIndex() != -1) | ||
2472 | { | 2479 | { | ||
2473 | iso->setText(ISOCombo->currentText()); | 2480 | iso->setText(ISOCombo->currentText()); | ||
2474 | jsonJob.insert("ISO", iso->text()); | 2481 | jsonJob.insert("ISO/Gain", iso->text()); | ||
2482 | } | ||||
2483 | else if (GainSpin && GainSpin->value() != -1) | ||||
2484 | { | ||||
2485 | iso->setText(GainSpin->cleanText()); | ||||
2486 | jsonJob.insert("ISO/Gain", iso->text()); | ||||
2475 | } | 2487 | } | ||
2476 | else | 2488 | else | ||
2477 | { | 2489 | { | ||
2478 | iso->setText("--"); | 2490 | iso->setText("--"); | ||
2479 | jsonJob.insert("ISO", "--"); | 2491 | jsonJob.insert("ISO/Gain", "--"); | ||
2480 | } | 2492 | } | ||
2481 | iso->setTextAlignment(Qt::AlignHCenter); | 2493 | iso->setTextAlignment(Qt::AlignHCenter); | ||
2482 | iso->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); | 2494 | iso->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); | ||
2483 | 2495 | | |||
2484 | QTableWidgetItem * count = m_JobUnderEdit ? queueTable->item(currentRow, 6) : new QTableWidgetItem(); | 2496 | QTableWidgetItem * count = m_JobUnderEdit ? queueTable->item(currentRow, 6) : new QTableWidgetItem(); | ||
2485 | job->setCountCell(count); | 2497 | job->setCountCell(count); | ||
2486 | jsonJob.insert("Count", count->text()); | 2498 | jsonJob.insert("Count", count->text()); | ||
2487 | 2499 | | |||
▲ Show 20 Lines • Show All 1298 Lines • ▼ Show 20 Line(s) | 3796 | { | |||
3786 | numbers[name] = cLocale.toDouble(pcdataXMLEle(oneNumber)); | 3798 | numbers[name] = cLocale.toDouble(pcdataXMLEle(oneNumber)); | ||
3787 | } | 3799 | } | ||
3788 | 3800 | | |||
3789 | const char * name = findXMLAttValu(subEP, "name"); | 3801 | const char * name = findXMLAttValu(subEP, "name"); | ||
3790 | propertyMap[name] = numbers; | 3802 | propertyMap[name] = numbers; | ||
3791 | } | 3803 | } | ||
3792 | 3804 | | |||
3793 | customPropertiesDialog->setCustomProperties(propertyMap); | 3805 | customPropertiesDialog->setCustomProperties(propertyMap); | ||
3806 | const double gain = getGain(); | ||||
3807 | if (gain != -1) GainSpin->setValue(gain); | ||||
3794 | } | 3808 | } | ||
3795 | else if (!strcmp(tagXMLEle(ep), "Calibration")) | 3809 | else if (!strcmp(tagXMLEle(ep), "Calibration")) | ||
3796 | { | 3810 | { | ||
3797 | subEP = findXMLEle(ep, "FlatSource"); | 3811 | subEP = findXMLEle(ep, "FlatSource"); | ||
3798 | if (subEP) | 3812 | if (subEP) | ||
3799 | { | 3813 | { | ||
3800 | XMLEle * typeEP = findXMLEle(subEP, "Type"); | 3814 | XMLEle * typeEP = findXMLEle(subEP, "Type"); | ||
3801 | if (typeEP) | 3815 | if (typeEP) | ||
▲ Show 20 Lines • Show All 360 Lines • ▼ Show 20 Line(s) | 4137 | { | |||
4162 | preMountPark = job->isPreMountPark(); | 4176 | preMountPark = job->isPreMountPark(); | ||
4163 | preDomePark = job->isPreDomePark(); | 4177 | preDomePark = job->isPreDomePark(); | ||
4164 | 4178 | | |||
4165 | // Custom Properties | 4179 | // Custom Properties | ||
4166 | customPropertiesDialog->setCustomProperties(job->getCustomProperties()); | 4180 | customPropertiesDialog->setCustomProperties(job->getCustomProperties()); | ||
4167 | 4181 | | |||
4168 | if (ISOCombo) | 4182 | if (ISOCombo) | ||
4169 | ISOCombo->setCurrentIndex(job->getISOIndex()); | 4183 | ISOCombo->setCurrentIndex(job->getISOIndex()); | ||
4170 | if (GainSpin) | 4184 | | ||
4171 | { | | |||
4172 | double value = getGain(); | 4185 | double value = getGain(); | ||
4173 | if (value > 0) | 4186 | if (value != -1) | ||
4174 | GainSpin->setValue(value); | 4187 | GainSpin->setValue(value); | ||
4175 | } | | |||
4176 | 4188 | | |||
4177 | transferFormatCombo->setCurrentIndex(job->getTransforFormat()); | 4189 | transferFormatCombo->setCurrentIndex(job->getTransforFormat()); | ||
4178 | 4190 | | |||
4179 | if (job->getTargetRotation() != Ekos::INVALID_VALUE) | 4191 | if (job->getTargetRotation() != Ekos::INVALID_VALUE) | ||
4180 | { | 4192 | { | ||
4181 | rotatorSettings->setRotationEnforced(true); | 4193 | rotatorSettings->setRotationEnforced(true); | ||
4182 | rotatorSettings->setTargetRotationPA(job->getTargetRotation()); | 4194 | rotatorSettings->setTargetRotationPA(job->getTargetRotation()); | ||
4183 | } | 4195 | } | ||
▲ Show 20 Lines • Show All 2401 Lines • ▼ Show 20 Line(s) | 6594 | { | |||
6585 | customProps["CCD_CONTROLS"] = ccdGain; | 6597 | customProps["CCD_CONTROLS"] = ccdGain; | ||
6586 | } | 6598 | } | ||
6587 | 6599 | | |||
6588 | customPropertiesDialog->setCustomProperties(customProps); | 6600 | customPropertiesDialog->setCustomProperties(customProps); | ||
6589 | } | 6601 | } | ||
6590 | 6602 | | |||
6591 | double Capture::getGain() | 6603 | double Capture::getGain() | ||
6592 | { | 6604 | { | ||
6605 | if (!GainSpin) return -1; | ||||
6606 | | ||||
6593 | QMap<QString, QMap<QString, double> > customProps = customPropertiesDialog->getCustomProperties(); | 6607 | QMap<QString, QMap<QString, double> > customProps = customPropertiesDialog->getCustomProperties(); | ||
6594 | 6608 | | |||
6595 | // Gain is manifested in two forms | 6609 | // Gain is manifested in two forms | ||
6596 | // Property CCD_GAIN and | 6610 | // Property CCD_GAIN and | ||
6597 | // Part of CCD_CONTROLS properties. | 6611 | // Part of CCD_CONTROLS properties. | ||
6598 | // Therefore, we have to find what the currently camera supports first. | 6612 | // Therefore, we have to find what the currently camera supports first. | ||
6599 | if (currentCCD->getProperty("CCD_GAIN")) | 6613 | if (currentCCD->getProperty("CCD_GAIN")) | ||
6600 | { | 6614 | { | ||
Show All 11 Lines |
Shouldn't this be 'i18n("--")' instead of 'tr("--"))'?