OpenStudioCore:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Protected Member Functions | List of all members
openstudio::OSServer Class Reference

#include <OSServer.hpp>

Public Member Functions

Constructor
 OSServer (const Url &url)
 
Destructors
virtual ~OSServer ()
 virtual destructor More...
 
Blocking class members
bool available (int msec=30000)
 
bool lastAvailable () const
 
std::vector< UUID > projectUUIDs (int msec=30000)
 
std::vector< UUID > lastProjectUUIDs () const
 
bool createProject (const UUID &projectUUID, int msec=30000)
 Typically, projectUUID corresponds to a project::ProjectDatabase::handle(). More...
 
bool lastCreateProjectSuccess () const
 
bool deleteProject (const UUID &projectUUID, int msec=30000)
 
bool lastDeleteProjectSuccess () const
 
std::vector< UUID > analysisUUIDs (const UUID &projectUUID, int msec=30000)
 
std::vector< UUID > lastAnalysisUUIDs () const
 
bool postAnalysisJSON (const UUID &projectUUID, const std::string &analysisJSON, int msec=30000)
 Posts file format created by analysis::Analysis::toJSON. More...
 
bool lastPostAnalysisJSONSuccess () const
 
bool postDataPointJSON (const UUID &analysisUUID, const std::string &dataPointJSON, int msec=30000)
 Posts file format created by. More...
 
bool lastPostDataPointJSONSuccess () const
 
bool uploadAnalysisFiles (const UUID &analysisUUID, const openstudio::path &analysisZipFile, int msec=30000)
 Upload the zip file created by analysisdriver::SimpleProject::zipFileForCloud(). More...
 
bool lastUploadAnalysisFilesSuccess () const
 
bool start (const UUID &analysisUUID, int msec=30000)
 
bool lastStartSuccess () const
 
bool isAnalysisQueued (const UUID &analysisUUID, int msec=30000)
 
bool lastIsAnalysisQueued () const
 
bool isAnalysisRunning (const UUID &analysisUUID, int msec=30000)
 
bool lastIsAnalysisRunning () const
 
bool isAnalysisComplete (const UUID &analysisUUID, int msec=30000)
 
bool lastIsAnalysisComplete () const
 
bool stop (const UUID &analysisUUID, int msec=30000)
 
bool lastStopSuccess () const
 
std::vector< UUID > dataPointUUIDs (const UUID &analysisUUID, int msec=30000)
 
std::vector< UUID > lastDataPointUUIDs () const
 
std::vector< UUID > queuedDataPointUUIDs (const UUID &analysisUUID, int msec=30000)
 
std::vector< UUID > lastQueuedDataPointUUIDs () const
 
std::vector< UUID > runningDataPointUUIDs (const UUID &analysisUUID, int msec=30000)
 
std::vector< UUID > lastRunningDataPointUUIDs () const
 
std::vector< UUID > completeDataPointUUIDs (const UUID &analysisUUID, int msec=30000)
 
std::vector< UUID > lastCompleteDataPointUUIDs () const
 
std::vector< UUID > downloadReadyDataPointUUIDs (const UUID &analysisUUID, int msec=30000)
 
std::vector< UUID > lastDownloadReadyDataPointUUIDs () const
 
std::string dataPointJSON (const UUID &analysisUUID, const UUID &dataPointUUID, int msec=30000)
 Returns JSON format that can be loaded with analysis::DataPoint::loadJSON. More...
 
std::string lastDataPointJSON () const
 
bool downloadDataPoint (const UUID &analysisUUID, const UUID &dataPointUUID, const openstudio::path &downloadPath, int msec=30000)
 Returns a zip file containing detailed simulation results for dataPointUUID. More...
 
bool lastDownloadDataPointSuccess () const
 
bool deleteDataPoint (const UUID &analysisUUID, const UUID &dataPointUUID, int msec=30000)
 
bool lastDeleteDataPointSuccess () const
 
bool waitForFinished (int msec=30000)
 
