Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-factor of the package #8

Open
6 of 7 tasks
ipa-nhg opened this issue Apr 15, 2021 · 1 comment · Fixed by #14
Open
6 of 7 tasks

Re-factor of the package #8

ipa-nhg opened this issue Apr 15, 2021 · 1 comment · Fixed by #14
Assignees

Comments

@ipa-nhg
Copy link
Member

ipa-nhg commented Apr 15, 2021

The purpose of this package is to support the .ros and the .rossystem models from python. For that we started creating mainly 2 modules:

  • Parsers for the models
  • Generators for the models

Ideally behind of these both modules we should create a common one that define the metamodels. A set of classes that describes the models and their attributes together with the Xtext code generator.

The PR #7 started this re-structuration

The first draft of this new modules, can be found under: https://github.com/ipa320/ros_model_parser/blob/d22d42278fd8319f9e21b6781992cb7a295a0b69/src/metamodel/metamodel_core.py

There we have together both models (ros and rossystem), we could separate both into 2 different files and have a dependency from rossystem to ros (they shared the definition of parameters).

In comparison with the ecore metamodels we are still missing:

  • The definition of the PackageSet and Package class for the .ros model, currently it starts with the Node
  • The proper support of components for the .rossystem model

Once the metamodel definition is complete, both, the parsers and the generators should be updated to use them.

With this approach the generators will be simplified and the create model functions will only have to call the dump_xtext_model for the upper layer of the model (PackageSet class for the .ros and RosSystem class for the .rossystem model).

For the parser instead of create local string variables to store the value of the attributes, we can create a proper model with the proper structure and fill it by parsing the selected file.

Summary of ToDos (starting from #7):

  • For consistency, split the metamodels_core.py into ros_metamodel_core.py and rossystem_metamodel_core.py (@ipa-nhg ) done in split the ros and rossystem metamodels into 2 different files #9
  • Complete the ros_metamodel_core.py: add PackageSet, CatkinPackage, Specs... Also a review of the nomenclature will be needed (for example the ecore model define fullname and name for the interfaces, while the current py code uses resolved and name) (@ipa-nhg )
  • Complete the rossystem_metamodel_core.py , the main issue here now is the definition of the references (@ipa-hsd )
  • Update the parsers to use the new modules and the provided script examples
  • Update the generators to use the new modules and the provided script examples

Apart of this the following 3 repositories will have to be updated:

@ipa-hsd please complete if needed

@hsd-dev
Copy link
Collaborator

hsd-dev commented Apr 20, 2021

@ipa-nhg ipa-nhg linked a pull request Apr 28, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants