void show_no_projects() { float x=.2, y=.3; char buf[256]; snprintf(buf, sizeof(buf), "%s is not attached to any projects.", brand_name); ttf_render_string(x, y, 0, ALERT_SIZE, white, buf); y = .25; snprintf(buf, sizeof(buf), "Attach to projects using %s.", brand_name); ttf_render_string(x, y, 0, ALERT_SIZE, white, buf); }
void show_coords() { int i; char buf[256]; for (i=-100; i< 101; i+=5) { sprintf(buf, "%d", i); float x = (float)i/100; ttf_render_string(x, 0, 0, 1000., white, buf); } for (i=-100; i< 101; i+=5) { sprintf(buf, "%d", i); float y = (float)i/100; ttf_render_string(0, y, 0, 1000., white, buf); } }
void show_project(unsigned int index, float alpha) { float x=.2, y=.6; char buf[1024]; ttf_render_string(x, y, 0, PROJ_INTRO_SIZE, white, "This computer is participating in"); y -= .07; PROJECT *p = cc_state.projects[index]; ttf_render_string(x, y, 0, PROJ_NAME_SIZE, white, (char*)p->project_name.c_str()); y -= .07; ttf_render_string(x, y, 0, PROJ_INFO_SIZE, white, p->master_url); y -= .05; snprintf(buf, sizeof(buf), "User: %s", p->user_name.c_str()); ttf_render_string(x, y, 0, PROJ_INFO_SIZE, white, buf); y -= .05; if (p->team_name.size()) { snprintf(buf, sizeof(buf), "Team: %s", p->team_name.c_str()); ttf_render_string(x, y, 0, PROJ_INFO_SIZE, white, buf); y -= .05; } snprintf(buf, sizeof(buf), "Total credit: %.0f Average credit: %.0f", p->user_total_credit, p->user_expavg_credit); ttf_render_string(x, y, 0, PROJ_INFO_SIZE, white, buf); y -= .05; if (p->suspended_via_gui) { ttf_render_string(x, y, 0, PROJ_INFO_SIZE, white, "Suspended"); } }
void show_result(RESULT* r, float x, float& y, float alpha) { PROGRESS_2D progress; char buf[256]; ttf_render_string(x, y, 0, TASK_PROJ_SIZE, white, (char*)r->project->project_name.c_str()); y -= .02; float prog_pos[] = {x, y, 0}; float prog_c[] = {.5, .4, .1, alpha/2}; float prog_ci[] = {.1, .8, .2, alpha}; progress.init(prog_pos, .4, -.01, -0.008, prog_c, prog_ci); progress.draw(r->fraction_done); snprintf(buf, sizeof(buf), "%.2f%% ", r->fraction_done*100); ttf_render_string(x+.41, y, 0, TASK_INFO_SIZE, white, buf); y -= .03; x += .05; snprintf(buf, sizeof(buf), "Elapsed: %.0f sec Remaining: %.0f sec", r->elapsed_time, r->estimated_cpu_time_remaining); ttf_render_string(x, y, 0, TASK_INFO_SIZE, white, buf); y -= .03; snprintf(buf, sizeof(buf), "App: %s Task: %s", r->app->user_friendly_name, r->wup->name); ttf_render_string(x, y, 0, TASK_INFO_SIZE, white, buf); y -= .03; }
void show_disconnected() { float x=.3, y=.3; char buf[256]; snprintf(buf, sizeof(buf), "%s is not running.", brand_name); ttf_render_string(x, y, 0, ALERT_SIZE, white, buf); }