Skip to content
Snippets Groups Projects
Select Git revision
  • b38bae316674aea686dc1789ec87ed1f9d30a14f
  • master default protected
  • fix_Makefile.mingw#2
  • update_Makefile.mingw
  • fix_Makefile.mingw
  • fix_API_for_C_apps
  • fix_procinfo_mac
  • boinccmd_gpu_mode_always_until_sigterm
  • fgrp_osx_hotfix
  • fix_boinc_master@f8250782
  • eah_wrapper_improvements
  • diagnostics_win-hotfix
  • diagnostics_win-hotfix-old
  • current_fgrp_apps
  • testing_gw_apps
  • gw_app_darwin_15
  • current_brp_apps
  • current_brp_apps_android10
  • current_gfx_apps
  • current_server
  • current_gw_apps
  • previous_fgrp_apps
  • previous_gw_apps
  • testing_brp_apps
  • apps_FGRP3_1.07
  • apps_FGRP3_1.08
26 results

bmplib.cpp

Blame
  • EinsteinS5R3Adapter.cpp 1.38 KiB
    #include "EinsteinS5R3Adapter.h"
    
    EinsteinS5R3Adapter::EinsteinS5R3Adapter(BOINCClientAdapter *boincClient)
    {
    	this->boincClient = boincClient;
    	
    	m_WUSkyPosRightAscension = 0.0;
    	m_WUSkyPosDeclination = 0.0;
    	m_WUFractionDone = 0.0;
    	m_WUCPUTime = 0.0;
    }
    
    EinsteinS5R3Adapter::~EinsteinS5R3Adapter()
    {
    }
    
    void EinsteinS5R3Adapter::refresh()
    {
    	boincClient->refresh();
    	parseApplicationInformation();
    }
    
    void EinsteinS5R3Adapter::parseApplicationInformation()
    {
    	// get updated application information
    	string info = boincClient->applicationInformation();
    	
    	// do we have any data?
    	if(info.length() > 0) {
    		
    		// parse data into members
    		if(4 != sscanf(info.c_str(),
    			  		"<graphics_info>\n"
    			  		"  <skypos_rac>%lf</skypos_rac>\n"
    			  		"  <skypos_dec>%lf</skypos_dec>\n"
    			  		"  <fraction_done>%lf</fraction_done>\n"
    			  		"  <cpu_time>%lf</cpu_time>\n",
    			  		&m_WUSkyPosRightAscension,
    			  		&m_WUSkyPosDeclination,
    			  		&m_WUFractionDone,
    			  		&m_WUCPUTime))
    		{		 
    			cerr << "Incompatible shared memory data encountered!" << endl;
    		}
    	}
    }
    
    double EinsteinS5R3Adapter::wuSkyPosRightAscension() const
    {
    	return m_WUSkyPosRightAscension;
    }
    
    double EinsteinS5R3Adapter::wuSkyPosDeclination() const
    {
    	return m_WUSkyPosDeclination;
    }
    
    double EinsteinS5R3Adapter::wuFractionDone() const
    {
    	return m_WUFractionDone;
    }
    
    double EinsteinS5R3Adapter::wuCPUTime() const
    {
    	return m_WUCPUTime;
    }