Skip to content

Commit

Permalink
feat(SetpointManagerMixedAir): fully support SetpointManagerMixedAir
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed Mar 6, 2024
1 parent 3d1a6e4 commit e880348
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 1 deletion.
Binary file modified doc/Icon/Ironbug.HVAC.afdesign
Binary file not shown.
Binary file added doc/Icon/Ironbug.HVAC/24h/SetpointMxAir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Linq;
using Grasshopper.Kernel;

namespace Ironbug.Grasshopper.Component.Ironbug
{
public class Ironbug_SetpointManagerMixedAir : Ironbug_DuplicableHVACWithParamComponent
{

public Ironbug_SetpointManagerMixedAir()
: base("IB_SetpointManagerMixedAir", "SPM_MxAir",
"Description",
"Ironbug", "05:SetpointManager & AvailabilityManager",
typeof(HVAC.IB_SetpointManagerMixedAir_FieldSet))
{
}
public override GH_Exposure Exposure => GH_Exposure.primary ;
protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
{
}

protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddGenericParameter("SetpointManagerMixedAir", "SPM", "TODO:...", GH_ParamAccess.item);
}


protected override void SolveInstance(IGH_DataAccess DA)
{
var obj = new HVAC.IB_SetpointManagerMixedAir();

var objs = this.SetObjDupParamsTo(obj);
if (objs.Count() == 1)
{
DA.SetData(0, obj);
}
else
{
DA.SetDataList(0, objs);
}
}

protected override System.Drawing.Bitmap Icon => Properties.Resources.SetpointMxAir;

public override Guid ComponentGuid => new Guid("{721290AC-8BA7-473B-8C83-39BD5E6B579F}");
}
}
10 changes: 10 additions & 0 deletions src/Ironbug.Grasshopper/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Ironbug.Grasshopper/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -709,4 +709,7 @@
<data name="UnitaryHP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UnitaryHP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SetpointMxAir" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SetpointMxAir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 17 additions & 1 deletion src/Ironbug.HVAC/SetpointManagers/IB_SetpointManagerMixedAir.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,23 @@ public IB_SetpointManagerMixedAir() : base(NewDefaultOpsObj(new Model()))

public override HVACComponent ToOS(Model model)
{
return base.OnNewOpsObj(NewDefaultOpsObj, model);
var obj = base.OnNewOpsObj(NewDefaultOpsObj, model);
// this will be executed after all loops (nodes) are saved
Func<bool> func = () =>
{
var airloopO = obj.airLoopHVAC();
if (airloopO == null || !airloopO.is_initialized())
throw new ArgumentException("Failed to find AirLoopHVAC for SetpointManagerMixedAir");

var lp = airloopO.get();
SetpointManagerMixedAir.updateFanInletOutletNodes(lp);
return true;

};

IB_Utility.AddDelayFunc(func);

return obj;
}
}

Expand Down

0 comments on commit e880348

Please sign in to comment.