mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 00:56:00 -05:00
Make date "At"-type check more robust
Previously the "At" check could skip the desired time window if e.g another macro was performing a long wait wait action or condition was taking a long time to check. The date condition will now take into consideration when the last time was the condition checked a date instead of simply applying a fixed window of "switcher->interval".
This commit is contained in:
@@ -48,8 +48,8 @@ public:
|
||||
bool _dayOfWeekCheck = false;
|
||||
|
||||
private:
|
||||
bool checkDayOfWeek();
|
||||
bool checkRegularDate();
|
||||
bool CheckDayOfWeek(int64_t);
|
||||
bool CheckRegularDate(int64_t);
|
||||
|
||||
static bool _registered;
|
||||
static const std::string id;
|
||||
|
||||
@@ -78,6 +78,7 @@ public:
|
||||
bool PerformActions(bool forceParallel = false,
|
||||
bool ignorePause = false);
|
||||
bool Matched() { return _matched; }
|
||||
int64_t MsSinceLastCheck();
|
||||
std::string Name() { return _name; }
|
||||
void SetName(const std::string &name);
|
||||
void SetRunInParallel(bool parallel) { _runInParallel = parallel; }
|
||||
@@ -139,6 +140,8 @@ private:
|
||||
bool _wasExecutedRecently = false;
|
||||
bool _onChangeTriggered = false;
|
||||
|
||||
std::chrono::high_resolution_clock::time_point _lastCheckTime{};
|
||||
|
||||
bool _die = false;
|
||||
bool _stop = false;
|
||||
bool _done = true;
|
||||
|
||||
Reference in New Issue
Block a user