Skip to content

aas-core-works/aas-smt-codegen

Repository files navigation

aas-smt-codegen

Continuous integration Test coverage

aas-smt-codegen:

  • ... generates code for different schemas and programming environments
  • ... to handle AAS Submodel Templates
  • ... based on the AAS Submodel Template definition given as AAS environment.

Installation

Create a virtual environment:

python -m venv venv

Activate it (in Windows):

venv\Scripts\activate

or in Linux and OS X:

source venv/bin/activate

Install the tool in the virtual environment from the GitHub:

pip3 install git+https://github.com/aas-core-works/aas-smt-codegen.git

The development is still very fast, so we decided to wait till it slows down for proper release cycles.

Usage

Download a submodel template from https://industrialdigitaltwin.org/en/content-hub/submodels or write your own and serialize it either as a JSON or XML file.

Make sure you are within the virtual environment where you installed the generator.

Write all the necessary implementation-specific snippets to a directory. For example, in case of JSON schema for value-only representation, this includes the base JSON schema, mapping of identifier to JSON references for external structures as well as mapping of identifiers to JSON names for local structures (see test_data/value_only_schema/*/snippets for concrete examples).

Call the generator with the appropriate target:

aas-smt-codegen \
    --smt path/to/submodel-template.json \
    --snippets_dir path/to/snippets \
    --output_dir path/to/output \
    --target value_only_schema

--help

usage: aas-smt-codegen [-h] --smt SMT --snippets_dir SNIPPETS_DIR --output_dir
                       OUTPUT_DIR --target {value-only-schema} [--version]

Transpile AAS Submodel Templates.

options:
  -h, --help            show this help message and exit
  --smt SMT             Path to the AAS submodel template
  --snippets_dir SNIPPETS_DIR
                        path to the directory containing implementation-
                        specific code snippets
  --output_dir OUTPUT_DIR
                        path to the generated code
  --target {value-only-schema}
                        target language or schema
  --version             show the current version and exit

Versioning

We are still not clear about how to version the generator. At the moment, since we are still in a fast development phase, we simply rely on Git commit revisions.

Contributing

Feature requests or bug reports are always very, very welcome!

Please see quickly if the issue does not already exist in the issue section and, if not, create a new issue.

Contributions in code are also welcome! Please see CONTRIBUTING.rst for developing guidelines.

About

Transpile AAS Submodel Templates.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages