summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <[email protected]>2015-09-02 17:45:22 +0300
committerJasem Mutlaq <[email protected]>2015-09-02 17:45:22 +0300
commit702db933396a41c4709a4f140de317dca7bc46bd (patch)
tree9c1e41d4cee81a6049e0dfc1ceca7378fd6b9e31
parentbfceaf6787f9f7c41c9401a876a39a0004299b19 (diff)
Startup and shutdown procedures seem to work properly now
-rw-r--r--kstars/ekos/capture.cpp4
-rw-r--r--kstars/ekos/scheduler.cpp30
-rw-r--r--kstars/ekos/scheduler.ui4
-rw-r--r--kstars/ekos/schedulerjob.cpp6
-rw-r--r--kstars/indi/indidome.cpp2
-rw-r--r--kstars/indi/inditelescope.cpp4
6 files changed, 28 insertions, 22 deletions
diff --git a/kstars/ekos/capture.cpp b/kstars/ekos/capture.cpp
index 55eec70..834f5d7 100644
--- a/kstars/ekos/capture.cpp
+++ b/kstars/ekos/capture.cpp
@@ -1868,7 +1868,9 @@ void Capture::updateAutofocusStatus(bool status, double HFR)
if (HFR > 0 && firstAutoFocus && HFRPixels->value() == 0)
{
firstAutoFocus = false;
- HFRPixels->setValue(HFR);
+ // Add 1% to the automatic initial HFR value to allow for minute changes in HFR without need to refocus
+ // in case in-sequence-focusing is used.
+ HFRPixels->setValue(HFR + (HFR * 0.01));
}
}
diff --git a/kstars/ekos/scheduler.cpp b/kstars/ekos/scheduler.cpp
index dd63cca..6994d27 100644
--- a/kstars/ekos/scheduler.cpp
+++ b/kstars/ekos/scheduler.cpp
@@ -515,7 +515,7 @@ void Scheduler::stop()
foreach(SchedulerJob *job, jobs)
{
if (job == currentJob)
- stopEkosAction();
+ stopEkosAction();
if (job->getState() <= SchedulerJob::JOB_BUSY)
job->setState(SchedulerJob::JOB_ABORTED);
@@ -1163,9 +1163,7 @@ bool Scheduler::checkShutdownState()
return false;
}
- shutdownState = SHUTDOWN_COMPLETE;
- appendLogText(i18n("Shutdown complete."));
- stop();
+ shutdownState = SHUTDOWN_COMPLETE;
return true;
break;
@@ -1218,14 +1216,10 @@ bool Scheduler::checkShutdownState()
case SHUTDOWN_SCRIPT_RUNNING:
return false;
- case SHUTDOWN_COMPLETE:
- appendLogText(i18n("Shutdown complete."));
- stop();
+ case SHUTDOWN_COMPLETE:
return true;
- case SHUTDOWN_ERROR:
- appendLogText(i18n("Shutdown script failed, aborting..."));
- stop();
+ case SHUTDOWN_ERROR:
return true;
break;
@@ -1334,7 +1328,14 @@ void Scheduler::checkStatus()
{
// #2.1 If shutdown is already complete or in error, we need to stop
if (shutdownState == SHUTDOWN_COMPLETE || shutdownState == SHUTDOWN_ERROR)
+ {
+ if (shutdownState == SHUTDOWN_COMPLETE)
+ appendLogText(i18n("Shutdown complete."));
+ else
+ appendLogText(i18n("Shutdown script failed, aborting..."));
+ stop();
return;
+ }
// #2.2 Check if shutdown is in progress
if (shutdownState > SHUTDOWN_IDLE)
@@ -1722,8 +1723,8 @@ void Scheduler::findNextJob()
}
if (currentJob->getCompletionCondition() == SchedulerJob::FINISH_AT)
- {
- if (currentJob->getCompletionTime().secsTo(KStarsData::Instance()->lt()) <= 0)
+ {
+ if (KStarsData::Instance()->lt().secsTo(currentJob->getCompletionTime()) <= 0)
{
appendLogText(i18np("%1 observation job reached completion time with #%2 batch done. Stopping...",
"%1 observation job reached completion time with #%2 batches done. Stopping...", currentJob->getName(), captureBatch+1));
@@ -1773,9 +1774,8 @@ void Scheduler::startAstrometry()
void Scheduler::startCalibrating()
{
// Make sure calibration is auto
- QList<QVariant> guideArgs;
- guideArgs.append(true);
- guideInterface->callWithArgumentList(QDBus::AutoDetect,"setCalibrationAuto",guideArgs);
+ QVariant arg(true);
+ guideInterface->call(QDBus::AutoDetect,"setCalibrationAutoStar", arg);
QDBusReply<bool> guideReply = guideInterface->call(QDBus::AutoDetect,"startCalibration");
if (guideReply.value() == false)
diff --git a/kstars/ekos/scheduler.ui b/kstars/ekos/scheduler.ui
index 60265dc..3497dde 100644
--- a/kstars/ekos/scheduler.ui
+++ b/kstars/ekos/scheduler.ui
@@ -693,7 +693,7 @@
<item>
<widget class="QLineEdit" name="startupScript">
<property name="readOnly">
- <bool>true</bool>
+ <bool>false</bool>
</property>
</widget>
</item>
@@ -792,7 +792,7 @@
<item>
<widget class="QLineEdit" name="shutdownScript">
<property name="readOnly">
- <bool>true</bool>
+ <bool>false</bool>
</property>
</widget>
</item>
diff --git a/kstars/ekos/schedulerjob.cpp b/kstars/ekos/schedulerjob.cpp
index 48eed23..b87dce5 100644
--- a/kstars/ekos/schedulerjob.cpp
+++ b/kstars/ekos/schedulerjob.cpp
@@ -193,7 +193,11 @@ void SchedulerJob::setState(const JOBStatus &value)
break;
case JOB_ABORTED:
- statusCell->setText(i18n("Aborted"));
+ statusCell->setText(i18n("Aborted"));
+ break;
+
+ case JOB_ERROR:
+ statusCell->setText(i18n("Error"));
break;
default:
diff --git a/kstars/indi/indidome.cpp b/kstars/indi/indidome.cpp
index d754771..c84cf60 100644
--- a/kstars/indi/indidome.cpp
+++ b/kstars/indi/indidome.cpp
@@ -59,7 +59,7 @@ bool Dome::isParked()
if (parkSW == NULL)
return false;
- return (parkSW->s == ISS_ON);
+ return ( (parkSW->s == ISS_ON) && parkSP->s == IPS_OK);
}
bool Dome::Abort()
diff --git a/kstars/indi/inditelescope.cpp b/kstars/indi/inditelescope.cpp
index 7514359..1021ec1 100644
--- a/kstars/indi/inditelescope.cpp
+++ b/kstars/indi/inditelescope.cpp
@@ -88,7 +88,7 @@ void Telescope::registerProperty(INDI::Property *prop)
ISwitch *sp = IUFindSwitch(svp, "PARK");
if (sp)
{
- IsParked = (sp->s == ISS_ON);
+ IsParked = ( (sp->s == ISS_ON) && svp->s == IPS_OK);
}
}
}
@@ -145,7 +145,7 @@ void Telescope::processSwitch(ISwitchVectorProperty *svp)
ISwitch *sp = IUFindSwitch(svp, "PARK");
if (sp)
{
- IsParked = (sp->s == ISS_ON);
+ IsParked = ( (sp->s == ISS_ON) && svp->s == IPS_OK);
}
emit switchUpdated(svp);