Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import static extension org.eclipse.set.ppmodel.extensions.BlockAnlageExtensions
import static extension org.eclipse.set.ppmodel.extensions.BlockElementExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.BlockStreckeExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.FmaAnlageExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.UrObjectExtensions.*

/**
* Table transformation for a Inselgleistabelle (Sslb).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,16 @@ public Table transformToTable(final TableInfo tableInfo,
area))) {
return createEmptyTable(tableInfo);
}
final Table resultTable = TableServiceUtils.filterRequestValue(
EcoreUtil.copy((Table) table), tableType, tableInfo,
modelSession, getModelService(tableInfo), controlAreaIds);
// Filter the table row, which belong to current table state
final Table stateTable = TableServiceUtils
.filterTableByState(EcoreUtil.copy((Table) table), tableType);
// Filter the table row, which belong to current control area
final Table resultTable = TableServiceUtils
.filterRowGroupBelongToControlArea(EcoreUtil.copy(stateTable),
tableType, tableInfo, modelSession,
getModelService(tableInfo), controlAreaIds);
TableServiceUtils.clearEmptyRow(resultTable);
getModelService(tableInfo).addAdditionRow((Table) table, resultTable);
getModelService(tableInfo).addAdditionRow(stateTable, resultTable);
sortTable(resultTable, tableInfo, tableType);
return resultTable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,27 +272,26 @@ public static void calculateAllMissingTables(
}
}

protected static Table filterRequestValue(final Table table,
protected static Table filterRowGroupBelongToControlArea(final Table table,
final TableType tableType, final TableInfo tableInfo,
final IModelSession modelsession,
final PlanPro2TableTransformationService transformationService,
final Set<String> controlAreaIds) {
final Table result = filterTableByState(table, tableType);
// Worknotes table need only regard on table state
if (tableInfo.shortcut()
.equalsIgnoreCase(ToolboxConstants.WORKNOTES_TABLE_SHORTCUT)) {
return result;
return table;
}
if (tableType == TableType.DIFF) {
filterRowGroupBelongToControlAreaByDiffState(result, modelsession,
filterRowGroupBelongToControlAreaByDiffState(table, modelsession,
transformationService, controlAreaIds);
result.getTablecontent()
table.getTablecontent()
.getRowgroups()
.removeIf(group -> !UrObjectExtensions
.isPlanningObject(group.getLeadingObject()));
return result;
return table;
}
result.getTablecontent().getRowgroups().removeIf(group -> {
table.getTablecontent().getRowgroups().removeIf(group -> {
final UrObjektEachContainer objectEachContanier = UrObjektEachContainer
.createInstance(group.getLeadingObject(), modelsession);
final Ur_Objekt leadingObj = objectEachContanier
Expand All @@ -308,10 +307,17 @@ protected static Table filterRequestValue(final Table table,
.isObjectBelongToRendereArea(leadingObj, areas);

});
return result;
return table;
}

private static Table filterTableByState(final Table table,
/**
* @param table
* the table
* @param tableType
* the table type
* @return the table with content, which belong to the table type
*/
public static Table filterTableByState(final Table table,
final TableType tableType) {
if (tableType == TableType.DIFF || tableType == TableType.SINGLE) {
return table;
Expand Down
Loading