Commit d6d651bf authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Set Focus module to the filter of the first light job in the sequence so that...

Set Focus module to the filter of the first light job in the sequence so that it is focused for that particular filter when the capture sequence begins
parent 636a05c9
Pipeline #122882 failed with stages
in 57 minutes and 48 seconds
......@@ -4716,6 +4716,14 @@ void Scheduler::startFocusing()
return;
}
// If we have a LIGHT filter set, let's set it.
if (!currentJob->getInitialFilter().isEmpty())
{
TEST_PRINT(stderr, "sch%d @@@dbus(%s): sending %s\n", __LINE__, "focusInterface", "focusInterface:setProperty");
focusInterface->setProperty("filter", currentJob->getInitialFilter());
}
// Set autostar if full field option is false
if (Options::focusUseFullField() == false)
{
......@@ -6976,7 +6984,18 @@ bool Scheduler::loadSequenceQueue(const QString &fileURL, SchedulerJob *schedJob
if (!strcmp(tagXMLEle(ep), "Autofocus"))
hasAutoFocus = (!strcmp(findXMLAttValu(ep, "enabled"), "true"));
else if (!strcmp(tagXMLEle(ep), "Job"))
{
jobs.append(processJobInfo(ep, schedJob));
if (jobs.count() == 1)
{
auto &firstJob = jobs.first();
if (FRAME_LIGHT == firstJob->getFrameType() && nullptr != schedJob)
{
schedJob->setInitialFilter(firstJob->getCoreProperty(SequenceJob::SJ_Filter).toString());
}
}
}
}
delXMLEle(root);
}
......
......@@ -1239,3 +1239,13 @@ bool SchedulerJob::runsDuringAstronomicalNightTime() const
// Thus if dawn comes first, the job startup time occurs during the dusk/dawn interval.
return nextDawn < nextDusk && startupTime <= earlyDawn;
}
void SchedulerJob::setInitialFilter(const QString &value)
{
m_InitialFilter = value;
}
const QString &SchedulerJob::getInitialFilter() const
{
return m_InitialFilter;
}
......@@ -632,6 +632,13 @@ class SchedulerJob
*/
double getMinAltitudeConstraint(double azimuth) const;
/**
* @brief setInitialFilter Set initial filter used in the capture sequence. This is used to pass to focus module.
* @param value Filter name of FIRST LIGHT job in the sequence queue, if any.
*/
void setInitialFilter(const QString &value);
const QString &getInitialFilter() const;
// Convenience debugging methods.
static QString jobStatusString(JOBStatus status);
static QString jobStageString(JOBStage stage);
......@@ -746,6 +753,7 @@ class SchedulerJob
uint16_t repeatsRequired { 1 };
uint16_t repeatsRemaining { 1 };
bool inSequenceFocus { false };
QString m_InitialFilter;
QString dateTimeDisplayFormat;
......
Supports Markdown
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