Skip to content

Commit

Permalink
fix(Json): add JsonConstructor for IB_ZoneHVACBaseboardRadiantConvect…
Browse files Browse the repository at this point in the history
…iveWater
  • Loading branch information
MingboPeng committed May 2, 2023
1 parent f4604e4 commit b176c9e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Ironbug.HVAC.BaseClass;
using Newtonsoft.Json;
using OpenStudio;

namespace Ironbug.HVAC
Expand All @@ -17,6 +18,11 @@ public class IB_CoilCoolingDXTwoStageWithHumidityControlMode : IB_CoilDX
private IB_CoilPerformanceDXCooling _dehumidificationStage1 => this.GetChild<IB_CoilPerformanceDXCooling>(2);
private IB_CoilPerformanceDXCooling _dehumidificationStage1p2 => this.GetChild<IB_CoilPerformanceDXCooling>(3);

[JsonConstructor]
private IB_CoilCoolingDXTwoStageWithHumidityControlMode(bool forDeserialization) : base(null)
{
}

public IB_CoilCoolingDXTwoStageWithHumidityControlMode() : base(NewDefaultOpsObj(new Model()))
{
// add placeholders
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Ironbug.HVAC.BaseClass;
using Newtonsoft.Json;
using OpenStudio;

namespace Ironbug.HVAC
Expand All @@ -13,6 +14,11 @@ private static ZoneHVACBaseboardRadiantConvectiveWater NewDefaultOpsObj(Model mo

private IB_CoilHeatingWaterBaseboardRadiant HeatingCoil => this.GetChild<IB_CoilHeatingWaterBaseboardRadiant>();

[JsonConstructor]
private IB_ZoneHVACBaseboardRadiantConvectiveWater(bool forDeserialization): base(null)
{
}

public IB_ZoneHVACBaseboardRadiantConvectiveWater() : base(NewDefaultOpsObj(new Model()))
{
this.AddChild(new IB_CoilHeatingWaterBaseboardRadiant());
Expand All @@ -26,7 +32,7 @@ public void SetHeatingCoil(IB_CoilHeatingWaterBaseboardRadiant Coil)
public override HVACComponent ToOS(Model model)
{
var opsObj = base.OnNewOpsObj(NewDefaultOpsObj, model);
opsObj.setHeatingCoil(this.HeatingCoil.ToOS(model));
if (this.HeatingCoil != null) opsObj.setHeatingCoil(this.HeatingCoil.ToOS(model));
return opsObj;
}

Expand Down

0 comments on commit b176c9e

Please sign in to comment.