diff --git a/CMake/install_codesign_script_OpenStudioApp.cmake b/CMake/install_codesign_script_OpenStudioApp.cmake index 1b1f6f587..2a8a0a125 100644 --- a/CMake/install_codesign_script_OpenStudioApp.cmake +++ b/CMake/install_codesign_script_OpenStudioApp.cmake @@ -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 diff --git a/FindOpenStudioSDK.cmake b/FindOpenStudioSDK.cmake index 12f23670f..4cadd384d 100644 --- a/FindOpenStudioSDK.cmake +++ b/FindOpenStudioSDK.cmake @@ -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}") @@ -17,9 +17,9 @@ 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 endif() elseif(UNIX) @@ -27,27 +27,27 @@ elseif(UNIX) 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() diff --git a/conan.lock b/conan.lock index ce5f29bc8..6ad38c538 100644 --- a/conan.lock +++ b/conan.lock @@ -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", @@ -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", @@ -57,4 +57,4 @@ ] }, "config_requires": [] -} \ No newline at end of file +} diff --git a/src/model_editor/Application.cpp b/src/model_editor/Application.cpp index d3250fa3d..44eba0599 100644 --- a/src/model_editor/Application.cpp +++ b/src/model_editor/Application.cpp @@ -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; //} @@ -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()) { @@ -123,11 +128,11 @@ 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(m_qApplication); } @@ -135,7 +140,7 @@ bool ApplicationSingleton::hasGUI() const { } /// 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; @@ -143,39 +148,39 @@ bool ApplicationSingleton::setApplication(QCoreApplication* qApplication) { 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 ApplicationSingleton::getSettingValueAsBool(const std::string& key) { +boost::optional Application::getSettingValueAsBool(const std::string& key) { boost::optional result; QString organizationName = QCoreApplication::organizationName(); @@ -196,7 +201,7 @@ boost::optional ApplicationSingleton::getSettingValueAsBool(const std::str return result; } -boost::optional ApplicationSingleton::getSettingValueAsInt(const std::string& key) { +boost::optional Application::getSettingValueAsInt(const std::string& key) { boost::optional result; QString organizationName = QCoreApplication::organizationName(); @@ -217,7 +222,7 @@ boost::optional ApplicationSingleton::getSettingValueAsInt(const std::strin return result; } -boost::optional ApplicationSingleton::getSettingValueAsDouble(const std::string& key) { +boost::optional Application::getSettingValueAsDouble(const std::string& key) { boost::optional result; QString organizationName = QCoreApplication::organizationName(); @@ -238,7 +243,7 @@ boost::optional ApplicationSingleton::getSettingValueAsDouble(const std: return result; } -boost::optional ApplicationSingleton::getSettingValueAsString(const std::string& key) { +boost::optional Application::getSettingValueAsString(const std::string& key) { boost::optional result; QString organizationName = QCoreApplication::organizationName(); @@ -259,28 +264,28 @@ boost::optional 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); diff --git a/src/model_editor/Application.hpp b/src/model_editor/Application.hpp index 97430fff0..d3986fdfb 100644 --- a/src/model_editor/Application.hpp +++ b/src/model_editor/Application.hpp @@ -8,8 +8,6 @@ #include "ModelEditorAPI.hpp" -#include - #include "QMetaTypes.hpp" #include @@ -20,12 +18,17 @@ namespace openstudio { /** Singleton application wide configuration management. */ -class ApplicationSingleton +class Application { - friend class Singleton; - 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); @@ -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; @@ -84,13 +86,6 @@ class ApplicationSingleton bool m_defaultInstance; }; -typedef openstudio::Singleton 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; -#endif } // namespace openstudio #endif // MODELEDITOR_APPLICATION_HPP diff --git a/src/model_editor/ModelEditor.i b/src/model_editor/ModelEditor.i index 26644076e..fe121e448 100644 --- a/src/model_editor/ModelEditor.i +++ b/src/model_editor/ModelEditor.i @@ -73,7 +73,6 @@ %ignore openstudio::LocalBCL; %ignore openstudio::WorkspaceWatcher; -%template(Application) openstudio::Singleton; %include %feature("director") PathWatcher;