|Re: C++ Code generation help needed? [message #1274601 is a reply to message #1273928]
||Fri, 21 March 2014 17:55
| Stephen Blackwell
Registered: March 2014
My ultimate goal is to move away from Rhapsody.|
My Rhapsody models contain some complicated state charts including parallel states, embedded or sub-state charts and derived state charts.
My immediate goal to to determine if Eclipse/Papyrus/Acceleo/??? can do the job.
To that end I want to start creating the simplest project I can, my "hello world" project, and run through all the steps to build and validate a model, generate, compile and build a C++ program.
Then I will slowly start to increase the complexity of the model to see what limtations and problems I run into.
As far as I can tell from what I've read, this should be possible but I have not found any useful examples or tutorials to get started.
So again, if anybody knows or any such documentation, please post a link.
The documentation that I have read for both Papyrus and Acceleo is, shall we say, obtuse.
FWIW, I would be happy to help improve the documentation.
|Re: C++ Code generation help needed? [message #1309294 is a reply to message #1307464]
||Tue, 22 April 2014 15:59
|| Ansgar Radermacher
Registered: March 2011
Location: Paris Saclay, France
Papyrus comes with a Acceleo based C++ code generator, the CDT editing feature is still experimental. It would be good to hear your feedback what works and what does not.
Although the work has been done on a Linux machine, the use of "/" instead of "\" should not impose any problems on Windows with mingw, cygwin or Visual C++. But you need eventually setup your include paths properly in the CDT project settings.
There are two different ways to use the C++ code generation. The first is the direct production of a C++ file (.cpp/.h) that belongs to the model element, the 2nd a support for component based modeling, including the generation of code from a so-called deployment plan. The idea is that a deployment plan describes instances and their allocation to hardware nodes. This approach is inspired by the CORBA Component Model (CCM).
There is a HelloWorld sample model for the 2nd way. It requires to
(1) Install Qompass designer from the Papyrus extensions
(2) Create an empty project (could be a CDT project, but does not have to be)
(3) Select the created project and choose FILE>New>Example.
(4) Select "Qompass Hello World example" from the list.
(5) Open the created example and select the deployment tab. Generate code from the deployment plan with a right click on the selected plan and then choose "Generate deployment models and code" from the context menu.
(6) The generator will produce a model for each node. Each node corresponds to a CDT project containing this model and the code generated from it.
Whereas the 2nd way to produce code is more powerful, it is also more complicated. Therefore, I will also providing a Hello World example for a simple object-oriented model soon.
Powered by FUDForum
. Page generated in 0.03144 seconds