Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMake/install_codesign_script_OpenStudioApp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ endif()

set(FILES_TO_SIGN
EnergyPlus/ExpandObjects
EnergyPlus/energyplus-25.1.0
EnergyPlus/energyplus-25.2.0
EnergyPlus/energyplus.1
EnergyPlus/libenergyplusapi.25.1.0.dylib
EnergyPlus/libenergyplusapi.25.2.0.dylib
EnergyPlus/libintl.8.dylib
EnergyPlus/libpython3.12.dylib
Ruby/openstudio.bundle
Expand Down
22 changes: 11 additions & 11 deletions FindOpenStudioSDK.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
set(OPENSTUDIO_VERSION_MAJOR 3)
set(OPENSTUDIO_VERSION_MINOR 10)
set(OPENSTUDIO_VERSION_MINOR 11)
set(OPENSTUDIO_VERSION_PATCH 0)
set(OPENSTUDIO_VERSION "${OPENSTUDIO_VERSION_MAJOR}.${OPENSTUDIO_VERSION_MINOR}.${OPENSTUDIO_VERSION_PATCH}")

#If this is an official release, leave this "", otherwise put for eg '-rc1'
set(OPENSTUDIO_VERSION_PRERELEASE "")
set(OPENSTUDIO_VERSION_PRERELEASE "-rc1")
# Enter SHA, always, eg "+79857912c4"
set(OPENSTUDIO_VERSION_SHA "+86d7e215a1")
set(OPENSTUDIO_VERSION_SHA "+dee62bf9dd")

# Paths where the cmake-downloaded archives will be put
set(OPENSTUDIO_ARCHIVE_DIR "${PROJECT_BINARY_DIR}/OpenStudio-${OPENSTUDIO_VERSION}")
Expand All @@ -17,37 +17,37 @@ set(OPENSTUDIO_EXT "tar.gz")
if(APPLE)
set(OPENSTUDIO_PLATFORM "Darwin-${ARCH}")
if(ARCH MATCHES "arm64")
set(OPENSTUDIO_EXPECTED_HASH b412f1cd6ab6747c75dece567291e81e)
set(OPENSTUDIO_EXPECTED_HASH 389a02d7f9d3526454bca74393ac7a6e)
else()
set(OPENSTUDIO_EXPECTED_HASH 00d0321aa6c4ab5a3c36fe2335a07157)
set(OPENSTUDIO_EXPECTED_HASH TODO_MISSING_TODO) # There is no mac intel (x86_64) installer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there be a Mac x86 installer or is this the end for that platform?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hoping there will be one, but not sure.

endif()

elseif(UNIX)
set(OPENSTUDIO_PLATFORM "${LSB_RELEASE_ID_SHORT}-${LSB_RELEASE_VERSION_SHORT}-${ARCH}")
if(LSB_RELEASE_VERSION_SHORT MATCHES "24.04")
#set(OPENSTUDIO_PLATFORM "${LSB_RELEASE_ID_SHORT}-22.04-${ARCH}")
if (ARCH MATCHES "arm64")
set(OPENSTUDIO_EXPECTED_HASH b4f328e0b28a479c55a338e87dac254f)
set(OPENSTUDIO_EXPECTED_HASH 2c0dc0cac19f2a09b3cb89a1c1bc52d7)
else()
set(OPENSTUDIO_EXPECTED_HASH 92c3407f888731d6da30b0a7b49d0f5c)
set(OPENSTUDIO_EXPECTED_HASH b822fa5d6f51d67dc11b8b0abf363c4c)
endif()
elseif(LSB_RELEASE_VERSION_SHORT MATCHES "22.04")
if (ARCH MATCHES "arm64")
set(OPENSTUDIO_EXPECTED_HASH d1ae86bba822eeb0541a7603e81a4074)
set(OPENSTUDIO_EXPECTED_HASH 1df158161213c1dd7562d489c8576c94)
else()
set(OPENSTUDIO_EXPECTED_HASH 209820bd2f9b487f0d0f4d4df311753f)
set(OPENSTUDIO_EXPECTED_HASH 2aed3184c33125b196ec833a1def9483)
endif()
elseif(LSB_RELEASE_ID_SHORT MATCHES "AlmaLinux")
if (ARCH MATCHES "arm64")
message(FATAL_ERROR "OpenStudio SDK for AlmaLinux is only built for x86_64")
endif()
set(OPENSTUDIO_EXPECTED_HASH 7ed93ad951b654cc6466803e365ddc17)
set(OPENSTUDIO_EXPECTED_HASH 0ed8089fd49054fe237c77070d492502)
else()
message(FATAL_ERROR "OpenStudio SDK no longer provides packages for Ubuntu 20.04 or older")
endif()

elseif(WIN32)
set(OPENSTUDIO_EXPECTED_HASH afd101545253e8e7ba17b7b88c0556a2)
set(OPENSTUDIO_EXPECTED_HASH 85d4677a325285549a850a872e86ffb6)
set(OPENSTUDIO_PLATFORM "Windows")
endif()

Expand Down
8 changes: 4 additions & 4 deletions conan.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"websocketpp/0.8.2#842a0419153a8aa52f3ea3a1da557d38%1695972005.713",
"tinygltf/2.5.0#65c28d0a4c3cbd4ef92b08b59df769da%1701621757.442",
"termcap/1.3.1#1986f84bf21dd07ea774b027a3201fcb%1678542508.75",
"swig/4.1.1#8f418438101ef7712d52a9fe739d32f9%1707838669.551",
"swig/4.1.1#2bb5c79321cbb05bcab525c690d9bf74%1707838669.551",
"stb/cci.20230920#9792498b81cf34a90138d239e36b0bf8%1700546289.605",
"sqlite3/3.38.5#4b875d4249cdfb4c1235e6b3ea6c18e7%1676251415.466",
"ruby/3.2.2#e349279c358fd8f54d83446a3af8ecfe%1718616192.725",
Expand All @@ -19,8 +19,8 @@
"libxslt/1.1.37#8c0548495527cea12de08ad6212fc3ce%1703714812.414",
"libxml2/2.11.6#41c14895baba105865cb22ecaf948115%1703682489.517",
"libiconv/1.17#9d9082101394d053c67e95d3bc9f1e78%1701083487.832",
"libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b%1692434363.136",
"libffi/3.4.4#35eb63842b505824b70aedc1baefc916%1682741110.044",
"libgettext/0.22#7d52ceb5f97b1de1de8362c9b68b4385%1692434363.136",
"libffi/3.4.4#33feb967b22d92ea0becce63bf9d5490%1764805028.297",
"libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c%1676205469.545",
"jsoncpp/1.9.5#9d91be1604af36ced56ae89ee65d53e0%1673844106.486",
"gtest/1.14.0#4372c5aed2b4018ed9f9da3e218d18b3%1691143988.385",
Expand Down Expand Up @@ -57,4 +57,4 @@
]
},
"config_requires": []
}
}
45 changes: 25 additions & 20 deletions src/model_editor/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@

namespace openstudio {

ApplicationSingleton::ApplicationSingleton() : m_qApplication(nullptr), m_sketchUpWidget(nullptr), m_defaultInstance(false) {}
Application& Application::instance() {
static Application instance;
return instance;
}

Application::Application() : m_qApplication(nullptr), m_sketchUpWidget(nullptr), m_defaultInstance(false) {}

ApplicationSingleton::~ApplicationSingleton() {
Application::~Application() {
//if (m_sketchUpWidget){
// delete m_sketchUpWidget;
//}
Expand All @@ -37,7 +42,7 @@ ApplicationSingleton::~ApplicationSingleton() {
}

/// get the QApplication, if no QApplication has been set this will create a default one
QCoreApplication* ApplicationSingleton::application(bool gui) {
QCoreApplication* Application::application(bool gui) {
if (!m_qApplication) {

if (QCoreApplication::instance()) {
Expand Down Expand Up @@ -123,59 +128,59 @@ QCoreApplication* ApplicationSingleton::application(bool gui) {
return m_qApplication;
}

bool ApplicationSingleton::hasApplication() const {
bool Application::hasApplication() const {
return (m_qApplication != nullptr);
}

bool ApplicationSingleton::hasGUI() const {
bool Application::hasGUI() const {
if (hasApplication()) {
return dynamic_cast<QApplication*>(m_qApplication);
}
return false;
}

/// set the QApplication, this should be done before calling application(), no op if it has already been set
bool ApplicationSingleton::setApplication(QCoreApplication* qApplication) {
bool Application::setApplication(QCoreApplication* qApplication) {
if (!m_qApplication) {
m_qApplication = qApplication;
return true;
}
return false;
}

QWidget* ApplicationSingleton::sketchUpWidget() {
QWidget* Application::sketchUpWidget() {
return m_sketchUpWidget;
}

void ApplicationSingleton::processEvents() {
void Application::processEvents() {
application()->sendPostedEvents();
application()->processEvents(QEventLoop::AllEvents);
}

void ApplicationSingleton::processEvents(int maxTime) {
void Application::processEvents(int maxTime) {
application()->sendPostedEvents();
application()->processEvents(QEventLoop::AllEvents, maxTime);
}

bool ApplicationSingleton::hasSetting(const std::string& key) {
bool Application::hasSetting(const std::string& key) {
QString organizationName = QCoreApplication::organizationName();
QString applicationName = QCoreApplication::applicationName();
QSettings settings(organizationName, applicationName);
return settings.contains(toQString(key));
}

void ApplicationSingleton::removeSetting(const std::string& key) {
void Application::removeSetting(const std::string& key) {
QString organizationName = QCoreApplication::organizationName();
QString applicationName = QCoreApplication::applicationName();
QSettings settings(organizationName, applicationName);
settings.remove(toQString(key));
}

bool ApplicationSingleton::isDefaultInstance() const {
bool Application::isDefaultInstance() const {
return m_defaultInstance;
}

boost::optional<bool> ApplicationSingleton::getSettingValueAsBool(const std::string& key) {
boost::optional<bool> Application::getSettingValueAsBool(const std::string& key) {
boost::optional<bool> result;

QString organizationName = QCoreApplication::organizationName();
Expand All @@ -196,7 +201,7 @@ boost::optional<bool> ApplicationSingleton::getSettingValueAsBool(const std::str
return result;
}

boost::optional<int> ApplicationSingleton::getSettingValueAsInt(const std::string& key) {
boost::optional<int> Application::getSettingValueAsInt(const std::string& key) {
boost::optional<int> result;

QString organizationName = QCoreApplication::organizationName();
Expand All @@ -217,7 +222,7 @@ boost::optional<int> ApplicationSingleton::getSettingValueAsInt(const std::strin
return result;
}

boost::optional<double> ApplicationSingleton::getSettingValueAsDouble(const std::string& key) {
boost::optional<double> Application::getSettingValueAsDouble(const std::string& key) {
boost::optional<double> result;

QString organizationName = QCoreApplication::organizationName();
Expand All @@ -238,7 +243,7 @@ boost::optional<double> ApplicationSingleton::getSettingValueAsDouble(const std:
return result;
}

boost::optional<std::string> ApplicationSingleton::getSettingValueAsString(const std::string& key) {
boost::optional<std::string> Application::getSettingValueAsString(const std::string& key) {
boost::optional<std::string> result;

QString organizationName = QCoreApplication::organizationName();
Expand All @@ -259,28 +264,28 @@ boost::optional<std::string> ApplicationSingleton::getSettingValueAsString(const
return result;
}

void ApplicationSingleton::setSettingValue(const std::string& key, bool value) {
void Application::setSettingValue(const std::string& key, bool value) {
QString organizationName = QCoreApplication::organizationName();
QString applicationName = QCoreApplication::applicationName();
QSettings settings(organizationName, applicationName);
settings.setValue(toQString(key), QVariant::fromValue(value));
}

void ApplicationSingleton::setSettingValue(const std::string& key, int value) {
void Application::setSettingValue(const std::string& key, int value) {
QString organizationName = QCoreApplication::organizationName();
QString applicationName = QCoreApplication::applicationName();
QSettings settings(organizationName, applicationName);
settings.setValue(toQString(key), QVariant::fromValue(value));
}

void ApplicationSingleton::setSettingValue(const std::string& key, double value) {
void Application::setSettingValue(const std::string& key, double value) {
QString organizationName = QCoreApplication::organizationName();
QString applicationName = QCoreApplication::applicationName();
QSettings settings(organizationName, applicationName);
settings.setValue(toQString(key), QVariant::fromValue(value));
}

void ApplicationSingleton::setSettingValue(const std::string& key, const std::string& value) {
void Application::setSettingValue(const std::string& key, const std::string& value) {
QString organizationName = QCoreApplication::organizationName();
QString applicationName = QCoreApplication::applicationName();
QSettings settings(organizationName, applicationName);
Expand Down
25 changes: 10 additions & 15 deletions src/model_editor/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include "ModelEditorAPI.hpp"

#include <openstudio/utilities/core/Singleton.hpp>

#include "QMetaTypes.hpp"

#include <QApplication>
Expand All @@ -20,12 +18,17 @@ namespace openstudio {

/** Singleton application wide configuration management.
*/
class ApplicationSingleton
class Application
{

friend class Singleton<ApplicationSingleton>;

public:
static Application& instance();

Application(const Application& other) = delete;
Application(Application&& other) = delete;
Application& operator=(const Application&) = delete;
Application& operator=(Application&&) = delete;

/// get the QApplication, if no QApplication has been set this will create a default one
QCoreApplication* application(bool gui = true);

Expand Down Expand Up @@ -69,11 +72,10 @@ class ApplicationSingleton
static void setSettingValue(const std::string& key, double value);
static void setSettingValue(const std::string& key, const std::string& value);

~ApplicationSingleton();

private:
/// private constructor
ApplicationSingleton();
Application();
~Application();

/// QApplication handle
QCoreApplication* m_qApplication;
Expand All @@ -84,13 +86,6 @@ class ApplicationSingleton
bool m_defaultInstance;
};

typedef openstudio::Singleton<ApplicationSingleton> Application;

#if _WIN32 || _MSC_VER
/// Explicitly instantiate and export ApplicationSingleton Singleton template instance
/// so that the same instance is shared between the DLL's that link to this dll
MODELEDITOR_TEMPLATE_EXT template class openstudio::Singleton<ApplicationSingleton>;
#endif
} // namespace openstudio

#endif // MODELEDITOR_APPLICATION_HPP
1 change: 0 additions & 1 deletion src/model_editor/ModelEditor.i
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
%ignore openstudio::LocalBCL;
%ignore openstudio::WorkspaceWatcher;

%template(Application) openstudio::Singleton<openstudio::ApplicationSingleton>;
%include <model_editor/Application.hpp>

%feature("director") PathWatcher;
Expand Down
Loading