Skip to content

Commit

Permalink
fix(IB_AirConditionerVariableRefrigerantFlow): improve ToOS (#99)
Browse files Browse the repository at this point in the history
* fix(IB_AirConditionerVariableRefrigerantFlow): improve ToOS

* fix(AirConditionerVariableRefrigerantFlow): throw an exception when failed to add terminals

* test(large model): ignore large model test for now

* fix(OpenStudio): upgrade to 3.6.1 on Linux

* fix(Console): upgrade to 3.6.1 on Linux

* test(LargeModel): add test back
  • Loading branch information
MingboPeng authored Sep 19, 2023
1 parent 1787b31 commit 0505d36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Ironbug.Console/Ironbug.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<!-- for Linux -->
<ItemGroup Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' ">
<PackageReference Include="NREL.OpenStudio.linux-x64" Version="3.5.1" />
<PackageReference Include="NREL.OpenStudio.linux-x64" Version="3.6.1" />
</ItemGroup>

<!-- <Target Name="PostBuild" AfterTargets="PostBuildEvent">
Expand Down
2 changes: 1 addition & 1 deletion src/Ironbug.HVAC/Ironbug.HVAC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<!-- for Linux -->
<ItemGroup Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' ">
<PackageReference Include="NREL.OpenStudio.linux-x64" Version="3.5.1" IncludeAssets="compile;build" />
<PackageReference Include="NREL.OpenStudio.linux-x64" Version="3.6.1" IncludeAssets="compile;build" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ public override IB_ModelObject Duplicate()
}
public override HVACComponent ToOS(Model model)
{
var existObj = model.getAirConditionerVariableRefrigerantFlows().FirstOrDefault(_ => _.comment() == this.GetTrackingID());
var existObj = this.GetIfInModel<AirConditionerVariableRefrigerantFlow>(model, this.GetTrackingID());
if (existObj != null) return existObj;

var newObj = base.OnNewOpsObj(NewDefaultOpsObj, model);

var allTerms = this.Terminals;
foreach (var terminal in allTerms)
{

var item = (IB_ZoneHVACTerminalUnitVariableRefrigerantFlow)terminal;
newObj.addTerminal((ZoneHVACTerminalUnitVariableRefrigerantFlow)item.ToOS(model));
var t = terminal.ToOS(model) as ZoneHVACTerminalUnitVariableRefrigerantFlow;
var done = newObj.addTerminal(t);
if (!done)
throw new ArgumentException("Failed to add ZoneHVACTerminalUnitVariableRefrigerantFlow");

}

Expand Down

0 comments on commit 0505d36

Please sign in to comment.