Addresses #3936, subSurface Type reset when assigned to surface#4023
Conversation
|
I wonder if there is really any interest in actually calling (The FixedWindow IDD Default would be pointless in that case). |
|
Can you explain this further? What would that block of code replace? What could be the surprise if it's left the way it is now? |
| bool SubSurface_Impl::setSurface(const Surface& surface) | ||
| { | ||
| bool emptySurface = isEmpty(OS_SubSurfaceFields::SurfaceName); | ||
| bool emptySubSurfaceType = isEmpty(OS_SubSurfaceFields::SubSurfaceType); |
There was a problem hiding this comment.
| bool emptySubSurfaceType = isEmpty(OS_SubSurfaceFields::SubSurfaceType); |
| bool emptySubSurfaceType = isEmpty(OS_SubSurfaceFields::SubSurfaceType); | ||
| bool result = setPointer(OS_SubSurfaceFields::SurfaceName, surface.handle()); | ||
| if (result && emptySurface){ | ||
| if (result && emptySurface && emptySubSurfaceType){ |
There was a problem hiding this comment.
| if (result && emptySurface && emptySubSurfaceType){ | |
| if (result && emptySurface && isSubSurfaceTypeDefaulted()){ |
Well, the API is actually assigning a value based on logic, which is what I would call a (smart) default. There will be no way of knowing whether the user actually assigned a value or if it was automatically assigned by Openstudio. eg: Perhaps it's not too big of a deal in E+ context though: I did check the FT, and it appears that the result in E+ will end up fine, as the only thing that matters for E+ is 'Door', 'GlassDoor' or 'Window'. |
|
Side note: This blocks need review, and definitely corrections to the "changing SubSurfaceType to Dloor/GlassDoor" warnings Should be: Perhaps we should also double check that the flow control is handling every case... And we should probably catch all other situations (but Door/GlassDoor) where a non-opaque type is used and the construction is opaque (eg FixedWindow, but using an Opaque construction... though perhaps that should be done in model API) |
|
@kbenne Can you review #4023 (comment) and decide whether we choose to change things or just go with this PR please? I am not extremely opinionated on the subject so it'd be great to have another pair of eyes. |
jmarrec
left a comment
There was a problem hiding this comment.
Unless we decide to change the underlying logic (assign a default or just actually default it), these changes are good and ready to drop.
| LOG(Warn, "SubSurface '" << modelObject.name().get() << "' uses fenestration construction, changing SubSurfaceType to GlassDoor"); | ||
| subSurfaceType = "GlassDoor"; | ||
| } else if (subSurfaceType == "GlassDoor" && !construction->isFenestration()){ | ||
| LOG(Warn, "SubSurface '" << modelObject.name().get() << "' uses non-fenestration construction, changing SubSurfaceType to GlassDoor"); | ||
| LOG(Warn, "SubSurface '" << modelObject.name().get() << "' uses non-fenestration construction, changing SubSurfaceType to Door"); |
Pull request overview
Please read OpenStudio Pull Requests to better understand the OpenStudio Pull Request protocol.
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)src/openstudio_lib/library/OpenStudioPolicy.xml)Labels:
IDDChangeAPIChangePull Request - Ready for CIso that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.