Skip to content

Commit 0a4da19

Browse files
committed
feat(SetpointManagerMixedAir): fully support SetpointManagerMixedAir
1 parent 2d66574 commit 0a4da19

File tree

7 files changed

+77
-1
lines changed

7 files changed

+77
-1
lines changed

doc/Icon/Ironbug.HVAC.afdesign

2.39 KB
Binary file not shown.
1.75 KB
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System;
2+
using System.Linq;
3+
using Grasshopper.Kernel;
4+
5+
namespace Ironbug.Grasshopper.Component.Ironbug
6+
{
7+
public class Ironbug_SetpointManagerMixedAir : Ironbug_DuplicableHVACWithParamComponent
8+
{
9+
10+
public Ironbug_SetpointManagerMixedAir()
11+
: base("IB_SetpointManagerMixedAir", "SPM_MxAir",
12+
"Description",
13+
"Ironbug", "05:SetpointManager & AvailabilityManager",
14+
typeof(HVAC.IB_SetpointManagerMixedAir_FieldSet))
15+
{
16+
}
17+
public override GH_Exposure Exposure => GH_Exposure.primary ;
18+
protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
19+
{
20+
}
21+
22+
protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
23+
{
24+
pManager.AddGenericParameter("SetpointManagerMixedAir", "SPM", "TODO:...", GH_ParamAccess.item);
25+
}
26+
27+
28+
protected override void SolveInstance(IGH_DataAccess DA)
29+
{
30+
var obj = new HVAC.IB_SetpointManagerMixedAir();
31+
32+
var objs = this.SetObjDupParamsTo(obj);
33+
if (objs.Count() == 1)
34+
{
35+
DA.SetData(0, obj);
36+
}
37+
else
38+
{
39+
DA.SetDataList(0, objs);
40+
}
41+
}
42+
43+
protected override System.Drawing.Bitmap Icon => Properties.Resources.SetpointMxAir;
44+
45+
public override Guid ComponentGuid => new Guid("{721290AC-8BA7-473B-8C83-39BD5E6B579F}");
46+
}
47+
}

src/Ironbug.Grasshopper/Properties/Resources.Designer.cs

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Ironbug.Grasshopper/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,4 +709,7 @@
709709
<data name="UnitaryHP" type="System.Resources.ResXFileRef, System.Windows.Forms">
710710
<value>..\Resources\UnitaryHP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
711711
</data>
712+
<data name="SetpointMxAir" type="System.Resources.ResXFileRef, System.Windows.Forms">
713+
<value>..\Resources\SetpointMxAir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
714+
</data>
712715
</root>
Loading

src/Ironbug.HVAC/SetpointManagers/IB_SetpointManagerMixedAir.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,23 @@ public IB_SetpointManagerMixedAir() : base(NewDefaultOpsObj(new Model()))
1616

1717
public override HVACComponent ToOS(Model model)
1818
{
19-
return base.OnNewOpsObj(NewDefaultOpsObj, model);
19+
var obj = base.OnNewOpsObj(NewDefaultOpsObj, model);
20+
// this will be executed after all loops (nodes) are saved
21+
Func<bool> func = () =>
22+
{
23+
var airloopO = obj.airLoopHVAC();
24+
if (airloopO == null || !airloopO.is_initialized())
25+
throw new ArgumentException("Failed to find AirLoopHVAC for SetpointManagerMixedAir");
26+
27+
var lp = airloopO.get();
28+
SetpointManagerMixedAir.updateFanInletOutletNodes(lp);
29+
return true;
30+
31+
};
32+
33+
IB_Utility.AddDelayFunc(func);
34+
35+
return obj;
2036
}
2137
}
2238

0 commit comments

Comments
 (0)