From ec680380e93b2712e328d7ff868cde47d696384a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 9 Jul 2004 20:14:33 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3834 --- checkin_notes | 16 +++++++-- client/gui_rpc_client.C | 75 +++++++++++++++++++++++++++++++++++++---- client/gui_rpc_client.h | 10 +++--- client/gui_rpc_server.C | 42 ++++++++++++++--------- client/gui_test.C | 19 +++++++++-- doc/community.php | 6 +++- doc/index.php | 12 +++---- doc/links.php | 5 +++ 8 files changed, 144 insertions(+), 41 deletions(-) diff --git a/checkin_notes b/checkin_notes index 1369c881d3..7858fecda5 100755 --- a/checkin_notes +++ b/checkin_notes @@ -14910,9 +14910,9 @@ Daniel 2004-07-08 Brian 8 July 2004 - Fixed a small bug in allowed_disk_usage where the - global_prefs.disk_max_used_pct was directly multiplied with the total - disk, creating a disk value that was a factor of 100 off, effectively - never becoming the min value returned by the function. + global_prefs.disk_max_used_pct was directly multiplied + by the total disk, creating a disk value that was a factor of 100 off, + effectively never becoming the min value returned by the function. client/ cs_prefs.C @@ -14963,3 +14963,13 @@ Daniel 2004-07-09 client/ app.C +David 9 July 2004 + - Implemented GUI RPCs for + - showing graphics (one result or all, window or fullscreen) + - project reset, attach, detach + - Added cmdline options to gui_test to exercise the above + + client/ + gui_rpc_client.C,h + gui_rpc_server.C + gui_test.C diff --git a/client/gui_rpc_client.C b/client/gui_rpc_client.C index b5407f1c31..1672d1bd4b 100644 --- a/client/gui_rpc_client.C +++ b/client/gui_rpc_client.C @@ -98,7 +98,7 @@ int RPC_CLIENT::get_reply(char*& mbuf) { int RPC_CLIENT::get_state() { char buf[256]; PROJECT* project; - char* mbuf; + char* mbuf=0; send_request("\n"); get_reply(mbuf); @@ -165,29 +165,90 @@ int RPC_CLIENT::get_state() { return 0; } -int RPC_CLIENT::result_show_graphics(RESULT& result) { +int RPC_CLIENT::show_graphics(char* result_name, bool full_screen) { + char buf[256]; + char* mbuf=0; + if (result_name) { + sprintf(buf, "\n" + "%s\n" + "%s" + "\n", + result_name, + full_screen?"\n":"" + ); + } else { + strcpy(buf, "\n\n"); + } + send_request(buf); + get_reply(mbuf); + if (mbuf) free(mbuf); return 0; } -int RPC_CLIENT::project_reset(PROJECT& project) { +int RPC_CLIENT::project_reset(char* url) { + char buf[256]; + char* mbuf=0; + sprintf(buf, + "\n" + " %s\n" + "\n", + url + ); + send_request(buf); + get_reply(mbuf); + if (mbuf) free(mbuf); return 0; } int RPC_CLIENT::project_attach(char* url, char* auth) { + char buf[256]; + char* mbuf=0; + sprintf(buf, + "\n" + " %s\n" + " %s\n" + "\n", + url, auth + ); + send_request(buf); + get_reply(mbuf); + if (mbuf) free(mbuf); return 0; } -int RPC_CLIENT::project_detach(PROJECT&) { +int RPC_CLIENT::project_detach(char* url) { + char buf[256]; + char* mbuf=0; + sprintf(buf, + "\n" + " %s\n" + "\n", + url + ); + send_request(buf); + get_reply(mbuf); + if (mbuf) free(mbuf); return 0; } -int RPC_CLIENT::project_update(PROJECT&) { +int RPC_CLIENT::project_update(char* url) { + char buf[256]; + char* mbuf=0; + sprintf(buf, + "\n" + " %s\n" + "\n", + url + ); + send_request(buf); + get_reply(mbuf); + if (mbuf) free(mbuf); return 0; } int RPC_CLIENT::set_run_mode(int mode) { char *p, buf[256]; - char* mbuf; + char* mbuf=0; switch (mode) { case RUN_MODE_ALWAYS: p=""; break; case RUN_MODE_NEVER: p=""; break; @@ -250,7 +311,7 @@ int RPC_CLIENT::get_messages( return 0; } -void RPC_CLIENT::print() { +void RPC_CLIENT::print_state() { unsigned int i; printf("======== Projects ========\n"); diff --git a/client/gui_rpc_client.h b/client/gui_rpc_client.h index c3bea809ac..0b623525e5 100644 --- a/client/gui_rpc_client.h +++ b/client/gui_rpc_client.h @@ -185,15 +185,15 @@ public: ~RPC_CLIENT(); int init(); int get_state(); - int result_show_graphics(RESULT&); - int project_reset(PROJECT&); + int show_graphics(char* result_name, bool full_screen); + int project_reset(char*); int project_attach(char* url, char* auth); - int project_detach(PROJECT&); - int project_update(PROJECT&); + int project_detach(char*); + int project_update(char*); int set_run_mode(int mode); int run_benchmarks(); int set_proxy_settings(PROXY_INFO&); int get_messages(int nmessages, int seqno, std::vector&); - void print(); + void print_state(); }; diff --git a/client/gui_rpc_server.C b/client/gui_rpc_server.C index e9305195dc..e88b10d7b4 100644 --- a/client/gui_rpc_server.C +++ b/client/gui_rpc_server.C @@ -71,24 +71,34 @@ static PROJECT* get_project(char* buf, MIOFILE& fout) { static void handle_result_show_graphics(char* buf, MIOFILE& fout) { string result_name; + ACTIVE_TASK* atp; + PROJECT* p = get_project(buf, fout); if (!p) return; - if (!parse_str(buf, "", result_name)) { - fout.printf("Missing result name\n"); - return; - } - RESULT* rp = gstate.lookup_result(p, result_name.c_str()); - if (!rp) { - fout.printf("No such result\n"); - return; - } - ACTIVE_TASK* atp = gstate.lookup_active_task_by_result(rp); - if (!atp) { - fout.printf("Result not active\n"); - return; - } - atp->request_graphics_mode(MODE_WINDOW); + if (parse_str(buf, "", result_name)) { + RESULT* rp = gstate.lookup_result(p, result_name.c_str()); + if (!rp) { + fout.printf("No such result\n"); + return; + } + atp = gstate.lookup_active_task_by_result(rp); + if (!atp || atp->scheduler_state != CPU_SCHED_RUNNING) { + fout.printf("Result not active\n"); + return; + } + if (match_tag(buf, "")) { + atp->request_graphics_mode(MODE_FULLSCREEN); + } else { + atp->request_graphics_mode(MODE_WINDOW); + } + } else { + for (unsigned int i=0; ischeduler_state != CPU_SCHED_RUNNING) continue; + atp->request_graphics_mode(MODE_WINDOW); + } + } fout.printf("\n"); } @@ -103,7 +113,7 @@ static void handle_project_reset(char* buf, MIOFILE& fout) { static void handle_project_attach(char* buf, MIOFILE& fout) { string url, authenticator; - if (!parse_str(buf, "", url)) { + if (!parse_str(buf, "", url)) { fout.printf("Missing URL\n"); return; } diff --git a/client/gui_test.C b/client/gui_test.C index 9ffaca9a1e..13342098a9 100644 --- a/client/gui_test.C +++ b/client/gui_test.C @@ -18,7 +18,13 @@ // // gui_test: test program for BOINC GUI RPCs. -// Does a single RPC and shows results +// usages: +// -state show state +// -msgs show messages +// -show_graphics_window result_name show graphics for result in a window +// -show_graphics_window show graphics for all results +// -show_graphics_full result_name show full-screen graphics for result + #ifdef _WIN32 #include "boinc_win.h" @@ -72,7 +78,8 @@ int main(int argc, char** argv) { if (!strcmp(argv[1], "-state")) { rpc.get_state(); - rpc.print(); + rpc.print_state(); + } else if (!strcmp(argv[1], "-msgs")) { rpc.get_messages(20, 0, message_descs); for (i=0; i BOINC beta test: http://setiboinc.ssl.berkeley.edu/ap/rss_main.php

Other

-For other information, contact Dr. David P. Anderson, +A good summary of distributed computing projects, +including those based on BOINC, is at +www.aspenleaf.com. +

+For inquiries about BOINC, contact Dr. David P. Anderson, the director of the BOINC project, at davea at ssl.berkeley.edu. If you have problems with the BOINC software for Windows please email Rom Walton: rwalton at ssl.berkeley.edu. diff --git a/doc/index.php b/doc/index.php index 789a9b78c6..29a0ac5c30 100644 --- a/doc/index.php +++ b/doc/index.php @@ -66,13 +66,11 @@ through award SCI/0221529.

Status

-BOINC is under development. -We are conducting a -beta test of BOINC -using the SETI@home and -Astropulse applications. -The public release will be announced on the SETI@home web site. -Several other distributed computing projects are evaluating BOINC. +BOINC is being used by +SETI@home +and Predictor@home. +Other distributed computing projects based on BOINC +will be launched soon.

News

diff --git a/doc/links.php b/doc/links.php index 0012354f90..2841189da2 100644 --- a/doc/links.php +++ b/doc/links.php @@ -83,6 +83,11 @@ show_link( "translation by Komori Hitoshi", "http://boinc.oocp.org/" ); +show_link( + "Polish", + "www.boinc.pl", + "http://www.boinc.pl" +); show_link( "Russian", "www.boinc.narod.ru",