Skip to content

Commit

Permalink
Merge pull request #705 from openstudiocoalition/develop
Browse files Browse the repository at this point in the history
PR to master for 1.7.1-rc1
  • Loading branch information
macumber authored Mar 30, 2024
2 parents b070178 + 95368d5 commit 5f63e31
Show file tree
Hide file tree
Showing 35 changed files with 501 additions and 427 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/app_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env:
CPACK_SOURCE_TXZ: OFF
CPACK_SOURCE_TZ: OFF
CPACK_SOURCE_ZIP: OFF
QT_VERSION: 6.6.1
QT_VERSION: 6.6.3
# CPACK_BINARY_DEB: OS-SPECIFIC
# CPACK_BINARY_IFW: OS-SPECIFIC

Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
COMPRESSED_EXT: tar.gz
BINARY_PKG_PATH: _CPack_Packages/Darwin/IFW
COMPRESSED_PKG_PATH: _CPack_Packages/Darwin/TGZ
MACOSX_DEPLOYMENT_TARGET: 10.15
MACOSX_DEPLOYMENT_TARGET: 11.0
SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
QT_OS_NAME: mac
QT_ARCH: clang_64
Expand Down Expand Up @@ -402,7 +402,7 @@ jobs:
cmake -E make_directory ./build
if [ "$RUNNER_OS" == "macOS" ]; then
QT_INSTALL_DIR="/Users/irvinemac/Qt/6.6.1/macos/"
QT_INSTALL_DIR="/Users/irvinemac/Qt/6.6.3/macos/"
fi
echo "$QT_INSTALL_DIR/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_cli_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
PLATFORM_NAME: Darwin
BINARY_EXT: dmg
COMPRESSED_EXT: tar.gz
MACOSX_DEPLOYMENT_TARGET: 10.15
MACOSX_DEPLOYMENT_TARGET: 11.0
- os: macos-arm64
SELF_HOSTED: true
PLATFORM_NAME: Darwin
Expand Down
29 changes: 23 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,28 @@ if(CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE FILEPATH "C compiler cache used")
endif()

project(OpenStudioApplication VERSION 1.7.0)
project(OpenStudioApplication VERSION 1.7.1)

# Check system info globally so we can use it everywhere after: Has to be done before FindOpenStudioSDK.cmake
if(APPLE)
# Looking at cmake source code OS_RELEASE is already set to the output of `sw_vers -productVersion` which is what we want
cmake_host_system_information(RESULT OSX_VERSION QUERY OS_RELEASE)
message("-- OS_RELEASE variable is set to: " ${OSX_VERSION})

if(DEFINED XCODE_VERSION)
if(XCODE_VERSION VERSION_LESS "13.0")
message(FATAL_ERROR "The minimum required version of XCode for compiling OpenStudio is 13, however XCODE_VERSION is set to " ${XCODE_VERSION} ". Please upgrade XCode and try again.")
endif()
# When using a generator other than XCode, ${XCODE_VERSION} is not set. Verify that we have at least the minimum macOS version required for XCode 13
elseif(OSX_VERSION VERSION_LESS "11.3")
message(FATAL_ERROR "The minimum required version of XCode for compiling OpenStudio is 13, which requires macOS 11.3 or greater, however macOS version is set to " ${OSX_VERSION} ". Please upgrade macOS and XCode and try again.")
endif()

if(NOT CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "")
if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "11.0")
message(FATAL_ERROR "The minimum required target version for macOS is 11.0, however CMAKE_OSX_DEPLOYMENT_TARGET is set to ${CMAKE_OSX_DEPLOYMENT_TARGET}. Please set CMAKE_OSX_DEPLOYMENT_TARGET to 11.0 or greater and try again.")
endif()

