Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion csharp/examples/OpenStudio.Tests/OpenStudio.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>NET7</TargetFrameworks>
<TargetFrameworks>NET8</TargetFrameworks>
<IsPackable>false</IsPackable>
<Platform>x64</Platform>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>NET7</TargetFrameworks>
<TargetFrameworks>NET8</TargetFrameworks>
<IsPackable>false</IsPackable>
<Platform>x86</Platform>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions developer/ruby/FindMissingSWIGTypes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"OpenStudioUtilitiesData" => [
"SWIGTYPE_p_std__variantT_std__monostate_bool_double_int_unsigned_int_std__string_std__vectorT_openstudio__Attribute_t_t.cs",
],
"OpenStudioUtilitiesIdf" => [
"SWIGTYPE_p_std__shared_ptrT_openstudio__detail__Workspace_Impl_t.cs" # Protected
],
"OpenStudioModelCore" => [
"SWIGTYPE_p_std__shared_ptrT_openstudio__model__detail__Model_Impl_t.cs" # Protected
],
}
n_ignored = known_errors.sum{|k, v| v.size}

Expand Down
2 changes: 1 addition & 1 deletion src/alfalfa/Alfalfa.i
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
using namespace openstudio::alfalfa;
%}

%ignore openstudio::alfalfa::AlfalfaComponentBase;
%ignore openstudio::alfalfa::AlfalfaComponentBase::clone;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TShapinsky not sure why it was entirely ignored, or if it was just a typo?

Not ignoring it doesn't mean you can instantiate it.

In [2]: openstudio.alfalfa.AlfalfaComponentBase()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 openstudio.alfalfa.AlfalfaComponentBase()

File /media/DataExt4/Software/Others/OS-build-release2/Products/python/openstudioalfalfa.py:141, in AlfalfaComponentBase.__init__(self, *args, **kwargs)
    140 def __init__(self, *args, **kwargs):
--> 141     raise AttributeError("No constructor defined - class is abstract")

AttributeError: No constructor defined - class is abstract

%ignore openstudio::alfalfa::AlfalfaActuator::clone;
%ignore openstudio::alfalfa::AlfalfaConstant::clone;
%ignore openstudio::alfalfa::AlfalfaMeter::clone;
Expand Down
3 changes: 3 additions & 0 deletions src/model/ModelCore.i
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
%ignore openstudio::model::Model::lightingSimulationControl;
%ignore openstudio::model::Model::outputControlFiles;
%ignore openstudio::model::Model::outputControlReportingTolerances;
%ignore openstudio::model::Model::outputControlResilienceSummaries;
%ignore openstudio::model::Model::outputControlTableStyle;
%ignore openstudio::model::Model::outputControlTimestamp;
%ignore openstudio::model::Model::outputDebuggingData;
Expand Down Expand Up @@ -85,13 +86,15 @@
const std::string& actuatedComponentType,
const std::string& actuatedComponentControlType,
const Space& space);
%ignore openstudio::model::EnergyManagementSystemActuator::space;
%ignore openstudio::model::EnergyManagementSystemActuator::setSpace;

// depends on ThermalZone (ModelHVAC.i)
%ignore openstudio::model::EnergyManagementSystemActuator::EnergyManagementSystemActuator(const ModelObject& modelObject,
const std::string& actuatedComponentType,
const std::string& actuatedComponentControlType,
const ThermalZone& thermalZone);
%ignore openstudio::model::EnergyManagementSystemActuator::thermalZone;
%ignore openstudio::model::EnergyManagementSystemActuator::setThermalZone;


Expand Down
15 changes: 14 additions & 1 deletion src/model/ModelGeometry.i
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
%ignore openstudio::model::Space::setThermalZone;
%ignore openstudio::model::Space::waterUseEquipment;

%ignore openstudio::model::Space::zoneMixing;
%ignore openstudio::model::Space::supplyZoneMixing;
%ignore openstudio::model::Space::exhaustZoneMixing;

%ignore openstudio::model::DaylightingDeviceTubular::transitionZones;
%ignore openstudio::model::DaylightingDeviceTubular::addTransitionZone;
%ignore openstudio::model::DaylightingDeviceTubular::addTransitionZones;
Expand Down Expand Up @@ -360,7 +364,11 @@ SWIG_MODELOBJECT(ExteriorWaterEquipment, 1);
return sc.setSubSurfaces(subSurfaces);
}

