Skip to content

Commit 4236115

Browse files
authored
Merge pull request #4 from vectorgrp/release-v1.8.x
OCS Domain Plugin Release v1.8.0
2 parents 318f5f1 + b3be32d commit 4236115

File tree

6 files changed

+137
-57
lines changed

6 files changed

+137
-57
lines changed

README.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ customization of the gradle properties.
4747
### Customization of the Gradle properties
4848
Within the `ocs-domain-plugins` folder you can find the `gradle.properties` file:
4949
```
50-
//localSipStore=path/to/sip/store/directory
51-
//localSip=path/to/used/sip/external
50+
#localSipStore=path/to/sip/store/directory
51+
#localSip=path/to/used/sip/external
5252
ocsRepo=../repository
5353
54-
vOcsCore=1.6.0
55-
vPluginsCommon=1.4.0
56-
vOcsCom=1.7.0
57-
vOcsDiag=1.7.0
58-
vOcsNvM=1.7.0
59-
vOcsEcuState=1.7.0
60-
vOcsRuntime=1.7.0
61-
vOcsSecurity=1.5.0
54+
vOcsCore=1.7.0
55+
vPluginsCommon=1.5.0
56+
vOcsCom=1.8.0
57+
vOcsDiag=1.8.0
58+
vOcsNvM=1.8.0
59+
vOcsEcuState=1.8.0
60+
vOcsRuntime=1.8.0
61+
vOcsSecurity=1.6.0
6262
```
6363
Based on the folder structure example above the explanation of the properties becomes easier.
6464
Adapt the properties as following:
@@ -67,14 +67,14 @@ localSipStore=D:/dev/ocs/BswPackages
6767
localSip=MICROSAR_Classic_R31
6868
ocsRepo=../repository
6969
70-
vOcsCore=1.6.0
71-
vPluginsCommon=my-company-1.4.0
72-
vOcsCom=my-company-1.7.0
73-
vOcsDiag=my-company-1.7.0
74-
vOcsNvM=my-company-1.7.0
75-
vOcsEcuState=my-company-1.7.0
76-
vOcsRuntime=my-company-1.7.0
77-
vOcsSecurity=my-company-1.5.0
70+
vOcsCore=1.7.0
71+
vPluginsCommon=my-company-1.5.0
72+
vOcsCom=my-company-1.8.0
73+
vOcsDiag=my-company-1.8.0
74+
vOcsNvM=my-company-1.8.0
75+
vOcsEcuState=my-company-1.8.0
76+
vOcsRuntime=my-company-1.8.0
77+
vOcsSecurity=my-company-1.6.0
7878
```
7979
The `localSipStore` should point to the root directory of the BSW Packages while the `localSip` itself mentions a
8080
dedicated BSW Package against which the source code will be compiled. The gradle project of the `ocs-custom-app` and
@@ -120,18 +120,18 @@ C:\Users\<your user account>\.m2\repository\com\vector\ocs\plugins\ocs-communica
120120
This step will look quite familiar to you. In the root folder of the `ocs-custom-app` you find the `gradle.properties`
121121
file:
122122
```
123-
//localSipStore=path/to/sip/store/directory
124-
//localSip=path/to/used/sip/
123+
#localSipStore=path/to/sip/store/directory
124+
#localSip=path/to/used/sip/
125125
ocsRepo=../repository
126126
127-
vOcsCore=2.1.0
128-
vPluginsCommon=1.4.0
129-
vOcsCom=1.7.0
130-
vOcsDiag=1.7.0
131-
vOcsNvM=1.7.0
132-
vOcsEcuState=1.7.0
133-
vOcsRuntime=1.7.0
134-
vOcsSecurity=1.5.0
127+
vOcsCore=2.2.0
128+
vPluginsCommon=1.5.0
129+
vOcsCom=1.8.0
130+
vOcsDiag=1.8.0
131+
vOcsNvM=1.8.0
132+
vOcsEcuState=1.8.0
133+
vOcsRuntime=1.8.0
134+
vOcsSecurity=1.6.0
135135
```
136136
The `localSipStore`, `localSip` and `ocsRepo` should be configured in the same way as for the `ocs-domain-plugins`.
137137
If you keep the other version numbers as stated in the file you would build the OCS Custom App based on the Vector
@@ -142,14 +142,14 @@ localSipStore=D:/dev/ocs/BswPackages
142142
localSip=MICROSAR_Classic_R31
143143
ocsRepo=../repository
144144
145-
vOcsCore=1.6.0
146-
vPluginsCommon=my-company-1.4.0
147-
vOcsCom=my-company-1.7.0
148-
vOcsDiag=my-company-1.7.0
149-
vOcsNvM=my-company-1.7.0
150-
vOcsEcuState=my-company-1.7.0
151-
vOcsRuntime=my-company-1.7.0
152-
vOcsSecurity=my-company-1.5.0
145+
vOcsCore=1.7.0
146+
vPluginsCommon=my-company-1.5.0
147+
vOcsCom=my-company-1.8.0
148+
vOcsDiag=my-company-1.8.0
149+
vOcsNvM=my-company-1.8.0
150+
vOcsEcuState=my-company-1.8.0
151+
vOcsRuntime=my-company-1.8.0
152+
vOcsSecurity=my-company-1.6.0
153153
```
154154
Please note that the gradle project of the OCS Custom App is prepared in a way that it handles the ocsRepo as well as
155155
the local maven repository.
@@ -179,6 +179,7 @@ Beside the mentioned dependencies the shared gradle project may point to additio
179179
|---------|--------------------------------|------------------------------------|
180180
| v1.6.0 | MICROSAR Automation SDK v1.5.0 | R31 - R34 |
181181
| v1.7.0 | MICROSAR Automation SDK v1.6.0 | R31 - R34 |
182+
| v1.8.0 | MICROSAR Automation SDK v1.7.0 | R31 - R34 |
182183

183184
## Abbreviations
184185
| Abbreviation | Description |

gradle.properties

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ org.gradle.parallel=true
22
org.gradle.caching=true
33
org.gradle.daemon=true
44

5-
//localSipStore=path/to/sip/store/directory
6-
//localSip=path/to/used/sip/external
5+
#localSipStore=path/to/sip/store/directory
6+
#localSip=path/to/used/sip/external
77
ocsRepo=../repository
88

9-
vOcsCore=1.6.0
10-
vPluginsCommon=1.4.0
11-
vOcsCom=1.7.0
12-
vOcsDiag=1.7.0
13-
vOcsNvM=1.7.0
14-
vOcsEcuState=1.7.0
15-
vOcsRuntime=1.7.0
16-
vOcsSecurity=1.5.0
9+
vOcsCore=1.7.0
10+
vPluginsCommon=1.5.0
11+
vOcsCom=1.8.0
12+
vOcsDiag=1.8.0
13+
vOcsNvM=1.8.0
14+
vOcsEcuState=1.8.0
15+
vOcsRuntime=1.8.0
16+
vOcsSecurity=1.6.0

plugins/ocs-diagnostics-plugin/src/main/kotlin/com/vector/ocs/plugins/diagnostics/application/service/ConfigureDiagnosticsService.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import com.vector.ocs.plugins.diagnostics.EDefaultDcmBuffer
4242
import com.vector.ocs.plugins.diagnostics.EDefaultDebouncingStrategy
4343
import com.vector.ocs.plugins.diagnostics.application.port.`in`.ConfigureDiagnosticsUseCase
4444
import com.vector.ocs.plugins.diagnostics.application.port.out.cfgAPI.ConfigServiceAPI
45-
import com.vector.ocs.plugins.diagnostics.constants.DcmDefRefs
4645
import com.vector.ocs.plugins.diagnostics.constants.DiagnosticConstants
4746
import com.vector.ocs.plugins.diagnostics.constants.NvMDefRefs
4847
import com.vector.ocs.plugins.diagnostics.domain.ComM.ComM
@@ -97,8 +96,15 @@ class ConfigureDiagnosticsService(
9796

9897
// Set reference to DcmDsdServiceTable
9998
if (model.defaultDcmServiceTableAssignment == true) {
100-
currentProtocolRow.dcmDsdServiceTableRef = dcm.dcmDsdServiceTableList[index]
101-
logger.infoMessage("Setting default Service Table " + dcm.dcmDsdServiceTableList[index].shortName + " set as reference for protocol row " + currentProtocolRow.shortName + ".")
99+
val serviceTableRef = if (index < dcm.dcmDsdServiceTableList.size) {
100+
dcm.dcmDsdServiceTableList[index]
101+
} else {
102+
// Fallback to the first service table if index exceeds the list size
103+
dcm.dcmDsdServiceTableList.first()
104+
}
105+
106+
currentProtocolRow.dcmDsdServiceTableRef = serviceTableRef
107+
logger.infoMessage("Setting Service Table " + serviceTableRef.shortName + " as reference for protocol row " + currentProtocolRow.shortName + ".")
102108
}
103109

104110
// Add DcmDslBuffer

plugins/ocs-ecustatemanagement-plugin/src/main/groovy/com/vector/ocs/plugins/ecustatemanagement/EcuStateManagementScript.groovy

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,20 +357,28 @@ class EcuStateManagementScript {
357357
modeManagement { modeMngt ->
358358
if (bswMConfigs.size() > 0) {
359359
try {
360-
getBswMAutoConfigDomains(bswMConfigs.first).each { autoConfigurationDomain ->
360+
MIContainer bswMConfigContainer
361+
if (!distinctNewModeManagementApiUsage()) {
362+
// Former API usage
363+
bswMConfigContainer = bswMConfigs.first
364+
} else {
365+
// New API usage
366+
bswMConfigContainer = null
367+
}
368+
getBswMAutoConfigDomains(bswMConfigContainer).each { autoConfigurationDomain ->
361369
if (null != autoConfigurationDomain.identifier && "Module Initialization" != autoConfigurationDomain.identifier) {
362370
switch (autoConfigurationDomain.identifier) {
363371
case "Communication Control":
364372
logger.info("Processing Communication Control domain.")
365-
CommunicationControl.initializeAndProcessDomain(model, modeMngt, autoConfigurationDomain.identifier, bswMConfigs.first, logger)
373+
CommunicationControl.initializeAndProcessDomain(model, modeMngt, autoConfigurationDomain.identifier, bswMConfigContainer, logger)
366374
break
367375
case "Ecu State Handling":
368376
logger.info("Processing Ecu State Handling domain.")
369-
EcuStateHandling.initializeAndProcessDomain(model, modeMngt, autoConfigurationDomain.identifier, bswMConfigs.first, logger)
377+
EcuStateHandling.initializeAndProcessDomain(model, modeMngt, autoConfigurationDomain.identifier, bswMConfigContainer, logger)
370378
break
371379
case "Service Discovery Control":
372380
logger.info("Processing Service Discovery Control domain.")
373-
ServiceDiscoveryControl.initializeAndProcessDomain(model, modeMngt, autoConfigurationDomain.identifier, bswMConfigs.first, logger)
381+
ServiceDiscoveryControl.initializeAndProcessDomain(model, modeMngt, autoConfigurationDomain.identifier, bswMConfigContainer, logger)
374382
break
375383
default:
376384
logger.info("Unknown AutoConfigurationDomain identifier detected '$autoConfigurationDomain.identifier'")
@@ -427,4 +435,21 @@ class EcuStateManagementScript {
427435
}
428436
initItem.ecuMModuleServiceOrCreate.value = initFunction.shortname
429437
}
438+
439+
/**
440+
* Certain DaVinci Configurator Service Pack versions require distinct ways to call the Mode Management comfort APIs.
441+
* This method checks the corresponding minor version and service pack version.
442+
* @return true if new API handling is required, otherwise false.
443+
*/
444+
static boolean distinctNewModeManagementApiUsage() {
445+
Number minorVersion = PluginsCommon.Cfg5MinorVersion()
446+
Number cfg5ServicePackVersion = PluginsCommon.Cfg5ServicePackVersion()
447+
boolean useNewApi = false
448+
if ((minorVersion == 29 && cfg5ServicePackVersion >= 5) || /* R32 */
449+
(minorVersion == 30 && cfg5ServicePackVersion >= 4) || /* R33 */
450+
(minorVersion == 31 && cfg5ServicePackVersion >= 2)) { /* R34 */
451+
useNewApi = true
452+
}
453+
return useNewApi
454+
}
430455
}

plugins/ocs-plugins-shared-lib/src/main/groovy/com/vector/ocs/lib/shared/PluginsCommon.groovy

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,20 @@ class PluginsCommon {
165165
int cfgMinorVersion = daVinciVersion.substring(2, 4).toInteger()
166166
return cfgMinorVersion
167167
}
168+
169+
/**
170+
* Determines the service pack version of the DaVinci Configurator Classic (CFG5)
171+
* @return cfgServicePackVersion is the service pack version of the DaVinci Configurator Classic (CFG5), or 0 for major version
172+
*/
173+
static Number Cfg5ServicePackVersion() {
174+
int cfgServicePackVersion = 0
175+
String versionString = ScriptApi.scriptCode.getInstance(IProductVersionApiEntryPoint.class).versions.daVinciConfiguratorVersion
176+
String daVinciVersion = versionString.replace("DaVinciConfigurator\t", "")
177+
String[] cfgServicePackVersionSplit = daVinciVersion.split(" ")
178+
// Example: 5.29.50 SP5 > [5.29.50, SP5]
179+
if (cfgServicePackVersionSplit.size() > 1) {
180+
cfgServicePackVersion = cfgServicePackVersionSplit[1].replace("SP", "").toInteger()
181+
}
182+
return cfgServicePackVersion
183+
}
168184
}

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)