OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Signals | Protected Slots | List of all members
openstudio::RemoteBCL Class Reference

#include <RemoteBCL.hpp>

+ Inheritance diagram for openstudio::RemoteBCL:

Signals

void componentDownloaded (const std::string &uid, const boost::optional< BCLComponent > &component) const
 Emitted when a component download completes. More...
 
void measureDownloaded (const std::string &uid, const boost::optional< BCLMeasure > &measure) const
 Emitted when a measure download completes. More...
 
void metaSearchCompleted (const boost::optional< BCLMetaSearchResult > &metaSearchResult) const
 Emitted when a meta search request completes. More...
 
void searchCompleted (const std::vector< BCLSearchResult > &searchResults) const
 Emitted when a search request completes. More...
 

Public Member Functions

Constructor
 RemoteBCL ()
 Default constructor. More...
 
Destructor
virtual ~RemoteBCL ()
 Virtual destructor. More...
 
Inherited members
virtual boost::optional
< BCLComponent
getComponent (const std::string &uid, const std::string &versionId="") const override
 Get the component by uid. More...
 
virtual boost::optional
< BCLMeasure
getMeasure (const std::string &uid, const std::string &versionId="") const override
 Get the measure by uid. More...
 
boost::optional
< BCLMetaSearchResult
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. More...
 
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
 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. More...
 
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
 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. More...
 
std::vector< BCLSearchResultsearchMeasureLibrary (const std::string &searchTerm, const unsigned componentTypeTID, const unsigned page=0) const
 
int checkForComponentUpdates ()
 Compare the versionIds of all downloaded components/measures to the published version online and return the number that have updates. More...
 
int checkForMeasureUpdates ()
 
std::vector< BCLSearchResultcomponentsWithUpdates () const
 Return the uids for components and measures respectively that have updates available. More...
 
std::vector< BCLSearchResultmeasuresWithUpdates () const
 
void updateComponents ()
 Replace local components and measures with the latest versions. More...
 
void updateMeasures ()
 
Non-blocking class members
bool downloadComponent (const std::string &uid)
 Starts downloading an individual component by uid, if successful this will start a download. More...
 
bool downloadMeasure (const std::string &uid)
 Starts downloading an individual measure by uid, if successful this will start a download. More...
 
bool startComponentLibraryMetaSearch (const std::string &searchTerm, const std::string &componentType, const std::string &filterType)
 Start a meta search, if successful this will start a download. More...
 
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)
 Start a search, if successful this will start a download. More...
 
bool startComponentLibrarySearch (const std::string &searchTerm, const unsigned componentTypeTID, const std::string &filterType, const unsigned page=0)
 
- Public Member Functions inherited from openstudio::BCL
virtual ~BCL ()
 Virtual destructor. More...
 

Protected Slots

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

Blocking class members

bool isOnline () const
 Returns true if there is an internet connection. More...
 
boost::optional< BCLComponentlastComponentDownload () const
 Returns the last downloaded component if there is one. More...
 
boost::optional< BCLMeasurelastMeasureDownload () const
 Returns the last downloaded measure if there is one. More...
 
boost::optional
< BCLMetaSearchResult
lastMetaSearch () const
 Returns the last meta search result if there is one. More...
 
std::vector< BCLSearchResultlastSearch () const
 Returns the last search results if there are any. More...
 
std::string remoteUrl () const
 Get the current remote url. More...
 
std::string remoteProductionUrl () const
 Get the remote production url. More...
 
std::string remoteDevelopmentUrl () const
 Get the remote development url. More...
 
void useRemoteDevelopmentUrl ()
 Use the development production server url. More...
 
void useRemoteProductionUrl ()
 Use the development production server url. More...
 
std::string authKey () const
 Get the current OAuth key. More...
 
std::string prodAuthKey () const
 Return production OAuth key. More...
 
bool setProdAuthKey (const std::string &prodAuthKey)
 Set the production OAuth key. More...
 
std::string devAuthKey () const
 Return development OAuth key. More...
 
bool setDevAuthKey (const std::string &devAuthKey)
 Set the development OAuth key. More...
 
int resultsPerQuery () const
 Return the number of results per query. More...
 
int lastTotalResults () const
 Return the total number of results. More...
 
int numResultPages () const
 Return the number of pages of results. More...
 
boost::optional< BCLComponentwaitForComponentDownload (int msec=50000) const
 Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time. More...
 
boost::optional< BCLMeasurewaitForMeasureDownload (int msec=50000) const
 Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time. More...
 
boost::optional
< BCLMetaSearchResult
waitForMetaSearch (int msec=50000) const
 Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time. More...
 
std::vector< BCLSearchResultwaitForSearch (int msec=50000) const
 Wait number of milliseconds for download to complete Returns the download if it completed in the allowable time. More...
 
static bool initializeSSL (const openstudio::path &t_pathToSSLLibraries=openstudio::path())
 

Additional Inherited Members

- Protected Member Functions inherited from openstudio::BCL
 BCL (QObject *parent=nullptr)
 Default constructor. More...
 

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.