// EMS Actuator setter for Space (reimplemented from ModelCore.i)
// EMS Actuator getter/setter for Space (reimplemented from ModelCore.i)
boost::optional<Space> getSpaceForEMSActuator(const openstudio::model::EnergyManagementSystemActuator& actuator) {
return actuator.space();
}

bool setSpaceForEMSActuator(openstudio::model::EnergyManagementSystemActuator actuator, openstudio::model::Space space) {
return actuator.setSpace(space);
}
Expand Down Expand Up @@ -450,6 +458,11 @@ SWIG_MODELOBJECT(ExteriorWaterEquipment, 1);
}

public partial class EnergyManagementSystemActuator : ModelObject {

public OptionalSpace space() {
return OpenStudio.OpenStudioModelGeometry.getSpaceForEMSActuator(this);
}

public bool setSpace(OpenStudio.Space space) {
return OpenStudio.OpenStudioModelGeometry.setSpaceForEMSActuator(this, space);
}
Expand Down
48 changes: 47 additions & 1 deletion src/model/ModelHVAC.i
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
%ignore openstudio::model::CoilHeatingGasMultiStageStageData::parentCoil;
%ignore openstudio::model::CoilHeatingElectricMultiStageStageData::parentCoil;

// AirCondVRF terminals: in ModelZoneHVAC.i
%ignore openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControl::addTerminal;
%ignore openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControl::removeTerminal;
%ignore openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControl::terminals;
%ignore openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR::addTerminal;
%ignore openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR::removeTerminal;
%ignore openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR::terminals;
#endif

#if defined SWIGPYTHON
Expand Down Expand Up @@ -394,18 +401,33 @@ SWIG_MODELOBJECT(LoadingIndex, 1);
std::vector<openstudio::model::ThermalZone> getThermalZones(const openstudio::model::Building& building){
return building.thermalZones();
}

// Space (ModelGeometry.i)
boost::optional<openstudio::model::ThermalZone> getThermalZone(const openstudio::model::Space& space){
return space.thermalZone();
}
bool setThermalZone(openstudio::model::Space space, openstudio::model::ThermalZone thermalZone){
return space.setThermalZone(thermalZone);
}
std::vector<openstudio::model::ZoneMixing> getZoneMixing(const openstudio::model::Space& space){
return space.zoneMixing();
}
std::vector<openstudio::model::ZoneMixing> getSupplyZoneMixing(const openstudio::model::Space& space){
return space.supplyZoneMixing();
}
std::vector<openstudio::model::ZoneMixing> getExhaustZoneMixing(const openstudio::model::Space& space){
return space.exhaustZoneMixing();
}

openstudio::model::ThermalZone getThermalZone(const openstudio::model::ZonePropertyUserViewFactorsBySurfaceName& zoneProp){
return zoneProp.thermalZone();
}

// EMS Actuator setter for ThermalZone (reimplemented from ModelCore.i)
// EMS Actuator getter/setter for ThermalZone (reimplemented from ModelCore.i)
boost::optional<ThermalZone> getThermalZoneForEMSActuator(const openstudio::model::EnergyManagementSystemActuator& actuator) {
return actuator.thermalZone();
}

bool setThermalZoneForEMSActuator(openstudio::model::EnergyManagementSystemActuator actuator, openstudio::model::ThermalZone thermalZone) {
return actuator.setThermalZone(thermalZone);
}
Expand All @@ -425,6 +447,11 @@ SWIG_MODELOBJECT(LoadingIndex, 1);
return hxData.heatExchangerDesiccantBalancedFlows();
}

// Reimplemented from ModelResources.i
std::vector<openstudio::model::ChillerElectricASHRAE205> getChillerElectricASHRAE205s(const openstudio::model::ExternalFile& externalFile) {
return externalFile.chillerElectricASHRAE205s();
}

// DaylightingDeviceTubular, reimplemented from ModelGeometry.i
std::vector<TransitionZone> transitionZones(const openstudio::model::DaylightingDeviceTubular& tubular) {
return tubular.transitionZones();
Expand Down Expand Up @@ -475,6 +502,15 @@ SWIG_MODELOBJECT(LoadingIndex, 1);
{
return OpenStudio.OpenStudioModelHVAC.setThermalZone(this, thermalZone);
}
public ZoneMixingVector zoneMixing() {
return OpenStudio.OpenStudioModelHVAC.getZoneMixing(this);
}
public ZoneMixingVector supplyZoneMixing() {
return OpenStudio.OpenStudioModelHVAC.getSupplyZoneMixing(this);
}
public ZoneMixingVector exhaustZoneMixing() {
return OpenStudio.OpenStudioModelHVAC.getExhaustZoneMixing(this);
}
}

