Skip to content

Commit

Permalink
Updated warning messages for invalid results (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser Greenroyd authored Oct 23, 2023
2 parents 84adc2f + 6b0f72e commit 66120e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Lusas_Adapter/Private Helpers/GetFeatureResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public partial class LusasV17Adapter
private Dictionary<string, double> GetFeatureResults(List<string> components, Dictionary<string, IFResultsComponentSet> resultsSets, IFUnitSet unitSet, int id, string suffix, int resultType = 6)
{
Dictionary<string, double> featureResults = new Dictionary<string, double>();
bool invalidResult = false;
IFResultsComponentSet resultsSet = null;

foreach (string component in components)
Expand Down Expand Up @@ -99,12 +100,17 @@ private Dictionary<string, double> GetFeatureResults(List<string> components, Di
if (!(resultsSet.isValidValue(featureResult)))
{
featureResult = 0;
Engine.Base.Compute.RecordWarning($"{suffix}{id} {component} is an invalid result and will be set to zero");
invalidResult = true;
}

featureResults.Add(component, featureResult);
}

if (invalidResult)
{
Engine.Base.Compute.RecordWarning($"Invalid results (i.e. where DOF is released) will be set to zero.");
}

return featureResults;
}

Expand Down

0 comments on commit 66120e9

Please sign in to comment.