Select Git revision
sliding_window.py
Forked from
Gregory Ashton / PyFstat
Source project has a limited visibility.
BOINCClientAdapter.cpp 7.06 KiB
/***************************************************************************
* Copyright (C) 2008 by Oliver Bock *
* oliver.bock[AT]aei.mpg.de *
* *
* This file is part of Einstein@Home. *
* *
* Einstein@Home is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, version 2 of the License. *
* *
* Einstein@Home is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Einstein@Home. If not, see <http://www.gnu.org/licenses/>. *
* *
***************************************************************************/
#include "BOINCClientAdapter.h"
#include "Libxml2Adapter.h"
#include <sstream>
BOINCClientAdapter::BOINCClientAdapter(string sharedMemoryIdentifier)
{
m_Initialized = false;
m_SharedMemoryAreaIdentifier = sharedMemoryIdentifier;
m_SharedMemoryAreaAvailable = false;
m_xmlIFace = new Libxml2Adapter();
m_GraphicsFrameRate = 20;
m_GraphicsQualitySetting = BOINCClientAdapter::LowGraphicsQualitySetting;
m_GraphicsWindowWidth = 800;
m_GraphicsWindowHeight = 600;
}
BOINCClientAdapter::~BOINCClientAdapter()
{
if(m_xmlIFace) delete m_xmlIFace;
}
void BOINCClientAdapter::initialize()
{
if(!m_Initialized) {
readUserInfo();
readSharedMemoryArea();
readProjectPreferences();
m_Initialized = true;
}
}
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! Doing so now..." << endl;
initialize();
}
}
void BOINCClientAdapter::readUserInfo()