-
Notifications
You must be signed in to change notification settings - Fork 233
Fix C# bindings - unbreak the build and add missing partial classes #5377
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 12 commits
180df4e
f50acda
f3e5d52
94cebdc
84038b4
b8f1feb
6c1d417
79e8d64
3d1f3fd
789d107
1c2ab98
92336a6
ecc90ca
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 |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ | |
| using namespace openstudio::alfalfa; | ||
| %} | ||
|
|
||
| %ignore openstudio::alfalfa::AlfalfaComponentBase; | ||
| %ignore openstudio::alfalfa::AlfalfaComponentBase::clone; | ||
|
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. @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; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
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. 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 | ||
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.
This is my attempt at fixing the C# test step, just allow whatever is on the GHA runner.
Launch a run at https://github.com/NREL/OpenStudio/actions/runs/14217768843
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.
I thought this would allow testing with ANY version installed in that list, but it seems that it tries to do ALL of them so the workflow is probably going to fail.
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.
MEH, just going to use NET8 and keep move on for now.
Launched at https://github.com/NREL/OpenStudio/actions/runs/14218506478
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.
Ok that run worked, including testing.