summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-11 22:27:14 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-11 22:27:14 (GMT)
commit1e647c49ede654d290189251c262adbda8323853 (patch)
tree1cd38f35404315841747170b616399f007e1ad79
parenta05de10c430555794fb32138b6d7bd471b09c7dc (diff)
Distinguish between shutterful and shutterless CCDs. Ask the user if the CCD has a shutter or not as to avoid asking the user to cover the telescope if it already has a shutter
-rw-r--r--kstars/ekos/darklibrary.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/kstars/ekos/darklibrary.cpp b/kstars/ekos/darklibrary.cpp
index d20c3dc..b068cdb 100644
--- a/kstars/ekos/darklibrary.cpp
+++ b/kstars/ekos/darklibrary.cpp
@@ -74,7 +74,7 @@ FITSData * DarkLibrary::getDarkFrame(ISD::CCDChip *targetChip, double duration)
double temperature=0;
targetChip->getCCD()->getTemperature(&temperature);
// TODO make this configurable value, the threshold
- if (fabs(map["temperature"].toDouble()-temperature) > 0.1)
+ if (fabs(map["temperature"].toDouble()-temperature) > Options::maxDarkTemperatureDiff())
continue;
}
@@ -200,6 +200,37 @@ bool DarkLibrary::subtract(FITSData *darkData, FITSView *lightImage, FITSScale f
void DarkLibrary::captureAndSubtract(ISD::CCDChip *targetChip, FITSView*targetImage, double duration, uint16_t offsetX, uint16_t offsetY)
{
+ QStringList shutterfulCCDs = Options::shutterfulCCDs();
+ QStringList shutterlessCCDs = Options::shutterlessCCDs();
+ QString deviceName = targetChip->getCCD()->getDeviceName();
+
+ bool hasShutter = shutterfulCCDs.contains(deviceName);
+ bool hasNoShutter = shutterlessCCDs.contains(deviceName);
+
+ // If no information is available either way, then ask the user
+ if (hasShutter == false && hasNoShutter == false)
+ {
+ if (KMessageBox::questionYesNo(NULL, i18n("Does %1 have mechanical or electronic shutter?", deviceName), i18n("Dark Exposure")) == KMessageBox::Yes)
+ {
+ hasShutter = true;
+ hasNoShutter = false;
+ shutterfulCCDs.append(deviceName);
+ Options::setShutterfulCCDs(shutterfulCCDs);
+ }
+ else
+ {
+ hasShutter = false;
+ hasNoShutter = true;
+ shutterlessCCDs.append(deviceName);
+ Options::setShutterlessCCDs(shutterlessCCDs);
+ }
+ }
+
+ if (hasNoShutter)
+ {
+ KMessageBox::information(NULL, i18n("Cover the telescope or camera in order to take a dark exposure."), i18n("Dark Exposure"), "dark_exposure_dialog_notification");
+ }
+
targetChip->resetFrame();
targetChip->setCaptureMode(FITS_CALIBRATE);
targetChip->setFrameType(FRAME_DARK);