summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-24 13:17:11 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-24 13:17:11 (GMT)
commit65db5ceb2d5d669bf3c6d31e04c7bc22d7126c34 (patch)
tree481a800783921827c3770bd0aea407e89d74798e
parentc9930ea268c9667b9368d98f4ecd0d7f128fa927 (diff)
Use flag to know if calibration was ever completed instead of checkin for prior status. Fix dark frame bug
-rw-r--r--kstars/ekos/guide/guide.cpp15
-rw-r--r--kstars/ekos/guide/guide.h16
2 files changed, 13 insertions, 18 deletions
diff --git a/kstars/ekos/guide/guide.cpp b/kstars/ekos/guide/guide.cpp
index 85a4c7d..5acd29a 100644
--- a/kstars/ekos/guide/guide.cpp
+++ b/kstars/ekos/guide/guide.cpp
@@ -695,7 +695,7 @@ void Guide::setBusy(bool enable)
if (guiderType != GUIDE_PHD2)
calibrateB->setEnabled(true);
- if (state == GUIDE_CALIBRATION_SUCESS || state == GUIDE_GUIDING || state == GUIDE_ABORTED || guiderType != GUIDE_INTERNAL)
+ if (calibrationComplete || guiderType != GUIDE_INTERNAL)
guideB->setEnabled(true);
stopB->setEnabled(false);
@@ -1065,6 +1065,7 @@ void Guide::startAutoCalibrateGuide()
// A must for auto stuff
Options::setGuideAutoStarEnabled(true);
+ calibrationComplete = false;
autoCalibrateGuide = true;
// Set status to idle and let the operations change it as they get executed
@@ -1105,6 +1106,7 @@ void Guide::setStatus(Ekos::GuideState newState)
case GUIDE_CALIBRATION_SUCESS:
appendLogText(i18n("Calibration completed."));
+ calibrationComplete = true;
if (autoCalibrateGuide)
{
autoCalibrateGuide = false;
@@ -1996,19 +1998,12 @@ bool Guide::executeOneOperation(GuideState operation)
connect(DarkLibrary::Instance(), SIGNAL(darkFrameCompleted(bool)), this, SLOT(setCaptureComplete()));
connect(DarkLibrary::Instance(), SIGNAL(newLog(QString)), this, SLOT(appendLogText(QString)));
+ actionRequired = true;
+
if (darkData)
- {
DarkLibrary::Instance()->subtract(darkData, guideView, targetChip->getCaptureFilter(), offsetX, offsetY);
- setCaptureComplete();
- }
else
- {
- //if (calibration->useAutoStar() == false)
- //KMessageBox::information(NULL, i18n("If the guide camera is not equipped with a shutter, cover the telescope or camera in order to take a dark exposure."), i18n("Dark Exposure"), "dark_exposure_dialog_notification");
-
DarkLibrary::Instance()->captureAndSubtract(targetChip, guideView, exposureIN->value(), offsetX, offsetY);
- actionRequired = true;
- }
}
}
break;
diff --git a/kstars/ekos/guide/guide.h b/kstars/ekos/guide/guide.h
index 83b1ba5..e9492e1 100644
--- a/kstars/ekos/guide/guide.h
+++ b/kstars/ekos/guide/guide.h
@@ -408,15 +408,18 @@ private:
*/
void setBusy(bool enable);
+ // Operation stack
void buildOperationStack(GuideState operation);
bool executeOperationStack();
bool executeOneOperation(GuideState operation);
bool captureOneFrame();
-
void refreshColorScheme();
+ // Operation Stack
+ QStack<GuideState> operationStack;
+
// Devices
ISD::CCD *currentCCD;
ISD::Telescope *currentTelescope;
@@ -447,9 +450,6 @@ private:
// Guide timer
QTime guideTimer;
- // Drift Graph
- //ScrollGraph *driftGraph;
-
// Log
QStringList logText;
@@ -469,11 +469,11 @@ private:
// Auto star operation
bool autoStarCaptured;
- // Was the modified frame subFramed?
- bool subFramed;
+ // Calibration done already?
+ bool calibrationComplete = false;
- // Operation stack
- QStack<GuideState> operationStack;
+ // Was the modified frame subFramed?
+ bool subFramed;
// CCD Chip frame settings
QMap<ISD::CCDChip *, QVariantMap> frameSettings;