#%VASE-API=2.0%
#######################################################################################################################
# COPYRIGHT
# -------------------------------------------------------------------------------------------------------------------
# \verbatim
# Copyright (c) 2018 by Vector Informatik GmbH. All rights reserved.
#
# This software is copyright protected and proprietary to Vector Informatik GmbH.
# Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
# All other rights remain with Vector Informatik GmbH.
# \endverbatim
# -------------------------------------------------------------------------------------------------------------------
# FILE DESCRIPTION
# -----------------------------------------------------------------------------------------------------------------*/
# \brief VASE script to insert the AccessPermissionRef in a DiagnosticRoutineControl according to AR 4.2.2
#######################################################################################################################
#
#######################################################################################################################
# AUTHOR IDENTITY
# -------------------------------------------------------------------------------------------------------------------
# Name Initials Company
# -------------------------------------------------------------------------------------------------------------------
# Andoni Rendon Borobia visrai Vector Informatik GmbH
# -------------------------------------------------------------------------------------------------------------------
# REVISION HISTORY
# -------------------------------------------------------------------------------------------------------------------
# Version Date Author Change Id Description
# -------------------------------------------------------------------------------------------------------------------
# 1.00.00 2018-11-23 visrai - initial version
#
#######################################################################################################################
import clr
import os
import sys
import cStringIO
clr.AddReference("GenTool_CsDataServerDomAsr4.dll")
from System.Collections.Generic import List
from GenTool_CsDataServerDomAsr4.Iface import * #LEnum, IDomain, IReferrableType
from GenTool_CsDataServerDomAsr4.Model import * #Model
#from GenTool_CsDataServerDomAsr4.Transfer.Iface.Builder import IBuilder, #ICopyBuilder, IMoveBuilder
#from #GenTool_CsDataServerDomAsr4.Transfer.Iface #import #ITransferer
def Find(qualifiedPathName):
return model.Find(qualifiedPathName)
def Log(message):
logger.Log(3,message)
#---#-------------------------------------------------------------------------------------------------------------
#-----------------------------------FindFirstAutosarArPackage(Root)----------------------------------------------
def FindDiagnosticRoutine(Arpackage, diagnosticRoutineCollector):
if hasattr(Arpackage, "ElementList"):
for element in Arpackage.ElementList:
if type(element) is VDiagnosticRoutine:
diagnosticRoutineCollector.Add(element)
for child_arPackage in Arpackage.ArPackageList:
if child_arPackage is not None:
FindDiagnosticRoutine(child_arPackage, diagnosticRoutineCollector)
#########################################################################################################################################################################################################
def MoveAccessPermissionToDiagnosticRoutineControl(diagnosticRoutineCollector, logFile):
#find referenced DiagnosticRoutineControl and add to collector
diagnosticRoutineAndDiagnosticRoutineControl = []
try:
for collectedDiagnosticRoutine in diagnosticRoutineCollector:
referencedByList = collectedDiagnosticRoutine.ReferencedFromList
for referencedby in referencedByList:
if type(referencedby.Owner) is VDiagnosticRoutineControl:
#find current index in the
#diagnosticRoutineAndDiagnosticRoutineControl
#####################################################################################################
if diagnosticRoutineAndDiagnosticRoutineControl.Count == 0:
actualIndex = 0
else:
actualIndex = diagnosticRoutineAndDiagnosticRoutineControl.Count
#####################################################################################################
diagnosticRoutineAndDiagnosticRoutineControl.append([])
#Save the DiagnoticRoutine and DiagnosticRoutineControl in the Collector
#####################################################################################################
diagnosticRoutineAndDiagnosticRoutineControl[actualIndex].append(collectedDiagnosticRoutine)
diagnosticRoutineAndDiagnosticRoutineControl[actualIndex].append(referencedby.Owner)
#####################################################################################################
for collectedmappedDiagnosticRoutine in diagnosticRoutineAndDiagnosticRoutineControl:
allSubfunctions = []
securityLevelsComparer = []
diagnosticRoutine = collectedmappedDiagnosticRoutine[0]
diagnosticRoutineControl = collectedmappedDiagnosticRoutine[1]
start = None
stop = None
requestResult = None
if diagnosticRoutine.StartSpecified == True:
start = diagnosticRoutine.Start
allSubfunctions.append(start)
if diagnosticRoutine.StopSpecified == True:
stop = diagnosticRoutine.Stop
allSubfunctions.append(stop)
if diagnosticRoutine.RequestResultSpecified == True:
requestResult = diagnosticRoutine.RequestResult
allSubfunctions.append(requestResult)
for subfunction in allSubfunctions:
if subfunction is not None:
if subfunction.AccessPermissionSpecified == True:
accessPermissionRef = subfunction.AccessPermission
#find accessPermision
findAccessPermission = model.Find(accessPermissionRef.Value)
if findAccessPermission.Count >0:
accessPermission = findAccessPermission[0]
#find SecurityLevel
if accessPermission.SecurityLevelList.Count > 0:
securityLevelsFound = []
for securityLevel in accessPermission.SecurityLevelList:
#find SecurityLevel
findSecurityLevel = model.Find(securityLevel.Value)
if findSecurityLevel.Count > 0:
foundSecurityLevel = findSecurityLevel[0]
securityLevelsFound.append(foundSecurityLevel)
if securityLevelsComparer.Count == 0:
actualIndex = 0
else:
actualIndex = securityLevelsComparer.Count
securityLevelsCom
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Vector AUTOSAR Components各个BSW模块。 1、BSWMD文件:存放arxm文件; 2、Documentation文件:存放关于BswM模块相关配置的说明文档pdf; 3、GeneratorMsr文件:BswM生成相关的工具文件*.jar; 4、Implementation文件:BswM模块的静态代码包括.c,.h; 5、Make文件:makefile编译BswM所支持的*mak文件。
资源推荐
资源详情
资源评论
收起资源包目录
Vector AUTOSAR Components BSW模块:MSR_Bmw_SLP4.zip (9个子文件)
MSR_Bmw_SLP4
BSWMD
Dcm_Preo.arxml 2KB
NvM_preo.arxml 1KB
Com_preo.arxml 2KB
FrNm_preo.arxml 7KB
CanIf_preo.arxml 2KB
CanNm_preo.arxml 35KB
Nm_preo.arxml 20KB
EcuC_preo.arxml 2KB
DaVinciCfg_AutomationScripts
MergeAccessPermission.py 14KB
共 9 条
- 1
资源评论
不脱发的程序猿
- 粉丝: 26w+
- 资源: 5881
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功