Commit b11c408a authored by Jasem Mutlaq's avatar Jasem Mutlaq

Add support for post-dither settle period in seconds before resuming guiding and capture

parent bae46bec
......@@ -30,7 +30,8 @@ static const QStringList guideStates = { I18N_NOOP("Idle"),
I18N_NOOP("Suspended"),
I18N_NOOP("Dithering"),
I18N_NOOP("Dithering error"),
I18N_NOOP("Dithering successful") };
I18N_NOOP("Dithering successful"),
I18N_NOOP("Settling")};
typedef enum {
GUIDE_IDLE,
......@@ -48,7 +49,8 @@ typedef enum {
GUIDE_SUSPENDED,
GUIDE_DITHERING,
GUIDE_DITHERING_ERROR,
GUIDE_DITHERING_SUCCESS
GUIDE_DITHERING_SUCCESS,
GUIDE_DITHERING_SETTLE
} GuideState;
const QString &getGuideStatusString(GuideState state);
......
......@@ -837,10 +837,14 @@ void Guide::setCaptureComplete()
guider->guide();
break;
case GUIDE_DITHERING:
case GUIDE_DITHERING:
guider->dither(Options::ditherPixels());
break;
case GUIDE_DITHERING_SETTLE:
capture();
break;
default:
break;
}
......@@ -1042,7 +1046,7 @@ bool Guide::guide()
bool Guide::dither()
{
if (state == GUIDE_DITHERING)
if (state == GUIDE_DITHERING || state == GUIDE_DITHERING_SETTLE)
return true;
if (guiderType == GUIDE_INTERNAL)
......@@ -1281,6 +1285,12 @@ void Guide::setStatus(Ekos::GuideState newState)
appendLogText(i18n("Dithering in progress."));
break;
case GUIDE_DITHERING_SETTLE:
if (Options::ditherSettle() > 0)
appendLogText(i18np("Post-dither settling for %1 second...", "Post-dither settling for %1 seconds...", Options::ditherSettle()));
capture();
break;
case GUIDE_DITHERING_ERROR:
appendLogText(i18n("Dithering failed!"));
// LinGuider guide continue after dithering failure
......
......@@ -211,11 +211,13 @@ bool InternalGuider::dither(double pixels)
if (Options::guideLogging())
qDebug() << "Guide: Dither complete.";
//emit ditherComplete();
emit newStatus(Ekos::GUIDE_DITHERING_SUCCESS);
if (Options::ditherSettle() > 0)
{
state = GUIDE_DITHERING_SETTLE;
emit newStatus(state);
}
// Back to guiding
state = GUIDE_GUIDING;
QTimer::singleShot(Options::ditherSettle()* 1000, this, SLOT(setDitherSettled()));
}
else
{
......@@ -231,7 +233,14 @@ bool InternalGuider::dither(double pixels)
{
emit newLog(i18n("Warning: Dithering failed. Autoguiding shall continue as set in the options in case "
"of dither failure."));
emit newStatus(Ekos::GUIDE_DITHERING_SUCCESS);
if (Options::ditherSettle() > 0)
{
state = GUIDE_DITHERING_SETTLE;
emit newStatus(state);
}
QTimer::singleShot(Options::ditherSettle()* 1000, this, SLOT(setDitherSettled()));
return true;
}
}
......@@ -242,6 +251,14 @@ bool InternalGuider::dither(double pixels)
return true;
}
void InternalGuider::setDitherSettled()
{
emit newStatus(Ekos::GUIDE_DITHERING_SUCCESS);
// Back to guiding
state = GUIDE_GUIDING;
}
bool InternalGuider::calibrate()
{
bool ccdInfo = true, scopeInfo = true;
......
......@@ -107,6 +107,7 @@ class InternalGuider : public GuideInterface
protected slots:
void trackingStarSelected(int x, int y);
void setDitherSettled();
signals:
void newPulse(GuideDirection ra_dir, int ra_msecs, GuideDirection dec_dir, int dec_msecs);
......
This diff is collapsed.
......@@ -1813,6 +1813,10 @@
<label>Dither after this many frames.</label>
<default>1</default>
</entry>
<entry name="DitherSettle" type="UInt">
<label>After dither is successful, wait for this many seconds before proceeding.</label>
<default>0</default>
</entry>
<entry name="DitherMaxIterations" type="UInt">
<label>How many dithering attempts to undertake before giving up.</label>
<default>10</default>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment