diff --git a/kstars/ekos/manager.h b/kstars/ekos/manager.h --- a/kstars/ekos/manager.h +++ b/kstars/ekos/manager.h @@ -134,6 +134,12 @@ QString getCurrentJobName(); void announceEvent(const QString &message, KSNotification::EventType event); + /** + * @brief applyConfig + * Update manager settings after KStars options were modified. + */ + void applyConfig(); + /** * @brief addProfile Add a new profile to the database. * @param profileInfo Collection of profile parameters to include the following: diff --git a/kstars/ekos/manager.cpp b/kstars/ekos/manager.cpp --- a/kstars/ekos/manager.cpp +++ b/kstars/ekos/manager.cpp @@ -2986,6 +2986,12 @@ } } +void Manager::applyConfig() +{ + if (schedulerProcess) + schedulerProcess->applyConfig(); +} + void Manager::getCurrentProfileTelescopeInfo(double &primaryFocalLength, double &primaryAperture, double &guideFocalLength, double &guideAperture) { ProfileInfo * pi = getCurrentProfile(); diff --git a/kstars/ekos/opsekos.ui b/kstars/ekos/opsekos.ui --- a/kstars/ekos/opsekos.ui +++ b/kstars/ekos/opsekos.ui @@ -6,15 +6,15 @@ 0 0 - 426 - 379 + 478 + 450 TabWidget - 0 + 1 @@ -56,7 +56,7 @@ - Always &load defaults + Alwa&ys load defaults @@ -99,7 +99,7 @@ Ekos module icons are placed to the left of pages - Left + &Left ekosIconsPositionGroup @@ -211,6 +211,52 @@ + + + + -24.000000000000000 + + + 24.000000000000000 + + + 0.500000000000000 + + + + + + + -24.000000000000000 + + + 24.000000000000000 + + + 0.500000000000000 + + + + + + + <html><body><p>Offset astronomical dusk by this many hours. This positive or negative value adjusts the twilight restriction.</p></body></html> + + + Dusk Offset + + + + + + + <html><body><p>Offset astronomical dawn by this many hours. This positive or negative value adjusts the twilight restriction.</p></body></html> + + + Dawn Offset + + + 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 @@ -127,6 +127,7 @@ return m_LogText.join("\n"); } void clearLog(); + void applyConfig(); void addObject(SkyObject *object); 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 @@ -217,6 +217,7 @@ Options::setErrorHandlingStrategyDelay(value); }); + calculateDawnDusk(); loadProfiles(); @@ -381,6 +382,17 @@ emit newLog(QString()); } +void Scheduler::applyConfig() +{ + calculateDawnDusk(); + + if (SCHEDULER_RUNNING != state) + { + jobEvaluationOnly = true; + evaluateJobs(); + } +} + void Scheduler::selectObject() { if (FindDialog::Instance()->exec() == QDialog::Accepted) @@ -2297,19 +2309,16 @@ void Scheduler::calculateDawnDusk() { KSAlmanac ksal; - Dawn = ksal.getDawnAstronomicalTwilight(); - Dusk = ksal.getDuskAstronomicalTwilight(); + Dawn = ksal.getDawnAstronomicalTwilight() + Options::dawnOffset() / 24.0; + Dusk = ksal.getDuskAstronomicalTwilight() + Options::duskOffset() / 24.0; - //QTime now = KStarsData::Instance()->lt().time(); - //QTime dawn = QTime(0, 0, 0).addSecs(Dawn * 24 * 3600); - QTime dusk = QTime(0, 0, 0).addSecs(Dusk * 24 * 3600); + QTime const dawn = QTime(0, 0, 0).addSecs(Dawn * 24 * 3600); + QTime const dusk = QTime(0, 0, 0).addSecs(Dusk * 24 * 3600); duskDateTime.setDate(KStars::Instance()->data()->lt().date()); duskDateTime.setTime(dusk); - // FIXME: reduce spam by moving twilight time to a text label - //appendLogText(i18n("Astronomical twilight: dusk at %1, dawn at %2, and current time is %3", - // dusk.toString(), dawn.toString(), now.toString())); + nightTime->setText(i18n("%1 - %2", dusk.toString("hh:mm"), dawn.toString("hh:mm"))); } void Scheduler::executeJob(SchedulerJob *job) diff --git a/kstars/ekos/scheduler/scheduler.ui b/kstars/ekos/scheduler/scheduler.ui --- a/kstars/ekos/scheduler/scheduler.ui +++ b/kstars/ekos/scheduler/scheduler.ui @@ -6,8 +6,8 @@ 0 0 - 721 - 541 + 860 + 638 @@ -896,6 +896,12 @@ + + + 0 + 29 + + Start the observation job as soon as all the constraints, if any, are met. The best candidate target shall be imaged first. @@ -919,6 +925,12 @@ + + + 0 + 29 + + Start the observation job when the object reaches culmination adjusted for the offset value in minutes. By default, the observation job runs 60 minutes prior to culmination. @@ -971,6 +983,12 @@ + + + 0 + 29 + + start the job on the specified date and time @@ -1007,6 +1025,23 @@ + + + + + + + 0 + 29 + + + + + + + + + @@ -1052,6 +1087,12 @@ + + + 0 + 29 + + The moon separation must remain equal to or higher than the given value. @@ -1085,6 +1126,12 @@ + + + 0 + 29 + + The object's altitude must remain equal or higher than the given value. @@ -1099,17 +1146,22 @@ - - - - - - 1 - - + + + + 0 + 0 + + + + + 0 + 29 + + - Jobs are only executed during astronomical twilight darkness period. + <html><body><p>The twilight restriction constrains jobs to execute in astronomical darkness. Use the dusk and dawn offsets in the Ekos Scheduler options to adjust the interval.</p></body></html> Twilight @@ -1122,8 +1174,14 @@ - + + + + 0 + 29 + + <html><head/><body><p>Weather conditions must remain safe. When weather conditions become dangerous, shutdown procedure is initiated.</p></body></html> @@ -1135,12 +1193,12 @@ - + - 32 - 32 + 0 + 29 @@ -1154,21 +1212,28 @@ - - - - Qt::Horizontal - - + + + - 40 - 20 + 0 + 29 - + + + + + + + + 1 + + + @@ -1194,25 +1259,41 @@ 3 - - - The observation job is completed when the sequence is complete. - - - Se&quence completion - - - true - - - completionButtonGroup - - + + + + + + 0 + 29 + + + + The observation job is completed when the sequence is complete. + + + Se&quence completion + + + true + + + completionButtonGroup + + + + + + + 0 + 29 + + &Repeat for @@ -1260,30 +1341,46 @@ - - - Restart the sequence job indefinitely. - - - Repeat until ter&minated - - - completionButtonGroup - - + + + + + + 0 + 29 + + + + Restart the sequence job indefinitely. + + + Repeat until ter&minated + + + completionButtonGroup + + + + 1 + + + 0 + 29 + + Terminate the job on the given date and time. - Repeat until + Repeat &until completionButtonGroup @@ -1401,7 +1498,7 @@ Re-schedule an aborted job immediately. - Re-s&chedule immediately + Re-schedule immediatel&y errorHandlingButtonGroup @@ -1831,35 +1928,31 @@ minAltitude moonSeparationCheck minMoonSeparation - twilightCheck - weatherCheck - sequenceCompletionR - loopCompletionR timeCompletionR completionTimeEdit - + + + false - - + false - + false - - + false diff --git a/kstars/kstars.cpp b/kstars/kstars.cpp --- a/kstars/kstars.cpp +++ b/kstars/kstars.cpp @@ -455,6 +455,12 @@ } } } + +#ifdef HAVE_INDI + //Ekos + if (!m_EkosManager.isNull()) + m_EkosManager->applyConfig(); +#endif } void KStars::showImgExportDialog() diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg --- a/kstars/kstars.kcfg +++ b/kstars/kstars.kcfg @@ -2297,6 +2297,14 @@ 3 + + + 0 + + + + 0 + 0