Commit 0b21b78f authored by Simon Barner's avatar Simon Barner
Browse files

- Remove all model elements that have been migrated

- Set to 'null' all EReferences that have been migrated
refs 3067
parent 7f73d9e2
TaskArchitectureMigration.java 6d2133f2c01d9c8161763b170b62916e144d53a8 YELLOW TaskArchitectureMigration.java 79d81d1dc88066b6b9d0576aab85a755f3f611ba YELLOW
...@@ -163,6 +163,7 @@ public class TaskArchitectureMigration implements IMigrationProvider { ...@@ -163,6 +163,7 @@ public class TaskArchitectureMigration implements IMigrationProvider {
Period period = getAnnotation(task, Period.class, false); Period period = getAnnotation(task, Period.class, false);
migrateIAnnotatedSpecification(taskPeriod, period); migrateIAnnotatedSpecification(taskPeriod, period);
period.setValue(valueOf(taskPeriod.getPeriod())); period.setValue(valueOf(taskPeriod.getPeriod()));
delete(taskPeriod);
} }
TaskDuration taskDuration = TaskDuration taskDuration =
...@@ -171,6 +172,7 @@ public class TaskArchitectureMigration implements IMigrationProvider { ...@@ -171,6 +172,7 @@ public class TaskArchitectureMigration implements IMigrationProvider {
Wcet wcet = getAnnotation(task, Wcet.class, false); Wcet wcet = getAnnotation(task, Wcet.class, false);
migrateIAnnotatedSpecification(taskDuration, wcet); migrateIAnnotatedSpecification(taskDuration, wcet);
wcet.setValue(valueOf(taskDuration.getDuration())); wcet.setValue(valueOf(taskDuration.getDuration()));
delete(taskDuration);
} }
TaskStartTime taskStartTime = TaskStartTime taskStartTime =
...@@ -204,8 +206,8 @@ public class TaskArchitectureMigration implements IMigrationProvider { ...@@ -204,8 +206,8 @@ public class TaskArchitectureMigration implements IMigrationProvider {
resourceAllocation.setSchedulableEntity(schedulableEntity); resourceAllocation.setSchedulableEntity(schedulableEntity);
} }
} }
delete(taskStartTime);
} }
} }
// Migrate task ports, including logical port to task port mapping // Migrate task ports, including logical port to task port mapping
...@@ -249,23 +251,29 @@ public class TaskArchitectureMigration implements IMigrationProvider { ...@@ -249,23 +251,29 @@ public class TaskArchitectureMigration implements IMigrationProvider {
Port port = null; Port port = null;
// Migrate logical port to task port mapping // Migrate logical port to task port mapping
if(oldTaskPort instanceof OutputSignalPort && if(oldTaskPort instanceof OutputSignalPort) {
((OutputSignalPort)oldTaskPort).getOutputPortReference() != null) { OutputSignalPort outputSignalPort = (OutputSignalPort)oldTaskPort;
ComponentToTaskAllocationTable ca2ta = if(outputSignalPort.getOutputPortReference() != null) {
getOrCreateComponentToTaskAllocationTable(fileProject, taskArch); ComponentToTaskAllocationTable ca2ta =
port = ((OutputSignalPort)oldTaskPort).getOutputPortReference(); getOrCreateComponentToTaskAllocationTable(fileProject, taskArch);
addAllocationEntry(ca2ta, InputPortToTaskInputPortAllocationEntry.class, port, port = outputSignalPort.getOutputPortReference();
newTaskPort); addAllocationEntry(ca2ta, InputPortToTaskInputPortAllocationEntry.class, port,
} else if(oldTaskPort instanceof InputSignalPort && newTaskPort);
((InputSignalPort)oldTaskPort).getInputPortReference() != null) { outputSignalPort.setOutputPortReference(null);
ComponentToTaskAllocationTable ca2ta = }
getOrCreateComponentToTaskAllocationTable(fileProject, taskArch); } else if(oldTaskPort instanceof InputSignalPort) {
port = ((InputSignalPort)oldTaskPort).getInputPortReference(); InputSignalPort inputSignalPort = (InputSignalPort)oldTaskPort;
addAllocationEntry(ca2ta, InputPortToTaskInputPortAllocationEntry.class, port, if(inputSignalPort.getInputPortReference() != null) {
newTaskPort); ComponentToTaskAllocationTable ca2ta =
getOrCreateComponentToTaskAllocationTable(fileProject, taskArch);
if(oldTaskPort instanceof InputBufferedSignalPort) { port = inputSignalPort.getInputPortReference();
bufferSize = ((InputBufferedSignalPort)oldTaskPort).getBufferSize(); addAllocationEntry(ca2ta, InputPortToTaskInputPortAllocationEntry.class, port,
newTaskPort);
if(inputSignalPort instanceof InputBufferedSignalPort) {
bufferSize = ((InputBufferedSignalPort)inputSignalPort).getBufferSize();
}
inputSignalPort.setInputPortReference(null);
} }
} }
......
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