Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » AnsiCLibrary does not seem to be loaded
AnsiCLibrary does not seem to be loaded [message #1803937] Wed, 13 March 2019 22:26 Go to next message
reza ahmadi is currently offline reza ahmadiFriend
Messages: 47
Registered: September 2016
Member
Hi,

I have a stand-alone Java application that processes UML-RT models.

This application processes the message parameter and capsule attribute types. In a model, if a message parameter or attribute type is based on the types defined in the "PrimitiveTypes" library package, my tool can successfully recognize the type of that message parameter or attribute. However, if types defined the model library AnsiCLibrary are used, the PrimitiveType attribute is null, which suggests that AnsiCLibrary is not loaded.

In my application, I load the resources required using, e.g.,
myResourceSet.getPackageRegistry().put(RTCppPropertiesPackage.eNS_URI, RTCppPropertiesPackage.eINSTANCE);

to load UML-RT profile.

But I cannot find which resource should be loaded in my application to be able to successfully load the types defined in AnsiCLibrary.

For example, if a capsule attribute X is defined in a model and its type is unsigned int (which has been defined in AnsiCLibrary model library), when I read the attributes in that capsule, X.getType().getName() equals null. However, if X is typed Integer (which has been defined in PrimaryTypes model library), X.getType().getName() returns "Integer".


Thanks for any help,
Reza
Re: AnsiCLibrary does not seem to be loaded [message #1803938 is a reply to message #1803937] Wed, 13 March 2019 22:43 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 381
Registered: March 2011
Senior Member
If you are asking at the modelling level:

- If you create the model with the New Papyrus Project wizard, select the UML-RT architecture context, and click [Next] twice (rather than [Finish]), and you select "UML for C++" under "You can load a template", the AnsiCLibrary will be automatically imported into the new model.

- If you are dealing with a model not created like that, right-click on the root element in the model explorer, select "Import > Import Registered Package", and in the dialog you should see the AnsiCLibrary.

If you are asking how to do it programmatically, get the Papyrus-RT sources from git, and search for "AnsiCLibrary". Also look at the org.eclipse.papyrusrt.xtumlrt.external plugin, which provides a class that can be used to load resources, libraries, profiles, etc. specially useful for standalone (non-eclipse-based) applications. This is used in the code generator. Take a look at org.eclipse.papyrusrt.codegen.cpp.AnsiCLibraryMetadata and org.eclipse.papyrusrt.codegen.cpp.AbstractUMLRT2CppCodeGenerator.java:62.

Re: AnsiCLibrary does not seem to be loaded [message #1803988 is a reply to message #1803938] Thu, 14 March 2019 22:47 Go to previous message
reza ahmadi is currently offline reza ahmadiFriend
Messages: 47
Registered: September 2016
Member
My case was the last one.
Thank you very much, Ernesto! Very helpful!
Previous Topic:Use externally defined structure in a signal
Next Topic:Implement network socket interface
Goto Forum:
  


Current Time: Mon Sep 23 20:05:53 GMT 2019

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

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

Back to the top