From b18a45ec97459ba2df8b4e13ec6ae52ea472febd Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 21 Jul 2008 22:07:25 +0000 Subject: [PATCH] - manager: display days w/ 2 decimals svn path=/trunk/boinc/; revision=15645 --- checkin_notes | 7 ++++ clientgui/DlgAdvPreferences.cpp | 2 +- clientgui/ViewWork.cpp | 13 ++++--- html/inc/bossa_example.inc | 63 +++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 html/inc/bossa_example.inc diff --git a/checkin_notes b/checkin_notes index 01285c3cf0..063e1abb61 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5909,3 +5909,10 @@ David 21 July 2008 ViewWorkGrid.cpp lib/ coproc.C,h + +David 21 July 2008 + - manager: display days w/ 2 decimals + + clientgui/ + DlgAdvPreferences.cpp + ViewWork.cpp diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index 159310dda2..b6585daf26 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -253,7 +253,7 @@ void CDlgAdvPreferences::ReadPreferenceSettings() { } } // connection interval - buffer.Printf(wxT("%01.4f"),prefs.work_buf_min_days); + buffer.Printf(wxT("%01.2f"),prefs.work_buf_min_days); *m_txtNetConnectInterval << buffer; //download rate buffer.Printf(wxT("%.2f"),prefs.max_bytes_sec_down / 1024); diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index adc54a010e..40d5c4c6a4 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -885,18 +885,21 @@ void CViewWork::GetDocTimeToCompletion(wxInt32 item, float& fBuffer) const { wxInt32 CViewWork::FormatTimeToCompletion(wxInt32 item, wxString& strBuffer) const { CWork* work = m_WorkCache.at(m_iSortedIndexes[item]); - float fBuffer = work->m_fTimeToCompletion; + double est = work->m_fTimeToCompletion; wxInt32 iHour = 0; wxInt32 iMin = 0; wxInt32 iSec = 0; wxTimeSpan ts; - if (0 >= fBuffer) { + if (est > 86400*365*10) { + est = 86400*365*10; + } + if (est <= 0) { strBuffer = wxT("---"); } else { - iHour = (wxInt32)(fBuffer / (60 * 60)); - iMin = (wxInt32)(fBuffer / 60) % 60; - iSec = (wxInt32)(fBuffer) % 60; + iHour = (wxInt32)(est / (60 * 60)); + iMin = (wxInt32)(est / 60) % 60; + iSec = (wxInt32)(est) % 60; ts = wxTimeSpan(iHour, iMin, iSec); diff --git a/html/inc/bossa_example.inc b/html/inc/bossa_example.inc new file mode 100644 index 0000000000..7209c1fc59 --- /dev/null +++ b/html/inc/bossa_example.inc @@ -0,0 +1,63 @@ +get_info($job); + $path = $info->path; + page_head("Find the Ellipse"); + echo " +
+ Click on the center of the ellipse. + If you don't see one, click here: + +

+ id> + +
+ "; + page_tail(); +} + +function job_issued($job, $inst, $user) { + $job->set_priority(0); +} + +function job_finished($job, $inst) { + $response = null; + if (get_str('submit', true)) { + $response->have_ellipse = 0; + } else { + $response->have_ellipse = 1; + $response->cx = get_int('pic_x'); + $response->cy = get_int('pic_y'); + } + $inst->update_info($response); +} + +function job_timed_out($job, $inst, $user) { + $job->set_priority(1); +} + +function job_summary($job) { + $info = $job->get_info(); + return "path>View image"; +} + +function instance_summary($inst) { + $info = $inst->get_info(); + if ($info->have_ellipse) { + return "($info->cx, $info->cy)"; + } else { + return "no ellipse"; + } +} + +function show_user_summary($user) { +} + +?>