Skip to content

Commit

Permalink
- make old-style graphics (though not supported) still compile
Browse files Browse the repository at this point in the history
svn path=/trunk/boinc/; revision=14588
  • Loading branch information
davidpanderson committed Jan 17, 2008
1 parent 5182deb commit 1e5b720
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 19 deletions.
24 changes: 18 additions & 6 deletions api/boinc_api.C
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ static bool have_new_upload_file;
static std::vector<UPLOAD_FILE_STATUS> upload_file_status;

static void graphics_cleanup();
static int suspend_activities();
static int resume_activities();
static void boinc_exit(int);
//static int suspend_activities();
//static int resume_activities();
//static void boinc_exit(int);
static void block_sigalrm();
static int start_worker_signals();

Expand Down Expand Up @@ -453,7 +453,8 @@ int boinc_finish(int status) {
// Unix: called only from the worker thread.
// Win: called from the worker or timer thread.
//
static void boinc_exit(int status) {
// make static eventually
void boinc_exit(int status) {
if (options.backwards_compatible_graphics) {
graphics_cleanup();
}
Expand Down Expand Up @@ -582,7 +583,8 @@ int boinc_wu_cpu_time(double& cpu_t) {
return 0;
}

static int suspend_activities() {
// make static eventually
int suspend_activities() {
BOINCINFO("Received Suspend Message");
#ifdef _WIN32
if (options.direct_process_action) {
Expand All @@ -592,7 +594,8 @@ static int suspend_activities() {
return 0;
}

static int resume_activities() {
// make static eventually
int resume_activities() {
BOINCINFO("Received Resume Message");
#ifdef _WIN32
if (options.direct_process_action) {
Expand All @@ -601,6 +604,15 @@ static int resume_activities() {
#endif
return 0;
}
int restore_activities() {
int retval;
if (boinc_status.suspended) {
retval = suspend_activities();
} else {
retval = resume_activities();
}
return retval;
}

static void handle_heartbeat_msg() {
char buf[MSG_CHANNEL_SIZE];
Expand Down
4 changes: 4 additions & 0 deletions api/boinc_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ extern void boinc_register_timer_callback(FUNC_PTR);
extern double boinc_worker_thread_cpu_time();
extern int boinc_ncpus_available();
extern void boinc_nthreads(int);
extern void boinc_exit(int); // deprecated

#ifdef __APPLE__
extern int setMacPList(void);
Expand All @@ -124,6 +125,9 @@ extern int boinc_wu_cpu_time(double&);
extern int boinc_upload_file(std::string& name);
extern int boinc_upload_status(std::string& name);
extern int boinc_write_init_data_file(APP_INIT_DATA&);
extern int suspend_activities(); // deprecated
extern int resume_activities(); // deprecated
extern int restore_activities(); //deprecated

/////////// API ENDS HERE

Expand Down
1 change: 1 addition & 0 deletions api/graphics_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct BOINC_MAIN_STATE {
int (*boinc_is_standalone_hook)();
int (*boinc_get_init_data_hook)(APP_INIT_DATA&);
int (*set_worker_timer_hook)();
int (*start_timer_thread_hook)();
APP_CLIENT_SHM** app_client_shmp;
#ifdef _WIN32
UINT_PTR gfx_timer_id;
Expand Down
8 changes: 8 additions & 0 deletions bolt_checkin_notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ David Jan 1 2008
user/
bolt_course_sample.php
bolt_sched.php

David Jan 17 2008
- Add table for selects

db/
bolt_schema.sql
html/inc/
bolt_db.inc
9 changes: 9 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -660,3 +660,12 @@ Charlie Jan 17 2008
Rom Jan 17 2008 (HEAD)
- Tag for 6.1.7 release, all platforms
boinc_core_release_6_1_7

David Jan 17 2008
- API: make the libraries for old-style graphics compile again
(these are no longer supported, but they probably still work)
api/
boinc_api.C,h
graphics_impl.h
client/
acct_mgr.C
6 changes: 2 additions & 4 deletions client/acct_mgr.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

#ifdef _WIN32
#include "boinc_win.h"
#endif

#ifndef _WIN32
#else
#include "config.h"
#endif

Expand All @@ -44,7 +42,7 @@ ACCT_MGR_OP::ACCT_MGR_OP() {
}

// do an account manager RPC;
// if url is null, defect from current account manager
// if URL is null, detach from current account manager
//
int ACCT_MGR_OP::do_rpc(
std::string _url, std::string name, std::string password_hash,
Expand Down
48 changes: 39 additions & 9 deletions db/bolt_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ create table bolt_view (
mode integer not null,
-- distinguishes exercise show/answer
action integer not null,
-- what the user clicked
-- what the user clicked to leave page
start_time integer not null,
end_time integer not null,
prev_view_id integer not null,
-- for exercise answer views,
-- this always refers to the original exercise show
-- for exercise answer views;
-- refers to the original exercise view
fraction_done double not null,
result_id integer not null,
-- if this was an exercise show, link to result record
refresh_id integer not null,
-- if unit was flagged for review, link to review record
-- ?? remove?
primary key (id)
);

Expand All @@ -65,7 +66,7 @@ create table bolt_result (
user_id integer not null,
course_id integer not null,
view_id integer not null,
-- the original display of exercise
-- the display of exercise
score double not null,
response text not null,
-- the query string containing user's responses
Expand All @@ -74,20 +75,36 @@ create table bolt_result (

-- represents the result of a completed exercise set,
-- where "completed" means the student clicked Next on the final answer page.
-- This is slightly redundant -
-- it could be reconstructed from the individual exercise results -
-- but this way makes it easier for analytics to treat exercise sets as units.
-- In theory this could be reconstructed from the individual exercise results,
-- but this table makes it easier for analytics
--
create table bolt_xset_result (
id integer not null auto_increment,
create_time integer not null,
user_id integer not null,
course_id integer not null,
start_time integer not null,
end_time integer not null,
name varchar(255) not null,
-- logical name of result set unit
score double not null,
-- weighted average score
view_id integer not null,
-- the view of the answer page of last exercise in set
primary key(id)
);

-- represents the completion of a select structure
--
create table bolt_select_complete (
id integer not null auto_increment,
user_id integer not null,
course_id integer not null,
start_time integer not null,
end_time integer not null,
name varchar(255) not null,
-- logical name of the select unit
view_id integer not null,
-- the answer page of last exercise in set
-- the view of the last item
primary key(id)
);

Expand All @@ -110,3 +127,16 @@ create table bolt_refresh (
-- when refresh will be due
primary key (id)
);

create table bolt_question (
id integer not null auto_increment,
create_time integer not null,
user_id integer not null,
course_id integer not null,
name varchar(255) not null,
-- logical name of item where question was asked
question text not null,
state integer not null,
-- whether question has been handled
primary key (id)
);
38 changes: 38 additions & 0 deletions html/inc/bolt_db.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
require_once("../inc/db_conn.inc");
require_once("../inc/util.inc");

define('BOLT_PHASE_STUDY');
define('BOLT_PHASE_REVIEW');
// review and repeat of an exercise set
define('BOLT_PHASE_REFRESH');

define('BOLT_MODE_LESSON', 1);
define('BOLT_MODE_SHOW', 2);
define('BOLT_MODE_SCORE', 3);
Expand Down Expand Up @@ -158,4 +163,37 @@ class BoltResult {
}
}

class BoltXsetResult {
function insert($clause) {
$db = BoltDb::get();
return $db->insert('bolt_xset_result', $clause);
}
static function enum($clause) {
$db = BoltDb::get();
return $db->enum('bolt_xset_result', 'BoltXsetResult', $clause);
}
}

class BoltSelectCompleted {
function insert($clause) {
$db = BoltDb::get();
return $db->insert('bolt_select_completed', $clause);
}
static function enum($clause) {
$db = BoltDb::get();
return $db->enum('bolt_select_completed', 'BoltSelectCompleted', $clause);
}
}

class BoltQuestion {
function insert($clause) {
$db = BoltDb::get();
return $db->insert('bolt_question', $clause);
}
static function enum($clause) {
$db = BoltDb::get();
return $db->enum('bolt_question', 'BoltQuestion', $clause);
}
}

?>

0 comments on commit 1e5b720

Please sign in to comment.