Commit a594edca authored by Simon Barner's avatar Simon Barner
Browse files

Add Task->Partition port mapping

refs 3035
parent b943c426
......@@ -33,6 +33,12 @@
<modelEditorBinding binding="org.fortiss.af3.partition.ui.editor.TaskToPartitionAllocationTableEditorBinding">
<modelElementClass modelElementClass="org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationTable"/>
</modelEditorBinding>
<modelEditorBinding binding="org.fortiss.af3.partition.ui.editor.TaskInputPortToPartitionInputPortAllocationTableEditorBinding">
<modelElementClass modelElementClass="org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationTable"/>
</modelEditorBinding>
<modelEditorBinding binding="org.fortiss.af3.partition.ui.editor.TaskOutputPortToPartitionOutputPortAllocationTableEditorBinding">
<modelElementClass modelElementClass="org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationTable"/>
</modelEditorBinding>
<modelEditorBinding binding="org.fortiss.af3.partition.ui.editor.PartitionToExecutionUnitAllocationTableEditorBinding">
<modelElementClass modelElementClass="org.fortiss.af3.partition.model.allocation.PartitionToExecutionUnitAllocationTable"/>
</modelEditorBinding>
......
......@@ -8,5 +8,9 @@ PartitionEditor.java 815fb9d8a13da071bc78db91b8fde14c5e3655ed YELLOW
PartitionEditorBinding.java f4b71e645ff651361dba803f9abf2bb06f19052d YELLOW
PartitionToExecutionUnitAllocationTableEditor.java b73dd2aac546583e848c1b4afa48321114031efc YELLOW
PartitionToExecutionUnitAllocationTableEditorBinding.java 4d00d6f7d09eaaf35d223331c1450c3b84d91633 YELLOW
TaskInputPortToPartitionInputPortAllocationTableEditor.java f5bd8eb567c77ace02014beaf36a674eca35408a YELLOW
TaskInputPortToPartitionInputPortAllocationTableEditorBinding.java 8b65522cdd24fbce7a2cf0d01bded68fceae5a11 YELLOW
TaskOutputPortToPartitionOutputPortAllocationTableEditor.java cf7db0c0a2b128e38ad7486b759ba0c3610ea787 YELLOW
TaskOutputPortToPartitionOutputPortAllocationTableEditorBinding.java 64809cdccc99ddbe3fe38dbd8f8eab49966b56ed YELLOW
TaskToPartitionAllocationTableEditor.java fef043a2c0f22ee344fe84a0bc8e5b83064eef03 YELLOW
TaskToPartitionAllocationTableEditorBinding.java 5feda399f7523552bb4d2e84333494e7d0b532be YELLOW
TaskToPartitionAllocationTableEditorBinding.java 294ef3e8e715562691c31858f33a7165c103af4c YELLOW
/*-------------------------------------------------------------------------+
| Copyright 2018 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.partition.ui.editor;
import org.fortiss.af3.allocation.ui.editor.AllocationTableEditor;
import org.fortiss.af3.partition.model.PartitionInputPort;
import org.fortiss.af3.partition.model.allocation.TaskInputPortToPartitionInputPortAllocationEntry;
import org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationTable;
import org.fortiss.af3.task.model.TaskInputPort;
/**
* Editor to assign {@link TaskInputPort}s to {@link PartitionInputPort}s.
*
* @author barner
*/
public class TaskInputPortToPartitionInputPortAllocationTableEditor extends
AllocationTableEditor<TaskToPartitionAllocationTable> {
/** Constructor. */
public TaskInputPortToPartitionInputPortAllocationTableEditor() {
super(TaskInputPortToPartitionInputPortAllocationEntry.class, null, null, true);
}
}
/*-------------------------------------------------------------------------+
| Copyright 2018 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.partition.ui.editor;
import static org.fortiss.af3.allocation.ui.DefaultStyle.RIGHT_ARROW;
import org.eclipse.ui.IEditorPart;
import org.fortiss.af3.partition.model.allocation.ComponentToPartitionAllocationTable;
import org.fortiss.tooling.kernel.ui.extension.base.ModelEditorBindingBase;
/**
* Editor binding for {@link TaskInputPortToPartitionInputPortAllocationTableEditor}.
*
* @author barner
*/
public class TaskInputPortToPartitionInputPortAllocationTableEditorBinding extends
ModelEditorBindingBase<ComponentToPartitionAllocationTable> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass() {
return TaskInputPortToPartitionInputPortAllocationTableEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Task " + RIGHT_ARROW + " Partition Input Ports";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return 4;
}
}
/*-------------------------------------------------------------------------+
| Copyright 2018 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.partition.ui.editor;
import org.fortiss.af3.allocation.ui.editor.AllocationTableEditor;
import org.fortiss.af3.partition.model.PartitionOutputPort;
import org.fortiss.af3.partition.model.allocation.TaskOutputPortToPartitionOutputPortAllocationEntry;
import org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationTable;
import org.fortiss.af3.task.model.TaskOutputPort;
/**
* Editor to assign {@link TaskOutputPort}s to {@link PartitionOutputPort}s.
*
* @author barner
*/
public class TaskOutputPortToPartitionOutputPortAllocationTableEditor extends
AllocationTableEditor<TaskToPartitionAllocationTable> {
/** Constructor. */
public TaskOutputPortToPartitionOutputPortAllocationTableEditor() {
super(TaskOutputPortToPartitionOutputPortAllocationEntry.class, null, null, true);
}
}
/*-------------------------------------------------------------------------+
| Copyright 2018 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.partition.ui.editor;
import static org.fortiss.af3.allocation.ui.DefaultStyle.RIGHT_ARROW;
import org.eclipse.ui.IEditorPart;
import org.fortiss.af3.partition.model.allocation.ComponentToPartitionAllocationTable;
import org.fortiss.tooling.kernel.ui.extension.base.ModelEditorBindingBase;
/**
* Editor binding for {@link TaskOutputPortToPartitionOutputPortAllocationTableEditor}.
*
* @author barner
*/
public class TaskOutputPortToPartitionOutputPortAllocationTableEditorBinding extends
ModelEditorBindingBase<ComponentToPartitionAllocationTable> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass() {
return TaskOutputPortToPartitionOutputPortAllocationTableEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Task " + RIGHT_ARROW + " Partition Output Ports";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return 3;
}
}
......@@ -37,7 +37,7 @@ public class TaskToPartitionAllocationTableEditorBinding extends
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Components " + RIGHT_ARROW + " Partitions";
return "Tasks " + RIGHT_ARROW + " Partitions";
}
/** {@inheritDoc} */
......
......@@ -6,8 +6,16 @@ Bundle-Version: 2.12.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.fortiss.af3.partition.AF3PartitionActivator
Require-Bundle: org.fortiss.af3.allocation;visibility:=reexport,
org.fortiss.tooling.base;visibility:=reexport,
org.fortiss.tooling.kernel;visibility:=reexport,
org.fortiss.af3.timing;visibility:=reexport,
org.fortiss.af3.task;visibility:=reexport,
org.fortiss.af3.platform,
org.fortiss.af3.component;visibility:=reexport,
org.fortiss.af3.expression;visibility:=reexport,
org.fortiss.af3.project;visibility:=reexport,
org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.fortiss.af3.platform;visibility:=reexport,
org.fortiss.af3.deployment,
org.fortiss.af3.platform.pikeos
Bundle-ActivationPolicy: lazy
......
......@@ -101,12 +101,30 @@
</eGenericType>
<eParameters name="partition" eType="#//Partition"/>
</eOperations>
<eOperations name="getPartitionInputPort" eType="#//PartitionInputPort">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Returns the {@link PartitionInputPort} to which the given {@link TaskInputPort} is allocated."/>
<details key="body" value="return TaskToPartitionAllocationTableStaticImpl.getPartitionInputPort(this, taskInputPort);"/>
</eAnnotations>
<eParameters name="taskInputPort" eType="ecore:EClass platform:/resource/org.fortiss.af3.task/model/task.ecore#//TaskInputPort"/>
</eOperations>
<eOperations name="getPartitionOutputPort" eType="#//PartitionOutputPort">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Returns the {@link PartitionOutputPort} to which the given {@link TaskOutputPort} is allocated."/>
<details key="body" value="return TaskToPartitionAllocationTableStaticImpl.getPartitionOutputPort(this, taskOutputPort);"/>
</eAnnotations>
<eParameters name="taskOutputPort" eType="ecore:EClass platform:/resource/org.fortiss.af3.task/model/task.ecore#//TaskOutputPort"/>
</eOperations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TaskToPartitionAllocationEntry" eSuperTypes="platform:/resource/org.fortiss.af3.allocation/model/allocation.ecore#//ManyToOneAllocationEntry platform:/resource/org.fortiss.af3.allocation/model/allocation.ecore#//IBidirectional platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//allocation/IAllocationTypeVirtualizationLayer platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//allocation/IAllocationTypeExecutionUnit">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="{@link AllocationEntry} specialization to map a set of {@link Task}s to a {@link Partition}."/>
</eAnnotations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TaskInputPortToPartitionInputPortAllocationEntry"
eSuperTypes="platform:/resource/org.fortiss.af3.allocation/model/allocation.ecore#//ManyToOneAllocationEntry platform:/resource/org.fortiss.af3.allocation/model/allocation.ecore#//IBidirectional platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//allocation/IAllocationTypeVirtualizationLayer platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//allocation/IAllocationTypeInputUnit"/>
<eClassifiers xsi:type="ecore:EClass" name="TaskOutputPortToPartitionOutputPortAllocationEntry"
eSuperTypes="platform:/resource/org.fortiss.af3.allocation/model/allocation.ecore#//ManyToOneAllocationEntry platform:/resource/org.fortiss.af3.allocation/model/allocation.ecore#//IBidirectional platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//allocation/IAllocationTypeVirtualizationLayer platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//allocation/IAllocationTypeOutputUnit"/>
<eClassifiers xsi:type="ecore:EClass" name="PartitionToExecutionUnitAllocationTable"
eSuperTypes="platform:/resource/org.fortiss.af3.allocation/model/allocation.ecore#//AllocationTable platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//allocation/IAllocationTypeHardwareLayer platform:/resource/org.fortiss.af3.platform/model/platform.ecore#//allocation/IAllocationTypeExecutionUnit">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
......
......@@ -51,8 +51,16 @@
<genOperations ecoreOperation="partition.ecore#//allocation/TaskToPartitionAllocationTable/getTasks">
<genParameters ecoreParameter="partition.ecore#//allocation/TaskToPartitionAllocationTable/getTasks/partition"/>
</genOperations>
<genOperations ecoreOperation="partition.ecore#//allocation/TaskToPartitionAllocationTable/getPartitionInputPort">
<genParameters ecoreParameter="partition.ecore#//allocation/TaskToPartitionAllocationTable/getPartitionInputPort/taskInputPort"/>
</genOperations>
<genOperations ecoreOperation="partition.ecore#//allocation/TaskToPartitionAllocationTable/getPartitionOutputPort">
<genParameters ecoreParameter="partition.ecore#//allocation/TaskToPartitionAllocationTable/getPartitionOutputPort/taskOutputPort"/>
</genOperations>
</genClasses>
<genClasses ecoreClass="partition.ecore#//allocation/TaskToPartitionAllocationEntry"/>
<genClasses ecoreClass="partition.ecore#//allocation/TaskInputPortToPartitionInputPortAllocationEntry"/>
<genClasses ecoreClass="partition.ecore#//allocation/TaskOutputPortToPartitionOutputPortAllocationEntry"/>
<genClasses ecoreClass="partition.ecore#//allocation/PartitionToExecutionUnitAllocationTable">
<genOperations ecoreOperation="partition.ecore#//allocation/PartitionToExecutionUnitAllocationTable/getExecutionUnits">
<genParameters ecoreParameter="partition.ecore#//allocation/PartitionToExecutionUnitAllocationTable/getExecutionUnits/partition"/>
......
......@@ -7,14 +7,14 @@
<!-- @generated partition -->
<package
uri="http://www.fortiss.org/af3/partition"
class="org.fortiss.af3.partition.model.PartitionPackage"
genModel="model/partition.genmodel"/>
class="org.fortiss.af3.partition.model.PartitionPackage"/>
</extension>
<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated partition -->
<package
uri="http://www.fortiss.org/af3/partition/allocation"
class="org.fortiss.af3.partition.model.allocation.PartitionAllocationPackage"
genModel="model/partition.genmodel"/>
class="org.fortiss.af3.partition.model.allocation.PartitionAllocationPackage"/>
</extension>
<extension point="org.fortiss.tooling.kernel.modelElementCompositor">
......
AF3PartitionActivator.java e765e8aa7e8c9c8fa9933df7b6d395ce9f96f171 YELLOW
AF3PartitionActivator.java 7631194c9b64957f57f771786ec48e74c323530d YELLOW
......@@ -31,6 +31,8 @@ import org.fortiss.af3.partition.model.allocation.InputPortToPartitionInputPortA
import org.fortiss.af3.partition.model.allocation.OutputPortToPartitionOutputPortAllocationEntry;
import org.fortiss.af3.partition.model.allocation.PartitionToExecutionUnitAllocationEntry;
import org.fortiss.af3.partition.model.allocation.PartitionToExecutionUnitAllocationTable;
import org.fortiss.af3.partition.model.allocation.TaskInputPortToPartitionInputPortAllocationEntry;
import org.fortiss.af3.partition.model.allocation.TaskOutputPortToPartitionOutputPortAllocationEntry;
import org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationEntry;
import org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationTable;
import org.fortiss.af3.platform.model.PlatformArchitecture;
......@@ -38,6 +40,8 @@ import org.fortiss.af3.platform.model.allocation.ComponentToExecutionUnitAllocat
import org.fortiss.af3.platform.model.generic.GenericExecutionUnit;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.af3.task.model.TaskInputPort;
import org.fortiss.af3.task.model.TaskOutputPort;
import org.fortiss.af3.task.model.allocation.TaskToExecutionUnitAllocationTable;
import org.fortiss.af3.task.model.allocation.TaskWcetTable;
import org.osgi.framework.BundleContext;
......@@ -83,7 +87,8 @@ public class AF3PartitionActivator extends Plugin {
as.addSourceEntityType(InputPortToPartitionInputPortAllocationEntry.class, InputPort.class);
as.addTargetEntityType(InputPortToPartitionInputPortAllocationEntry.class,
PartitionInputPort.class);
as.addSourceEntityType(OutputPortToPartitionOutputPortAllocationEntry.class, OutputPort.class);
as.addSourceEntityType(OutputPortToPartitionOutputPortAllocationEntry.class,
OutputPort.class);
as.addTargetEntityType(OutputPortToPartitionOutputPortAllocationEntry.class,
PartitionOutputPort.class);
......@@ -93,6 +98,18 @@ public class AF3PartitionActivator extends Plugin {
as.setTargetModelType(TaskToPartitionAllocationTable.class, PartitionArchitecture.class);
as.addSourceEntityType(TaskToPartitionAllocationEntry.class, Task.class);
as.addTargetEntityType(TaskToPartitionAllocationEntry.class, Partition.class);
as.addAllocationEntryType(TaskToPartitionAllocationTable.class,
TaskInputPortToPartitionInputPortAllocationEntry.class);
as.addSourceEntityType(TaskInputPortToPartitionInputPortAllocationEntry.class,
TaskInputPort.class);
as.addTargetEntityType(TaskInputPortToPartitionInputPortAllocationEntry.class,
PartitionInputPort.class);
as.addAllocationEntryType(TaskToPartitionAllocationTable.class,
TaskOutputPortToPartitionOutputPortAllocationEntry.class);
as.addSourceEntityType(TaskOutputPortToPartitionOutputPortAllocationEntry.class,
TaskOutputPort.class);
as.addTargetEntityType(TaskOutputPortToPartitionOutputPortAllocationEntry.class,
PartitionOutputPort.class);
as.addAllocationEntryType(PartitionToExecutionUnitAllocationTable.class,
PartitionToExecutionUnitAllocationEntry.class);
......
ComponentToPartitionAllocationTableStaticImpl.java e05051a2381824743337823db1561b56150cb883 YELLOW
PartitionToExecutionUnitAllocationTableStaticImpl.java eb4395b7b7e147eda26d87105637db5417fd0b26 YELLOW
TaskToPartitionAllocationTableStaticImpl.java bb3596a15546402dc576550f9e6d2b1ab9f464ff YELLOW
TaskToPartitionAllocationTableStaticImpl.java bcc324b77686a7d65ec59bcb34629d2aee3f977e YELLOW
......@@ -20,9 +20,15 @@ import static org.fortiss.tooling.kernel.utils.EcoreUtils.convertList;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.partition.model.Partition;
import org.fortiss.af3.partition.model.PartitionInputPort;
import org.fortiss.af3.partition.model.PartitionOutputPort;
import org.fortiss.af3.partition.model.allocation.TaskInputPortToPartitionInputPortAllocationEntry;
import org.fortiss.af3.partition.model.allocation.TaskOutputPortToPartitionOutputPortAllocationEntry;
import org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationEntry;
import org.fortiss.af3.partition.model.allocation.TaskToPartitionAllocationTable;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskInputPort;
import org.fortiss.af3.task.model.TaskOutputPort;
/**
* Implementation of static methods for {@link TaskToPartitionAllocationTable}'s eOperations.
......@@ -41,4 +47,19 @@ public class TaskToPartitionAllocationTableStaticImpl {
return convertList(Task.class,
ta2pa.getSourceElements(partition, TaskToPartitionAllocationEntry.class));
}
/** Returns the {@link PartitionInputPort} to which the given {@link TaskInputPort} is mapped. */
public static PartitionInputPort getPartitionInputPort(TaskToPartitionAllocationTable ta2pa,
TaskInputPort taskInputPort) {
return (PartitionInputPort)ta2pa.getTargetElement(asEList(taskInputPort),
TaskInputPortToPartitionInputPortAllocationEntry.class);
}
/** Returns the {@link PartitionOutputPort} to which the given {@link TaskOutputPort} is mapped. */
public static PartitionOutputPort getPartitionOutputPort(TaskToPartitionAllocationTable ta2pa,
TaskOutputPort taskOutputPort) {
return (PartitionOutputPort)ta2pa.getTargetElement(asEList(taskOutputPort),
TaskOutputPortToPartitionOutputPortAllocationEntry.class);
}
}
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