Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update to 3.1.0 SDK - punt on new shading controls UI #240

Merged
merged 4 commits into from
Sep 19, 2020
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ core-build/
super-build/
debug/
release/
relwithdebinfo/
profile/
/super-build-shared/
/super-build-static/

Expand Down
10 changes: 5 additions & 5 deletions FindOpenStudioSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ set(OPENSTUDIO_VERSION "${OPENSTUDIO_VERSION_MAJOR}.${OPENSTUDIO_VERSION_MINOR}.
#If this is a release enter the SHA as "+79857912c4"
#set(OPENSTUDIO_VERSION_SHA "+09b7c8a554")
#If this is a pre-release enter the pre-release and SHA as "-rc1+79857912c4"
set(OPENSTUDIO_VERSION_SHA "-alpha+aefc63b9f9")
set(OPENSTUDIO_VERSION_SHA "-alpha+e454bfaffb")

# Paths where the cmake-downloaded archives will be put
set(OPENSTUDIO_ARCHIVE_DIR "${PROJECT_BINARY_DIR}/OpenStudio-${OPENSTUDIO_VERSION}")

# If downloaded, we need the SHA to match. This block is here since we need "OPENSTUDIO_PLATFORM" anyways
if(APPLE)
set(OPENSTUDIO_EXPECTED_HASH c1def1c24d4f00cf86e8bd7788241306)
set(OPENSTUDIO_EXPECTED_HASH 4eabc4a81dda2b34eb57a4e3414e2f84)
set(OPENSTUDIO_PLATFORM "Darwin")
set(OPENSTUDIO_EXT "tar.gz")
elseif(UNIX)
set(OPENSTUDIO_EXPECTED_HASH f03fe39bb55f025a31ee1f18ca453728)
set(OPENSTUDIO_EXPECTED_HASH 15dca067b1fdf79a639e121a8e376534)
set(OPENSTUDIO_PLATFORM "Linux")
set(OPENSTUDIO_EXT "tar.gz")
elseif(WIN32)
set(OPENSTUDIO_EXPECTED_HASH TODO_08a771da5c739e1da8a65bb5b252dffc) # TODO
set(OPENSTUDIO_EXPECTED_HASH 483512d858677821ea24d6adf87cbf80)
set(OPENSTUDIO_PLATFORM "Windows")
set(OPENSTUDIO_EXT "tar.gz")
endif()
Expand Down Expand Up @@ -54,7 +54,7 @@ else()
# Occasionally we can point to a specific PR by using something like ""http://openstudio-ci-builds.s3-website-us-west-2.amazonaws.com/PR-4080"
set(OPENSTUDIO_BASELINK_CI
# "http://openstudio-ci-builds.s3-website-us-west-2.amazonaws.com/develop"
"http://openstudio-ci-builds.s3-website-us-west-2.amazonaws.com/PR-4080"
"http://openstudio-ci-builds.s3-website-us-west-2.amazonaws.com/PR-4066"
CACHE STRING "Base link to where the openstudio develop archives are hosted" FORCE)

# Make subdir if it doesn't exist
Expand Down
12 changes: 10 additions & 2 deletions src/openstudio_lib/SpacesSubsurfacesGridView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ void SpacesSubsurfacesGridController::addColumns(const QString& category, std::v
std::vector<boost::optional<model::ModelObject>> allModelObjects;
std::vector<boost::optional<model::ShadingControl>> allShadingControls;
for (auto subSurface : allSubSurfaces(t_space)) {
// temporary workaround, Shading Control Enhancements #239
#pragma warning(disable : 4996) // ignore deprecated method warning
auto shadingControl = subSurface.cast<model::SubSurface>().shadingControl();
if (shadingControl) {
allShadingControls.push_back(shadingControl);
Expand Down Expand Up @@ -431,8 +433,14 @@ void SpacesSubsurfacesGridController::addColumns(const QString& category, std::v
} else if (field == SHADINGSURFACENAME) {

} else if (field == SHADINGCONTROLNAME) {
addDropZoneColumn(Heading(QString(SHADINGCONTROLNAME)), CastNullAdapter<model::SubSurface>(&model::SubSurface::shadingControl),
CastNullAdapter<model::SubSurface>(&model::SubSurface::setShadingControl),

// temporary workaround, see Shading Control Enhancements #239
std::function<bool(model::SubSurface*, const model::ShadingControl&)> setter(
[](model::SubSurface* t_surface, const model::ShadingControl& t_arg) {
return const_cast<model::ShadingControl&>(t_arg).addSubSurface(*t_surface);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

const_cast is ugly but ok for now

});

addDropZoneColumn(Heading(QString(SHADINGCONTROLNAME)), CastNullAdapter<model::SubSurface>(&model::SubSurface::shadingControl), setter,
boost::optional<std::function<void(model::SubSurface*)>>(NullAdapter(&model::SubSurface::resetShadingControl)),
boost::optional<std::function<bool(model::SubSurface*)>>(), DataSource(allSubSurfaces, true));
} else if (field == SHADINGTYPE) {
Expand Down