Commit c0adec4b authored by Alexander Diewald's avatar Alexander Diewald

Merge branch '3964' into 'master'

3964

See merge request !302
parents 4a7ec8ee bd934ed5
......@@ -4,4 +4,4 @@ PlatformComponentControllerFactory.java c353602118a17bdb9e78ad3d97ed9dbca5297a7f
PlatformComponentFXEditor.java 579bda140d6d490e40c49386957bf63af345f373 GREEN
PlatformComponentFXEditorBinding.java 0cfd58f8ffdd9fd8faae854841cfd5fb8cde24a1 GREEN
PlatformComponentModelFactory.java 2075ee98896f6d26c3bf24045ccc8b3eb8f0d6aa GREEN
PlatformComponentVisualFactory.java e0a773856f7d037ff0f21234ed1884a49c1161c4 GREEN
PlatformComponentVisualFactory.java ae8344ea761001ab0dbb9f92addf721855f92e1c GREEN
......@@ -15,31 +15,33 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.ui.editor.fx;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IDiagramAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IDiagramAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.ILinkVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IVisualFactory;
import org.fortiss.af3.platform.hierarchic.model.cluster.Cluster;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.DirectedPlatformConnectorContentVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.DirectedPlatformConnectorDiagramVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformClusterVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformExecutionUnitVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformGatewayUnitVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformGenericUnitVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformMemoryUnitVisual;
import org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual.PlatformTransmissionUnitVisual;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.GatewayUnit;
import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.af3.platform.model.MemoryUnit;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.model.PlatformConnectorUnit;
import org.fortiss.af3.platform.model.TransmissionConnection;
import org.fortiss.af3.platform.model.TransmissionUnit;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedLineLinkVisual;
import org.fortiss.af3.platform.ui.editor.fx.visual.TransmissionConnectionVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IDiagramAnchorageMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.ILinkMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IContentVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IDiagramAnchorageVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.ILinkVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IVisualFactory;
/**
* {@link IVisualFactory} for the or the lower layers of hierarchical
......@@ -63,6 +65,8 @@ public final class PlatformComponentVisualFactory implements IVisualFactory {
return new PlatformGatewayUnitVisual(modelBundle);
} else if(model instanceof MemoryUnit) {
return new PlatformMemoryUnitVisual(modelBundle);
} else if(model instanceof IPlatformArchitectureElement) {
return new PlatformGenericUnitVisual(modelBundle);
}
return null;
......@@ -99,7 +103,7 @@ public final class PlatformComponentVisualFactory implements IVisualFactory {
public ILinkVisual createLinkVisual(ILinkMVCBundle modelBundle) {
Object linkObj = modelBundle.getModel();
if(linkObj instanceof TransmissionConnection) {
return new NamedLayoutedLineLinkVisual<>(modelBundle, TransmissionConnection.class);
return new TransmissionConnectionVisual(modelBundle);
}
return null;
}
......
......@@ -3,5 +3,6 @@ DirectedPlatformConnectorDiagramVisual.java b752a6fc089fb0457409a16f8446349b3213
PlatformClusterVisual.java 119c9931b1674451e99ab5a3df090369de3ac629 GREEN
PlatformExecutionUnitVisual.java 6ca5f83416416e2e4576689199f9ed8375fb2118 GREEN
PlatformGatewayUnitVisual.java 7b22801b13863f972ab46eb4cd87853801ac7ce8 GREEN
PlatformGenericUnitVisual.java 80e903e53a226ac772f21f851c1230141a5ec0a9 GREEN
PlatformMemoryUnitVisual.java 12ced545e8aadcc4a413ad8f939b3528bcc1422a GREEN
PlatformTransmissionUnitVisual.java b2dee9a83c2bf9bbf082c042d3a712a91ed3feb6 GREEN
/*-------------------------------------------------------------------------+
| Copyright 2019 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.ui.editor.fx.visual;
import static javafx.scene.paint.Color.rgb;
import static org.fortiss.af3.platform.hierarchic.ui.HierarchicPlatformUIActivator.PLUGIN_ID;
import static org.fortiss.tooling.common.ui.javafx.util.GraphicUtils.getFXImage;
import org.fortiss.af3.platform.model.IPlatformArchitectureElement;
import org.fortiss.tooling.base.ui.editor.fx.visual.NamedLayoutedRectangularContentVisual;
import org.fortiss.tooling.common.ui.javafx.lwfxef.mvc.IContentMVCBundle;
import org.fortiss.tooling.common.ui.javafx.lwfxef.visual.IVisual;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
/**
* {@link IVisual} of hierarchical generic {@link IPlatformArchitectureElement}s.
*
* @author diewald
*/
public class PlatformGenericUnitVisual
extends NamedLayoutedRectangularContentVisual<IPlatformArchitectureElement> {
/** Fill color of a Cluster. */
private static final Color GENERIC_COLOR = rgb(200, 200, 200); // Grey;
/** The icon image. */
private static final Image ICON = getFXImage(PLUGIN_ID, "/icons/generic-platform-unit.png");
/** Constructor. */
public PlatformGenericUnitVisual(IContentMVCBundle mvcb) {
super(mvcb, IPlatformArchitectureElement.class);
}
/** {@inheritDoc} */
@Override
protected Paint getFillColor() {
return GENERIC_COLOR;
}
/** {@inheritDoc} */
@Override
protected Image getIcon() {
return ICON;
}
}
HierarchicPlatformArchitectureCompositor.java 93e171754ce52fcdf5792ead7e021927aa0d51d0 GREEN
HierarchicalCompositionRules.java 6c1aafc2f14d0af7511fbf7630e5620e8876f98b GREEN
HierarchicPlatformArchitectureCompositor.java bbd67a9699b73eb051a815aa513f61621e3836d4 GREEN
HierarchicalCompositionRules.java 9ab422ee2de9216a99a2ebd13345db453132e803 GREEN
......@@ -22,7 +22,7 @@ import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.platform.hierarchic.compose.base.IPlatformHierarchicalCompositionRules;
import org.fortiss.af3.platform.hierarchic.compose.base.PlatformArchitectureCompositorBase;
import org.fortiss.af3.platform.hierarchic.model.cluster.Cluster;
import org.fortiss.af3.platform.hierarchic.model.node.Node;
import org.fortiss.af3.platform.hierarchic.model.cluster.IClusterDomain;
import org.fortiss.af3.platform.hierarchic.model.node.OffChipNetworkInterface;
import org.fortiss.af3.platform.hierarchic.model.node.OffChipNetworkPort;
import org.fortiss.af3.platform.model.IArchitectureDomain;
......@@ -61,10 +61,10 @@ public class HierarchicPlatformArchitectureCompositor extends PlatformArchitectu
// Clusters and Nodes are used at the top-level.
EList<IHierarchicElement> paChildren = container.getContainedElements();
boolean containsCluster = pickFirstInstanceOf(Cluster.class, paChildren) != null;
boolean containsNode = pickFirstInstanceOf(Node.class, paChildren) != null;
boolean containsNonCluster = !containsCluster && !paChildren.isEmpty();
if((containsCluster && contained instanceof Node) ||
(containsNode && contained instanceof Cluster)) {
if((containsCluster && !(contained instanceof IClusterDomain)) ||
(containsNonCluster && contained instanceof Cluster)) {
return false;
}
......
......@@ -65,9 +65,9 @@ public class HierarchicalCompositionRules extends PlatformHierarchicalCompositio
} else if(hasEqualLevel(domain, IPlatformDomain.class)) {
rval.add(IClusterDomain.class);
rval.add(INodeDomain.class);
rval.add(IElectronicsDomain.class);
} else if(hasEqualLevel(domain, IClusterDomain.class)) {
rval.add(INodeDomain.class);
// rval.add(IPeripheralsDomain.class);
rval.add(IElectronicsDomain.class);
} else if(hasEqualLevel(domain, INodeDomain.class)) {
// Required for availability of these elements at the node level (i.e., to drop elements
......@@ -84,6 +84,7 @@ public class HierarchicalCompositionRules extends PlatformHierarchicalCompositio
} else if(hasEqualLevel(domain, IMemoryDomain.class)) {
rval.add(IProcessorDomain.class);
rval.add(ITileDomain.class);
rval.add(IElectronicsDomain.class);
} else if(hasEqualLevel(domain, IPeripheralsDomain.class)) {
rval.add(IElectronicsDomain.class);
}
......@@ -112,7 +113,20 @@ public class HierarchicalCompositionRules extends PlatformHierarchicalCompositio
IProcessorDomain.class, IPeripheralsDomain.class);
boolean processorAndMemory = isCompatibleDomainsCommutative(domain1, domain2,
IProcessorDomain.class, IMemoryDomain.class);
return processorAndPeripherals || processorAndMemory ||
// Electrical supply of platform elements down to tiles.
boolean tileAndElectrialSupply = isCompatibleDomainsCommutative(domain1, domain2,
ITileDomain.class, IElectronicsDomain.class);
boolean nodeAndElectrialSupply = isCompatibleDomainsCommutative(domain1, domain2,
INodeDomain.class, IElectronicsDomain.class);
boolean clusterAndElectrialSupply = isCompatibleDomainsCommutative(domain1, domain2,
IClusterDomain.class, IElectronicsDomain.class);
boolean memoryAndElectrialSupply = isCompatibleDomainsCommutative(domain1, domain2,
IMemoryDomain.class, IElectronicsDomain.class);
boolean electricalSupply = tileAndElectrialSupply || nodeAndElectrialSupply ||
clusterAndElectrialSupply || memoryAndElectrialSupply;
return processorAndPeripherals || processorAndMemory || electricalSupply ||
super.isCompatibleDomains(domain1, domain2);
}
}
ExecutionUnitComponentCompositorBase.java 93fca1115e430b6b751c5a241c699afd27941b1a GREEN
GatewayUnitComponentCompositorBase.java 426a31ee4322eb6d0722a5cc12b76994193c1b86 GREEN
ExecutionUnitComponentCompositorBase.java 44c23f0620a71e6aa4ed03ae0554dffdda28b775 GREEN
GatewayUnitComponentCompositorBase.java 98fb71a38a87de4c09fa072cda4b53f04f8b673f GREEN
GenericPlatformUnitCompositorBase.java 4b4ae309acc3d3185c0adad9ee894a2eef288f4f GREEN
MemoryUnitCompositorBase.java 07b03804e84404a0c80a04d137da2f81d3f59e64 GREEN
MemoryUnitCompositorBase.java ec0d5a99ccc6db78251caa5877573b0318bd9992 GREEN
PlatformElementCompositorBase.java e4831ad227874f1ee7b2b6f16775d145acaa2f15 GREEN
TransmissionUnitComponentCompositorBase.java 0b6f5bd1572d895811279609a71ea5c78caeeeee GREEN
TransmissionUnitComponentCompositorBase.java 8aadef8ae7c0b9c04d989a15635e268b264e8d26 GREEN
......@@ -15,12 +15,15 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.compose.base.elements;
import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAll;
import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.isMasterPort;
import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.isPlatformElement;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.platform.hierarchic.model.electronics.IElectronicsDomain;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.IArchitectureDomain;
import org.fortiss.af3.platform.model.IGenericPlatformTargetConnector;
/**
* Base class for compositors for {@link ExecutionUnit} components of hierarchical platforms.
......@@ -33,7 +36,9 @@ public abstract class ExecutionUnitComponentCompositorBase<T extends ExecutionUn
/** {@inheritDoc} */
@Override
protected boolean canBeAddedAtCurrentLevel(IArchitectureDomain element) {
return isMasterPort(element);
boolean isElectricalSupply = isInstanceOfAll(element, IElectronicsDomain.class,
IGenericPlatformTargetConnector.class);
return isMasterPort(element) || isElectricalSupply;
}
/** {@inheritDoc} */
......
......@@ -15,11 +15,14 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.compose.base.elements;
import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAll;
import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.isMasterExport;
import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.isMasterPort;
import org.fortiss.af3.platform.hierarchic.model.electronics.IElectronicsDomain;
import org.fortiss.af3.platform.model.GatewayUnit;
import org.fortiss.af3.platform.model.IArchitectureDomain;
import org.fortiss.af3.platform.model.IGenericPlatformTargetConnector;
/**
* Base class for compositors for {@link GatewayUnit} components of hierarchical platforms.
......@@ -32,6 +35,8 @@ public abstract class GatewayUnitComponentCompositorBase<T extends GatewayUnit &
/** {@inheritDoc} */
@Override
protected boolean canBeAddedAtCurrentLevel(IArchitectureDomain element) {
return isMasterPort(element) || isMasterExport(element);
boolean isElectricalSupply = isInstanceOfAll(element, IElectronicsDomain.class,
IGenericPlatformTargetConnector.class);
return isMasterPort(element) || isMasterExport(element) || isElectricalSupply;
}
}
......@@ -15,11 +15,14 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.compose.base.elements;
import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAll;
import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAny;
import org.fortiss.af3.platform.hierarchic.model.electronics.IElectronicsDomain;
import org.fortiss.af3.platform.hierarchic.model.tile.OnChipNetworkPort;
import org.fortiss.af3.platform.model.IArchitectureDomain;
import org.fortiss.af3.platform.model.ICommunicationSlave;
import org.fortiss.af3.platform.model.IGenericPlatformTargetConnector;
import org.fortiss.af3.platform.model.IPlatformExport;
import org.fortiss.af3.platform.model.IPlatformPort;
import org.fortiss.af3.platform.model.MemoryUnit;
......@@ -35,7 +38,10 @@ public abstract class MemoryUnitCompositorBase<T extends MemoryUnit & IArchitect
/** {@inheritDoc} */
@Override
protected boolean canBeAddedAtCurrentLevel(IArchitectureDomain element) {
boolean isElectricalSupply = isInstanceOfAll(element, IElectronicsDomain.class,
IGenericPlatformTargetConnector.class);
return (isInstanceOfAny(element, IPlatformExport.class, IPlatformPort.class) &&
(element instanceof ICommunicationSlave)) || element instanceof OnChipNetworkPort;
(element instanceof ICommunicationSlave)) || element instanceof OnChipNetworkPort ||
isElectricalSupply;
}
}
......@@ -15,9 +15,12 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.hierarchic.compose.base.elements;
import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAll;
import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.isInterface;
import org.fortiss.af3.platform.hierarchic.model.electronics.IElectronicsDomain;
import org.fortiss.af3.platform.model.IArchitectureDomain;
import org.fortiss.af3.platform.model.IGenericPlatformTargetConnector;
import org.fortiss.af3.platform.model.TransmissionUnit;
/**
......@@ -31,6 +34,8 @@ public abstract class TransmissionUnitComponentCompositorBase<T extends Transmis
/** {@inheritDoc} */
@Override
protected boolean canBeAddedAtCurrentLevel(IArchitectureDomain element) {
return isInterface(element);
boolean isElectricalSupply = isInstanceOfAll(element, IElectronicsDomain.class,
IGenericPlatformTargetConnector.class);
return isInterface(element) || isElectricalSupply;
}
}
BusCompositor.java 26b60c609de15d545abc945cc7c35d487531800c GREEN
ClockCompositor.java 360aea01ec2ae832ab5c69e95b38b38ade3f5f2f GREEN
ClusterCompositor.java 63fde8474bdfabac6002186d295a1956144d4257 GREEN
ClusterCompositor.java 6a2861b896f790c404753844eaa15222518fd59d GREEN
CoreCompositor.java 050798a2f694a04c23595ab7b9dee9756e9a3404 GREEN
MemoryCompositor.java 3064bb9b47a0df16eb85304481716d56273a21b9 GREEN
NetworkInterfaceCompositor.java da20db4c57e17921143fd8ea87635d9f341904b5 GREEN
......@@ -12,5 +12,5 @@ OffChipNetworkRouterCompositor.java b7893fbbc0865f98d63c4ac7c647f5efba3b7b28 GRE
OnChipNetworkCompositor.java b90a297b0efdeb97b4b06c2bd0e22ad7737df588 GREEN
OnChipOffChipGatewayCompositor.java e9f51bc859ec7901c8f9fa1b1751c2a5804d6b3c GREEN
PowerSupplyCompositor.java 1a3f76d53557533d80c7ffdb8c28500bd453ff47 GREEN
TileCompositor.java 3c3e5bd6f90328e306b1f5d6ea187985a8a19421 GREEN
TileCompositor.java 2b59f673831d5d6a2065db8903b2bf8c06f0c1e8 GREEN
WatchDogCompositor.java 9d121bde08bc3e68c91ab53c673bd8865ae6fc44 GREEN
......@@ -24,6 +24,8 @@ import org.fortiss.af3.platform.hierarchic.compose.HierarchicalCompositionRules;
import org.fortiss.af3.platform.hierarchic.compose.base.IPlatformHierarchicalCompositionRules;
import org.fortiss.af3.platform.hierarchic.compose.base.elements.PlatformElementCompositorBase;
import org.fortiss.af3.platform.hierarchic.model.cluster.Cluster;
import org.fortiss.af3.platform.hierarchic.model.electronics.ClockOut;
import org.fortiss.af3.platform.hierarchic.model.electronics.PowerOut;
import org.fortiss.af3.platform.hierarchic.model.node.Node;
import org.fortiss.af3.platform.hierarchic.model.node.OffChipNetwork;
import org.fortiss.af3.platform.hierarchic.model.node.OffChipNetworkPort;
......@@ -68,7 +70,8 @@ public final class ClusterCompositor extends PlatformElementCompositorBase<Clust
/** {@inheritDoc} */
@Override
protected boolean canBeAddedAtCurrentLevel(IArchitectureDomain element) {
return isInstanceOfAny(element, OffChipNetwork.class, Node.class);
return isInstanceOfAny(element, OffChipNetwork.class, Node.class, PowerOut.class,
ClockOut.class);
}
/** {@inheritDoc} */
......
......@@ -20,7 +20,6 @@ import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAny;
import org.fortiss.af3.platform.hierarchic.compose.HierarchicalCompositionRules;
import org.fortiss.af3.platform.hierarchic.compose.base.IPlatformHierarchicalCompositionRules;
import org.fortiss.af3.platform.hierarchic.compose.base.elements.ExecutionUnitComponentCompositorBase;
import org.fortiss.af3.platform.hierarchic.model.electronics.ClockIn;
import org.fortiss.af3.platform.hierarchic.model.peripherals.GeneralPurposeInput;
import org.fortiss.af3.platform.hierarchic.model.peripherals.GeneralPurposeOutput;
import org.fortiss.af3.platform.hierarchic.model.peripherals.WatchDogIn;
......@@ -50,7 +49,7 @@ public final class TileCompositor extends ExecutionUnitComponentCompositorBase<T
/** {@inheritDoc} */
@Override
protected boolean canBeAddedAtCurrentLevel(IArchitectureDomain element) {
return isInstanceOfAny(element, OnChipOffChipExport.class, ClockIn.class, WatchDogIn.class,
return isInstanceOfAny(element, OnChipOffChipExport.class, WatchDogIn.class,
GeneralPurposeInput.class, GeneralPurposeOutput.class) ||
super.canBeAddedAtCurrentLevel(element);
}
......
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