Conversation
MingboPeng
commented
Oct 6, 2025
- Add PVWatts.gh for photovoltaic power generation
- Add PVs.gh for photovoltaic systems
- Add WindTurbine_MicroTurbine_Transformer.gh for wind power generation
- Add new base classes for electric inverters, storage, and generators - Update ElectricLoadCenterDistribution to support new components - Modify existing generator classes to inherit from new base class - Implement serialization for ElectricLoadCenter - Move model loading utility to IB_Utility class
…e saving functionality - Add Ironbug_ElectricLoadCenter component for main panel of ElectricLoadCenter - Extend Ironbug_ElectricLoadCenterDistribution for sub-panel components - Update Ironbug_SaveOSModel to include ElectricLoadCenter saving functionality - Obsolete Ironbug_SaveOSModel_Obsolete3 due to updated saving process
- Add new components for ElectricLoadCenterInverter, ElectricLoadCenterStorage, and Generator - Update exposure levels for existing ElectricLoadCenter components - Refactor component names and descriptions for consistency
- Remove Ironbug_GeneratorPhotovoltaicEquivalentOneDiode, Ironbug_GeneratorPhotovoltaicSandia, and Ironbug_GeneratorPhotovoltaicSimple components - Add new Ironbug_GeneratorPhotovoltaic component that can handle different photovoltaic performances - Update Ironbug_GeneratorPVWatts to use a ShadeSurface input instead of SurfaceID - Refactor IB_GeneratorPhotovoltaicSimple to IB_GeneratorPhotovoltaic and remove unused code - Remove unused IB_PhotovoltaicPerformanceSimple class
- Remove unnecessary whitespace and blank lines - Update version numbers for Grasshopper and NREL.OpenStudio packages - Adjust indentation for better readability
- Removed the configuration for ironbug-net8.zip from .releaserc.json - This change simplifies the release process and reduces the number of assets generated
- Replace HVAC icon in .afdesign file
- Replace default icons with custom-designed images for various ElectricLoadCenter components - Update Resources.resx and Resources.Designer.cs to include new icon resources - Modify individual component files to use new icons
…eter method - Changed the implementation of DestroyParameter method in Ironbug_OutputParams class - Replaced NotImplementedException with a simple return true statement - This allows the method to compile and run without throwing an exception - Commented out the NotImplementedException line for future reference
… improve generator - Add Ironbug_PhotovoltaicPerformanceEquivalentOneDiode, Ironbug_PhotovoltaicPerformanceSandia, and Ironbug_PhotovoltaicPerformanceSimple components - Rename Ironbug_GeneratorPhotovoltaicSimple to Ironbug_GeneratorPhotovoltaic - Update photovoltaic performance handling in IB_GeneratorPhotovoltaic - Fix surface retrieval in IB_GeneratorPVWatts
…ll objects - Add constructor to IB_Children that initializes the list with a specified capacity - Change Children property in IB_ModelObject from private to protected setter - Initialize Children in IB_ElectricLoadCenterDistribution with capacity of 4
- Add InverterTable, PVPerfSimple, PVPerfSandia, and PVPerfSDM components - Update component names and parameters for ElectricLoadCenter - Modify icons and resources for new components - Update Spine.json file to include new components
- Add PVWatts.gh for photovoltaic power generation - Add PVs.gh for photovoltaic systems - Add WindTurbine_MicroTurbine_Transformer.gh for wind power generation
Summary of ChangesHello @MingboPeng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Ironbug library by introducing a robust 'ElectricLoadCenter' feature. This new capability allows users to design and simulate complex electrical systems, integrating various renewable energy sources like solar PV and wind, along with different types of electrical storage and power conversion devices. The changes span across new Grasshopper components for user interaction and corresponding backend HVAC library implementations, ensuring a comprehensive and extensible framework for energy modeling. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant number of new components and classes to support ElectricLoadCenter functionality, including photovoltaic and wind power generation. The overall structure and implementation are good, but there are several areas that need attention. Many of the new Grasshopper components have placeholder descriptions and GUIDs, which will impact usability and could cause conflicts. There are also some maintainability issues, such as a redundant null check, commented-out code that should be removed, and a file/class name mismatch that could cause confusion. Addressing these points will improve the quality and robustness of the new features.
| : base("IB_GeneratorWindTurbine", "WindTurbine", | ||
| "Description", | ||
| "Ironbug", "08:ElectricLoadCenter", | ||
| typeof(HVAC.IB_GeneratorWindTurbine_FieldSet)) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| public override GH_Exposure Exposure => GH_Exposure.tertiary; | ||
|
|
||
| protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) | ||
| { | ||
| } | ||
|
|
||
| protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) | ||
| { | ||
| pManager.AddGenericParameter("generator", "generator", "generator", GH_ParamAccess.item); | ||
| } | ||
|
|
||
| protected override void SolveInstance(IGH_DataAccess DA) | ||
| { | ||
| var obj = new HVAC.IB_GeneratorWindTurbine(); | ||
|
|
||
| this.SetObjParamsTo(obj); | ||
| var objs = this.SetObjDupParamsTo(obj); | ||
| DA.SetDataList(0, objs); | ||
| } | ||
|
|
||
| protected override System.Drawing.Bitmap Icon => Resources.WindTurbine; | ||
|
|
||
| public override Guid ComponentGuid => new Guid("E1F2A3B4-C5D6-7890-1234-F1234567890A"); |
There was a problem hiding this comment.
This component has placeholder values that should be updated:
- Description: The component description on line 11 is a placeholder. Please provide a meaningful description that explains what the component does.
- GUID: The
ComponentGuidon line 40 is a placeholder. Using non-unique GUIDs can cause conflicts in Grasshopper. Please generate a new, unique GUID for this component.
| : base("IB_GeneratorPVWatts", "PVWatts", | ||
| "Description", | ||
| "Ironbug", "08:ElectricLoadCenter", | ||
| typeof(HVAC.IB_GeneratorPVWatts_FieldSet)) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| public override GH_Exposure Exposure => GH_Exposure.tertiary; | ||
|
|
||
| protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) | ||
| { | ||
| pManager.AddGenericParameter("ShadeSurface", "_surface", "A Honeybee Shade", GH_ParamAccess.item); | ||
| } | ||
|
|
||
| protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) | ||
| { | ||
| pManager.AddGenericParameter("generator", "generator", "generator", GH_ParamAccess.item); | ||
| } | ||
|
|
||
| protected override void SolveInstance(IGH_DataAccess DA) | ||
| { | ||
| var obj = new HVAC.IB_GeneratorPVWatts(); | ||
| var surface = (object)null; | ||
| if (DA.GetData(0, ref surface)) | ||
| { | ||
| var shadeID = Helper.GetShadeName(surface); | ||
| obj.SetSurface(shadeID); | ||
| } | ||
|
|
||
| this.SetObjParamsTo(obj); | ||
| var objs = this.SetObjDupParamsTo(obj); | ||
| DA.SetDataList(0, objs); | ||
| } | ||
|
|
||
| protected override System.Drawing.Bitmap Icon => Resources.PVWatts; | ||
|
|
||
| public override Guid ComponentGuid => new Guid("D0E1F2A3-B4C5-6789-0123-EF1234567890"); |
There was a problem hiding this comment.
This component has placeholder values that should be updated:
- Description: The component description on line 12 is a placeholder. Please provide a meaningful description that explains what the component does.
- GUID: The
ComponentGuidon line 48 is a placeholder. Using non-unique GUIDs can cause conflicts in Grasshopper. Please generate a new, unique GUID for this component.
| : base("IB_ElectricLoadCenterInverterLookUpTable", "InverterLookUpTable", | ||
| "Description", | ||
| "Ironbug", "08:ElectricLoadCenter", | ||
| typeof(HVAC.IB_ElectricLoadCenterInverterLookUpTable_FieldSet)) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| public override GH_Exposure Exposure => GH_Exposure.secondary; | ||
|
|
||
| protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) | ||
| { | ||
| } | ||
|
|
||
| protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) | ||
| { | ||
| pManager.AddGenericParameter("inverter", "inverter", "inverter", GH_ParamAccess.item); | ||
| } | ||
|
|
||
| protected override void SolveInstance(IGH_DataAccess DA) | ||
| { | ||
| var obj = new HVAC.IB_ElectricLoadCenterInverterLookUpTable(); | ||
|
|
||
| this.SetObjParamsTo(obj); | ||
| var objs = this.SetObjDupParamsTo(obj); | ||
| DA.SetDataList(0, objs); | ||
| } | ||
|
|
||
| protected override System.Drawing.Bitmap Icon => Resources.InverterTable; | ||
|
|
||
| public override Guid ComponentGuid => new Guid("A1B2C3D4-E5F6-7890-1234-567890ABCDEF"); |
There was a problem hiding this comment.
This component has placeholder values that should be updated:
- Description: The component description on line 11 is a placeholder. Please provide a meaningful description that explains what the component does.
- GUID: The
ComponentGuidon line 40 is a placeholder. Using non-unique GUIDs can cause conflicts in Grasshopper. Please generate a new, unique GUID for this component. You can use an online GUID generator or the 'Create GUID' tool in Visual Studio.
| : base("IB_GeneratorMicroTurbine", "MicroTurbine", | ||
| "Description", | ||
| "Ironbug", "08:ElectricLoadCenter", | ||
| typeof(HVAC.IB_GeneratorMicroTurbine_FieldSet)) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| public override GH_Exposure Exposure => GH_Exposure.tertiary; | ||
|
|
||
| protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) | ||
| { | ||
| } | ||
|
|
||
| protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) | ||
| { | ||
| pManager.AddGenericParameter("generator", "generator", "generator", GH_ParamAccess.item); | ||
| } | ||
|
|
||
| protected override void SolveInstance(IGH_DataAccess DA) | ||
| { | ||
| var obj = new HVAC.IB_GeneratorMicroTurbine(); | ||
|
|
||
| this.SetObjParamsTo(obj); | ||
| var objs = this.SetObjDupParamsTo(obj); | ||
| DA.SetDataList(0, objs); | ||
| } | ||
|
|
||
| protected override System.Drawing.Bitmap Icon => Resources.MicroTurbine; | ||
|
|
||
| public override Guid ComponentGuid => new Guid("F6A7B8C9-D0E1-2345-6789-0ABCDEF12345"); |
There was a problem hiding this comment.
This component has placeholder values that should be updated:
- Description: The component description on line 11 is a placeholder. Please provide a meaningful description that explains what the component does.
- GUID: The
ComponentGuidon line 40 is a placeholder. Using non-unique GUIDs can cause conflicts in Grasshopper. Please generate a new, unique GUID for this component.
| : base("IB_ElectricLoadCenterInverterSimple", "InverterSimple", | ||
| "Description", | ||
| "Ironbug", "08:ElectricLoadCenter", | ||
| typeof(HVAC.IB_ElectricLoadCenterInverterSimple_FieldSet)) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| public override GH_Exposure Exposure => GH_Exposure.secondary; | ||
|
|
||
| protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) | ||
| { | ||
| } | ||
|
|
||
| protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) | ||
| { | ||
| pManager.AddGenericParameter("inverter", "inverter", "inverter", GH_ParamAccess.item); | ||
| } | ||
|
|
||
| protected override void SolveInstance(IGH_DataAccess DA) | ||
| { | ||
| var obj = new HVAC.IB_ElectricLoadCenterInverterSimple(); | ||
|
|
||
| this.SetObjParamsTo(obj); | ||
| var objs = this.SetObjDupParamsTo(obj); | ||
| DA.SetDataList(0, objs); | ||
| } | ||
|
|
||
| protected override System.Drawing.Bitmap Icon => Resources.Inverter; | ||
|
|
||
| public override Guid ComponentGuid => new Guid("B2C3D4E5-F6A7-8901-2345-67890ABCDEF1"); |
There was a problem hiding this comment.
This component has placeholder values that should be updated:
- Description: The component description on line 11 is a placeholder. Please provide a meaningful description that explains what the component does.
- GUID: The
ComponentGuidon line 40 is a placeholder. Using non-unique GUIDs can cause conflicts in Grasshopper. Please generate a new, unique GUID for this component.
| { | ||
| public Ironbug_PhotovoltaicPerformanceSandia() | ||
| : base("IB_PhotovoltaicPerformanceSandia", "PvPerfSandia", | ||
| "Description", |
| public Ironbug_PhotovoltaicPerformanceSimple() | ||
| : base("IB_PhotovoltaicPerformanceSimple", "PV", | ||
| : base("IB_PhotovoltaicPerformanceSimple", "PvPerfSimple", | ||
| "Description", |
| { | ||
| public Ironbug_ElectricLoadCenterTransformer() | ||
| : base("IB_ElectricLoadCenterTransformer", "Transformer", | ||
| "Description", |
| if (generators != null && generators.Any()) | ||
| obj.SetGenerators(generators); |
There was a problem hiding this comment.
| //using System; | ||
| //using System.Collections.Generic; | ||
| //using System.Linq; | ||
| //using Ironbug.HVAC.BaseClass; | ||
| //using OpenStudio; | ||
|
|
||
| //namespace Ironbug.HVAC | ||
| //{ | ||
| // public class IB_GeneratorMicroTurbineHeatRecovery : IB_Generator | ||
| // { | ||
| // protected override Func<IB_ModelObject> IB_InitSelf => () => new IB_GeneratorMicroTurbineHeatRecovery(); | ||
|
|
||
| // private static GeneratorMicroTurbineHeatRecovery NewDefaultOpsObj(Model model) => new(model, new GeneratorMicroTurbine(model)); | ||
| // private IB_GeneratorMicroTurbine _microTurbine => this.GetChild<IB_GeneratorMicroTurbine>(0); | ||
|
|
||
| // public IB_GeneratorMicroTurbineHeatRecovery() : base(NewDefaultOpsObj) | ||
| // { | ||
| // } | ||
|
|
||
| // public override Generator ToOS(Model model) | ||
| // { | ||
| // var turbine = _microTurbine.ToOS(model) as GeneratorMicroTurbine; | ||
| // var obj = base.OnNewOpsObj((model) => new GeneratorMicroTurbineHeatRecovery(model, turbine), model); | ||
| // return obj; | ||
| // } | ||
|
|
||
| // } | ||
|
|
||
| // public sealed class IB_GeneratorMicroTurbineHeatRecovery_FieldSet | ||
| // : IB_FieldSet<IB_GeneratorMicroTurbineHeatRecovery_FieldSet, GeneratorMicroTurbineHeatRecovery> | ||
| // { | ||
|
|
||
| // private IB_GeneratorMicroTurbineHeatRecovery_FieldSet() { } | ||
|
|
||
| // } | ||
|
|
||
|
|
||
| //} |
- Rename IB_ElectricLoadCenterInverterPVWatts to IB_ElectricLoadCenterInverterLookUpTable and vice versa - Update related FieldSet classes to match the new class names - This change ensures the class names accurately reflect the type of inverter they represent
|
🎉 This PR is included in version 1.20.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |