-
Notifications
You must be signed in to change notification settings - Fork 222
#4668 - Wrap E+ 22.2 new People fields #4669
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
Changes from all commits
60cfcc4
6a3aaa4
e4a0a1c
f692354
460ea49
76ca256
f7988f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,13 +150,35 @@ namespace energyplus { | |
| } | ||
| } | ||
|
|
||
| for (int i = 0, n = definition.numThermalComfortModelTypes(); i < n; ++i) { | ||
| // As of 22.2.0, this is no longer possible to make this an extensible field | ||
| // because E+ added 3 regular fields at the end (eg: Ankle Level Velocity Schedule Name) | ||
| for (int i = 0, numComfortModelTypes = 0; i < definition.numThermalComfortModelTypes(); ++i) { | ||
| OptionalString s = definition.getThermalComfortModelType(i); | ||
| if (s) { | ||
| idfObject.pushExtensibleGroup(StringVector(1U, *s)); | ||
| ++numComfortModelTypes; | ||
| if (numComfortModelTypes > 7) { | ||
| LOG(Warn, "For " << definition.briefDescription() << ", only 7 Thermal Confort Model Types are supported by EnergyPlus, number " | ||
| << numComfortModelTypes << " [=" << *s << "] will be ignored."); | ||
| } else { | ||
| idfObject.setString(PeopleFields::ThermalComfortModel1Type + i, *s); | ||
| } | ||
|
Comment on lines
+153
to
+164
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FT: Annoying but necessary to write to the now non-extensible fields |
||
| } | ||
| } | ||
|
|
||
| if (boost::optional<Schedule> schedule_ = modelObject.ankleLevelAirVelocitySchedule()) { | ||
| if (auto idf_schedule_ = translateAndMapModelObject(schedule_.get())) { | ||
| idfObject.setString(PeopleFields::AnkleLevelAirVelocityScheduleName, idf_schedule_->nameString()); | ||
| } | ||
| } | ||
|
|
||
| if (!modelObject.isColdStressTemperatureThresholdDefaulted()) { | ||
| idfObject.setDouble(PeopleFields::ColdStressTemperatureThreshold, modelObject.coldStressTemperatureThreshold()); | ||
| } | ||
|
|
||
| if (!modelObject.isHeatStressTemperatureThresholdDefaulted()) { | ||
| idfObject.setDouble(PeopleFields::HeatStressTemperatureThreshold, modelObject.heatStressTemperatureThreshold()); | ||
| } | ||
|
Comment on lines
+168
to
+180
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FT new fields |
||
|
|
||
| return idfObject; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,12 +131,12 @@ namespace energyplus { | |
| LOG(Error, "SurfaceName_AngleFactorListName not currently imported"); | ||
| } | ||
|
|
||
| for (unsigned i = 0, n = workspaceObject.numExtensibleGroups(); i < n; ++i) { | ||
| IdfExtensibleGroup eg = workspaceObject.getExtensibleGroup(i); | ||
| OS_ASSERT(!eg.empty()); | ||
| s = eg.getString(openstudio::PeopleExtensibleFields::ThermalComfortModelType); | ||
| // As of 22.2.0, this is no longer possible to make this an extensible field | ||
| // because E+ added 3 regular fields at the end (eg: Ankle Level Velocity Schedule Name) | ||
| for (unsigned i = PeopleFields::ThermalComfortModel1Type, k = 0; i <= PeopleFields::ThermalComfortModel7Type; ++i) { | ||
| s = workspaceObject.getString(i, false, true); | ||
| if (s) { | ||
| definition.setThermalComfortModelType(i, *s); | ||
| definition.setThermalComfortModelType(k++, *s); | ||
|
Comment on lines
+134
to
+139
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RT: Annoying but necessary to read the now non-extensible fields |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -235,6 +235,31 @@ namespace energyplus { | |
| } | ||
| } | ||
|
|
||
| target = workspaceObject.getTarget(openstudio::PeopleFields::AnkleLevelAirVelocityScheduleName); | ||
| if (target) { | ||
| OptionalModelObject modelObject = translateAndMapWorkspaceObject(*target); | ||
| if (modelObject) { | ||
| if (OptionalSchedule intermediate = modelObject->optionalCast<Schedule>()) { | ||
| Schedule schedule(*intermediate); | ||
| bool ok = people.setAnkleLevelAirVelocitySchedule(schedule); | ||
| if (!ok) { | ||
| LOG(Error, "Unable to set " << people.briefDescription() << "'s Ankle Level Air Velocity schedule to " << schedule.briefDescription() | ||
| << ", likely because of a ScheduleTypeLimits conflict."); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| d = workspaceObject.getDouble(openstudio::PeopleFields::ColdStressTemperatureThreshold); | ||
| if (d) { | ||
| people.setColdStressTemperatureThreshold(*d); | ||
| } | ||
|
|
||
| d = workspaceObject.getDouble(openstudio::PeopleFields::HeatStressTemperatureThreshold); | ||
| if (d) { | ||
| people.setHeatStressTemperatureThreshold(*d); | ||
| } | ||
|
|
||
|
Comment on lines
+238
to
+262
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RT new fields |
||
| return people; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new OS fields