OpenStudio:utilities
 AllClasses Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages

#include "RemoteBCL.hpp"

Inheritance diagram for openstudio::RemoteBCL:

Signals

void componentDownloaded (const std::string &uid, const boost::optional< BCLComponent > &component) const
void measureDownloaded (const std::string &uid, const boost::optional< BCLMeasure > &measure) const
void metaSearchCompleted (const boost::optional< BCLMetaSearchResult > &metaSearchResult) const
void searchCompleted (const std::vector< BCLSearchResult > &searchResults) const

Public Member Functions

 RemoteBCL ()
virtual ~RemoteBCL ()
virtual boost::optional
< BCLComponent
getComponent (const std::string &uid, const std::string &versionId="") const override
virtual boost::optional
< BCLMeasure
getMeasure (const std::string &uid, const std::string &versionId="") const override
boost::optional
< BCLMetaSearchResult
metaSearchComponentLibrary (const std::string &searchTerm, const std::string &componentType, const std::string &filterType="nrel_component") const
boost::optional
< BCLMetaSearchResult
metaSearchComponentLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType="nrel_component") const
std::vector< BCLSearchResultsearchComponentLibrary (const std::string &searchTerm, const std::string &componentType, const unsigned page=0) const
std::vector< BCLSearchResultsearchComponentLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const unsigned page=0) const
std::vector< BCLSearchResultsearchMeasureLibrary (const std::string &searchTerm, const std::string &componentType, const unsigned page=0) const
std::vector< BCLSearchResultsearchMeasureLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const unsigned page=0) const
int checkForComponentUpdates ()
int checkForMeasureUpdates ()
std::vector< BCLSearchResultcomponentsWithUpdates () const
std::vector< BCLSearchResultmeasuresWithUpdates () const
void updateComponents ()
void updateMeasures ()
bool downloadComponent (const std::string &uid)
bool downloadMeasure (const std::string &uid)
bool startComponentLibraryMetaSearch (const std::string &searchTerm, const std::string &componentType, const std::string &filterType)
bool startComponentLibraryMetaSearch (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType)
bool startComponentLibrarySearch (const std::string &searchTerm, const std::string &componentType, const std::string &filterType, const unsigned page=0)
bool startComponentLibrarySearch (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType, const unsigned page=0)

Protected Slots

void downloadData ()
void onDownloadComplete (QNetworkReply *reply)
void onMetaSearchResponseComplete (QNetworkReply *reply)
void onSearchResponseComplete (QNetworkReply *reply)

Blocking class members

bool isOnline () const
boost::optional< BCLComponentlastComponentDownload () const
boost::optional< BCLMeasurelastMeasureDownload () const
boost::optional
< BCLMetaSearchResult
lastMetaSearch () const
std::vector< BCLSearchResultlastSearch () const
std::string remoteUrl () const
std::string remoteProductionUrl () const
std::string remoteDevelopmentUrl () const
void useRemoteDevelopmentUrl ()
void useRemoteProductionUrl ()
std::string authKey () const
std::string prodAuthKey () const
bool setProdAuthKey (const std::string &prodAuthKey)
std::string devAuthKey () const
bool setDevAuthKey (const std::string &devAuthKey)
int resultsPerQuery () const
int lastTotalResults () const
int numResultPages () const
boost::optional< BCLComponentwaitForComponentDownload (int msec=50000) const
boost::optional< BCLMeasurewaitForMeasureDownload (int msec=50000) const
boost::optional
< BCLMetaSearchResult
waitForMetaSearch (int msec=50000) const
std::vector< BCLSearchResultwaitForSearch (int msec=50000) const
static bool initializeSSL (const openstudio::path &t_pathToSSLLibraries=openstudio::path())

Detailed Description

Class for accessing the remote BCL.

Constructor & Destructor Documentation

openstudio::RemoteBCL::RemoteBCL ( )

Default constructor.

virtual openstudio::RemoteBCL::~RemoteBCL ( )
virtual

Virtual destructor.

Member Function Documentation

std::string openstudio::RemoteBCL::authKey ( ) const

Get the current OAuth key.

int openstudio::RemoteBCL::checkForComponentUpdates ( )

Compare the versionIds of all downloaded components/measures to the published version online and return the number that have updates.

int openstudio::RemoteBCL::checkForMeasureUpdates ( )
void openstudio::RemoteBCL::componentDownloaded ( const std::string &  uid,
const boost::optional< BCLComponent > &  component 
) const
signal

Emitted when a component download completes.

std::vector<BCLSearchResult> openstudio::RemoteBCL::componentsWithUpdates ( ) const

Return the uids for components and measures respectively that have updates available.

std::string openstudio::RemoteBCL::devAuthKey ( ) const

Return development OAuth key.

bool openstudio::RemoteBCL::downloadComponent ( const std::string &  uid)

Starts downloading an individual component by uid, if successful this will start a download.

void openstudio::RemoteBCL::downloadData ( )
protectedslot
bool openstudio::RemoteBCL::downloadMeasure ( const std::string &  uid)

Starts downloading an individual measure by uid, if successful this will start a download.

virtual boost::optional<BCLComponent> openstudio::RemoteBCL::getComponent ( const std::string &  uid,
const std::string &  versionId = "" 
) const
overridevirtual

Get the component by uid.

Implements openstudio::BCL.

virtual boost::optional<BCLMeasure> openstudio::RemoteBCL::getMeasure ( const std::string &  uid,
const std::string &  versionId = "" 
) const
overridevirtual

Get the measure by uid.

Implements openstudio::BCL.

static bool openstudio::RemoteBCL::initializeSSL ( const openstudio::path &  t_pathToSSLLibraries = openstudio::path())
static
bool openstudio::RemoteBCL::isOnline ( ) const

