Can OpenStudio generate ZoneControl:Thermostat?
I need to create a thermostat dualsetpoint But when I set ScheduleWeek for the ScheduleYear using C# code it's failed. After reading the source code, the problem is it will check the assumedYear. "if (yd.assumedYear() != untilDate.assumedBaseYear()){ LOG(Error, ..."
First question: Do I need to check the function return value each time? Open Studio does not throw exceptions? If throw where can I know what exceptions may be thrown for each function? How can I get the Open Studio log for debugging like the log in this example?
Second question: I know the assumedyear of the date is 2009. Then I set the yeardescription's assumedyear to 2009 too. The scheduleweek set successfully. Then two scheduleyears set for the OS:ThermostatSetpoint:DualSetpoint. But still no dualsetpoint and zonecontrol:thermostat in the IDF
Third question: What does assumedyear mean? Why do we check this?
I'm a little confused at your code. The first line looks like ruby, the other lines look like part of a thermal zone object from an osm file?
Make sure that "thermostatDualSetpoint" has valid heating and cooling temperature schedules. If not it is possible that it wouldn't translate as you expect.
I use the following code to add the schedules. "res1" and "res2" return false while "res3" and "res4" return true. I guess something wrong with the schedules. Open Studio doesn't tell users any message in this case which is not good. Date untilDate = new Date(new MonthOfYear(12), 31); bool res1 = coolScheduleYear.addScheduleWeek(untilDate, coolScheduleWeek); bool res2 = heatScheduleYear.addScheduleWeek(untilDate, heatScheduleWeek); bool res3 = dualSetpoint.setCoolingSetpointTemperatureSchedule(coolScheduleYear); bool res4 = dualSetpoint.setHeatingSetpointTemperatureSchedule(heatScheduleYear)
Do I need to check the function return value each time? Will Open Studio throw any exceptions?No document or comment explain what exceptions will be thrown
Add a scheduleweek to a scheduleyear sometimes success sometimes fail. I don't know why. Any restrictions for the scheduleday/scheduleweek?
Is it because of "if (yd.assumedYear() != untilDate.assumedBaseYear()){ LOG(Error, "Assumed base year " << untilDate.assumedBaseYear() << " of untilDate does not match this model's assumed base year of " << yd.assumedYear()); return false; }"
But I can't get the assumedyear of YearDescription from C#. I know assumedyear of untilDate is 2009. How can I get the Open Studio log?
I manually set the CalenderYear of YearDescription as 2009. All ScheduleYear setting return true. But there is still no ZoneControl:Thermostat in IDF