Skip to content

Commit

Permalink
Pass message to errManager and powerCompoenntSuccess. Fixes #2028.
Browse files Browse the repository at this point in the history
Previously, in one of the else branches, the message had been built and
stored in modelExceeds, but the modelExceeds variable was not used.
  • Loading branch information
joeseibel committed Jan 14, 2020
1 parent 8bb423e commit e3aeb19
Showing 1 changed file with 13 additions and 14 deletions.
Expand Up @@ -203,19 +203,17 @@ private void report(Section section, ComponentInstance ci, String somName, Strin
powerComponentInfo(section, "Capacity: " + toString(capacity), "");
powerComponentInfo(section, "Supply: " + toString(supply), supplyDetails);
powerComponentInfo(section, "Budget: " + toString(budget), budgetDetail);
String modelExceeds = "";
String modelStats = "";
if (capacity > 0.0 && budget > 0.0) {
if (budget > capacity) {
modelExceeds = "** " + resourceName + " budget total " + toString(budget) + " exceeds capacity "
String message = "** " + resourceName + " budget total " + toString(budget) + " exceeds capacity "
+ toString(capacity);
errManager.error(ci, somName + ": " + modelExceeds);
powerComponentError(section, modelExceeds);
errManager.error(ci, somName + ": " + message);
powerComponentError(section, message);
} else {
modelExceeds = resourceName + " budget total " + toString(budget) + " within capacity "
String message = resourceName + " budget total " + toString(budget) + " within capacity "
+ toString(capacity);
errManager.info(ci, somName + ": " + modelStats);
powerComponentSuccess(section, modelStats);
errManager.info(ci, somName + ": " + message);
powerComponentSuccess(section, message);
}
}
String suppliedmsg = "";
Expand All @@ -229,13 +227,14 @@ private void report(Section section, ComponentInstance ci, String somName, Strin
}

if (budget > available) {
modelStats = "** " + "budget total " + toString(budget) + " exceeds" + suppliedmsg + toString(available);
powerComponentError(section, modelStats);
errManager.error(ci, somName + ": " + modelStats);
String message = "** " + "budget total " + toString(budget) + " exceeds" + suppliedmsg
+ toString(available);
powerComponentError(section, message);
errManager.error(ci, somName + ": " + message);
} else {
modelStats = "budget total " + toString(budget) + " within" + suppliedmsg + toString(available);
errManager.info(ci, somName + ": " + modelStats);
powerComponentSuccess(section, modelStats);
String message = "budget total " + toString(budget) + " within" + suppliedmsg + toString(available);
errManager.info(ci, somName + ": " + message);
powerComponentSuccess(section, message);
}
Line l = new Line();
l.addContent("");
Expand Down

0 comments on commit e3aeb19

Please sign in to comment.