*** empty log message ***

svn path=/trunk/boinc/; revision=11553
This commit is contained in:
David Anderson 2006-11-20 16:52:03 +00:00
parent 8489867ea4
commit 27d33df2d4
6 changed files with 32 additions and 2 deletions

View File

@ -12715,3 +12715,14 @@ Rom 20 Nov 2006
NetworkTracker.cpp
lib/
network.C
David 20 Nov 2006
- GUI RPC: return task and network mode delays in get_cc_status().
This tells the GUI how long the current snooze is going to last.
client/
client_types.C,h
gui_rpc_server_ops.C
lib/
gui_rpc_client.h
gui_rpc_client_ops.C

View File

@ -1796,4 +1796,12 @@ int MODE::get_current() {
}
}
double MODE::delay() {
if (temp_timeout > gstate.now) {
return temp_timeout - gstate.now;
} else {
return 0;
}
}
const char *BOINC_RCSID_b81ff9a584 = "$Id$";

View File

@ -511,6 +511,7 @@ public:
void set(int mode, double duration);
int get_perm();
int get_current();
double delay();
};
#endif

View File

@ -527,6 +527,8 @@ static void handle_get_cc_status(MIOFILE& fout) {
" <network_mode>%d</network_mode>\n"
" <task_mode_perm>%d</task_mode_perm>\n"
" <network_mode_perm>%d</network_mode_perm>\n"
" <task_mode_delay>%f</task_mode_delay>\n"
" <network_mode_delay>%f</network_mode_delay>\n"
"</cc_status>\n",
net_status.network_status(),
gstate.acct_mgr_info.password_error?1:0,
@ -535,7 +537,9 @@ static void handle_get_cc_status(MIOFILE& fout) {
gstate.run_mode.get_current(),
gstate.network_mode.get_current(),
gstate.run_mode.get_perm(),
gstate.network_mode.get_perm()
gstate.network_mode.get_perm(),
gstate.run_mode.delay(),
gstate.network_mode.delay()
);
}

View File

@ -469,8 +469,10 @@ struct CC_STATUS {
int network_suspend_reason;
int task_mode; // always/auto/never; see common_defs.h
int network_mode;
int task_mode_perm;
int task_mode_perm; // same, but permanent version
int network_mode_perm;
double task_mode_delay; // time until perm becomes actual
double network_mode_delay;
CC_STATUS();
~CC_STATUS();

View File

@ -964,6 +964,8 @@ int CC_STATUS::parse(MIOFILE& in) {
else if (parse_int(buf, "<network_mode>", network_mode)) continue;
else if (parse_int(buf, "<task_mode_perm>", task_mode_perm)) continue;
else if (parse_int(buf, "<network_mode_perm>", network_mode_perm)) continue;
else if (parse_double(buf, "<task_mode_delay>", task_mode_delay)) continue;
else if (parse_double(buf, "<network_mode_delay>", network_mode_delay)) continue;
}
return ERR_XML_PARSE;
}
@ -977,6 +979,8 @@ void CC_STATUS::clear() {
network_mode = -1;
task_mode_perm = -1;
network_mode_perm = -1;
task_mode_delay = 0;
network_mode_delay = 0;
}
/////////// END OF PARSING FUNCTIONS. RPCS START HERE ////////////////