Skip to content

Commit

Permalink
ShadowCalculation:try fwd decl ThermalZone for ruby + C# partial classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Mar 11, 2020
1 parent aa4cf32 commit 4787f5c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/model/ModelHVAC.i
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ SWIG_MODELOBJECT(SetpointManagerFollowGroundTemperature,1);
return actuator.setThermalZone(thermalZone);
}

// Reimplemented from ModelSimulation.i
std::vector<openstudio::model::ThermalZone> getShadingZoneGroup(const openstudio::model::ShadowCalculation& sc, unsigned groupIndex) {
return sc.getShadingZoneGroup(groupIndex);
}
bool addShadingZoneGroup(openstudio::model::ShadowCalculation sc, const std::vector<openstudio::model::ThermalZone>& thermalZones) {
return sc.addShadingZoneGroup(thermalZones);
}

}
}
}
Expand Down Expand Up @@ -393,6 +401,16 @@ SWIG_MODELOBJECT(SetpointManagerFollowGroundTemperature,1);
this.setThermalZone(thermalZone);
}
}

public partial class ShadowCalculation : ModelObject {
public ThermalZoneVector getShadingZoneGroup(uint groupIndex) {
return OpenStudio.OpenStudioModelHVAC.getShadingZoneGroup(this, groupIndex);
}
public bool addShadingZoneGroup(ThermalZoneVector thermalZones) {
return OpenStudio.OpenStudioModelHVAC.addShadingZoneGroup(this, thermalZones);
}
}

%}
#endif

Expand Down
5 changes: 5 additions & 0 deletions src/model/ModelSimulation.i
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
%ignore openstudio::model::WeatherFile::site;
%ignore openstudio::model::ClimateZones::site;

// Note JM 2020-03-11: Ignoring this, will reimplement later in ModelHVAC.i using partial classes
%ignore openstudio::model::ShadowCalculation::addShadingZoneGroup;
%ignore openstudio::model::ShadowCalculation::getShadingZoneGroup;

#endif

namespace openstudio {
Expand All @@ -38,6 +42,7 @@ namespace model {
class SubSurface;
class InternalMass;
class Schedule;
class ThermalZone; // For ShadowCalculation::addShadingZoneGroup & getShadingZoneGroup
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/model/ShadowCalculation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
namespace openstudio {
namespace model {

// Forward declarations
class ThermalZone;

namespace detail {
class ShadowCalculation_Impl;
} // detail

class ThermalZone;

/** ShadowCalculation derives from ModelObject and is an interface to the OpenStudio IDD object named "ShadowCalculation".
*
* ShadowCalculation defines how often shadowing calculations should be performed in EnergyPlus simulations
Expand Down

0 comments on commit 4787f5c

Please sign in to comment.