summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-07 17:15:30 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-07 17:15:30 (GMT)
commit4bd27900f17ff2becb9079494b8f7119ad5ddbd0 (patch)
treea0d342ef5162d90cf5b1fc86f80547784cc53496
parente1beafd01a2f0ead08e162e6d03473dd1c18c074 (diff)
If user canceled dark frame capture then we set the options to off
-rw-r--r--kstars/ekos/auxiliary/darklibrary.cpp10
-rw-r--r--kstars/ekos/auxiliary/darklibrary.h3
-rw-r--r--kstars/ekos/focus/focus.cpp5
-rw-r--r--kstars/ekos/guide/guide.cpp5
-rw-r--r--kstars/ekos/guide/internalguide/gmath.cpp2
-rw-r--r--kstars/ekos/guide/internalguide/internalguider.cpp5
6 files changed, 20 insertions, 10 deletions
diff --git a/kstars/ekos/auxiliary/darklibrary.cpp b/kstars/ekos/auxiliary/darklibrary.cpp
index fdf0eff..0d1ba95 100644
--- a/kstars/ekos/auxiliary/darklibrary.cpp
+++ b/kstars/ekos/auxiliary/darklibrary.cpp
@@ -245,7 +245,7 @@ template<typename T> bool DarkLibrary::subtract(FITSData *darkData, FITSView *li
}
-void DarkLibrary::captureAndSubtract(ISD::CCDChip *targetChip, FITSView*targetImage, double duration, uint16_t offsetX, uint16_t offsetY)
+bool DarkLibrary::captureAndSubtract(ISD::CCDChip *targetChip, FITSView*targetImage, double duration, uint16_t offsetX, uint16_t offsetY)
{
QStringList shutterfulCCDs = Options::shutterfulCCDs();
QStringList shutterlessCCDs = Options::shutterlessCCDs();
@@ -275,13 +275,13 @@ void DarkLibrary::captureAndSubtract(ISD::CCDChip *targetChip, FITSView*targetIm
if (hasNoShutter)
{
- if ( (KMessageBox::warningContinueCancel(NULL, i18n("Cover the telescope or camera in order to take a dark exposure."), i18n("Dark Exposure"),
- KStandardGuiItem::cont(), KStandardGuiItem::cancel(), "dark_exposure_dialog_notification"))
- == KMessageBox::Cancel)
+ if ( KMessageBox::warningContinueCancel(NULL, i18n("Cover the telescope or camera in order to take a dark exposure."), i18n("Dark Exposure"),
+ KStandardGuiItem::cont(), KStandardGuiItem::cancel(), "dark_exposure_dialog_notification") == KMessageBox::Cancel)
{
emit newLog(i18n("Dark frame capture cancelled."));
disconnect(targetChip->getCCD(), SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
emit darkFrameCompleted(false);
+ return false;
}
}
@@ -300,6 +300,8 @@ void DarkLibrary::captureAndSubtract(ISD::CCDChip *targetChip, FITSView*targetIm
emit newLog(i18n("Capturing dark frame..."));
targetChip->capture(duration);
+
+ return true;
}
void DarkLibrary::newFITS(IBLOB *bp)
diff --git a/kstars/ekos/auxiliary/darklibrary.h b/kstars/ekos/auxiliary/darklibrary.h
index c28af37..e891cef 100644
--- a/kstars/ekos/auxiliary/darklibrary.h
+++ b/kstars/ekos/auxiliary/darklibrary.h
@@ -34,7 +34,8 @@ public:
FITSData * getDarkFrame(ISD::CCDChip *targetChip, double duration);
bool subtract(FITSData *darkData, FITSView *lightImage, FITSScale filter, uint16_t offsetX, uint16_t offsetY);
- void captureAndSubtract(ISD::CCDChip *targetChip, FITSView*targetImage, double duration, uint16_t offsetX, uint16_t offsetY);
+ // Return false if canceled. True if dark capture proceeds
+ bool captureAndSubtract(ISD::CCDChip *targetChip, FITSView*targetImage, double duration, uint16_t offsetX, uint16_t offsetY);
signals:
void darkFrameCompleted(bool);
diff --git a/kstars/ekos/focus/focus.cpp b/kstars/ekos/focus/focus.cpp
index 5c93d24..3ae48af 100644
--- a/kstars/ekos/focus/focus.cpp
+++ b/kstars/ekos/focus/focus.cpp
@@ -977,7 +977,10 @@ void Focus::newFITS(IBLOB *bp)
if (darkData)
DarkLibrary::Instance()->subtract(darkData, focusView, defaultScale, offsetX, offsetY);
else
- DarkLibrary::Instance()->captureAndSubtract(targetChip, focusView, exposureIN->value(), offsetX, offsetY);
+ {
+ bool rc = DarkLibrary::Instance()->captureAndSubtract(targetChip, focusView, exposureIN->value(), offsetX, offsetY);
+ darkFrameCheck->setChecked(rc);
+ }
return;
}
diff --git a/kstars/ekos/guide/guide.cpp b/kstars/ekos/guide/guide.cpp
index eb20059..50453cd 100644
--- a/kstars/ekos/guide/guide.cpp
+++ b/kstars/ekos/guide/guide.cpp
@@ -2076,7 +2076,10 @@ bool Guide::executeOneOperation(GuideState operation)
if (darkData)
DarkLibrary::Instance()->subtract(darkData, guideView, targetChip->getCaptureFilter(), offsetX, offsetY);
else
- DarkLibrary::Instance()->captureAndSubtract(targetChip, guideView, exposureIN->value(), offsetX, offsetY);
+ {
+ bool rc = DarkLibrary::Instance()->captureAndSubtract(targetChip, guideView, exposureIN->value(), offsetX, offsetY);
+ setDarkFrameEnabled(rc);
+ }
}
}
break;
diff --git a/kstars/ekos/guide/internalguide/gmath.cpp b/kstars/ekos/guide/internalguide/gmath.cpp
index 9787331..f801b9b 100644
--- a/kstars/ekos/guide/internalguide/gmath.cpp
+++ b/kstars/ekos/guide/internalguide/gmath.cpp
@@ -960,7 +960,7 @@ void cgmath::process_axes( void )
void cgmath::performProcessing( void )
{
- Vector arc_star_pos, arc_reticle_pos, pos, p;
+ Vector arc_star_pos, arc_reticle_pos;
// do nothing if suspended
if( suspended )
diff --git a/kstars/ekos/guide/internalguide/internalguider.cpp b/kstars/ekos/guide/internalguide/internalguider.cpp
index eab29d2..a9aa84b 100644
--- a/kstars/ekos/guide/internalguide/internalguider.cpp
+++ b/kstars/ekos/guide/internalguide/internalguider.cpp
@@ -769,12 +769,13 @@ bool InternalGuider::processGuiding()
// do pulse
out = pmath->getOutputParameters();
- if (out->pulse_length[GUIDE_RA] == Options::rAMaximumPulse() || out->pulse_length[GUIDE_DEC] == Options::dECMaximumPulse())
+ // If within 90% of max pulse repeatedly, let's abort
+ if (out->pulse_length[GUIDE_RA] >= (0.9 * Options::rAMaximumPulse()) || out->pulse_length[GUIDE_DEC] >= (0.9 * Options::dECMaximumPulse()))
maxPulseCounter++;
else
maxPulseCounter=0;
- if (maxPulseCounter > 3)
+ if (maxPulseCounter >= 3)
{
emit newLog(i18n("Lost track of the guide star. Aborting guiding..."));
abort();