Commit bb952212 authored by aziz's avatar aziz
Browse files

Cosimulation: Bugs removed



Issue-Ref:2802
Signed-off-by: default avataraziz <aziz@fortiss.org>
parents acdffd37 7d6127c3
CCodeGeneratorEasyStartMenu.java 4a721440ec0144dde1e0379d374fea333b3c5dc5 YELLOW
CCodeGeneratorEasyStartMenu.java aee60ea30cbe51832305ffd448cabc4fafab4452 YELLOW
CGeneratorExecutionTarget.java 270fd30aaa67a294fd2bf4585044b46a54ee907f GREEN
FMUGeneratorEasyStartMenu.java 6cdbd12a280e07fa326b2d6db690c1a9a8944766 GREEN
FMUGeneratorEasyStartMenu.java 7bf75d51ef6763faae5a98188744a4d6ccc0c0b5 YELLOW
FMUGeneratorExecutionTarget.java bf91d9e976b43ba70aaf7d436420307575502f07 GREEN
JavaCodeGeneratorEasyStartMenu.java c467d9fc77fdc9c11485127e2760f40af0fa4ecb GREEN
JavaCodeGeneratorEasyStartMenu.java f6f660fe4804d5229de9f729657116d6b821aaee YELLOW
JavaGeneratorExecutionTarget.java dba521d1b700365c0522b7c70e49653fcced66cb GREEN
......@@ -15,10 +15,11 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.generator;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.hasComponentWithReadOnlyBehaviorSpecification;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.containsReadOnlyBehaviorSpecification;
import static org.fortiss.af3.project.ui.AF3ProjectUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.project.extension.IExecutionTarget;
import org.fortiss.af3.project.services.IExecutionService;
import org.fortiss.af3.project.ui.execution.EasyStartMenuBase;
......@@ -55,8 +56,9 @@ public class CCodeGeneratorEasyStartMenu extends EasyStartMenuBase {
@Override
protected boolean acceptSelection(INamedElement selection,
ContextMenuContextProvider contextProvider) {
return INavigatorService.getInstance().isNavigatorView(contextProvider) &&
hasComponentWithReadOnlyBehaviorSpecification(selection);
return (selection instanceof ComponentArchitecture) &&
INavigatorService.getInstance().isNavigatorView(contextProvider) &&
!containsReadOnlyBehaviorSpecification(selection);
}
/** {@inheritDoc} */
......
......@@ -16,9 +16,10 @@
package org.fortiss.af3.component.ui.generator;
import static org.fortiss.af3.component.ui.AF3ComponentUIActivator.getImageDescriptor;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.hasComponentWithReadOnlyBehaviorSpecification;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.containsReadOnlyBehaviorSpecification;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.project.extension.IExecutionTarget;
import org.fortiss.af3.project.services.IExecutionService;
import org.fortiss.af3.project.ui.execution.EasyStartMenuBase;
......@@ -55,8 +56,9 @@ public class FMUGeneratorEasyStartMenu extends EasyStartMenuBase {
@Override
protected boolean acceptSelection(INamedElement selection,
ContextMenuContextProvider contextProvider) {
return INavigatorService.getInstance().isNavigatorView(contextProvider) &&
hasComponentWithReadOnlyBehaviorSpecification(selection);
return (selection instanceof ComponentArchitecture) &&
INavigatorService.getInstance().isNavigatorView(contextProvider) &&
!containsReadOnlyBehaviorSpecification(selection);
}
/** {@inheritDoc} */
......
......@@ -15,10 +15,11 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.generator;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.hasComponentWithReadOnlyBehaviorSpecification;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.containsReadOnlyBehaviorSpecification;
import static org.fortiss.af3.project.ui.AF3ProjectUIActivator.getImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.project.extension.IExecutionTarget;
import org.fortiss.af3.project.services.IExecutionService;
import org.fortiss.af3.project.ui.execution.EasyStartMenuBase;
......@@ -55,8 +56,8 @@ public class JavaCodeGeneratorEasyStartMenu extends EasyStartMenuBase {
@Override
protected boolean acceptSelection(INamedElement selection,
ContextMenuContextProvider contextProvider) {
return INavigatorService.getInstance().isNavigatorView(contextProvider) &&
hasComponentWithReadOnlyBehaviorSpecification(selection);
return (selection instanceof ComponentArchitecture)&&INavigatorService.getInstance().isNavigatorView(contextProvider) &&
!containsReadOnlyBehaviorSpecification(selection);
}
/** {@inheritDoc} */
......
SimulationManager.java 9b1e4eb4ceafdb5c9dc7bf5f5150abe0e57dd8bf GREEN
SimulationPerspective.java 6d99ef287c75a0b0d40327a1ae5ddf9ff6003f2f GREEN
SimulationView.java 7bfea7cbe39aaa740058fac3ab5fcf66a0d1304e GREEN
SimulatorEasyStartMenu.java 82f09cd8275bd04d977d2716266bfe6b152d2db1 YELLOW
SimulatorEasyStartMenu.java ac7c0003cf48a80cd4b56c4b2b2a57d1207445cd YELLOW
SimulatorExecutionTarget.java 658ec31aafe5b4474cdfa5de03a30c91f2196577 GREEN
SimulatorExecutionTargetBase.java eab5ff1d6b857d3b99c568860e6caff8e4509cb7 GREEN
......@@ -17,7 +17,7 @@ package org.fortiss.af3.component.ui.simulator;
import static org.conqat.ide.commons.ui.ui.WorkbenchUtils.getActiveWorkbenchPage;
import static org.fortiss.af3.component.ui.AF3ComponentUIActivator.getDefault;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.hasComponentWithReadOnlyBehaviorSpecification;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.containsReadOnlyBehaviorSpecification;
import static org.fortiss.af3.component.utils.ComponentLibraryUtils.cleanTemporaryCopiedProject;
import static org.fortiss.af3.component.utils.ComponentLibraryUtils.copyComponentIntoNewProject;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
......@@ -73,8 +73,9 @@ public class SimulatorEasyStartMenu extends EasyStartMenuBase {
@Override
protected boolean acceptSelection(INamedElement selection,
ContextMenuContextProvider contextProvider) {
return INavigatorService.getInstance().isNavigatorView(contextProvider) &&
hasComponentWithReadOnlyBehaviorSpecification(selection);
return (selection instanceof ComponentArchitecture || selection instanceof Component) &&
INavigatorService.getInstance().isNavigatorView(contextProvider) &&
!containsReadOnlyBehaviorSpecification(selection);
}
/** {@inheritDoc} */
......
BehaviorComponentCompositor.java e8dcb90f31a9fb4ccadf5ae96483d5d30ed6703d GREEN
BehaviorComponentCompositorBase.java a2cc53dd67ec05f9e9563e93d814852ee30ef95f GREEN
BehaviorComponentCompositorBase.java b29fecf99dbb1ef8d7b57875f93804913a703662 YELLOW
ComponentArchitectureCompositor.java ea69480c2f1e2f392eeabb31a9a8e450e350d196 GREEN
ComponentArchitectureFileProjectCompositor.java 0be29f5ed0eca54797c51c8a263c8bd77922d72b GREEN
ComponentCompositor.java 55c5e8c08f6e5d9a9998165bb9eba706c9e46998 GREEN
......
......@@ -44,7 +44,7 @@ public abstract class BehaviorComponentCompositorBase<T extends Component> exten
return false;
}
boolean isRootComponent = true;
if(contained instanceof IReadOnlyBehaviorSpecification) {
if(contained instanceof IReadOnlyBehaviorSpecification && !isTopComponent(container)) {
isRootComponent = isTopComponent(container.getParentComponent());
}
// @CodeFormatterOff
......@@ -53,7 +53,6 @@ public abstract class BehaviorComponentCompositorBase<T extends Component> exten
// 3) does not allow behavior specification, if container has a subcomponent (https://af3.fortiss.org/issues/458)
// 4) does not allow behavior specification, if container already has one (https://af3.fortiss.org/issues/1175)
// 5) does not allow IReadOnlyBehaviorSpecification specification, if container's parent component in NOT component architecture root component
return container.eContainer() instanceof Component // 1
&& pickInstanceOf(contained.getClass(), container.getSpecifications()) == null // 2)
&& isAtomicComponent(container) // 3)
......
BehaviorModelElementFactory.java 5be68f9a2ae4fad663d6fb20f6c5c7b12c0647ab GREEN
ComponentArchitectureTransformationBase.java adb7d3e5f240e5b1aea15f35b458a136d8cb79d6 GREEN
ComponentArchitectureUtils.java cf5b528977da1b3f21926a600d96ffa2baea9027 GREEN
ComponentArchitectureUtils.java 6fba78c1a5fae9ae9cd6c4f39ad1de30054fd5af YELLOW
ComponentLibraryModelElementFactory.java b6c854e91d431fa3bc42fafdcf618a2040d23ab4 GREEN
ComponentLibraryUtils.java eacae09896dab81355565ae295c2c3400ab007b0 GREEN
ComponentModelElementFactory.java 520d0d3d3763dee16990d4d30792fbf315d10a8a GREEN
......
......@@ -353,21 +353,21 @@ public class ComponentArchitectureUtils {
/**
* Check if the ComponentArchitecture has any component with the ReadOnlyBehaviorSpecification
* inside
* inside or if the selection is component then check if it has ReadOnlyBehaviorSpecification
*/
public static boolean hasComponentWithReadOnlyBehaviorSpecification(EObject selection) {
public static boolean containsReadOnlyBehaviorSpecification(EObject selection) {
if(selection instanceof Component) {
return !hasReadOnlyBehaviorSpecification((Component)selection);
return hasReadOnlyBehaviorSpecification((Component)selection);
} else if(selection instanceof ComponentArchitecture) {
Component rootComponent = ((ComponentArchitecture)selection).getTopComponent();
EList<Component> subComponentsList = rootComponent.getSubComponents();
for(Component c : subComponentsList) {
if(hasReadOnlyBehaviorSpecification(c)) {
return false;
return true;
}
}
return true;
return false;
}
return false;
return true;
}
}
CosimulationConfigurationsDialog.java 9fcc43de9ff6ee40b7cb9136155ba937e65b12bb GREEN
CosimulatorGraphGenerator.java 291416e6045663810876ffa0eb0dd46e4d186c09 GREEN
FMUSimulatorEasyStartMenu.java 890960280a9d4386161e707f3827238f5a8eca40 GREEN
FMUSimulatorEasyStartMenu.java d11e36db19e4e46b9f662f6e1d2d762bf0a2c67b YELLOW
FMUSimulatorExecutionTarget.java 8b5a1bc3bf39f8fbf11020470bafd89cfad7beb0 GREEN
......@@ -16,7 +16,7 @@
package org.fortiss.af3.cosimulation.ui.simulator;
import static org.fortiss.af3.component.ui.AF3ComponentUIActivator.getImageDescriptor;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.hasReadOnlyBehaviorSpecification;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.containsReadOnlyBehaviorSpecification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.resource.ImageDescriptor;
......@@ -62,14 +62,8 @@ public class FMUSimulatorEasyStartMenu extends EasyStartMenuBase {
INavigatorService.getInstance().isNavigatorView(contextProvider)) {
Component rootComponent = ((ComponentArchitecture)selection).getTopComponent();
EList<Component> subComponentsList = rootComponent.getSubComponents();
if(subComponentsList.size() == 1) {
return false;
}
for(Component c : subComponentsList) {
if(hasReadOnlyBehaviorSpecification(c)) {
return true;
}
}
return containsReadOnlyBehaviorSpecification(selection) &&
subComponentsList.size() != 1;
}
return false;
}
......
CosimulationConfigurationTextGenerator.java aaf3a45b910cd5af32ebcc7328961fb2b8f6dd24 GREEN
CosimulationConfigurationTextGenerator.java 2abd27bfa386de555eefbae1e70b640e8620db54 YELLOW
......@@ -113,7 +113,7 @@ public class CosimulationConfigurationTextGenerator {
}
}
// To remove the comma and \n added in the last iteration in the loop
return buf.substring(0, buf.length() - 2);
return buf == "" ? "" : buf.substring(0, buf.length() - 2);
}
/** Return the FMU links with the required format */
......@@ -142,6 +142,6 @@ public class CosimulationConfigurationTextGenerator {
}
}
// To remove the comma and \n added in the last iteration in the loop
return buf.substring(0, buf.length() - 2);
return buf == "" ? "" : buf.substring(0, buf.length() - 2);
}
}
Supports Markdown
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