75
79
// run always if start==end or start==0, end=24
76
80
// don't run at all if start=24, end=0
85
: start_hour(0), end_hour(0) {}
86
TIME_SPAN(double start, double end)
87
: start_hour(start), end_hour(end) {}
89
bool suspended(double hour) const;
90
TimeMode mode() const;
92
TIME_SPAN() : start_hour(0), end_hour(0) {}
93
TIME_SPAN(double start, double end) : start_hour(start), end_hour(end) {}
95
bool suspended(double hour) const;
96
TimeMode mode() const;
101
WEEK_PREFS(const WEEK_PREFS& original);
104
TIME_SPAN* get(int day) const;
104
memset(this, 0, sizeof(WEEK_PREFS));
105
110
void set(int day, double start, double end);
106
111
void set(int day, TIME_SPAN* time);
107
112
void unset(int day);
109
WEEK_PREFS& operator=(const WEEK_PREFS& rhs);
112
115
void copy(const WEEK_PREFS& original);
118
class TIME_PREFS : public TIME_SPAN {
120
TIME_PREFS() : TIME_SPAN() {}
121
TIME_PREFS(double start, double end)
122
: TIME_SPAN(start, end) {}
125
bool suspended() const;
119
struct TIME_PREFS : public TIME_SPAN {
123
TIME_PREFS(double start, double end) {
129
bool suspended() const;
134
137
// poorly named; what it really means is:
135
138
// if false, suspend while on batteries
136
139
bool run_if_user_active;
140
bool run_gpu_if_user_active;
137
141
double idle_time_to_run;
138
142
double suspend_if_no_recent_input;
143
double suspend_cpu_usage;
139
144
bool leave_apps_in_memory;
140
145
bool confirm_before_connecting;
141
146
bool hangup_if_dialed;
157
164
double max_bytes_sec_up;
158
165
double max_bytes_sec_down;
159
166
double cpu_usage_limit;
167
double daily_xfer_limit_mb;
168
int daily_xfer_period_days;
160
169
char source_project[256];
161
170
char source_scheduler[256];
162
171
bool host_specific;
171
180
int parse_file(const char* filename, const char* venue, bool& found_venue);
172
181
int write(MIOFILE&);
173
182
int write_subset(MIOFILE&, GLOBAL_PREFS_MASK&);
183
void write_day_prefs(MIOFILE&);
174
184
inline double cpu_scheduling_period() {
175
185
return cpu_scheduling_period_minutes*60;