Skip to content

Commit

Permalink
Merge pull request #794 from architecture-building-systems/746-Hizard…
Browse files Browse the repository at this point in the history
…-not-showing-missing-Surface-Warning

EnergySystems Hizard not always showing missing-Surface-Warning

works!
  • Loading branch information
christophwaibel committed Nov 25, 2022
2 parents 74ccff8 + 913ef04 commit c287a36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Binary file modified setup/Setup_Hive.exe
Binary file not shown.
22 changes: 11 additions & 11 deletions src/Hive.IO/Hive.IO/GhInputOutput/GhEnergySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,7 @@ private void ShowForm()

protected override void SolveInstance(IGH_DataAccess DA)
{

if(_viewModel.FreeSurfaces.Count() != 0)
{
var w = GH_RuntimeMessageLevel.Warning;
List<string> list = new List<string>();
foreach (var srf in _viewModel.FreeSurfaces)
list.Add(srf.Name);
string[] surfaces = list.ToArray();
AddRuntimeMessage(w, String.Format("Attention! There are surface geometries in the Hizard that have not been assigned to any solar energy technology yet:\n- {0}", string.Join("\n- ", surfaces)));
}
var solarObjects = new List<GH_ObjectWrapper>();
var solarObjects = new List<GH_ObjectWrapper>();
DA.GetDataList(0, solarObjects);

var meshList = new List<Mesh>();
Expand Down Expand Up @@ -180,6 +170,16 @@ protected override void SolveInstance(IGH_DataAccess DA)
// create a viewmodel for the form (note, it get's set to null when the input values change...)
CreateViewModel(conversionTech, meshList, emitters);

if (_viewModel.FreeSurfaces.Count() != 0)
{
var w = GH_RuntimeMessageLevel.Warning;
List<string> list = new List<string>();
foreach (var srf in _viewModel.FreeSurfaces)
list.Add(srf.Name);
string[] surfaces = list.ToArray();
AddRuntimeMessage(w, String.Format("Attention! There are surface geometries in the Hizard that have not been assigned to any solar energy technology yet:\n- {0}", string.Join("\n- ", surfaces)));
}

// the result might be changed by opening the form,
// so we need to create it based on the view model (the result of the form)
var result = ReadViewModel();
Expand Down

0 comments on commit c287a36

Please sign in to comment.