Skip to content
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

Dev #120

Merged
merged 3 commits into from
Apr 23, 2024
Merged

Dev #120

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Ironbug.HVAC/BaseClass/IB_Field.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ protected IB_Field(IB_Field otherField)
this.SetterMethod = otherField.SetterMethod;
this.Description = otherField.Description;
}

public IB_Field(string fullName): this(fullName, "")
{
}

public IB_Field(string fullName, string nickName, Type valueType = default)
{

Expand Down
1 change: 1 addition & 0 deletions src/Ironbug.HVAC/BaseClass/IB_ModelObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public IB_ModelObject(ModelObject ghostOpsObj)
public bool ShouldSerializeCustomActuators() => !this.CustomActuators.IsNullOrEmpty();
public bool ShouldSerializeIBProperties() => !this.IBProperties.IsNullOrEmpty();
#endregion
public void AddCustomAttribute(string fieldName, object value) => this.SetFieldValue(new IB_Field(fieldName), value);

/// <summary>
/// Same as SetFieldValue
Expand Down
6 changes: 3 additions & 3 deletions src/Ironbug.HVAC/LoopObjs/IB_CentralHeatPumpSystemModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class IB_CentralHeatPumpSystemModule : IB_ModelObject

private IB_ChillerHeaterPerformanceElectricEIR _chiller => this.GetChild<IB_ChillerHeaterPerformanceElectricEIR>();

public int NumberOfChillerHeaterModules { get => Get<int>(1); private set => Set(value, 1); }
//public int NumberOfChillerHeaterModules { get => Get<int>(1); private set => Set(value, 1); }

[JsonConstructor]
private IB_CentralHeatPumpSystemModule(bool forDeserialization) : base(null)
Expand All @@ -38,8 +38,8 @@ public ModelObject ToOS(Model model)

var chillerHeater = this._chiller.ToOS(model) as ChillerHeaterPerformanceElectricEIR;
newObj.setChillerHeaterModulesPerformanceComponent(chillerHeater);
newObj.setNumberofChillerHeaterModules(this.NumberOfChillerHeaterModules);
var count = model.getChillerHeaterPerformanceElectricEIRs().Count;
//newObj.setNumberofChillerHeaterModules(this.NumberOfChillerHeaterModules);
//var count = model.getChillerHeaterPerformanceElectricEIRs().Count;

return newObj;
}
Expand Down
20 changes: 20 additions & 0 deletions src/Ironbug.HVAC_Tests/HVACComponentsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,25 @@ public void IB_ScheduleType()

}

[Test]
public void IB_WaterHeaterHP()
{

var obj = new HVAC.IB_WaterHeaterHeatPump();
obj.AddCustomAttribute("InletAirConfiguration", "OutdoorAirOnly");
obj.AddCustomAttribute("CompressorLocation", "Outdoors");

var md1 = new OpenStudio.Model();
obj.ToOS(md1);

var osObj = md1.getWaterHeaterHeatPumps().First();
Assert.AreEqual(osObj.inletAirConfiguration(), "OutdoorAirOnly");
Assert.AreEqual(osObj.compressorLocation(), "Outdoors");

string saveFile = GenFileName;
var saved = md1.Save(saveFile);
Assert.True(saved);
}

}
}
Loading