std::vector< std::string > errors () const
 
std::vector< std::string > warnings () const
 
Non-blocking class members
bool requestAvailable ()
 
bool requestProjectUUIDs ()
 
bool requestCreateProject (const UUID &projectUUID)
 Typically, projectUUID corresponds to a project::ProjectDatabase::handle(). More...
 
bool requestDeleteProject (const UUID &projectUUID)
 
bool requestAnalysisUUIDs (const UUID &projectUUID)
 
bool startPostAnalysisJSON (const UUID &projectUUID, const std::string &analysisJSON)
 Posts file format created by analysis::Analysis::toJSON. More...
 
bool startPostDataPointJSON (const UUID &analysisUUID, const std::string &dataPointJSON)
 Posts file format created by. More...
 
bool startUploadAnalysisFiles (const UUID &analysisUUID, const openstudio::path &analysisZipFile)
 Upload the zip file created by analysisdriver::SimpleProject::zipFileForCloud(). More...
 
bool requestStart (const UUID &analysisUUID)
 
bool requestIsAnalysisQueued (const UUID &analysisUUID)
 
bool requestIsAnalysisRunning (const UUID &analysisUUID)
 
bool requestIsAnalysisComplete (const UUID &analysisUUID)
 
bool requestStop (const UUID &analysisUUID)
 
bool requestDataPointUUIDs (const UUID &analysisUUID)
 
bool requestRunningDataPointUUIDs (const UUID &analysisUUID)
 
bool requestQueuedDataPointUUIDs (const UUID &analysisUUID)
 
bool requestCompleteDataPointUUIDs (const UUID &analysisUUID)
 
bool requestDownloadReadyDataPointUUIDs (const UUID &analysisUUID)
 
bool requestDataPointJSON (const UUID &analysisUUID, const UUID &dataPointUUID)
 Returns JSON format that can be loaded with analysis::DataPoint::loadJSON. More...
 
bool startDownloadDataPoint (const UUID &analysisUUID, const UUID &dataPointUUID, const openstudio::path &downloadPath)
 Returns a zip file containing detailed simulation results for dataPointUUID. More...
 
bool requestDeleteDataPoint (const UUID &analysisUUID, const UUID &dataPointUUID)
 
Signals, Slots, Threads
bool connect (const char *signal, const QObject *qObject, const char *slot, Qt::ConnectionType type=Qt::AutoConnection) const
 Connect signal from this OSServer to slot on qObject. More...
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *slot=nullptr) const
 Disconnect signal from this OSServer to slot on receiver. More...
 
Type Casting
template<typename T >
cast () const
 cast to type T, can throw std::bad_cast More...
 
template<typename T >
boost::optional< T > optionalCast () const
 cast to optional of type T More...
 

Protected Member Functions

 OSServer (const std::shared_ptr< detail::OSServer_Impl > &impl)
 

Detailed Description

OSServer is a class for accessing the rails server started on machines provided by a CloudProvider.

Constructor & Destructor Documentation

openstudio::OSServer::OSServer ( const Url &  url)
virtual openstudio::OSServer::~OSServer ( )
virtual

virtual destructor

openstudio::OSServer::OSServer ( const std::shared_ptr< detail::OSServer_Impl > &  impl)
protected

Member Function Documentation

std::vector<UUID> openstudio::OSServer::analysisUUIDs ( const UUID &  projectUUID,
int  msec = 30000 
)
bool openstudio::OSServer::available ( int  msec = 30000)
template<typename T >
T openstudio::OSServer::cast ( ) const
inline

cast to type T, can throw std::bad_cast

std::vector<UUID> openstudio::OSServer::completeDataPointUUIDs ( const UUID &  analysisUUID,
int  msec = 30000 
)
bool openstudio::OSServer::connect ( const char *  signal,
const QObject qObject,
const char *  slot,
Qt::ConnectionType  type = Qt::AutoConnection 
) const

Connect signal from this OSServer to slot on qObject.

bool openstudio::OSServer::createProject ( const UUID &  projectUUID,
int  msec = 30000 
)

Typically, projectUUID corresponds to a project::ProjectDatabase::handle().

std::string openstudio::OSServer::dataPointJSON ( const UUID &  analysisUUID,
const UUID &  dataPointUUID,
int  msec = 30000 
)

Returns JSON format that can be loaded with analysis::DataPoint::loadJSON.

This format can also be used to update an existing DataPoint (analysis::DataPoint::updateFromJSON).

std::vector<UUID> openstudio::OSServer::dataPointUUIDs ( const UUID &  analysisUUID,
int  msec = 30000 
)
bool openstudio::OSServer::deleteDataPoint ( const UUID &  analysisUUID,
const UUID &  dataPointUUID,
int  msec = 30000 
)
bool openstudio::OSServer::deleteProject ( const UUID &  projectUUID,
int  msec = 30000 
)
bool openstudio::OSServer::disconnect ( const char *  signal = nullptr,
const QObject receiver = nullptr,
const char *  slot = nullptr 
) const

Disconnect signal from this OSServer to slot on receiver.

bool openstudio::OSServer::downloadDataPoint ( const UUID &  analysisUUID,
const UUID &  dataPointUUID,
const openstudio::path &  downloadPath,
int  msec = 30000 
)

Returns a zip file containing detailed simulation results for dataPointUUID.

Should be called after getting the high-level results from dataPointJSON.

std::vector<UUID> openstudio::OSServer::downloadReadyDataPointUUIDs ( const UUID &  analysisUUID,
int  msec = 30000 
)
std::vector<std::string> openstudio::OSServer::errors ( ) const
bool openstudio::OSServer::isAnalysisComplete ( const UUID &  analysisUUID,
int  msec = 30000 
)
bool openstudio::OSServer::isAnalysisQueued ( const UUID &  analysisUUID,
int  msec = 30000 
)
bool openstudio::OSServer::isAnalysisRunning ( const UUID &  analysisUUID,
int  msec = 30000 
)
std::vector<UUID> openstudio::OSServer::lastAnalysisUUIDs ( ) const
bool openstudio::OSServer::lastAvailable ( ) const
std::vector<UUID> openstudio::OSServer::lastCompleteDataPointUUIDs ( ) const
bool openstudio::OSServer::lastCreateProjectSuccess ( ) const
std::string openstudio::OSServer::lastDataPointJSON ( ) const
std::vector<UUID> openstudio::OSServer::lastDataPointUUIDs ( ) const
bool openstudio::OSServer::lastDeleteDataPointSuccess ( ) const
bool openstudio::OSServer::lastDeleteProjectSuccess ( ) const
bool openstudio::OSServer::lastDownloadDataPointSuccess ( ) const
std::vector<UUID> openstudio::OSServer::lastDownloadReadyDataPointUUIDs ( ) const
bool openstudio::OSServer::lastIsAnalysisComplete ( ) const
bool openstudio::OSServer::lastIsAnalysisQueued ( ) const
bool openstudio::OSServer::lastIsAnalysisRunning ( ) const
bool openstudio::OSServer::lastPostAnalysisJSONSuccess ( ) const
bool openstudio::OSServer::lastPostDataPointJSONSuccess ( ) const
std::vector<UUID> openstudio::OSServer::lastProjectUUIDs ( ) const
std::vector<UUID> openstudio::OSServer::lastQueuedDataPointUUIDs ( ) const
std::vector<UUID> openstudio::OSServer::lastRunningDataPointUUIDs ( ) const
bool openstudio::OSServer::lastStartSuccess ( ) const
bool openstudio::OSServer::lastStopSuccess ( ) const
bool openstudio::OSServer::lastUploadAnalysisFilesSuccess ( ) const
template<typename T >
boost::optional<T> openstudio::OSServer::optionalCast ( ) const
inline

cast to optional of type T

bool openstudio::OSServer::postAnalysisJSON ( const UUID &  projectUUID,
const std::string &  analysisJSON,
int  msec = 30000 
)

Posts file format created by analysis::Analysis::toJSON.

Creates an analysis on the openstudio-server with UUID equal to analysis::Analysis::uuid().

bool openstudio::OSServer::postDataPointJSON ( const UUID &  analysisUUID,
const std::string &  dataPointJSON,
int  msec = 30000 
)

Posts file format created by.

analysis::toJSON(const std::vector<DataPoint>&, const DataPointSerializationOptions&);

in analysis/DataPoint.hpp

std::vector<UUID> openstudio::OSServer::projectUUIDs ( int  msec = 30000)
std::vector<UUID> openstudio::OSServer::queuedDataPointUUIDs ( const UUID &  analysisUUID,
int  msec = 30000 
)
bool openstudio::OSServer::requestAnalysisUUIDs ( const UUID &  projectUUID)
bool openstudio::OSServer::requestAvailable ( )
bool openstudio::OSServer::requestCompleteDataPointUUIDs ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestCreateProject ( const UUID &  projectUUID)

Typically, projectUUID corresponds to a project::ProjectDatabase::handle().

bool openstudio::OSServer::requestDataPointJSON ( const UUID &  analysisUUID,
const UUID &  dataPointUUID 
)

Returns JSON format that can be loaded with analysis::DataPoint::loadJSON.

This format can also be used to update an existing DataPoint (analysis::DataPoint::updateFromJSON).

bool openstudio::OSServer::requestDataPointUUIDs ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestDeleteDataPoint ( const UUID &  analysisUUID,
const UUID &  dataPointUUID 
)
bool openstudio::OSServer::requestDeleteProject ( const UUID &  projectUUID)
bool openstudio::OSServer::requestDownloadReadyDataPointUUIDs ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestIsAnalysisComplete ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestIsAnalysisQueued ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestIsAnalysisRunning ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestProjectUUIDs ( )
bool openstudio::OSServer::requestQueuedDataPointUUIDs ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestRunningDataPointUUIDs ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestStart ( const UUID &  analysisUUID)
bool openstudio::OSServer::requestStop ( const UUID &  analysisUUID)
std::vector<UUID> openstudio::OSServer::runningDataPointUUIDs ( const UUID &  analysisUUID,
int  msec = 30000 
)
bool openstudio::OSServer::start ( const UUID &  analysisUUID,
int  msec = 30000 
)
bool openstudio::OSServer::startDownloadDataPoint ( const UUID &  analysisUUID,
const UUID &  dataPointUUID,
const openstudio::path &  downloadPath 
)

Returns a zip file containing detailed simulation results for dataPointUUID.

Should be called after getting the high-level results from dataPointJSON.

bool openstudio::OSServer::startPostAnalysisJSON ( const UUID &  projectUUID,
const std::string &  analysisJSON 
)

Posts file format created by analysis::Analysis::toJSON.

Creates an analysis on the openstudio-server with UUID equal to analysis::Analysis::uuid().

bool openstudio::OSServer::startPostDataPointJSON ( const UUID &  analysisUUID,
const std::string &  dataPointJSON 
)

Posts file format created by.

analysis::toJSON(const std::vector<DataPoint>&, const DataPointSerializationOptions&);

in analysis/DataPoint.hpp

bool openstudio::OSServer::startUploadAnalysisFiles ( const UUID &  analysisUUID,
const openstudio::path &  analysisZipFile 
)

Upload the zip file created by analysisdriver::SimpleProject::zipFileForCloud().

bool openstudio::OSServer::stop ( const UUID &  analysisUUID,
int  msec = 30000 
)
bool openstudio::OSServer::uploadAnalysisFiles ( const UUID &  analysisUUID,
const openstudio::path &  analysisZipFile,
int  msec = 30000 
)

Upload the zip file created by analysisdriver::SimpleProject::zipFileForCloud().

bool openstudio::OSServer::waitForFinished ( int  msec = 30000)
std::vector<std::string> openstudio::OSServer::warnings ( ) const