*** empty log message ***

svn path=/trunk/boinc/; revision=9479
This commit is contained in:
Rom Walton 2006-02-15 22:35:18 +00:00
parent be81ca3aa8
commit 8c263b323c
5 changed files with 53 additions and 16 deletions

View File

@ -1897,3 +1897,14 @@ David 15 Feb 2006
clientgui/
MainFrame.cpp
Rom 15 Feb 2006
- Bug Fix: Force a project state update even when we are looking at
the tasks tab. Copy the updated project state to the existing global
state structure.
clientgui/
MainDocument.cpp, .h
lib/
gui_rpc_client.h
gui_rpc_client_ops.C

View File

@ -386,7 +386,6 @@ int CMainDocument::ResetState() {
rpc.close();
state.clear();
host.clear_host_info();
project_status.clear();
results.clear();
messages.clear();
ft.clear();
@ -584,15 +583,15 @@ int CMainDocument::CachedProjectStatusUpdate() {
int i = 0;
if (IsConnected()) {
iRetVal = rpc.get_project_status(project_status);
iRetVal = rpc.get_project_status(state);
if (iRetVal) {
wxLogTrace(wxT("Function Status"), "CMainDocument::CachedProjectStatusUpdate - Get Project Status Failed '%d'", iRetVal);
m_pNetworkConnection->SetStateDisconnected();
ForceCacheUpdate();
}
m_fProjectTotalResourceShare = 0.0;
for (i=0; i < (long)project_status.projects.size(); i++) {
m_fProjectTotalResourceShare += project_status.projects.at(i)->resource_share;
for (i=0; i < (long)state.projects.size(); i++) {
m_fProjectTotalResourceShare += state.projects.at(i)->resource_share;
}
}
@ -610,8 +609,8 @@ PROJECT* CMainDocument::project(unsigned int i) {
// which will cause an exception which can be trapped and return a NULL
// pointer when the exception is thrown.
try {
if (!project_status.projects.empty())
pProject = project_status.projects.at(i);
if (!state.projects.empty())
pProject = state.projects.at(i);
}
catch (std::out_of_range e) {
pProject = NULL;
@ -624,11 +623,11 @@ PROJECT* CMainDocument::project(unsigned int i) {
int CMainDocument::GetProjectCount() {
int iCount = -1;
CachedStateUpdate();
CachedProjectStatusUpdate();
CachedStateUpdate();
if (!project_status.projects.empty())
iCount = project_status.projects.size();
if (!state.projects.empty())
iCount = state.projects.size();
return iCount;
}
@ -735,7 +734,7 @@ int CMainDocument::CachedResultsStatusUpdate() {
iRetVal = rpc.get_results(results);
if (iRetVal) {
wxLogTrace(wxT("Function Status"), "CMainDocument::CachedResultsStatusUpdate - Get Result Status Failed '%d'", iRetVal);
m_pNetworkConnection->SetStateDisconnected();
ForceCacheUpdate();
}
}
@ -767,8 +766,9 @@ RESULT* CMainDocument::result(unsigned int i) {
int CMainDocument::GetWorkCount() {
int iCount = -1;
CachedStateUpdate();
CachedProjectStatusUpdate();
CachedResultsStatusUpdate();
CachedStateUpdate();
if (!results.results.empty())
iCount = results.results.size();
@ -932,7 +932,7 @@ int CMainDocument::CachedFileTransfersUpdate() {
iRetVal = rpc.get_file_transfers(ft);
if (iRetVal) {
wxLogTrace(wxT("Function Status"), "CMainDocument::CachedFileTransfersUpdate - Get File Transfers Failed '%d'", iRetVal);
m_pNetworkConnection->SetStateDisconnected();
ForceCacheUpdate();
}
}
@ -1007,7 +1007,7 @@ int CMainDocument::CachedResourceStatusUpdate() {
iRetVal = rpc.get_disk_usage(resource_status);
if (iRetVal) {
wxLogTrace(wxT("Function Status"), "CMainDocument::CachedResourceStatusUpdate - Get Disk Usage Failed '%d'", iRetVal);
m_pNetworkConnection->SetStateDisconnected();
ForceCacheUpdate();
}
}
@ -1058,7 +1058,7 @@ int CMainDocument::CachedStatisticsStatusUpdate() {
iRetVal = rpc.get_statistics(statistics_status);
if (iRetVal) {
wxLogTrace(wxT("Function Status"), "CMainDocument::CachedStatisticsStatusUpdate - Get Statistics Failed '%d'", iRetVal);
m_pNetworkConnection->SetStateDisconnected();
ForceCacheUpdate();
}
}

View File

@ -145,7 +145,6 @@ private:
int CachedProjectStatusUpdate();
public:
PROJECTS project_status;
PROJECT* project(unsigned int);
float m_fProjectTotalResourceShare;

View File

@ -531,6 +531,7 @@ public:
int get_state(CC_STATE&);
int get_results(RESULTS&);
int get_file_transfers(FILE_TRANSFERS&);
int get_project_status(CC_STATE&);
int get_project_status(PROJECTS&);
int get_disk_usage(PROJECTS&);
int show_graphics(

View File

@ -1047,6 +1047,32 @@ int RPC_CLIENT::get_project_status(PROJECTS& p) {
return 0;
}
int RPC_CLIENT::get_project_status(CC_STATE& state) {
char buf[256];
RPC rpc(this);
int retval;
retval = rpc.do_rpc("<get_project_status/>\n");
if (retval) return retval;
while (rpc.fin.fgets(buf, 256)) {
if (match_tag(buf, "</projects>")) break;
else if (match_tag(buf, "<project>")) {
PROJECT* project = new PROJECT();
PROJECT* state_project;
project->parse(rpc.fin);
state_project = state.lookup_project(project->master_url);
if (state_project && (project->master_url == state_project->master_url)) {
state_project->copy(*project);
} else {
return ERR_NOT_FOUND;
}
continue;
}
}
return 0;
}
int RPC_CLIENT::get_disk_usage(PROJECTS& p) {
char buf[256];
RPC rpc(this);