Returns true if there is an internet connection.

boost::optional<BCLComponent> openstudio::RemoteBCL::lastComponentDownload ( ) const

Returns the last downloaded component if there is one.

boost::optional<BCLMeasure> openstudio::RemoteBCL::lastMeasureDownload ( ) const

Returns the last downloaded measure if there is one.

boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::lastMetaSearch ( ) const

Returns the last meta search result if there is one.

std::vector<BCLSearchResult> openstudio::RemoteBCL::lastSearch ( ) const

Returns the last search results if there are any.

int openstudio::RemoteBCL::lastTotalResults ( ) const

Return the total number of results.

void openstudio::RemoteBCL::measureDownloaded ( const std::string &  uid,
const boost::optional< BCLMeasure > &  measure 
) const
signal

Emitted when a measure download completes.

std::vector<BCLSearchResult> openstudio::RemoteBCL::measuresWithUpdates ( ) const
void openstudio::RemoteBCL::metaSearchCompleted ( const boost::optional< BCLMetaSearchResult > &  metaSearchResult) const
signal

Emitted when a meta search request completes.

boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::metaSearchComponentLibrary ( const std::string &  searchTerm,
const std::string &  componentType,
const std::string &  filterType = "nrel_component" 
) const

Perform a meta search on the library to identify number and types of results available.

The total number of search results available can be used in the search method which requires a page number.

boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::metaSearchComponentLibrary ( const std::string &  searchTerm,
const unsigned  componentTypeTID,
const std::string &  filterType = "nrel_component" 
) const
int openstudio::RemoteBCL::numResultPages ( ) const

Return the number of pages of results.

void openstudio::RemoteBCL::onDownloadComplete ( QNetworkReply *  reply)
protectedslot
void openstudio::RemoteBCL::onMetaSearchResponseComplete ( QNetworkReply *  reply)
protectedslot
void openstudio::RemoteBCL::onSearchResponseComplete ( QNetworkReply *  reply)
protectedslot
std::string openstudio::RemoteBCL::prodAuthKey ( ) const

Return production OAuth key.

std::string openstudio::RemoteBCL::remoteDevelopmentUrl ( ) const

Get the remote development url.

std::string openstudio::RemoteBCL::remoteProductionUrl ( ) const

Get the remote production url.

std::string openstudio::RemoteBCL::remoteUrl ( ) const

Get the current remote url.

int openstudio::RemoteBCL::resultsPerQuery ( ) const

Return the number of results per query.

void openstudio::RemoteBCL::searchCompleted ( const std::vector< BCLSearchResult > &  searchResults) const
signal

Emitted when a search request completes.

std::vector<BCLSearchResult> openstudio::RemoteBCL::searchComponentLibrary ( const std::string &  searchTerm,
const std::string &  componentType,
const unsigned  page = 0 
) const

Perform a component search of the library, results are returned in 'pages', the number of results per page is configurable and a metasearch should be performed to determine the total number of results pages available.

std::vector<BCLSearchResult> openstudio::RemoteBCL::searchComponentLibrary ( const std::string &  searchTerm,
const unsigned  componentTypeTID,
const unsigned  page = 0 
) const
std::vector<BCLSearchResult> openstudio::RemoteBCL::searchMeasureLibrary ( const std::string &  searchTerm,
const std::string &  componentType,
const unsigned  page = 0 
) const

Perform a measure search of the library, results are returned in 'pages', the number of results per page is configurable and a metasearch should be performed to determine the total number of results pages available.

std::vector<BCLSearchResult> openstudio::RemoteBCL::searchMeasureLibrary ( const std::string &  searchTerm,
const unsigned  componentTypeTID,
const unsigned  page = 0 
) const
bool openstudio::RemoteBCL::setDevAuthKey ( const std::string &  devAuthKey)

Set the development OAuth key.

bool openstudio::RemoteBCL::setProdAuthKey ( const std::string &  prodAuthKey)

Set the production OAuth key.

bool openstudio::RemoteBCL::startComponentLibraryMetaSearch ( const std::string &  searchTerm,
const std::string &  componentType,
const std::string &  filterType 
)

Start a meta search, if successful this will start a download.

bool openstudio::RemoteBCL::startComponentLibraryMetaSearch ( const std::string &  searchTerm,
const unsigned  componentTypeTID,
const std::string &  filterType 
)
bool openstudio::RemoteBCL::startComponentLibrarySearch ( const std::string &  searchTerm,
const std::string &  componentType,
const std::string &  filterType,
const unsigned  page = 0 
)

Start a search, if successful this will start a download.

bool openstudio::RemoteBCL::startComponentLibrarySearch ( const std::string &  searchTerm,
const unsigned  componentTypeTID,
const std::string &  filterType,
const unsigned  page = 0 
)
void openstudio::RemoteBCL::updateComponents ( )

Replace local components and measures with the latest versions.

void openstudio::RemoteBCL::updateMeasures ( )
void openstudio::RemoteBCL::useRemoteDevelopmentUrl ( )

Use the development production server url.

void openstudio::RemoteBCL::useRemoteProductionUrl ( )

Use the development production server url.

boost::optional<BCLComponent> openstudio::RemoteBCL::waitForComponentDownload ( int  msec = 50000) const

Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.

boost::optional<BCLMeasure> openstudio::RemoteBCL::waitForMeasureDownload ( int  msec = 50000) const

Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.

boost::optional<BCLMetaSearchResult> openstudio::RemoteBCL::waitForMetaSearch ( int  msec = 50000) const

Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.

std::vector<BCLSearchResult> openstudio::RemoteBCL::waitForSearch ( int  msec = 50000) const

Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time.