diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp --- a/kstars/ekos/ekosmanager.cpp +++ b/kstars/ekos/ekosmanager.cpp @@ -1802,6 +1802,7 @@ SLOT(updateCaptureProgress(QImage*,Ekos::SequenceJob*))); connect(captureProcess.get(), SIGNAL(newExposureProgress(Ekos::SequenceJob*)), this, SLOT(updateExposureProgress(Ekos::SequenceJob*))); + connect(captureProcess.get(), &Ekos::Capture::newStatus, schedulerProcess.get(), &Ekos::Scheduler::updateCaptureState); connect(captureProcess.get(), &Ekos::Capture::sequenceChanged, ekosLiveClient.get()->message(), &EkosLive::Message::sendCaptureSequence); connect(captureProcess.get(), &Ekos::Capture::settingsUpdated, ekosLiveClient.get()->message(), &EkosLive::Message::sendCaptureSettings); captureGroup->setEnabled(true); diff --git a/kstars/ekos/scheduler/scheduler.h b/kstars/ekos/scheduler/scheduler.h --- a/kstars/ekos/scheduler/scheduler.h +++ b/kstars/ekos/scheduler/scheduler.h @@ -205,6 +205,12 @@ /** @}*/ + public slots: + /** + * @brief newCaptureState Manage capture states while running a schedule. + */ + void updateCaptureState(Ekos::CaptureState); + /** @{ */ private: /** @internal Safeguard flag to avoid registering signals from widgets multiple times. diff --git a/kstars/ekos/scheduler/scheduler.cpp b/kstars/ekos/scheduler/scheduler.cpp --- a/kstars/ekos/scheduler/scheduler.cpp +++ b/kstars/ekos/scheduler/scheduler.cpp @@ -1246,6 +1246,19 @@ } } +void Scheduler::updateCaptureState(Ekos::CaptureState state) +{ + if (nullptr != currentJob && Ekos::CAPTURE_IMAGE_RECEIVED == state) + { + /* We received a new image, but we don't know precisely where so update the storage map */ + updateCompletedJobsCount(true); + + /* And re-estimate job times */ + for (SchedulerJob * job: jobs) + estimateJobTime(job); + } +} + void Scheduler::evaluateJobs() { /* FIXME: it is possible to evaluate jobs while KStars has a time offset, so warn the user about this */