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

Improve management of ALE when used as SiriusInterpreter #45

Merged
merged 3 commits into from Jul 24, 2020

Conversation

dvojtise
Copy link
Contributor

@dvojtise dvojtise commented Jul 22, 2020

Description

This PR makes ALE interperter available all the time as a SiriusInterpreter (ie. a SiriusInterpreter is an interpreter used by Sirius in the odesign fields) (It was previously available only when running a single engine)

Expression in Sirius can now use ale: queries for both displaying runtime data while running a model AND displaying static information while editing a model (ie. as a replacement of [ /] or aql: queries)

This PR also fixes the display of ale: queries in Sirius 6.3.0 when no model is running (cf. #44)

This PR also provides a support for multiple model execution at the same time. (In the previous version, only one engine was available to provide runtime data to the SiriusIntepreter )

Changes

  • the classes have been renamed in order to clearly show the relationship with SiriusInterpreter
  • the ALESiriusInterpreterProvider is registered using the extension point in the plugin.xml
  • ALESiriusInterpreter is now a singleton, engines register themselves as known engines. When evaluating a query, ALESiriusInterpreter either find the appropriate ALEEngine or creates a new one able to evaluate queries relative only to the static part of the model. A small cache avoid creating ALEEngine on every call.
  • a new EngineAddon is used to dispose the resources when an engine is definitively closed
  • the Launcher (launch configuration) implicitly registers the newly created engine to the known engines of ALESiriusInterpreter singleton. The launcher also implicitly adds the EngineAddon to the engine in order to unregister and free all the resources.

Contribution to issues

Closes #44
Contributes to gemoc/ale-lang#150

Companion Pull Requests

use an EngineAddon to register/unregister engines that are used by the
ALESiriusInterpreter

Enable ALESiriusInterpreter in edition mode (in addition to run mode)

fix #44

Signed-off-by: Didier Vojtisek <didier.vojtisek@inria.fr>
Signed-off-by: Didier Vojtisek <didier.vojtisek@inria.fr>
@dvojtise dvojtise added bug Something isn't working enhancement New feature or request labels Jul 22, 2020
@dvojtise dvojtise changed the title Improve management of ale when used as SiriusInterpreter Improve management of ALE when used as SiriusInterpreter Jul 22, 2020
@ebousse
Copy link
Contributor

ebousse commented Jul 22, 2020

very nice!

Makes me think that a rather fun thing would be a generic SiriusInterpreter able to retrieve runtime data defined with any sort of metaprogramming approach.

@dvojtise
Copy link
Contributor Author

Makes me think that a rather fun thing would be a generic SiriusInterpreter able to retrieve runtime data defined with any sort of metaprogramming approach.

This would be cool indeed because currently every engine provides its own way to access its RTD. Having a way to register "RTD Accessor service" in the GEMOC framework would probably help to design Sirius animation layers.

Signed-off-by: Didier Vojtisek <didier.vojtisek@inria.fr>
@dvojtise dvojtise merged commit 6b5174b into master Jul 24, 2020
@dvojtise dvojtise deleted the improve_ale_sirius_interpreter_management branch May 26, 2021 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect management of ale engine registration for use in odesign queries
2 participants