message("Using CMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
set(OSX_VERSION "${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
Expand Down Expand Up @@ -249,7 +263,7 @@ endif()

# TODO: Modify the more specific variables as needed to indicate prerelease, etc
# Keep in beta in-between release cycles. Set to empty string (or comment out) for official)
set(PROJECT_VERSION_PRERELEASE "")
set(PROJECT_VERSION_PRERELEASE "rc1")

# OpenStudio version: Only include Major.Minor.Patch, eg "3.0.0", even if you have a prerelease tag
set(OPENSTUDIOAPPLICATION_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
Expand Down Expand Up @@ -491,9 +505,9 @@ set(SWIG_EXECUTABLE "${CURRENT_CONAN_SWIG_ROOT}/bin/swig")
set(SWIG_LIB "${CURRENT_CONAN_SWIG_ROOT}/bin/swiglib")

# Qt
# e.g. QT_INSTALL_DIR = C:/Qt/6.6.1/msvc2019_64
# e.g. QT_INSTALL_DIR = C:/Qt/6.6.3/msvc2019_64
set(QT_INSTALL_DIR "" CACHE PATH "Path to Qt Install")
set(QT_VERSION "6.6.1")
set(QT_VERSION "6.6.3")

# TODO: how to set OPENSSL_ROOT_DIR to a generator expression?
set(OPENSSL_ROOT_DIR ${CONAN_OPENSSL_ROOT_RELEASE})
Expand Down Expand Up @@ -591,7 +605,7 @@ if(WIN32)
endif()

if(UNIX AND NOT APPLE)
# Apparently libqxcb.so depends on libQt6OpenGL.so in Qt 6.6.1 (it depended on libGL on 5.15.0 but not OpenGL)
# Apparently libqxcb.so depends on libQt6OpenGL.so in Qt 6.6.3 (it depended on libGL on 5.15.0 but not OpenGL)
find_package(Qt6OpenGL ${QT_VERSION} REQUIRED PATHS ${QT_INSTALL_DIR} NO_DEFAULT_PATH)
list(APPEND QT_LIBS Qt6::OpenGL)
endif()
Expand Down Expand Up @@ -736,7 +750,10 @@ install(DIRECTORY "${openstudio_ROOT_DIR}/Python" DESTINATION "." COMPONENT "Pyt
# install(DIRECTORY "${openstudio_ROOT_DIR}/lib" DESTINATION "." COMPONENT "OpenStudioApp" USE_SOURCE_PERMISSIONS)

if(NOT APPLE)
# On Mac, in openstudio_app/CMakeLists.txt we've already copied the CLI to the OpenStudio.app/Contents/MacOS
# On Mac, we want to have openstudio CLI next to the OpenStudioApp in ./OpenStudio.app/Contents/MacOS
# But we still need it in the ./bin directory so it can be found relative to the files in ./lib, this occurs when a measure tries to use getOpenStudioCLI, see #695
# In openstudio_app/CMakeLists.txt we've already copied the CLI to the OpenStudio.app/Contents/MacOS, and we install a symlink to ./bin as well
# TODO: the link order is the reverse of the lib ones (where we create a symlink **in the bundle** that points to the ./lib contents)
install(IMPORTED_RUNTIME_ARTIFACTS openstudio::openstudio DESTINATION bin COMPONENT "CLI")
endif()
install(IMPORTED_RUNTIME_ARTIFACTS openstudio::openstudiolib DESTINATION ${LIB_DESTINATION_DIR} COMPONENT "CLI")
Expand Down
8 changes: 8 additions & 0 deletions ConanInstall.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ if(NOT CONAN_OPENSTUDIO_ALREADY_RUN)
# TODO: temp, revert to stable soon
set(CONAN_RUBY "openstudio_ruby/2.7.2@nrel/testing#d66e3b66568b13acf3b16d866bec68d0")

# TODO: temp, see issue #689 . gmp revision on NREL has sources to gmplib.org which banned GHA IP range, so pick a newer conan-center-index revision in the meantime that uses GCC's FTP.
if(WIN32)
set(CONAN_GMP "")
else()
set(CONAN_GMP "gmp/6.2.1#560eab30a8f52beae2cef5ff26cdd61c")
endif()

# conan_add_remote(
# NAME bincrafters URL
# https://bincrafters.jfrog.io/artifactory/api/conan/public-conan)
Expand Down Expand Up @@ -152,6 +159,7 @@ if(NOT CONAN_OPENSTUDIO_ALREADY_RUN)
REQUIRES
${CONAN_READLINE}
${CONAN_QT}
${CONAN_GMP}
${CONAN_RUBY}
${CONAN_OPENSSL}
"boost/1.79.0#f664bfe40e2245fa9baf1c742591d582"
Expand Down
8 changes: 8 additions & 0 deletions signatures/version1/cla.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
"created_at": "2022-05-05T14:47:30Z",
"repoId": 174587908,
"pullRequestNo": 354
},
{
"name": "mduvanel",
"id": 11503554,
"comment_id": 1923809542,
"created_at": "2024-02-02T13:27:51Z",
"repoId": 174587908,
"pullRequestNo": 678
}
]
}
5 changes: 5 additions & 0 deletions src/openstudio_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ if( APPLE )
"../../../lib/$<TARGET_FILE_NAME:openstudio::openstudiolib>"
"${CMAKE_INSTALL_PREFIX}/OpenStudioApp.app/Contents/Frameworks/$<TARGET_FILE_NAME:openstudio::openstudiolib>"

COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_INSTALL_PREFIX}/bin"
COMMAND "${CMAKE_COMMAND}" -E create_symlink
"../OpenStudioApp.app/Contents/MacOS/$<TARGET_FILE_NAME:openstudio::openstudio>"
"${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:openstudio::openstudio>"

COMMAND_ECHO STDOUT
COMMAND_ERROR_IS_FATAL ANY
)
Expand Down
34 changes: 5 additions & 29 deletions src/openstudio_lib/ConstructionObjectVectorController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,51 +43,27 @@
#include <openstudio/utilities/idd/IddEnums.hxx>

#include <QMessageBox>
#include <QTimer>
#include <QMutex>

namespace openstudio {

// ConstructionObjectVectorController

ConstructionObjectVectorController::ConstructionObjectVectorController(QWidget* parentWidget)
: ModelObjectVectorController(), m_reportScheduled(false), m_reportItemsMutex(new QMutex()), m_parentWidget(parentWidget) {}
: ModelObjectVectorController(), m_parentWidget(parentWidget) {}

ConstructionObjectVectorController::~ConstructionObjectVectorController() {
delete m_reportItemsMutex;
}

void ConstructionObjectVectorController::reportItemsLater() {
m_reportScheduled = true;

QTimer::singleShot(0, this, &ConstructionObjectVectorController::reportItems);
}

void ConstructionObjectVectorController::reportItems() {
if (!m_reportItemsMutex->tryLock()) {
return;
}

if (m_reportScheduled) {
m_reportScheduled = false;

ModelObjectVectorController::reportItems();
}

m_reportItemsMutex->unlock();
}
ConstructionObjectVectorController::~ConstructionObjectVectorController() {}

void ConstructionObjectVectorController::onChangeRelationship(const model::ModelObject& /*modelObject*/, int /*index*/, Handle /*newHandle*/,
Handle /*oldHandle*/) {
reportItemsLater();
reportItems();
}

void ConstructionObjectVectorController::onDataChange(const model::ModelObject& /*modelObject*/) {
reportItemsLater();
reportItems();
}

void ConstructionObjectVectorController::onChange(const model::ModelObject& /*modelObject*/) {
reportItemsLater();
reportItems();
}

std::vector<OSItemId> ConstructionObjectVectorController::makeVector() {
Expand Down
12 changes: 0 additions & 12 deletions src/openstudio_lib/ConstructionObjectVectorController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include "ModelObjectVectorController.hpp"
#include <openstudio/utilities/core/Logger.hpp>

class QMutex;

namespace openstudio {

class ConstructionObjectVectorController : public ModelObjectVectorController
Expand All @@ -49,13 +47,6 @@ class ConstructionObjectVectorController : public ModelObjectVectorController

void setParentWidget(QWidget* parentWidget);

public slots:

// reportItemsLater should be used as it wraps the call to reportItems in a QTimer::singleShot
// which eventually calls ModelObjectVector::reportItems
void reportItemsLater();
void reportItems();

protected:
virtual void onChangeRelationship(const model::ModelObject& modelObject, int index, Handle newHandle, Handle oldHandle) override;

Expand All @@ -76,9 +67,6 @@ class ConstructionObjectVectorController : public ModelObjectVectorController

void insert(const OSItemId& itemId, int insertPosition = -1, boost::optional<int> erasePosition_ = boost::none);

bool m_reportScheduled;
QMutex* m_reportItemsMutex;

enum LayerType
{
FENESTRATION,
Expand Down
2 changes: 1 addition & 1 deletion src/openstudio_lib/ConstructionsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
namespace openstudio {

ConstructionsView::ConstructionsView(bool isIP, const openstudio::model::Model& model, QWidget* parent)
: ModelSubTabView(new ModelObjectTypeListView(ConstructionsView::modelObjectTypesAndNames(), model, true, OSItemType::ListItem, parent),
: ModelSubTabView(new ModelObjectTypeListView(ConstructionsView::modelObjectTypesAndNames(), model, true, OSItemType::ListItem, false, parent),
new ConstructionsInspectorView(isIP, model, parent), false, parent) {
connect(this, &ConstructionsView::toggleUnitsClicked, modelObjectInspectorView(), &ModelObjectInspectorView::toggleUnitsClicked);
}
Expand Down
2 changes: 1 addition & 1 deletion src/openstudio_lib/DefaultConstructionSetsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace openstudio {

DefaultConstructionSetsView::DefaultConstructionSetsView(const openstudio::model::Model& model, const QString& tabLabel, bool hasSubTabs,
QWidget* parent)
: ModelSubTabView(new ModelObjectListView(IddObjectType::OS_DefaultConstructionSet, model, true, parent),
: ModelSubTabView(new ModelObjectListView(IddObjectType::OS_DefaultConstructionSet, model, true, false, parent),
new DefaultConstructionSetInspectorView(model, parent), false, parent) {}

} // namespace openstudio
Loading

0 comments on commit 5f63e31

Please sign in to comment.