summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-22 20:19:57 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-22 20:19:57 (GMT)
commit36c6899a433c295bb36a79cbd12c4d92c8fdac7e (patch)
tree076ca36dd721034225e16c639bbf5e514645598a
parent8d5cca1e553a7e101b1aef517e8d4506d43d72b2 (diff)
Use a timer to check if guiding deviation are still not resolved after 1 minute. If that happens then complete abort of the sequence occurs
-rw-r--r--kstars/ekos/capture/capture.cpp16
-rw-r--r--kstars/ekos/capture/capture.h17
2 files changed, 25 insertions, 8 deletions
diff --git a/kstars/ekos/capture/capture.cpp b/kstars/ekos/capture/capture.cpp
index bf8670b..48e3709 100644
--- a/kstars/ekos/capture/capture.cpp
+++ b/kstars/ekos/capture/capture.cpp
@@ -44,6 +44,7 @@
#define INVALID_TEMPERATURE 10000
#define INVALID_HA 10000
#define MF_TIMER_TIMEOUT 90000
+#define GD_TIMER_TIMEOUT 60000
#define MF_RA_DIFF_LIMIT 4
#define MAX_CAPTURE_RETRIES 3
@@ -129,6 +130,8 @@ Capture::Capture()
connect(CCDCaptureCombo, SIGNAL(activated(QString)), this, SLOT(setDefaultCCD(QString)));
connect(CCDCaptureCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(checkCCD(int)));
+ guideDeviationTimer.setInterval(GD_TIMER_TIMEOUT);
+ connect(&guideDeviationTimer, SIGNAL(timeout()), this, SLOT(checkGuideDeviationTimeout()));
connect(FilterCaptureCombo, SIGNAL(activated(int)), this, SLOT(checkFilter(int)));
@@ -1932,6 +1935,7 @@ void Capture::setGuideDeviation(double delta_ra, double delta_dec)
deviationDetected = true;
appendLogText(i18n("Guiding deviation %1 exceeded limit value of %2 arcsecs, aborting exposure.", deviationText, guideDeviation->value()));
abort();
+ guideDeviationTimer.start();
}
return;
}
@@ -1940,6 +1944,8 @@ void Capture::setGuideDeviation(double delta_ra, double delta_dec)
{
if (deviation_rms <= guideDeviation->value())
{
+ guideDeviationTimer.stop();
+
if (seqDelay == 0)
appendLogText(i18n("Guiding deviation %1 is now lower than limit value of %2 arcsecs, resuming exposure.", deviationText, guideDeviation->value()));
else
@@ -3011,6 +3017,16 @@ void Capture::checkMeridianFlipTimeout()
}
}
+void Capture::checkGuideDeviationTimeout()
+{
+ if (activeJob && activeJob->getStatus() == SequenceJob::JOB_ABORTED && deviationDetected)
+ {
+ appendLogText(i18n("Guide module timed out."));
+ deviationDetected=false;
+ }
+}
+
+
void Capture::setAlignStatus(AlignState state)
{
alignState = state;
diff --git a/kstars/ekos/capture/capture.h b/kstars/ekos/capture/capture.h
index d2d6c23..8fad82a 100644
--- a/kstars/ekos/capture/capture.h
+++ b/kstars/ekos/capture/capture.h
@@ -56,7 +56,7 @@ class KDirWatch;
* The primary class is EkosManager. It handles startup and shutdown of local and remote INDI devices, manages and orchesterates the various Ekos modules, and provides advanced DBus
* interface to enable unattended scripting.
*@author Jasem Mutlaq
- *@version 1.3
+ *@version 1.4
*/
namespace Ekos
{
@@ -71,7 +71,7 @@ class SequenceJob;
* is exceeded, it automatically trigger autofocus operation. The capture process can also be linked with guide module. If guiding deviations exceed a certain threshold, the capture operation aborts until
* the guiding deviation resume to acceptable levels and the capture operation is resumed.
*@author Jasem Mutlaq
- *@version 1.2
+ *@version 1.3
*/
class Capture : public QWidget, public Ui::Capture
{
@@ -177,17 +177,17 @@ public:
/** DBUS interface function.
* @return Returns the percentage of completed captures in all active jobs
*/
- Q_SCRIPTABLE double getProgressPercentage();
+ Q_SCRIPTABLE double getProgressPercentage();
/** DBUS interface function.
* @return Returns the number of jobs in the sequence queue.
*/
- Q_SCRIPTABLE int getJobCount() { return jobs.count(); }
+ Q_SCRIPTABLE int getJobCount() { return jobs.count(); }
/** DBUS interface function.
* @return Returns ID of current active job if any, or -1 if there are no active jobs.
*/
- Q_SCRIPTABLE int getActiveJobID();
+ Q_SCRIPTABLE int getActiveJobID();
/** DBUS interface function.
* @return Returns time left in seconds until active job is estimated to be complete.
@@ -418,6 +418,9 @@ private slots:
void checkMeridianFlipTimeout();
//void checkAlignmentSlewComplete();
+ // AutoGuide
+ void checkGuideDeviationTimeout();
+
// Auto Focus
//void updateAutofocusStatus(bool status, double HFR);
void startPostFilterAutoFocus();
@@ -518,6 +521,7 @@ private:
// Guide Deviation
bool deviationDetected;
bool spikeDetected;
+ QTimer guideDeviationTimer;
// Autofocus
bool isAutoFocus;
@@ -534,9 +538,6 @@ private:
MFStage meridianFlipStage;
// Flat field automation
- /*double ExpRaw1, ExpRaw2;
- double ADURaw1, ADURaw2;
- double ADUSlope;*/
QList<double> ExpRaw;
QList<double> ADURaw;
double targetADU;