New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashes with assigning Summer/Winter Schedule #613
Comments
Ok, most of the time it just crashes. I'm not sure what the trick is to make it work. |
Yeah, I can reproduce this. I'll see if I can figure it out. |
@Ski90Moo would you mind trying https://github.com/openstudiocoalition/OpenStudioApplication/suites/14505073196/artifacts/820150340 to verify that the issue is fixed? |
Yes, this fixed it. |
Is there any way -or trick- to avoid this bug using OpenStudio Application 1.5 (without having to change app version)? |
@jordibrunet yes, create the DD Summer and/or Winter schedule via the API, then reload your model. Example m = exampleModel # here you would load your model instead
sch_ruleset = m.getScheduleRulesets.first
# setSummer/WinterDesignDaySchedule clones the ScheduleDay passed as argument
sch_ruleset.setSummerDesignDaySchedule(sch_ruleset.defaultDaySchedule)
sch_ruleset.setWinterDesignDaySchedule(sch_ruleset.defaultDaySchedule) |
Thanks, @jmarrec Is there any tutorial explaining how to access to OpenStudio API? |
https://nrel.github.io/OpenStudio-user-documentation/getting_started/getting_started/ See "Optional - Install Ruby" to setup an interactive prompt. You can also write a script.rb file and launch the openstudio CLI on it directly if you don't want the hassle of setting up ruby. example require 'openstudio'
include OpenStudio::Model
# Helper to load a model in one line
# It will raise if the path (or the model) isn't valid
#
# @param path [String] The path to the osm
# @return [OpenStudio::Model::Model] the resulting model.
def osload(path)
translator = OpenStudio::OSVersion::VersionTranslator.new
ospath = OpenStudio::Path.new(path)
model = translator.loadModel(ospath)
if model.empty?
raise "Path '#{path}' is not a valid path to an OpenStudio Model"
else
model = model.get
end
return model
end
# Load
m = osload('model.osm')
# DO STUFF
sch_ruleset = m.getScheduleRulesetByName("My Schedule")
# setSummer/WinterDesignDaySchedule clones the ScheduleDay passed as argument
if sch_ruleset.isSummerDesignDayScheduleDefaulted
sch_ruleset.setSummerDesignDaySchedule(sch_ruleset.defaultDaySchedule)
end
if sch_ruleset.isWinterDesignDayScheduleDefaulted
sch_ruleset.setWinterDesignDaySchedule(sch_ruleset.defaultDaySchedule)
end
# Save
m.save('model.osm', true) Usage: in a terminal (cmd/powershell on windows), cd to the directory you have put it in and do Then reload your OSM in the OS App. If you want to do it for all schedule rulesets, replace the "DO STUFF" section above with a for loop m.getScheduleRulesets.each do |sch_ruleset|
if sch_ruleset.isSummerDesignDayScheduleDefaulted
sch_ruleset.setSummerDesignDaySchedule(sch_ruleset.defaultDaySchedule)
end
if sch_ruleset.isWinterDesignDayScheduleDefaulted
sch_ruleset.setWinterDesignDaySchedule(sch_ruleset.defaultDaySchedule)
end
end |
Thank you very much @jmarrec ! I had some problems with "isSummerDesignDayScheduleDefaulted", but modifing the code as above works! Maybe is something related to OS 1.5.0? # DO STUFF
sch_ruleset = model.getScheduleRulesetByName("My Schedule")
if sch_ruleset.is_initialized
sch_ruleset = sch_ruleset.get
default_day_schedule = sch_ruleset.defaultDaySchedule
if sch_ruleset.isSummerDesignDayScheduleDefaulted
sch_ruleset.setSummerDesignDaySchedule(default_day_schedule)
end
if sch_ruleset.isWinterDesignDayScheduleDefaulted
sch_ruleset.setWinterDesignDaySchedule(default_day_schedule)
end
else
puts "Schedule 'My Schedule' not found in the model."
end |
Issue overview
Program crashes when creating a new summer/winter design day schedule for a fractional schedule type.
Current Behavior
Expected Behavior
Steps to Reproduce
Possible Solution
I think there is a timing or pause error. If I select the drop down and select a "new profile based on", and then click out, such as the schedule name, and then click the add button, it works.
Details
Environment
Some additional details about your environment for this issue (if relevant):
Context
The text was updated successfully, but these errors were encountered: