Skip to content

Commit 4dc41c5

Browse files
committed
Create missing BswEvent container in Rte if necessary
1 parent ea010da commit 4dc41c5

1 file changed

Lines changed: 36 additions & 4 deletions

File tree

plugins/ocs-runtimesystem-plugin/src/main/groovy/com/vector/ocs/plugins/runtimesystem/RuntimeSystemConnectAndMap.groovy

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,20 +244,21 @@ class RuntimeSystemConnectAndMap {
244244
handleInterruptMapping(model.interruptMapping.userDefinedMapping, model.interruptMapping.defaultIsrApplication, logger)
245245

246246
// 4. Map runnables to tasks
247+
logger.debug("Check that Rte module is available.")
248+
Boolean isRtePresent = PluginsCommon.ConfigPresent(RuntimeSystemConstants.RTE_DEFREF)
249+
if (isRtePresent) {
250+
triggerRteSolvingActionForCreationOfMissingBswEventContainer(logger)
251+
}
247252
handleTaskMapping(model.taskMapping.userDefinedMapping, model.taskMapping.defaultBswTask, model.cores, logger)
248253

249254
// 5. Trigger RTE solving action to fix the runnable order
250-
logger.debug("Check that Rte module is available.")
251-
Boolean isRtePresent = PluginsCommon.ConfigPresent(RuntimeSystemConstants.RTE_DEFREF)
252255
if (isRtePresent) {
253256
triggerRteSolvingActionForRunnableOrder(logger)
254-
}
255257

256258
// 6. Trigger calculation phase of the Rte to create additional Os configuration
257259
// Currently it is not clear if this operation could be also done in another context, e.g. individual file
258260
// which address the Rte configuration parts. Therefore for not it is kept here but the Rte.DefRef is not
259261
// directly used. instead the DefRef is created itself in the triggerRteCalculation()
260-
if (isRtePresent) {
261262
triggerRteCalculation(logger)
262263
}
263264

@@ -918,6 +919,37 @@ class RuntimeSystemConnectAndMap {
918919
}
919920
}
920921

922+
/**
923+
* Trigger the following solving action of the RTE BSW module.<br>
924+
* <ul>
925+
* <li>RTE1009</li>
926+
* </ul>
927+
* @param logger
928+
*/
929+
private static void triggerRteSolvingActionForCreationOfMissingBswEventContainer(OcsLogger logger) {
930+
activeProject() { IProject project ->
931+
PluginsCommon.modelSynchronization(project, logger)
932+
// Justify missing return statement because it could be the case that no solving action appears
933+
//noinspection GroovyMissingReturnStatement
934+
validation {
935+
final String RTE = "RTE"
936+
Collection<IValidationResultUI> rte1009Results = validationResults.findAll { IValidationResultUI iValidationResults ->
937+
iValidationResults.isId(RTE, 1009) && iValidationResults.isActive()
938+
}
939+
if (!rte1009Results.isEmpty()) {
940+
solver.solve {
941+
result {
942+
isId(RTE, 1009)
943+
}.withAction {
944+
logger.info("Trigger RTE1009 solving action.")
945+
solvingActions.first
946+
}
947+
}
948+
}
949+
}
950+
}
951+
}
952+
921953
/**
922954
* Trigger the following solving action of the COM BSW module.<br>
923955
* <ul>

0 commit comments

Comments
 (0)