1 Star 1 Fork 3

Sgnes/autosar

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
README.rst 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
cogu 提交于 2017-01-02 18:27 . readme fix

AUTOSAR

A set of python modules for working with AUTOSAR XML files

Usage:

>>> import autosar
>>> ws = autosar.workspace()
>>> ws.loadXML('DataTypes.arxml', roles={'/DataType': 'DataType'})
>>> ws.loadXML('Constants.arxml', roles={'/Constant': 'Constant'})
>>> ws.loadXML('PortInterfaces.arxml', roles={'/PortInterface': 'PortInterface'})
>>> package = ws.createPackage('ComponentType', role='ComponentType')
>>> swc = package.createApplicationSoftwareComponent('EngineStart')
>>> swc.createProvidePort('EngineStartControlStatus', 'EngineStartControlStatus_I', initValueRef='C_EngineStartControlStatus_IV')
>>> swc.createRequirePort('EngStartProhibByTransm', 'EngStartProhibByTransm_I', initValueRef='C_EngStartProhibByTransm_IV')
>>> portAccessList = ['EngStartProhibByTransm', 'EngineStartControlStatus']
>>> swc.behavior.createRunnable('EngineStart_run', portAccess=portAccessList)
>>> swc.behavior.createTimingEvent('EngineStart_run', period=20)
>>> ws.saveXML('EngineStart.arxml', packages=['ComponentType'])

Prerequisites

Python 3.x

Documentation

The documentation can be found here.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/sgnes/autosar.git
git@gitee.com:sgnes/autosar.git
sgnes
autosar
autosar
master

搜索帮助