diff --git a/AbstractGraphicsEngine.cpp b/AbstractGraphicsEngine.cpp index 6276baf4f0c18d5160736e48a7e6c1206d5827f6..73eefad039ce0d88858cfd7351bccf12a7839b9d 100644 --- a/AbstractGraphicsEngine.cpp +++ b/AbstractGraphicsEngine.cpp @@ -8,7 +8,7 @@ AbstractGraphicsEngine::~AbstractGraphicsEngine() { } -void AbstractGraphicsEngine::refreshBOINCInformation() +void AbstractGraphicsEngine::refreshLocalBOINCInformation() { m_BoincAdapter.refresh(); } diff --git a/AbstractGraphicsEngine.h b/AbstractGraphicsEngine.h index 33c4c705576f001fcca819d5e5a4f2009645a6ff..2f033e1bd0ad85a2fb3e01b9e630db1f1e43d231 100644 --- a/AbstractGraphicsEngine.h +++ b/AbstractGraphicsEngine.h @@ -133,10 +133,13 @@ public: /** * \brief This method is called when the BOINC client information should be updated * - * When you inherit from this class and override this method, please make sure you call this (base) - * method anyway as it already has a default implementation which refreshes \ref m_BoincAdapter. + * When you inherit from this class and implement this method, please make sure you call + * \ref refreshLocalBOINCInformation() to invoke the generic default implementation which + * refreshes \ref m_BoincAdapter. + * + * \see refreshLocalBOINCInformation() */ - virtual void refreshBOINCInformation(); + virtual void refreshBOINCInformation() = 0; protected: /** @@ -145,6 +148,15 @@ protected: * The constructor is protected since this is an abstract class. */ AbstractGraphicsEngine(); + + /** + * \brief This method has to be called in order to update the BOINC client information + * + * This is the local/generic implementation which refreshes \ref m_BoincAdapter. + * + * \see refreshBOINCInformation() + */ + virtual void refreshLocalBOINCInformation(); /// BOINC client adapter instance for information retrieval BOINCClientAdapter m_BoincAdapter; diff --git a/BOINCClientAdapter.cpp b/BOINCClientAdapter.cpp index 4f301b83732885f15233d6ab9c4caad6a5a1b343..6245478382ca7b8349c6b9db08119cc24c3894b4 100644 --- a/BOINCClientAdapter.cpp +++ b/BOINCClientAdapter.cpp @@ -23,7 +23,10 @@ void BOINCClientAdapter::initialize(string sharedMemoryIdentifier) void BOINCClientAdapter::refresh() { if(m_Initialized) { + readUserInfo(); readSharedMemoryArea(); + + /// \todo Check that we're still watching our own WU (or science app)! } else { cerr << "The BOINC Client Adapter has not yet been initialized!"; diff --git a/Starsphere.cpp b/Starsphere.cpp index a59afb155de5a481e8893b98d0ee13866711e066..650dbf3cd064ef09ac80e2ae4e4b11ccdda89a51 100644 --- a/Starsphere.cpp +++ b/Starsphere.cpp @@ -379,9 +379,9 @@ void Starsphere::make_search_marker(GLfloat RAdeg, GLfloat DEdeg, GLfloat size) // r1 is inner circle, r2 is outer circle, r3 is crosshairs r1 = size, r2=3*size, r3=4*size; - // delete any existing marker, then create a new one + // delete existing marker, then create a new one if (SearchMarker) { - glDeleteLists(SearchMarker, SearchMarker); + glDeleteLists(SearchMarker, 1); } SearchMarker = glGenLists(1); @@ -432,8 +432,8 @@ void Starsphere::make_search_marker(GLfloat RAdeg, GLfloat DEdeg, GLfloat size) // West arm: sphVertex(+r1, 0.0); sphVertex(+r3, 0.0); - glEnd(); + glPopMatrix(); // searchlight line out to marker (OFF!) @@ -896,10 +896,10 @@ bool Starsphere::isFeature(const Features feature) return ((featureFlags & feature) == feature ? true : false); } -void Starsphere::refreshBOINCInformation() +void Starsphere::refreshLocalBOINCInformation() { // call base class implementation - AbstractGraphicsEngine::refreshBOINCInformation(); + AbstractGraphicsEngine::refreshLocalBOINCInformation(); // prepare conversion buffer stringstream buffer; diff --git a/Starsphere.h b/Starsphere.h index 312bb7e2993ecce92bd443d842e247db36f4d2b8..5eaa0c5e19c222baf532fe0b3448cc5e3d43f2ed 100644 --- a/Starsphere.h +++ b/Starsphere.h @@ -90,11 +90,6 @@ public: const AbstractGraphicsEngine::MouseButton buttonPressed); void keyboardPressEvent(const AbstractGraphicsEngine::KeyBoardKey keyPressed); - /** - * \brief This method is called when the BOINC client information should be updated - */ - virtual void refreshBOINCInformation(); - protected: /** * \brief Default contructor @@ -114,7 +109,17 @@ protected: */ virtual void renderSearchInformation() = 0; - + /** + * \brief This method has to be called in order to update the BOINC client information + * + * This is the local/generic implementation which calls + * AbstractGraphicsEngine::refreshLocalBOINCInformation() first and + * refreshes the "BOINC Statistics" afterwards. + * + * \see AbstractGraphicsEngine::refreshLocalBOINCInformation() + */ + virtual void refreshLocalBOINCInformation(); + // resource handling OGLFT::TranslucentTexture* m_FontLogo1; OGLFT::TranslucentTexture* m_FontLogo2; diff --git a/StarsphereS5R3.cpp b/StarsphereS5R3.cpp index c93bed2e9bbfddecaa1a11bc2b11e3d6fc764cb5..3d21a5da90fe28887f7f63d18e7f648a3f591782 100644 --- a/StarsphereS5R3.cpp +++ b/StarsphereS5R3.cpp @@ -32,7 +32,11 @@ void StarsphereS5R3::resize(const int width, const int height) void StarsphereS5R3::refreshBOINCInformation() { - Starsphere::refreshBOINCInformation(); + // call base class implementation + Starsphere::refreshLocalBOINCInformation(); + + // update local/specific content + m_EinsteinAdapter.refresh(); // prepare conversion buffer stringstream buffer; diff --git a/StarsphereS5R3.h b/StarsphereS5R3.h index d2880caa385d3d8fb44440d9f7740d156c62710b..0bd5a241077391d696260bb42ea98278e8f25ea8 100644 --- a/StarsphereS5R3.h +++ b/StarsphereS5R3.h @@ -57,8 +57,12 @@ public: /** * \brief This method is called when the BOINC client information should be updated * - * As this method overrides its parent's implementation, it calls Starsphere::refreshBOINCInformation() - * first in order to "add" the sepcialized parts afterwards. + * This method implements AbstractGraphicsEngine::refreshBOINCInformation() and calls + * Starsphere::refreshLocalBOINCInformation() first and "adds" the sepcialized + * parts afterwards. + * + * \see AbstractGraphicsEngine::refreshBOINCInformation() + * \see Starsphere::refreshLocalBOINCInformation() */ void refreshBOINCInformation();