mirror of https://github.com/BOINC/boinc.git
- Added <d_allowed> element to get_disk_usage GUI RPC
svn path=/trunk/boinc/; revision=15190
This commit is contained in:
parent
65e019daf5
commit
58b5f80366
|
@ -3913,3 +3913,15 @@ David May 12 2008
|
||||||
cs_cmdline.C
|
cs_cmdline.C
|
||||||
log_flags.C
|
log_flags.C
|
||||||
main.C
|
main.C
|
||||||
|
|
||||||
|
David May 13 2008
|
||||||
|
- Added <d_allowed> element to get_disk_usage GUI RPC
|
||||||
|
|
||||||
|
client/
|
||||||
|
gui_rpc_server_ops.C
|
||||||
|
hostinfo_win.C
|
||||||
|
clientgui/
|
||||||
|
ViewResources.cpp
|
||||||
|
lib/
|
||||||
|
gui_rpc_client.h
|
||||||
|
gui_rpc_client_ops.C
|
||||||
|
|
|
@ -122,10 +122,10 @@ static void handle_get_project_status(MIOFILE& fout) {
|
||||||
|
|
||||||
static void handle_get_disk_usage(MIOFILE& fout) {
|
static void handle_get_disk_usage(MIOFILE& fout) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
double size, d_total, d_free, d_boinc;
|
double size, d_total, d_free, d_boinc, d_allowed;
|
||||||
|
|
||||||
fout.printf("<disk_usage_summary>\n");
|
fout.printf("<disk_usage_summary>\n");
|
||||||
get_filesystem_info(d_total, d_free);
|
get_filesystem_info(gstate.host_info.d_total, gstate.host_info.d_free);
|
||||||
dir_size(".", d_boinc, false);
|
dir_size(".", d_boinc, false);
|
||||||
dir_size("locale", size, false);
|
dir_size("locale", size, false);
|
||||||
d_boinc += size;
|
d_boinc += size;
|
||||||
|
@ -144,11 +144,13 @@ static void handle_get_disk_usage(MIOFILE& fout) {
|
||||||
if (! err) d_boinc += manager_size;
|
if (! err) d_boinc += manager_size;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
d_allowed = gstate.allowed_disk_usage();
|
||||||
fout.printf(
|
fout.printf(
|
||||||
"<d_total>%f</d_total>\n"
|
"<d_total>%f</d_total>\n"
|
||||||
"<d_free>%f</d_free>\n"
|
"<d_free>%f</d_free>\n"
|
||||||
"<d_boinc>%f</d_boinc>\n",
|
"<d_boinc>%f</d_boinc>\n"
|
||||||
d_total, d_free, d_boinc
|
"<d_allowed>%f</d_allowed>\n",
|
||||||
|
d_total, d_free, d_boinc, d_allowed
|
||||||
);
|
);
|
||||||
for (i=0; i<gstate.projects.size(); i++) {
|
for (i=0; i<gstate.projects.size(); i++) {
|
||||||
PROJECT* p = gstate.projects[i];
|
PROJECT* p = gstate.projects[i];
|
||||||
|
|
|
@ -626,42 +626,23 @@ int get_accelerators(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gets windows specific host information (not complete)
|
// Gets host information; called on startup and before each sched RPC
|
||||||
//
|
//
|
||||||
int HOST_INFO::get_host_info() {
|
int HOST_INFO::get_host_info() {
|
||||||
|
|
||||||
// Get timezone
|
|
||||||
get_timezone(timezone);
|
get_timezone(timezone);
|
||||||
|
|
||||||
// Detect the filesystem information
|
|
||||||
get_filesystem_info(d_total, d_free);
|
get_filesystem_info(d_total, d_free);
|
||||||
|
|
||||||
// Detect the amount of memory the system has
|
|
||||||
get_memory_info(m_nbytes, m_swap);
|
get_memory_info(m_nbytes, m_swap);
|
||||||
|
|
||||||
// Detect OS Information
|
|
||||||
get_os_information(
|
get_os_information(
|
||||||
os_name, sizeof(os_name), os_version, sizeof(os_version)
|
os_name, sizeof(os_name), os_version, sizeof(os_version)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Detect proccessor make and model.
|
|
||||||
get_processor_info(
|
get_processor_info(
|
||||||
p_vendor, sizeof(p_vendor),
|
p_vendor, sizeof(p_vendor),
|
||||||
p_model, sizeof(p_model),
|
p_model, sizeof(p_model),
|
||||||
p_features, sizeof(p_features)
|
p_features, sizeof(p_features)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Detect the number of CPUs
|
|
||||||
get_processor_count(p_ncpus);
|
get_processor_count(p_ncpus);
|
||||||
|
|
||||||
// Detect host name/ip info
|
|
||||||
get_local_network_info();
|
get_local_network_info();
|
||||||
|
get_accelerators(accelerators, sizeof(accelerators));
|
||||||
// Detect which accelerators are installed on the system
|
|
||||||
get_accelerators(
|
|
||||||
accelerators, sizeof(accelerators)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!strlen(host_cpid)) {
|
if (!strlen(host_cpid)) {
|
||||||
generate_host_cpid();
|
generate_host_cpid();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ CViewResources::CViewResources()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#define COLOR(c) wxColour(c>>16, (c>>8)&0xff, c&0xff)
|
#define COLOR(c) wxColour(c>>16, (c>>8)&0xff, c&0xff)
|
||||||
CViewResources::CViewResources(wxNotebook* pNotebook) :
|
CViewResources::CViewResources(wxNotebook* pNotebook) :
|
||||||
CBOINCBaseView(pNotebook)
|
CBOINCBaseView(pNotebook)
|
||||||
{
|
{
|
||||||
m_BOINCwasEmpty=false;
|
m_BOINCwasEmpty=false;
|
||||||
|
@ -73,11 +73,11 @@ CViewResources::CViewResources(wxNotebook* pNotebook) :
|
||||||
m_pieCtrlBOINC->SetLabel(_("disk usage by BOINC projects"));
|
m_pieCtrlBOINC->SetLabel(_("disk usage by BOINC projects"));
|
||||||
//init the flexGrid
|
//init the flexGrid
|
||||||
itemGridSizer->Add(m_pieCtrlTotal,1,wxGROW|wxALL,1);
|
itemGridSizer->Add(m_pieCtrlTotal,1,wxGROW|wxALL,1);
|
||||||
itemGridSizer->Add(m_pieCtrlBOINC,1, wxGROW|wxALL,1);
|
itemGridSizer->Add(m_pieCtrlBOINC,1, wxGROW|wxALL,1);
|
||||||
|
|
||||||
SetSizer(itemGridSizer);
|
SetSizer(itemGridSizer);
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
|
|
||||||
UpdateSelection();
|
UpdateSelection();
|
||||||
}
|
}
|
||||||
|
@ -169,18 +169,17 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) {
|
||||||
|
|
||||||
wxASSERT(pDoc);
|
wxASSERT(pDoc);
|
||||||
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
||||||
|
|
||||||
//get data for BOINC projects disk usage
|
//get data for BOINC projects disk usage
|
||||||
pDoc->CachedDiskUsageUpdate();
|
pDoc->CachedDiskUsageUpdate();
|
||||||
pDoc->CachedStateUpdate();
|
pDoc->CachedStateUpdate();
|
||||||
bool refreshBOINC=false;
|
bool refreshBOINC=false;
|
||||||
if (pDoc->disk_usage.projects.size()>0) {
|
if (pDoc->disk_usage.projects.size()>0) {
|
||||||
m_BOINCwasEmpty=false;
|
m_BOINCwasEmpty=false;
|
||||||
//check for changes worth a refresh
|
//check for changes worth a refresh
|
||||||
if(pDoc->disk_usage.projects.size() != m_pieCtrlBOINC->m_Series.size()) {
|
if(pDoc->disk_usage.projects.size() != m_pieCtrlBOINC->m_Series.size()) {
|
||||||
refreshBOINC=true;
|
refreshBOINC=true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (i=0; i<pDoc->disk_usage.projects.size(); i++) {
|
for (i=0; i<pDoc->disk_usage.projects.size(); i++) {
|
||||||
wxString oldValue;
|
wxString oldValue;
|
||||||
wxString newValue;
|
wxString newValue;
|
||||||
|
@ -196,9 +195,9 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) {
|
||||||
if(refreshBOINC) {
|
if(refreshBOINC) {
|
||||||
m_pieCtrlBOINC->m_Series.Clear();
|
m_pieCtrlBOINC->m_Series.Clear();
|
||||||
for (i=0; i<pDoc->disk_usage.projects.size(); i++) {
|
for (i=0; i<pDoc->disk_usage.projects.size(); i++) {
|
||||||
//update data for boinc projects pie chart
|
//update data for boinc projects pie chart
|
||||||
PROJECT* project = pDoc->DiskUsageProject(i);
|
PROJECT* project = pDoc->DiskUsageProject(i);
|
||||||
wxString projectname;
|
wxString projectname;
|
||||||
FormatProjectName(project, projectname);
|
FormatProjectName(project, projectname);
|
||||||
FormatDiskSpace(project->disk_usage, diskspace);
|
FormatDiskSpace(project->disk_usage, diskspace);
|
||||||
double usage = project->disk_usage;
|
double usage = project->disk_usage;
|
||||||
|
@ -222,7 +221,7 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) {
|
||||||
part.SetLabel(_("not attached to any BOINC project - 0 bytes"));
|
part.SetLabel(_("not attached to any BOINC project - 0 bytes"));
|
||||||
part.SetValue(boinctotal);
|
part.SetValue(boinctotal);
|
||||||
part.SetColour(wxColour(0,0,0));
|
part.SetColour(wxColour(0,0,0));
|
||||||
m_pieCtrlBOINC->m_Series.Add(part);
|
m_pieCtrlBOINC->m_Series.Add(part);
|
||||||
m_pieCtrlBOINC->Refresh();
|
m_pieCtrlBOINC->Refresh();
|
||||||
m_BOINCwasEmpty=true;
|
m_BOINCwasEmpty=true;
|
||||||
refreshBOINC=true;
|
refreshBOINC=true;
|
||||||
|
@ -239,31 +238,33 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) {
|
||||||
if(m_pieCtrlTotal->m_Series.size()>0) {
|
if(m_pieCtrlTotal->m_Series.size()>0) {
|
||||||
wxString oldFree;
|
wxString oldFree;
|
||||||
wxString newFree;
|
wxString newFree;
|
||||||
FormatDiskSpace(free,newFree);
|
FormatDiskSpace(free, newFree);
|
||||||
FormatDiskSpace(m_pieCtrlTotal->m_Series.Item(0).GetValue(),oldFree);
|
FormatDiskSpace(m_pieCtrlTotal->m_Series.Item(0).GetValue(), oldFree);
|
||||||
if(oldFree.Cmp(newFree)!=0) {
|
if(oldFree.Cmp(newFree)!=0) {
|
||||||
refreshTotal=true;
|
refreshTotal=true;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
refreshTotal=true;
|
refreshTotal=true;
|
||||||
}
|
}
|
||||||
if(refreshBOINC || refreshTotal) {
|
if(refreshBOINC || refreshTotal) {
|
||||||
m_pieCtrlTotal->m_Series.Clear();
|
m_pieCtrlTotal->m_Series.Clear();
|
||||||
wxPiePart part;
|
wxPiePart part;
|
||||||
|
|
||||||
//free disk space
|
//free disk space
|
||||||
FormatDiskSpace(free,diskspace);
|
FormatDiskSpace(free,diskspace);
|
||||||
part.SetLabel(_("free disk space - ") + diskspace);
|
part.SetLabel(_("free disk space - ") + diskspace);
|
||||||
part.SetValue(free);
|
part.SetValue(free);
|
||||||
part.SetColour(wxColour(238,238,238));
|
part.SetColour(wxColour(238,238,238));
|
||||||
m_pieCtrlTotal->m_Series.Add(part);
|
m_pieCtrlTotal->m_Series.Add(part);
|
||||||
|
|
||||||
//used by boinc projects
|
//used by boinc projects
|
||||||
boinctotal += pDoc->disk_usage.d_boinc;
|
boinctotal += pDoc->disk_usage.d_boinc;
|
||||||
FormatDiskSpace(boinctotal,diskspace);
|
FormatDiskSpace(boinctotal,diskspace);
|
||||||
part.SetLabel(_("used by BOINC - ") + diskspace);
|
part.SetLabel(_("used by BOINC - ") + diskspace);
|
||||||
part.SetValue(boinctotal);
|
part.SetValue(boinctotal);
|
||||||
part.SetColour(wxColour(0,0,0));
|
part.SetColour(wxColour(0,0,0));
|
||||||
m_pieCtrlTotal->m_Series.Add(part);
|
m_pieCtrlTotal->m_Series.Add(part);
|
||||||
|
|
||||||
//used by others
|
//used by others
|
||||||
FormatDiskSpace(total-boinctotal-free,diskspace);
|
FormatDiskSpace(total-boinctotal-free,diskspace);
|
||||||
part.SetLabel(_("used by other programs - ") + diskspace);
|
part.SetLabel(_("used by other programs - ") + diskspace);
|
||||||
|
|
17
doc/help.php
17
doc/help.php
|
@ -4,19 +4,9 @@ require_once("spoken_languages.php");
|
||||||
require_once("help_db.php");
|
require_once("help_db.php");
|
||||||
require_once("../html/inc/translation.inc");
|
require_once("../html/inc/translation.inc");
|
||||||
|
|
||||||
page_head(tr(HELP_TITLE));
|
page_head("Live help via Internet phone or email");
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
<h2>".tr(HELP_HEADING2)."</h2>
|
|
||||||
<p>
|
|
||||||
<ul>
|
|
||||||
<li> <a href=trac/wiki/RunningBoinc>".tr(HELP_P2_ITEM1)."</a>
|
|
||||||
<li> <a href=trac/wiki/TroubleshootClient>".tr(HELP_P2_ITEM2)."</a>
|
|
||||||
<li> <a href=links.php>".tr(HELP_P2_ITEM3)."</a>
|
|
||||||
<li> <a href=dev/>".tr(HELP_P2_ITEM4)."</a>
|
|
||||||
<li> ".tr(HELP_P2_ITEM5)."
|
|
||||||
</ul>
|
|
||||||
<h2>".tr(HELP_HEADING1)."</h2>
|
|
||||||
<p>
|
<p>
|
||||||
".sprintf(tr(HELP_P1_1), "<ul><li>", "<li>", "<li>", "<li>")."
|
".sprintf(tr(HELP_P1_1), "<ul><li>", "<li>", "<li>", "<li>")."
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -35,11 +25,8 @@ sort($langs);
|
||||||
$n = 0;
|
$n = 0;
|
||||||
foreach ($langs as $lang) {
|
foreach ($langs as $lang) {
|
||||||
$lang_enc = urlencode($lang);
|
$lang_enc = urlencode($lang);
|
||||||
if (!$n) {
|
if ($n) {
|
||||||
} else if (!($n%5)) {
|
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
} else {
|
|
||||||
echo " | ";
|
|
||||||
}
|
}
|
||||||
$n++;
|
$n++;
|
||||||
echo "<a href=help_lang.php?lang=$lang_enc><b>$lang</b></a>";
|
echo "<a href=help_lang.php?lang=$lang_enc><b>$lang</b></a>";
|
||||||
|
|
|
@ -88,8 +88,8 @@ function show_participate() {
|
||||||
<span class=section_title>".tr(HOME_HEADING1)."</span>
|
<span class=section_title>".tr(HOME_HEADING1)."</span>
|
||||||
<br>
|
<br>
|
||||||
<a class=heading href=download.php><b>".tr(HOME_DOWNLOAD)."</b></a>
|
<a class=heading href=download.php><b>".tr(HOME_DOWNLOAD)."</b></a>
|
||||||
|
· <a class=heading href=/wiki/index.php/BOINC_Help><b>Help</b></a>
|
||||||
· <a class=heading href=wiki/index.php/User_Manual><b><nobr>Documentation</nobr></b></a>
|
· <a class=heading href=wiki/index.php/User_Manual><b><nobr>Documentation</nobr></b></a>
|
||||||
· <a class=heading href=links.php><b><nobr>Web sites</nobr></b></a>
|
|
||||||
</center>
|
</center>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
|
|
|
@ -26,7 +26,7 @@ See:
|
||||||
<li>
|
<li>
|
||||||
<a href=wiki/index.php/Project_list>A complete list of projects</a>.
|
<a href=wiki/index.php/Project_list>A complete list of projects</a>.
|
||||||
<li>
|
<li>
|
||||||
<a href=http://boinc.berkeley.edu/trac/wiki/ProjectPapers>
|
<a href=/wiki/index.php/Publications_by_BOINC_projects>
|
||||||
A list of scientific publications of projects</a>.
|
A list of scientific publications of projects</a>.
|
||||||
</ul>
|
</ul>
|
||||||
The following projects are known to us;
|
The following projects are known to us;
|
||||||
|
|
|
@ -356,6 +356,7 @@ struct DISK_USAGE {
|
||||||
double d_total;
|
double d_total;
|
||||||
double d_free;
|
double d_free;
|
||||||
double d_boinc; // amount used by BOINC itself, not projects
|
double d_boinc; // amount used by BOINC itself, not projects
|
||||||
|
double d_allowed; // amount BOINC is allowed to use, total
|
||||||
|
|
||||||
DISK_USAGE(){clear();}
|
DISK_USAGE(){clear();}
|
||||||
~DISK_USAGE();
|
~DISK_USAGE();
|
||||||
|
|
|
@ -751,6 +751,7 @@ void DISK_USAGE::clear() {
|
||||||
d_free = 0;
|
d_free = 0;
|
||||||
d_total = 0;
|
d_total = 0;
|
||||||
d_boinc = 0;
|
d_boinc = 0;
|
||||||
|
d_allowed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RESULTS::~RESULTS() {
|
RESULTS::~RESULTS() {
|
||||||
|
@ -1386,6 +1387,7 @@ int RPC_CLIENT::get_disk_usage(DISK_USAGE& du) {
|
||||||
if (parse_double(buf, "<d_total>", du.d_total)) continue;
|
if (parse_double(buf, "<d_total>", du.d_total)) continue;
|
||||||
if (parse_double(buf, "<d_free>", du.d_free)) continue;
|
if (parse_double(buf, "<d_free>", du.d_free)) continue;
|
||||||
if (parse_double(buf, "<d_boinc>", du.d_boinc)) continue;
|
if (parse_double(buf, "<d_boinc>", du.d_boinc)) continue;
|
||||||
|
if (parse_double(buf, "<d_allowed>", du.d_allowed)) continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
|
|
Loading…
Reference in New Issue