openstudiocoalition / OpenStudioApplication

The OpenStudio Application is a fully featured graphical interface to OpenStudio models including envelope, loads, schedules, and HVAC.
https://openstudiocoalition.org
Other
126 stars 23 forks source link

Cannot view floor plan or update render color for Space if its Story assignment was deleted #711

Open aaron-boranian opened 4 months ago

aaron-boranian commented 4 months ago

Issue overview

If a user mistakenly deleted a Story assignment for a Space, even after setting the Story back to what it was, they cannot view the Space's floor plan or update its render color in the Geometry / Editor tab that connects to FloorspaceJS. If the user then merged FloorspaceJS data with the current model, some Spaces are deleted.

For background information, I was hoping to develop a hands-on exercise for an OpenStudio Application training workshop where the attendee would inherit a half-complete model where various Spaces are missing, or the Spaces that are existing have some key attributes (Story, Thermal Zone, etc.) unassigned. The attached ZIP folder has three OSM files:

Current Behavior

When a Space does not have a Story assigned, it is not listed in the Geometry / Editor tab.

After a Story has been assigned to a Space, the Space is then listed in the Geometry / Editor tab, but the floor plan for the Space is not visible in the grid and the Render Color input for the Space cannot be set.

Expected Behavior

If a Space has its Story setting deleted, setting the Story again should allow the user to edit the Space further on the Geometry / Editor tab:

  1. Select a Render Color for that Space
  2. See the floor plan for that Space in the grid

Steps to Reproduce

  1. I started off using FloorspaceJS to draw a 5-story building with some missing Spaces. I then deleted the Story assignment from a few Spaces, such as L1 Corridor and L1 East Office (see below). OS issue_blank story

When a Space does not have a Story assigned, it is not listed in the Geometry / Editor tab (see below).

OS issue_blank story2
  1. After a Story has been assigned to a Space, the Space is then listed in the Geometry / Editor tab (refer to attached 'Exercise-01-assign-story.osm'). However, the floor plan is not visible in the grid and the Render Color input cannot be set.

    image
  2. For testing, I also tried deleting the Render Color assignment from a Space by:

    • Clicking on text for Hex Key
    • Deleting text in pop-up window
    • Hitting "Esc" key
    • Clicking on blank window for Hex Key
    • Selecting color in pop-up window
    • Hitting "Esc" key

Deleting and assigning a new Render Color like this is working in the Geometry / Editor tab correctly and that is the expected behavior.

  1. For further testing, I also tried merging the FloorspaceJS data with the current OSM, but that ended up deleting Spaces from the model (refer to attached 'Exercise-01-assign-story-merge.osm').

Possible Solution

Details

Environment

Some additional details about your environment for this issue (if relevant):

Context

For background information, I was hoping to develop a hands-on exercise for an OpenStudio Application training workshop where the attendee would inherit a half-complete model where various Spaces are missing, or the Spaces that are existing have some key attributes (Story, Thermal Zone, etc.) unassigned.

macumber commented 4 months ago

Thanks for the bug report @aaron-boranian. This happens because the FloorspaceJS data model is based around stories, a space cannot exist in that model without a story (which is different than the OpenStudio Model's scheme in which a space can exist without a story). I think the right fix for this would be to disable deleting stories from spaces if the space came from FloorpsaceJS. The other issue would be if you deleted a story in the OS App, that wouldn't immediately delete the spaces assigned to that story in the OS App but would after merging with the geometry editor.

I think for the purpose of your example, you'd have to think of story as a required field for space. You could have spaces without thermal zone assignments but you can't have a space without a story assigned if you are using FloorspaceJS.