Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Client] Modify preferences if niu & in use times overlap #4960

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions lib/prefs.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// Copyright (C) 2022 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -32,8 +32,9 @@
#include "error_numbers.h"
#include "str_replace.h"
#include "parse.h"
#include "str_util.h"
#include "util.h"

#include "..\client\client_msgs.h"
#include "prefs.h"

void GLOBAL_PREFS_MASK::set_all() {
Expand Down Expand Up @@ -408,6 +409,14 @@ int GLOBAL_PREFS::parse_override(
if (!mask.niu_suspend_cpu_usage) {
niu_suspend_cpu_usage = suspend_cpu_usage;
}
// Checks for a condition where no computing could occur if suspend until idle and
// suspend after being idle overlap.
//
if (mask.idle_time_to_run && mask.suspend_if_no_recent_input) {
if ((idle_time_to_run - suspend_if_no_recent_input + 0.005) >= 0) {
msg_printf(NULL, MSG_USER_ALERT, "%s", "Test message.");
}
}
return 0;
}
if (in_venue) {
Expand Down Expand Up @@ -765,7 +774,7 @@ void GLOBAL_PREFS::write_day_prefs(MIOFILE& f) {
bool net_present = net_times.week.days[i].present;
//write only when needed
if (net_present || cpu_present) {

f.printf(" <day_prefs>\n");
f.printf(" <day_of_week>%d</day_of_week>\n", i);
if (cpu_present) {
Expand Down