Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Extend Sirius Editor with Animation of Simulator
Extend Sirius Editor with Animation of Simulator [message #1602610] Thu, 05 February 2015 17:38 Go to next message
Joel Greenyer is currently offline Joel GreenyerFriend
Messages: 19
Registered: October 2014
Junior Member
Hi,
we are doing simulations inside Eclipse of communicating EMF objects.
Our idea is now to use Sirius to create a graphical representation of the objects (this is not the problem), and then to extend Sirius somehow in order to animate the objects as they communicate.

Can anybody tell me if that is possible or has been done before in some project we could have a closer look at?

The communication is not part of the domain model, but is information inside the simulation engine. GMF has extension points to plug-in external tools that can then highlight elements. Does anything similar exist for Sirius?

As another application example, let's say you would for example have a statechart editor and simulation engine, like for example Yakindu has---and now you would like to highlight the active states after each simulation step... how would you do that? Has anyone done that?

Thanks

Joel
Re: Extend Sirius Editor with Animation of Simulator [message #1603660 is a reply to message #1602610] Fri, 06 February 2015 10:00 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan LussaudFriend
Messages: 59
Registered: July 2009
Member
Hi Joel,

I'm working on the Gemoc project (www.gemoc.org). One part of the project provides animation and debug for model execution. We used Sirius for graphical syntax and we animate Sirius diagrams to show change during execution.

The animation can be based on two kind of changes:
- changes in the model it self
- you will have to make your changes in an EMF transaction (using a RecordingCommand for instance)
- the refresh is done by Sirius
- changes not in the model it self
- you will have to use a service to capture the change
- the refresh must be done by hand using RefreshRepresentationsCommand

regards,
Yvan.
Re: Extend Sirius Editor with Animation of Simulator [message #1609767 is a reply to message #1603660] Tue, 10 February 2015 10:24 Go to previous messageGo to next message
Joel Greenyer is currently offline Joel GreenyerFriend
Messages: 19
Registered: October 2014
Junior Member
Hi Yvan,
this sounds interesting. So you mention "a service to capture the change". Can you tell me a bit more about that? Is that something you have built into Sirius? Is it an extension point?
What do you mean by "the refresh must be done by hand using RefreshRepresentationsCommand".

Is there any way to have a look at the implementation?

Best regards

Joel
Re: Extend Sirius Editor with Animation of Simulator [message #1612885 is a reply to message #1609767] Thu, 12 February 2015 09:07 Go to previous message
Yvan Lussaud is currently offline Yvan LussaudFriend
Messages: 59
Registered: July 2009
Member
Hi,

I will use a state machine as example and the change to monitor will be the current state. The current state is a variable in the simulation process and is not represented in the EMF model.
So you need a service to be able to get the current state from the simulator process. A service is a way to call a Java method from Sirius:
http://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods
This service can then be used to change the style of a state if it's the current state.
But at this point even if you can get the value from the simulator Sirius don't know when the current state is changed by the simulation process and the service will not be called. In order to do that the simulation process should refresh the Sirius editor after changing the current state value. This can be done using the RefreshRepresentationsCommand:

for (IEditingSession session : SessionUIManager.INSTANCE.getUISessions()) {
final TransactionalEditingDomain transactionalEditingDomain = session.getSession().getTransactionalEditingDomain();
final List<DRepresentation> representations = new ArrayList<DRepresentation>();
// TODO find the representation using the current state service

final RefreshRepresentationsCommand refresh = new RefreshRepresentationsCommand(transactionalEditingDomain, new NullProgressMonitor(), representations);
transactionalEditingDomain.getCommandStack().execute(refresh);

In this code I assume the Sirius editor is already opened. I hope it helps Smile

Yvan.
Previous Topic:Why this error
Next Topic:Expand and collapse Container
Goto Forum:
  


Current Time: Wed Jan 20 04:44:10 GMT 2021

Powered by FUDForum. Page generated in 0.02126 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top