Enable buttons and the display.

Kind-of-sort-of usable-ish.
This commit is contained in:
2019-06-06 22:30:27 -07:00
parent 1cc2f7adf4
commit 125ddfb687
19 changed files with 937 additions and 196 deletions

38
Task.h
View File

@@ -29,8 +29,8 @@ namespace Common {
namespace Schedule {
enum class ScheduleType {
AT_TIME,
NEVER,
AT_TIME = 0,
NEVER = 1,
};
class NextTime {
@@ -63,8 +63,38 @@ public:
return { ScheduleType::AT_TIME, time };
}
inline ScheduleType get_type() { return m_type; }
inline time_t get_time() { return m_time; }
inline ScheduleType get_type() const { return m_type; }
inline time_t get_time() const { return m_time; }
inline bool operator<(const NextTime other) const {
if (m_type < other.m_type) {
return true;
} else if (m_type == other.m_type) {
switch(m_type){
case ScheduleType::AT_TIME:
return m_time < other.m_time;
case ScheduleType::NEVER:
return false;
}
return false;
} else {
return false;
}
}
inline bool operator==(const NextTime other) const {
if (m_type != other.m_type) {
return false;
} else {
switch(m_type){
case ScheduleType::AT_TIME:
return m_time == other.m_time;
case ScheduleType::NEVER:
return true;
}
return false;
}
}
private:
NextTime(ScheduleType type, time_t time) :