Skip to content

Commit 4aa666e

Browse files
ChristophBodensteinChristophBodenstein
authored andcommitted
first set value of targetForm, then send feedback to mainframe
1 parent 4d8fe55 commit 4aa666e

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

TimeNETOptimizationEnvironment/src/toe/simulation/SimulatorCached.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,6 @@ public void operationFeedback(String message, typedef.typeOfProcessFeedback feed
331331
break;
332332
}
333333

334-
if (foundOptima.size() < 1) {
335-
//Error checking the target
336-
listener.operationFeedback("Opticheck failed.", typedef.typeOfProcessFeedback.TargetCheckFailed);
337-
support.log("No optimum found, targetcheck failed.", typeOfLogLevel.ERROR);
338-
} else if (foundOptima.size() > 1) {
339-
//Not unique
340-
listener.operationFeedback("Selected Target is not unique There are " + foundOptima.size() + " same targets.", typedef.typeOfProcessFeedback.TargetValueNotUnique);
341-
support.log("The distance to target is: " + oldDistance, typeOfLogLevel.INFO);
342-
} else if (foundOptima.size() == 1) {
343-
//Exactly one optimum with selected target value was found
344-
listener.operationFeedback("Target is unique!", typedef.typeOfProcessFeedback.TargetCheckSuccessful);
345-
}
346334
support.log("Target value(s) found at: ", typeOfLogLevel.RESULT);
347335
for (int i = 0; i < foundOptima.size(); i++) {
348336
support.log("Parameterset: " + i, typeOfLogLevel.RESULT);
@@ -357,6 +345,20 @@ public void operationFeedback(String message, typedef.typeOfProcessFeedback feed
357345
support.log("Will set targetvalue to: " + calculatedOptimum.getMeasureValueByMeasureName(targetMeasure.getMeasureName()), typeOfLogLevel.RESULT);
358346
MeasurementForm tmpMeasurementForm = (MeasurementForm) support.getMeasureFormPane().getComponent(0);
359347
tmpMeasurementForm.setTargetValue(calculatedOptimum.getMeasureValueByMeasureName(targetMeasure.getMeasureName()));
348+
349+
if (foundOptima.size() < 1) {
350+
//Error checking the target
351+
listener.operationFeedback("Opticheck failed.", typedef.typeOfProcessFeedback.TargetCheckFailed);
352+
support.log("No optimum found, targetcheck failed.", typeOfLogLevel.ERROR);
353+
} else if (foundOptima.size() > 1) {
354+
//Not unique
355+
listener.operationFeedback("Selected Target is not unique There are " + foundOptima.size() + " same targets.", typedef.typeOfProcessFeedback.TargetValueNotUnique);
356+
support.log("The distance to target is: " + oldDistance, typeOfLogLevel.INFO);
357+
} else if (foundOptima.size() == 1) {
358+
//Exactly one optimum with selected target value was found
359+
listener.operationFeedback("Target is unique!", typedef.typeOfProcessFeedback.TargetCheckSuccessful);
360+
}
361+
360362
break;
361363
case SimulationCanceled:
362364
support.log("Simulation aborted during targetcheck.", typeOfLogLevel.INFO);

0 commit comments

Comments
 (0)