*** empty log message ***

svn path=/trunk/boinc/; revision=5773
This commit is contained in:
David Anderson 2005-04-04 21:14:49 +00:00
parent 53c7a7e0e5
commit 5d7760d7b2
9 changed files with 47 additions and 21 deletions

View File

@ -26639,3 +26639,18 @@ David 4 April 2005
cliengui/
MainFrame.cpp
Makefile.am
David 4 April 2005
- Call get_connected_state() every 10 seconds, not 10X per second
(it does a registry lookup on Win)
- fix names of SS constants
client/
client_state.C
client_types.C
ss_logic.C,h
time_stats.C,h
win/
win_screensaver.cpp
lib/
boinc_cmd.C

View File

@ -499,8 +499,7 @@ bool CLIENT_STATE::do_something(double now) {
if (actions > 0) {
return true;
} else {
int connected_state = get_connected_state();
time_stats.update(now, connected_state, !activities_suspended);
time_stats.update(now, !activities_suspended);
return false;
}
}

View File

@ -326,7 +326,7 @@ void PROJECT::copy_state_fields(PROJECT& p) {
// Write project statistic to project statistics file
//
int PROJECT::write_statistics(MIOFILE& out, bool gui_rpc) {
int PROJECT::write_statistics(MIOFILE& out, bool /*gui_rpc*/) {
out.printf(
"<project_statistics>\n"
" <master_url>%s</master_url>\n",

View File

@ -32,8 +32,8 @@ SS_LOGIC::SS_LOGIC() {
ss_status = 0;
}
// this is called when the core client receives a set_screensaver_mode RPC
// from the screensaver module.
// called in response to a set_screensaver_mode RPC with <enabled>.
// Start providing screensaver graphics
//
void SS_LOGIC::start_ss(GRAPHICS_MSG& m, double new_blank_time) {
ACTIVE_TASK* atp;
@ -57,6 +57,9 @@ void SS_LOGIC::start_ss(GRAPHICS_MSG& m, double new_blank_time) {
}
}
// called in response to a set_screensaver_mode RPC without <enabled>
// Stop providing screensaver graphics
//
void SS_LOGIC::stop_ss() {
if (!do_ss) return;
reset();
@ -66,6 +69,7 @@ void SS_LOGIC::stop_ss() {
}
// If an app is acting as screensaver, tell it to stop.
// Called from CLIENT_STATE::schedule_cpus()
//
void SS_LOGIC::reset() {
GRAPHICS_MSG m;
@ -116,7 +120,6 @@ void SS_LOGIC::poll() {
m.mode = MODE_HIDE_GRAPHICS;
atp->request_graphics_mode(m);
atp->is_ss_app = false;
ss_status = SS_STATUS_NOTGRAPHICSCAPABLE;
}
}
} else {
@ -129,7 +132,7 @@ void SS_LOGIC::poll() {
if (gstate.projects.size()>0) {
ss_status = SS_STATUS_NOAPPSEXECUTING;
} else {
ss_status = SS_STATUS_NOAPPSEXECUTINGNOPROJECTSDETECTED;
ss_status = SS_STATUS_NOPROJECTSDETECTED;
}
} else {
ss_status = SS_STATUS_NOGRAPHICSAPPSEXECUTING;

View File

@ -24,15 +24,24 @@
#include <ctime>
#endif
// the core client can be requested to provide screensaver graphics (SSG).
// The following are states of this function:
#define SS_STATUS_ENABLED 1
// requested to provide SSG
#define SS_STATUS_RESTARTREQUEST 2
// ???
#define SS_STATUS_BLANKED 3
// not providing SSG, SS should blank screen
#define SS_STATUS_BOINCSUSPENDED 4
#define SS_STATUS_NOTGRAPHICSCAPABLE 5
// not providing SS because suspended
#define SS_STATUS_NOAPPSEXECUTING 6
// no apps executing
#define SS_STATUS_NOGRAPHICSAPPSEXECUTING 7
// apps executing, but none graphical
#define SS_STATUS_QUIT 8
#define SS_STATUS_NOAPPSEXECUTINGNOPROJECTSDETECTED 9
// not requested to provide SSG
#define SS_STATUS_NOPROJECTSDETECTED 9
class SS_LOGIC {
public:
@ -54,7 +63,6 @@ private:
// invariants
//
// do_boinc_logo_ss and do_blank are not both true
// at most one app has request_mode = FULLSCREEN
// pre-ss mode of all apps is not FULLSCREEN
};

View File

@ -55,7 +55,7 @@ TIME_STATS::TIME_STATS() {
// so these get written to disk only when other activities
// cause this to happen. Maybe should change this.
//
void TIME_STATS::update(double now, int connected_state, bool is_active) {
void TIME_STATS::update(double now, bool is_active) {
double dt, w1, w2;
if (last_update == 0) {
@ -73,6 +73,7 @@ void TIME_STATS::update(double now, int connected_state, bool is_active) {
w1 = 1 - exp(-dt/ALPHA); // weight for recent period
w2 = 1 - w1; // weight for everything before that
// (close to zero if long gap)
int connected_state = get_connected_state();
if (first) {
// the client has just started; this is the first call.
//

View File

@ -35,7 +35,7 @@ public:
// the fraction it is enabled to work
// (as determined by preferences, manual suspend/resume, etc.)
void update(double now, int connected_state, bool is_active);
void update(double now, bool is_active);
TIME_STATS();
int write(MIOFILE&, bool to_server);

View File

@ -911,7 +911,7 @@ LRESULT CScreensaver::SaverProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
m_bErrorMode = TRUE;
m_hrError = SCRAPPERR_BOINCNOAPPSEXECUTING;
break;
case SS_STATUS_NOAPPSEXECUTINGNOPROJECTSDETECTED:
case SS_STATUS_NOPROJECTSDETECTED:
m_bErrorMode = TRUE;
m_hrError = SCRAPPERR_BOINCNOAPPSEXECUTINGNOPROJECTSDETECTED;
break;

View File

@ -70,7 +70,7 @@ void usage() {
exit(1);
}
void parse_display_args(int argc, char** argv, int& i, DISPLAY_INFO& di) {
void parse_display_args(char** argv, int& i, DISPLAY_INFO& di) {
strcpy(di.window_station, "winsta0");
strcpy(di.desktop, "default");
strcpy(di.display, "");
@ -179,11 +179,11 @@ int main(int argc, char** argv) {
retval = rpc.result_op(result, "abort");
} else if (!strcmp(op, "graphics_window")) {
DISPLAY_INFO di;
parse_display_args(argc, argv, i, di);
parse_display_args(argv, i, di);
retval = rpc.show_graphics(project_url, name, false, di);
} else if (!strcmp(op, "graphics_fullscreen")) {
DISPLAY_INFO di;
parse_display_args(argc, argv, i, di);
parse_display_args(argv, i, di);
retval = rpc.show_graphics(project_url, name, true, di);
} else {
fprintf(stderr, "Unknown op %s\n", op);
@ -290,10 +290,10 @@ int main(int argc, char** argv) {
retval = rpc.get_host_info(hi);
if (!retval) hi.print();
} else if (!strcmp(cmd, "--acct_mgr_rpc")) {
char* url = next_arg(argc, argv, i);
char* name = next_arg(argc, argv, i);
char* passwd = next_arg(argc, argv, i);
retval = rpc.acct_mgr_rpc(url, name, passwd);
char* am_url = next_arg(argc, argv, i);
char* am_name = next_arg(argc, argv, i);
char* am_passwd = next_arg(argc, argv, i);
retval = rpc.acct_mgr_rpc(am_url, am_name, am_passwd);
} else if (!strcmp(cmd, "--run_benchmarks")) {
retval = rpc.run_benchmarks();
} else if (!strcmp(cmd, "--get_screensaver_mode")) {
@ -308,7 +308,7 @@ int main(int argc, char** argv) {
char* op = next_arg(argc, argv, i);
if (!strcmp(op, "on")) enabled = true;
blank_time = atof(next_arg(argc, argv, i));
parse_display_args(argc, argv, i, di);
parse_display_args(argv, i, di);
retval = rpc.set_screensaver_mode(enabled, blank_time, di);
} else if (!strcmp(cmd, "--quit")) {
retval = rpc.quit();