public partial class ZonePropertyUserViewFactorsBySurfaceName : ModelObject {
Expand All @@ -485,6 +521,10 @@ SWIG_MODELOBJECT(LoadingIndex, 1);
}

public partial class EnergyManagementSystemActuator : ModelObject {
public OptionalThermalZone thermalZone() {
return OpenStudio.OpenStudioModelHVAC.getThermalZoneForEMSActuator(this);
}

public bool setThermalZone(OpenStudio.ThermalZone thermalZone) {
return OpenStudio.OpenStudioModelHVAC.setThermalZoneForEMSActuator(this, thermalZone);
}
Expand All @@ -511,6 +551,12 @@ SWIG_MODELOBJECT(LoadingIndex, 1);
}
}

public partial class ExternalFile : ResourceObject {
public ChillerElectricASHRAE205Vector chillerElectricASHRAE205s() {
return OpenStudio.OpenStudioModelHVAC.getChillerElectricASHRAE205s(this);
}
}

public partial class DaylightingDeviceTubular : ModelObject {

public TransitionZoneVector transitionZones(){
Expand Down
7 changes: 4 additions & 3 deletions src/model/ModelResources.i
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@
// HeatExchangerDesiccantBalancedFlow is done later in ModelHVAC.i
%ignore openstudio::model::HeatExchangerDesiccantBalancedFlowPerformanceDataType1::heatExchangerDesiccantBalancedFlows;

// TODO: why?
// ignore schedule type
// %ignore openstudio::model::ScheduleType;
// Done later in ModelHVAC.i
%ignore openstudio::model::ExternalFile::chillerElectricASHRAE205s;

#endif

Expand Down Expand Up @@ -339,7 +338,9 @@ SWIG_MODELOBJECT(HeatExchangerDesiccantBalancedFlowPerformanceDataType1, 1);
: this(model) {
this.setCurveOrTableObject(curve);
}
}

public partial class Model : Workspace {
public OptionalPythonPluginSearchPaths pythonPluginSearchPaths() {
return OpenStudio.OpenStudioModelResources.pythonPluginSearchPaths(this);
}
Expand Down
69 changes: 69 additions & 0 deletions src/model/ModelZoneHVAC.i
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,73 @@ SWIG_MODELOBJECT(ZoneHVACUnitHeater,1);
SWIG_MODELOBJECT(ZoneHVACUnitVentilator,1);
SWIG_MODELOBJECT(ZoneHVACWaterToAirHeatPump,1);

#if defined(SWIGCSHARP) || defined(SWIGJAVA)
%inline {
namespace openstudio {
namespace model {

// AirCondVRF, reimplemented from ModelHVAC.i
std::vector<ZoneHVACTerminalUnitVariableRefrigerantFlow> terminals(const openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControl& airCondVRF) {
return airCondVRF.terminals();
}
Comment on lines +97 to +105
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example of missing partial classes

bool addTerminal(openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControl airCondVRF, openstudio::model::ZoneHVACTerminalUnitVariableRefrigerantFlow vrf) {
return airCondVRF.addTerminal(vrf);
}
void removeTerminal(openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControl airCondVRF, openstudio::model::ZoneHVACTerminalUnitVariableRefrigerantFlow vrf) {
airCondVRF.removeTerminal(vrf);
}

std::vector<ZoneHVACTerminalUnitVariableRefrigerantFlow> terminals(const openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR& airCondVRF) {
return airCondVRF.terminals();
}
bool addTerminal(openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR airCondVRF, openstudio::model::ZoneHVACTerminalUnitVariableRefrigerantFlow vrf) {
return airCondVRF.addTerminal(vrf);
}
void removeTerminal(openstudio::model::AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR airCondVRF, openstudio::model::ZoneHVACTerminalUnitVariableRefrigerantFlow vrf) {
airCondVRF.removeTerminal(vrf);
}

} // namespace model
} // namespace openstudio
} // %inline
#endif

#if defined(SWIGCSHARP)
//%pragma(csharp) imclassimports=%{
%pragma(csharp) moduleimports=%{

using System;
using System.Runtime.InteropServices;

public partial class AirConditionerVariableRefrigerantFlowFluidTemperatureControl : HVACComponent {
public ZoneHVACTerminalUnitVariableRefrigerantFlowVector terminals(){
return OpenStudio.OpenStudioModelZoneHVAC.terminals(this);
}

public bool addTerminal(OpenStudio.ZoneHVACTerminalUnitVariableRefrigerantFlow vrf) {
return OpenStudio.OpenStudioModelZoneHVAC.addTerminal(this, vrf);
}

public void removeTerminal(OpenStudio.ZoneHVACTerminalUnitVariableRefrigerantFlow vrf) {
OpenStudio.OpenStudioModelZoneHVAC.removeTerminal(this, vrf);
}
}

public partial class AirConditionerVariableRefrigerantFlowFluidTemperatureControlHR : HVACComponent {
public ZoneHVACTerminalUnitVariableRefrigerantFlowVector terminals(){
return OpenStudio.OpenStudioModelZoneHVAC.terminals(this);
}

public bool addTerminal(OpenStudio.ZoneHVACTerminalUnitVariableRefrigerantFlow vrf) {
return OpenStudio.OpenStudioModelZoneHVAC.addTerminal(this, vrf);
}

public void removeTerminal(OpenStudio.ZoneHVACTerminalUnitVariableRefrigerantFlow vrf) {
OpenStudio.OpenStudioModelZoneHVAC.removeTerminal(this, vrf);
}
}

%}
#endif

#endif
4 changes: 4 additions & 0 deletions src/utilities/filetypes/Filetypes.i
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
%ignore std::vector<openstudio::EpwGroundTemperatureDepth>::vector(size_type);
%ignore std::vector<openstudio::EpwGroundTemperatureDepth>::resize(size_type);
%template(EpwGroundTemperatureDepthVector) std::vector<openstudio::EpwGroundTemperatureDepth>;
%template(OptionalEpwGroundTemperatureDepth) boost::optional<openstudio::EpwGroundTemperatureDepth>;

%ignore std::vector<openstudio::EpwHoliday>::vector(size_type);
%ignore std::vector<openstudio::EpwHoliday>::resize(size_type);
Expand Down Expand Up @@ -118,6 +119,9 @@
%ignore std::vector<openstudio::MeasureStep>::resize(size_type);
%template(MeasureStepVector) std::vector<openstudio::MeasureStep>;
%template(OptionalMeasureStep) boost::optional<openstudio::MeasureStep>;
// WorkflowJSON::getMeasureStepsWithIndex
%template(UIntMeasureStepPair) std::pair<unsigned, openstudio::MeasureStep>;
%template(UIntMeasureStepPairVector) std::vector<std::pair<unsigned, openstudio::MeasureStep> >;

%template(WorkflowJSONVector) std::vector<openstudio::WorkflowJSON>;
%template(OptionalWorkflowJSON) boost::optional<openstudio::WorkflowJSON>;
Expand Down
7 changes: 4 additions & 3 deletions src/utilities/filetypes/WorkflowStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,13 @@ bool WorkflowStep::operator==(const WorkflowStep& other) const {
return m_impl == other.m_impl;
}

MeasureStep::MeasureStep(const std::string& measureDirName)
: WorkflowStep(std::shared_ptr<detail::MeasureStep_Impl>(new detail::MeasureStep_Impl(measureDirName))) {
MeasureStep::MeasureStep() : WorkflowStep(std::make_shared<detail::MeasureStep_Impl>("")) {}

MeasureStep::MeasureStep(const std::string& measureDirName) : WorkflowStep(std::make_shared<detail::MeasureStep_Impl>(measureDirName)) {
OS_ASSERT(getImpl<detail::MeasureStep_Impl>());
}

MeasureStep::MeasureStep(std::shared_ptr<detail::MeasureStep_Impl> impl) : WorkflowStep(impl) {
MeasureStep::MeasureStep(std::shared_ptr<detail::MeasureStep_Impl> impl) : WorkflowStep(std::move(impl)) {
OS_ASSERT(getImpl<detail::MeasureStep_Impl>());
}

Expand Down
3 changes: 3 additions & 0 deletions src/utilities/filetypes/WorkflowStep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ class UTILITIES_API WorkflowStep
class UTILITIES_API MeasureStep : public WorkflowStep
{
public:
// Makes no sense really, providing it for SWIG only now, really for WorkflowJSON::getMeasureStepsWithIndex
MeasureStep();

MeasureStep(const std::string& measureDirName);

std::string measureDirName() const;
Expand Down
1 change: 1 addition & 0 deletions src/utilities/xml/XMLValidator.i
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

%include <utilities/core/CommonInclude.i>
%import <utilities/core/CommonImport.i>
%import <utilities/bcl/LocalBCL.i>

%{
#include <utilities/xml/XMLValidator.hpp>
Expand Down
Loading