Skip to content

Commit

Permalink
Merge pull request #224 from hrntsm/Fix/output-no-name-error
Browse files Browse the repository at this point in the history
Fix/output no name error
  • Loading branch information
hrntsm authored Jan 16, 2024
2 parents 42b482a + 72e4170 commit 38fd86c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Tunny/Handler/OutputLoop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal static void Run(object sender, DoWorkEventArgs e)
TunnyMessageBox.Show("There are no output models. Please check study name.", "Tunny", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (s_component.GhInOut.HasConstraint)
if (s_component.GhInOut.HasConstraint && Indices[0] == -1)
{
TunnyMessageBox.Show("Pareto solution is output with no constraints taken into account.", "Tunny", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Expand Down
6 changes: 6 additions & 0 deletions Tunny/UI/OptimizeWindowTab/OutputTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;

using Tunny.Enum;
using Tunny.Handler;
Expand Down Expand Up @@ -36,6 +37,11 @@ private void RunOutputLoop(OutputMode mode)
OutputLoop.Mode = mode;
OutputLoop.Settings = _settings;
OutputLoop.StudyName = outputTargetStudyComboBox.Text;
if (string.IsNullOrEmpty(OutputLoop.StudyName))
{
TunnyMessageBox.Show("Please select study name.", "Tunny", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
OutputLoop.NickNames = _component.GhInOut.Variables.Select(x => x.NickName).ToArray();
bool result = SetOutputIndices(mode);
if (result)
Expand Down

0 comments on commit 38fd86c

Please sign in to comment.