Commit f7cc0239 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Merge branch '3888' into 'master'

Platform-Exp.-Converter: Fix containment resolution.

See merge request af3/af3!264
parents c27babfb c9dd953c
DeploymentSynthesisViewBackend.java df1b02a7a1bda52effda366ad1b47e06c6dc58d7 GREEN
PlatformSynthesisViewBackend.java ea74030685642c70ae73e97bb10c4c9932e00c94 GREEN
PlatformSynthesisViewBackend.java 40058024c841b27d75c41fa8080493664395b352 GREEN
ScheduleSynthesisViewBackend.java 597320941b651a4c53e313e00ae3b345f111726e GREEN
......@@ -29,7 +29,8 @@ import static org.fortiss.tooling.kernel.ui.util.MessageUtilsExtended.showErrorI
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.runAsCommand;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.showInfo;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.fixMissingIDs;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.getLargestID;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.prepareIDs;
import java.util.ArrayList;
import java.util.HashSet;
......@@ -168,7 +169,6 @@ public class PlatformSynthesisViewBackend extends PlatformSynthesisViewGUI {
try {
dbs.explore(new DSEResultAdapter(), getTotalTimeout());
runAsCommand(dse, () -> fixMissingIDs(pm.getCurrentlySelectedDSE(), dse));
} catch(Exception ex) {
showErrorInUIThread("Error executing the DSE.", ex.getMessage());
}
......@@ -220,6 +220,12 @@ public class PlatformSynthesisViewBackend extends PlatformSynthesisViewGUI {
"solution was found (or infeasibility was detected).");
return;
} else {
DSE dse = IDSEPerspectiveManager.INSTANCE.getCurrentlySelectedDSE();
prepareIDs(solution, dse, getLargestID(dse));
// Unchecked cast: It is not possible to get here without an ExplorationStep being the
// current one upfront.
ExplorationStep expStep = (ExplorationStep)dse.getCurrentStep();
getRunner().run(() -> expStep.setSolution(solution));
prepareResultVisualization(solution);
}
}
......
PlatformConnectorInstanceConverter.java 073e050ad673f41e9d012de01c1aee6fdd04e4ce GREEN
PlatformExecUnitInstantiationConverter.java 6a003e2fbc3fc115ad39578c87ddd64f23da9593 GREEN
PlatformExecUnitInstantiationConverter.java cd360ac1bb1d719da3761455f95549bcb0411a3f GREEN
PlatformTransmissionConnectionConverter.java 365a2fb563e4ed36a1b159dfa3bcce47216a935c GREEN
......@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.Set;
import org.fortiss.af3.exploration.dseml.model.expression.SuperSet;
import org.fortiss.af3.exploration.model.specification.ContainedByElement;
import org.fortiss.af3.exploration.model.specification.InstanceOfElement;
import org.fortiss.af3.exploration.solutionconverter.DSESolutionArtifacts;
import org.fortiss.af3.exploration.solutionconverter.DSESolutionConverterBase;
......@@ -77,7 +78,9 @@ public class PlatformExecUnitInstantiationConverter
templateExecUnits.add(templateExecUnit);
// Add the instance (copy).
IHierarchicElementContainer currentParent = templateExecUnit.getContainer();
ContainedByElement containmentSpec =
getAndRemoveSpec(instExecUnit, ContainedByElement.class);
IHierarchicElementContainer currentParent = containmentSpec.getFutureContainerRef();
currentParent.getContainedElements().add(instExecUnit);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment