Skip to content

Commit

Permalink
Merge pull request #27 from MingboPeng/dev
Browse files Browse the repository at this point in the history
check data structure only when demand  side has more branches than supply side
  • Loading branch information
MingboPeng authored Apr 14, 2019
2 parents 57ef779 + 4849fd7 commit e16df42
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 37 deletions.
Binary file modified doc/testFile/HVACSystemWorkflow.gh
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override void SolveInstance(IGH_DataAccess DA)
var supplyPathCount = this.Params.Input[0].VolatileData.PathCount;
var demandPathCount = this.Params.Input[1].VolatileData.PathCount;
var dualLoopObjs = supplyComs.Where(_ => _ is HVAC.IIB_DualLoopObj);
if (supplyPathCount != demandPathCount & dualLoopObjs.Any())
if (supplyPathCount < demandPathCount & dualLoopObjs.Any())
{
AddRuntimeMessage(GH_RuntimeMessageLevel.Error, $"Dual loop object [{dualLoopObjs.First().GetType().Name}] in supply side cannot be auto-duplicated. \nIt is because the data structure of supply side doesn't match demand side's. \nPlease use Ironbug_duplicate to duplicate {demandPathCount} objects, and match demand input's data structure.");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ protected override void SolveInstance(IGH_DataAccess DA)
DA.GetDataList(1, demandComs);
DA.GetData(2, ref sizing);

//check if there is a dual loop object that cannot be duplicated.
var supplyPathCount = this.Params.Input[0].VolatileData.PathCount;
var demandPathCount = this.Params.Input[1].VolatileData.PathCount;
var dualLoopObjs = supplyComs.Where(_ => _ is HVAC.IIB_DualLoopObj);
if (supplyPathCount != demandPathCount & dualLoopObjs.Any())
{
AddRuntimeMessage(GH_RuntimeMessageLevel.Error, $"Dual loop object [{dualLoopObjs.First().GetType().Name}] in supply side cannot be auto-duplicated. \nIt is because the data structure of supply side doesn't match demand side's. \nPlease use Ironbug_duplicate to duplicate {demandPathCount} objects, and match demand input's data structure.");
return;
}

var plant = new HVAC.IB_PlantLoop();
foreach (var item in supplyComs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ protected override void SolveInstance(IGH_DataAccess DA)
DA.GetDataList(1, demandComs);
DA.GetData(2, ref sizing);

//check if there is a dual loop object that cannot be duplicated.
var supplyPathCount = this.Params.Input[0].VolatileData.PathCount;
var demandPathCount = this.Params.Input[1].VolatileData.PathCount;
var dualLoopObjs = supplyComs.Where(_ => _ is HVAC.IIB_DualLoopObj);
if (supplyPathCount != demandPathCount & dualLoopObjs.Any())
{
AddRuntimeMessage(GH_RuntimeMessageLevel.Error, $"Dual loop object [{dualLoopObjs.First().GetType().Name}] in supply side cannot be auto-duplicated. \nIt is because the data structure of supply side doesn't match demand side's. \nPlease use Ironbug_duplicate to duplicate {demandPathCount} objects, and match demand input's data structure.");
return;
}

var plant = new HVAC.IB_PlantLoop();
var plantFields = HVAC.IB_PlantLoop_FieldSet.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ protected override void SolveInstance(IGH_DataAccess DA)
DA.GetDataList(1, demandComs);
DA.GetData(2, ref sizing);

//check if there is a dual loop object that cannot be duplicated.
var supplyPathCount = this.Params.Input[0].VolatileData.PathCount;
var demandPathCount = this.Params.Input[1].VolatileData.PathCount;
var dualLoopObjs = supplyComs.Where(_ => _ is HVAC.IIB_DualLoopObj);
if (supplyPathCount != demandPathCount & dualLoopObjs.Any())
{
AddRuntimeMessage(GH_RuntimeMessageLevel.Error, $"Dual loop object [{dualLoopObjs.First().GetType().Name}] in supply side cannot be auto-duplicated. \nIt is because the data structure of supply side doesn't match demand side's. \nPlease use Ironbug_duplicate to duplicate {demandPathCount} objects, and match demand input's data structure.");
return;
}

var plant = new HVAC.IB_PlantLoop();
var plantFields = HVAC.IB_PlantLoop_FieldSet.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ protected override void SolveInstance(IGH_DataAccess DA)
DA.GetDataList(1, demandComs);
DA.GetData(2, ref sizing);

//check if there is a dual loop object that cannot be duplicated.
var supplyPathCount = this.Params.Input[0].VolatileData.PathCount;
var demandPathCount = this.Params.Input[1].VolatileData.PathCount;
var dualLoopObjs = supplyComs.Where(_ => _ is HVAC.IIB_DualLoopObj);
if (supplyPathCount != demandPathCount & dualLoopObjs.Any())
{
AddRuntimeMessage(GH_RuntimeMessageLevel.Error, $"Dual loop object [{dualLoopObjs.First().GetType().Name}] in supply side cannot be auto-duplicated. \nIt is because the data structure of supply side doesn't match demand side's. \nPlease use Ironbug_duplicate to duplicate {demandPathCount} objects, and match demand input's data structure.");
return;
}

var plant = new HVAC.IB_PlantLoop();
var plantFields = HVAC.IB_PlantLoop_FieldSet.Value;
Expand Down

0 comments on commit e16df42

Please sign in to comment.