Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/scheduler/scheduler.cpp
Show First 20 Lines • Show All 4505 Lines • ▼ Show 20 Line(s) | 4492 | { | |||
---|---|---|---|---|---|
4506 | { | 4506 | { | ||
4507 | case SchedulerJob::FINISH_LOOP: | 4507 | case SchedulerJob::FINISH_LOOP: | ||
4508 | case SchedulerJob::FINISH_AT: | 4508 | case SchedulerJob::FINISH_AT: | ||
4509 | // In these cases, we leave the captured frames map empty | 4509 | // In these cases, we leave the captured frames map empty | ||
4510 | // to ensure, that the capture sequence is executed in any case. | 4510 | // to ensure, that the capture sequence is executed in any case. | ||
4511 | break; | 4511 | break; | ||
4512 | 4512 | | |||
4513 | default: | 4513 | default: | ||
4514 | // Scheduler always sets captured frame map when starting a sequence - count may be different, robustness, dynamic priority | ||||
4515 | #if 0 | ||||
4514 | // JM 2018-09-24: If job is looping, no need to set captured frame maps. | 4516 | // JM 2018-09-24: If job is looping, no need to set captured frame maps. | ||
4515 | if (currentJob->getCompletionCondition() != SchedulerJob::FINISH_SEQUENCE) | 4517 | if (currentJob->getCompletionCondition() != SchedulerJob::FINISH_SEQUENCE) | ||
4516 | break; | 4518 | break; | ||
4519 | #endif | ||||
4517 | 4520 | | |||
4518 | // hand over the map of captured frames so that the capture | 4521 | // hand over the map of captured frames so that the capture | ||
4519 | // process knows about existing frames | 4522 | // process knows about existing frames | ||
4520 | SchedulerJob::CapturedFramesMap fMap = currentJob->getCapturedFramesMap(); | 4523 | SchedulerJob::CapturedFramesMap fMap = currentJob->getCapturedFramesMap(); | ||
4521 | 4524 | | |||
4522 | for (auto &e : fMap.keys()) | 4525 | for (auto &e : fMap.keys()) | ||
4523 | { | 4526 | { | ||
4524 | QList<QVariant> dbusargs; | 4527 | QList<QVariant> dbusargs; | ||
4525 | QDBusMessage reply; | 4528 | QDBusMessage reply; | ||
4526 | 4529 | | |||
4527 | dbusargs.append(e); | 4530 | dbusargs.append(e); | ||
4528 | dbusargs.append(fMap.value(e)); | 4531 | dbusargs.append(fMap.value(e)); | ||
4529 | if ((reply = captureInterface->callWithArgumentList(QDBus::AutoDetect, "setCapturedFramesMap", dbusargs)).type() == | 4532 | if ((reply = captureInterface->callWithArgumentList(QDBus::AutoDetect, "setCapturedFramesMap", dbusargs)).type() == | ||
4530 | QDBusMessage::ErrorMessage) | 4533 | QDBusMessage::ErrorMessage) | ||
4531 | { | 4534 | { | ||
4532 | qCCritical(KSTARS_EKOS_SCHEDULER) << QString("Warning: job '%1' setCapturedFramesCount request received DBUS error: %1").arg(currentJob->getName()).arg(reply.errorMessage()); | 4535 | qCCritical(KSTARS_EKOS_SCHEDULER) << QString("Warning: job '%1' setCapturedFramesCount request received DBUS error: %1").arg(currentJob->getName()).arg(reply.errorMessage()); | ||
4533 | if (!manageConnectionLoss()) | 4536 | if (!manageConnectionLoss()) | ||
4534 | currentJob->setState(SchedulerJob::JOB_ERROR); | 4537 | currentJob->setState(SchedulerJob::JOB_ERROR); | ||
4535 | return; | 4538 | return; | ||
4536 | } | 4539 | } | ||
4537 | } | 4540 | } | ||
4538 | break; | 4541 | break; | ||
4539 | } | 4542 | } | ||
4540 | 4543 | | |||
4541 | 4544 | // Never ignore sequence history in the Capture module, it is unrelated to storage | |||
4545 | #if 0 | ||||
4542 | // If sequence is a loop, ignore sequence history | 4546 | // If sequence is a loop, ignore sequence history | ||
4543 | // FIXME: set, but never used. | 4547 | // FIXME: set, but never used. | ||
4544 | if (currentJob->getCompletionCondition() != SchedulerJob::FINISH_SEQUENCE) | 4548 | if (currentJob->getCompletionCondition() != SchedulerJob::FINISH_SEQUENCE) | ||
4545 | captureInterface->call(QDBus::AutoDetect, "ignoreSequenceHistory"); | 4549 | captureInterface->call(QDBus::AutoDetect, "ignoreSequenceHistory"); | ||
4550 | #endif | ||||
4546 | 4551 | | |||
4547 | // Start capture process | 4552 | // Start capture process | ||
4548 | captureInterface->call(QDBus::AutoDetect, "start"); | 4553 | captureInterface->call(QDBus::AutoDetect, "start"); | ||
4549 | 4554 | | |||
4550 | currentJob->setStage(SchedulerJob::STAGE_CAPTURING); | 4555 | currentJob->setStage(SchedulerJob::STAGE_CAPTURING); | ||
4551 | 4556 | | |||
4552 | KNotification::event(QLatin1String("EkosScheduledImagingStart"), | 4557 | KNotification::event(QLatin1String("EkosScheduledImagingStart"), | ||
4553 | i18n("Ekos job (%1) - Capture started", currentJob->getName())); | 4558 | i18n("Ekos job (%1) - Capture started", currentJob->getName())); | ||
▲ Show 20 Lines • Show All 2192 Lines • Show Last 20 Lines |