OpenStudioApplication icon indicating copy to clipboard operation
OpenStudioApplication copied to clipboard

Duplicated orphaned ScheduleRule when making a new profile based on existing one

Open rwadhwa910 opened this issue 4 years ago • 7 comments

I have imported a schedule from a library which has 12 different schedules within it. After getting imported each schedule creates a copy of its own schedule as shown in the image below.

OS APP 1.1.0 Windows 10 1

rwadhwa910 avatar Jan 14 '21 08:01 rwadhwa910

Can you attach the original OSM you imported @rwadhwa910 ? By import, do you mean you loaded the OSM as a library and dragged the schedule into your model from the library?

macumber avatar Jan 17 '21 19:01 macumber

@rwadhwa910 ping.

jmarrec avatar Feb 10 '21 15:02 jmarrec

@macumber I imported the osm file as a library and then drag the schedules that were there in the osm file.I am not sure whether I have that osm file with me as I was working on NREL computer at that time.

rwadhwa910 avatar Feb 10 '21 22:02 rwadhwa910

I'm not seeing this same behavior but I am seeing orphan schedule day objects created when you "Make a new profile based on" another schedule.

macumber avatar Feb 13 '21 17:02 macumber

I can't see the duplicated stuff. I suspect user tried to load the same OSM as a library, and while editing the OSM tried to import from that "library".

As far as orphaned... There's a double clone happening between the OSApp and the SDK.

https://github.com/openstudiocoalition/OpenStudioApplication/blob/d115b0393ee44efb01f97b19639ca7ebb0a4a0c4/src/openstudio_lib/SchedulesTabController.cpp#L121-L134

It's perhaps confusing but the SDK ctor ScheduleRule::ScheduleRule(ScheduleRuleset& scheduleRuleset, const ScheduleDay& daySchedule) actually clones daySchedule already internally...

https://github.com/NREL/OpenStudio/blob/92a416c03a98b44b67668e5b3d6d3c89be729afa/src/model/ScheduleRule.cpp#L600-L617

jmarrec avatar Jun 01 '21 12:06 jmarrec

For the record, the same applies to Summer/Winter/holiday profiles... ScheduleRuleset::setXXXDesignDaySchedule ALSO clones the schedule day it's passed (which is confusing).

https://github.com/NREL/OpenStudio/blob/92a416c03a98b44b67668e5b3d6d3c89be729afa/src/model/ScheduleRuleset.cpp#L281-L307

jmarrec avatar Jun 01 '21 12:06 jmarrec

Is there really an action item for us here? Seems like this is the default behavior of the OS SDK (which clones the schedule days), or am I misreading the situation?

jmarrec avatar Jun 03 '22 09:06 jmarrec