Skip to content

Commit 1ec9185

Browse files
Fix Exception by Single state plan (#1936)
* Fix Exception by Single state plan * Add missing field * fix build error * Fix table overview not update
1 parent ae99972 commit 1ec9185

File tree

5 files changed

+32
-8
lines changed

5 files changed

+32
-8
lines changed

java/bundles/org.eclipse.set.application/src/org/eclipse/set/application/controlarea/ControlAreaSelectionControl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ private void setCombo(final TableType type) {
168168
break;
169169
case SINGLE:
170170
setSinglePlanControlAreaCombo();
171+
seletcionControlArea(comboViewer.getSelection(),
172+
TableType.SINGLE);
171173
return;
172174
case DIFF:
173175
values.addAll(getDiffComboValues());

java/bundles/org.eclipse.set.basis/src/org/eclipse/set/basis/constants/ToolboxConstants.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public interface CacheId {
7777
*/
7878
public static final String TABLE_ERRORS_FINAL = "toolbox.cache.table-errors-final";
7979

80+
/**
81+
* The id of the table error cache of single state.
82+
*/
83+
public static final String TABLE_ERRORS_SINGLE = "toolbox.cache.table-errors-single";
84+
8085
/**
8186
* The id of the table error cache.
8287
*/
@@ -86,7 +91,6 @@ public interface CacheId {
8691
* The id of the siteplan
8792
*/
8893
public static final String SITEPLAN_CACHE_ID = "toolbox.cache.siteplan";
89-
9094
}
9195

9296
/**

java/bundles/org.eclipse.set.feature.table/src/org/eclipse/set/feature/table/internal/TableServiceImpl.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,15 @@ public Map<String, Collection<TableError>> getTableErrors(
255255
final IModelSession modelSession, final Set<String> controlAreaIds,
256256
final Pt1TableCategory tableCategory) {
257257
final HashMap<String, Collection<TableError>> map = new HashMap<>();
258+
final String tableErrorsCacheGroup = switch (modelSession
259+
.getTableType()) {
260+
case FINAL -> ToolboxConstants.CacheId.TABLE_ERRORS_FINAL;
261+
case INITIAL -> ToolboxConstants.CacheId.TABLE_ERRORS_INITIAL;
262+
case SINGLE -> ToolboxConstants.CacheId.TABLE_ERRORS_SINGLE;
263+
case DIFF -> ToolboxConstants.CacheId.TABLE_ERRORS;
264+
};
258265
final Cache cache = getCacheService().getCache(
259-
modelSession.getPlanProSchnittstelle(),
260-
ToolboxConstants.CacheId.TABLE_ERRORS);
266+
modelSession.getPlanProSchnittstelle(), tableErrorsCacheGroup);
261267
getAvailableTables().forEach(tableInfo -> {
262268
if (tableInfo.category().equals(tableCategory)) {
263269
final List<Pair<String, String>> cacheKeys = getCacheKeys(
@@ -281,7 +287,7 @@ public Map<String, Collection<TableError>> getTableErrors(
281287
}
282288

283289
@SuppressWarnings("unchecked")
284-
private boolean combineTableErrors(final IModelSession modelSession,
290+
private void combineTableErrors(final IModelSession modelSession,
285291
final String cacheKey) {
286292
final Collection<TableError> initialErrors = (Collection<TableError>) getCacheService()
287293
.getCache(modelSession.getPlanProSchnittstelle(),
@@ -292,7 +298,7 @@ private boolean combineTableErrors(final IModelSession modelSession,
292298
ToolboxConstants.CacheId.TABLE_ERRORS_FINAL)
293299
.getIfPresent(cacheKey);
294300
if (initialErrors == null || finalErrors == null) {
295-
return false;
301+
return;
296302
}
297303
final Collection<TableError> combined = new ArrayList<>();
298304
combined.addAll(initialErrors);
@@ -302,7 +308,6 @@ private boolean combineTableErrors(final IModelSession modelSession,
302308
ToolboxConstants.CacheId.TABLE_ERRORS)
303309
.set(cacheKey, combined);
304310
broker.post(Events.TABLEERROR_CHANGED, null);
305-
return true;
306311
}
307312

308313
private void saveTableError(final String shortCut,
@@ -326,6 +331,14 @@ private void saveTableError(final String shortCut,
326331
ToolboxConstants.CacheId.TABLE_ERRORS_FINAL)
327332
.set(cacheKey, errors);
328333
break;
334+
case SINGLE:
335+
getCacheService()
336+
.getCache(modelSession.getPlanProSchnittstelle(),
337+
ToolboxConstants.CacheId.TABLE_ERRORS_SINGLE)
338+
.set(cacheKey, errors);
339+
// The plan with single state don't need combine cache errrors
340+
broker.post(Events.TABLEERROR_CHANGED, null);
341+
return;
329342
default:
330343
return;
331344
}

java/bundles/org.eclipse.set.feature.table/src/org/eclipse/set/feature/table/overview/TableOverviewPart.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
*/
99
package org.eclipse.set.feature.table.overview;
1010

11-
import static org.eclipse.set.basis.constants.ToolboxConstants.*;
11+
import static org.eclipse.set.basis.constants.ToolboxConstants.ESTW_SUPPLEMENT_PART_ID_PREFIX;
12+
import static org.eclipse.set.basis.constants.ToolboxConstants.ESTW_TABLE_PART_ID_PREFIX;
13+
import static org.eclipse.set.basis.constants.ToolboxConstants.ETCS_TABLE_PART_ID_PREFIX;
1214

1315
import java.lang.reflect.InvocationTargetException;
1416
import java.util.ArrayList;
@@ -224,6 +226,9 @@ private void calculateAllMissingTables(final IProgressMonitor monitor) {
224226
tableService.transformTables(monitor, getModelSession(),
225227
new HashSet<>(missingTables), TableType.FINAL,
226228
controlAreaIds);
229+
} else {
230+
tableService.transformTables(monitor, getModelSession(),
231+
new HashSet<>(missingTables), tableType, controlAreaIds);
227232
}
228233

229234
}

java/bundles/org.eclipse.set.ppmodel.extensions/src/org/eclipse/set/ppmodel/extensions/utils/PlanProToTitleboxTransformation.xtend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class PlanProToTitleboxTransformation {
150150
"")
151151
it.set(70, lastPlanungEErstellung?.datum?.wert?.toString(DATE_FORMAT) ?:
152152
"")
153-
val lastPlanPruefung = planungEinzel?.planungEHandlung?.planungEPruefung.lastOrNull
153+
val lastPlanPruefung = planungEinzel?.planungEHandlung?.planungEPruefung?.lastOrNull
154154
it.set(59,
155155
lastPlanPruefung?.handelnder?.akteurAllg?.nameAkteur5?.wert ?:
156156
"")

0 commit comments

Comments
 (0)