mirror of https://github.com/BOINC/boinc.git
- manager: display days w/ 2 decimals
svn path=/trunk/boinc/; revision=15645
This commit is contained in:
parent
6c0731e82e
commit
b18a45ec97
|
@ -5909,3 +5909,10 @@ David 21 July 2008
|
||||||
ViewWorkGrid.cpp
|
ViewWorkGrid.cpp
|
||||||
lib/
|
lib/
|
||||||
coproc.C,h
|
coproc.C,h
|
||||||
|
|
||||||
|
David 21 July 2008
|
||||||
|
- manager: display days w/ 2 decimals
|
||||||
|
|
||||||
|
clientgui/
|
||||||
|
DlgAdvPreferences.cpp
|
||||||
|
ViewWork.cpp
|
||||||
|
|
|
@ -253,7 +253,7 @@ void CDlgAdvPreferences::ReadPreferenceSettings() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// connection interval
|
// 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;
|
*m_txtNetConnectInterval << buffer;
|
||||||
//download rate
|
//download rate
|
||||||
buffer.Printf(wxT("%.2f"),prefs.max_bytes_sec_down / 1024);
|
buffer.Printf(wxT("%.2f"),prefs.max_bytes_sec_down / 1024);
|
||||||
|
|
|
@ -885,18 +885,21 @@ void CViewWork::GetDocTimeToCompletion(wxInt32 item, float& fBuffer) const {
|
||||||
|
|
||||||
wxInt32 CViewWork::FormatTimeToCompletion(wxInt32 item, wxString& strBuffer) const {
|
wxInt32 CViewWork::FormatTimeToCompletion(wxInt32 item, wxString& strBuffer) const {
|
||||||
CWork* work = m_WorkCache.at(m_iSortedIndexes[item]);
|
CWork* work = m_WorkCache.at(m_iSortedIndexes[item]);
|
||||||
float fBuffer = work->m_fTimeToCompletion;
|
double est = work->m_fTimeToCompletion;
|
||||||
wxInt32 iHour = 0;
|
wxInt32 iHour = 0;
|
||||||
wxInt32 iMin = 0;
|
wxInt32 iMin = 0;
|
||||||
wxInt32 iSec = 0;
|
wxInt32 iSec = 0;
|
||||||
wxTimeSpan ts;
|
wxTimeSpan ts;
|
||||||
|
|
||||||
if (0 >= fBuffer) {
|
if (est > 86400*365*10) {
|
||||||
|
est = 86400*365*10;
|
||||||
|
}
|
||||||
|
if (est <= 0) {
|
||||||
strBuffer = wxT("---");
|
strBuffer = wxT("---");
|
||||||
} else {
|
} else {
|
||||||
iHour = (wxInt32)(fBuffer / (60 * 60));
|
iHour = (wxInt32)(est / (60 * 60));
|
||||||
iMin = (wxInt32)(fBuffer / 60) % 60;
|
iMin = (wxInt32)(est / 60) % 60;
|
||||||
iSec = (wxInt32)(fBuffer) % 60;
|
iSec = (wxInt32)(est) % 60;
|
||||||
|
|
||||||
ts = wxTimeSpan(iHour, iMin, iSec);
|
ts = wxTimeSpan(iHour, iMin, iSec);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once("../inc/bossa.inc");
|
||||||
|
|
||||||
|
// Bossa example #1.
|
||||||
|
// Show the user an image and ask them to click on the ellipse
|
||||||
|
// This version does no replication.
|
||||||
|
|
||||||
|
function job_show($job, $inst, $user) {
|
||||||
|
$info = $job->get_info($job);
|
||||||
|
$path = $info->path;
|
||||||
|
page_head("Find the Ellipse");
|
||||||
|
echo "
|
||||||
|
<form method=get action=bossa_job_finished.php>
|
||||||
|
Click on the center of the ellipse.
|
||||||
|
If you don't see one, click here:
|
||||||
|
<input type=submit name=submit value=None>
|
||||||
|
<br><br>
|
||||||
|
<input type=hidden name=bji value=$inst->id>
|
||||||
|
<input type=image name=pic src=$path>
|
||||||
|
</form>
|
||||||
|
";
|
||||||
|
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 "<a href=".URL_BASE."$info->path>View image</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue