C++ code generation [message #1444675] |
Tue, 14 October 2014 07:42  |
Eclipse User |
|
|
|
Just elaborating my query and simplifying the question.
I do the steps below:
1. Create a Papyrus project - UML model and template UML Primitive Types.
2. Add C/C++ Profile to model.
3. Add Child Class, in this Add Child Operation.
4. In Operation Properties, in Method, add a new Opaque Behavior(OB).
5. In OB, Properties, add C++ Language, in right side box, the implementation code - cout << ...
6. In Model Explorer, rt. clk. model, Code Generation>Generate C++.
7. Accept query about creating a C++ Project, empty executable...
8. All expected files are generated, but in <classname>.cpp, the body code does not appear from the OB implementation entries.
Am I missing something basic pl.
Anantha Krishnan.
In the latest Papyrus(Luna) there is a C/C++ hello world example, that seems to provide for generating body code from entries in the UML model. I have been trying to create another Operation in the HelloWorld class and generate my own body code similarly, but its not happening.
What exactly are the steps for this pl. A detailed explanation I think is needed.
Also, what else code generation is now possible. How about state machine code-for transitions/entry/do/exit actions etc.
Thank you.
Anantha Krishnan
[Updated on: Mon, 20 October 2014 08:15] by Moderator
|
|
|
|
|
|
|
|
|
|
Re: C++ code generation [message #1467511 is a reply to message #1444675] |
Sun, 09 November 2014 23:47   |
Eclipse User |
|
|
|
Some queries pl., Ansgar:
1. I think UML-RT does not support parallel state machines?
2. I have a background working with Rational Rose-RT which has contributed to UML-RT, right? In Rose-RT, it was very intuitive - you created Capsules(Class stereotyped as Capsule with Papyrus/UML-RT profile is OK), then Protocols(in Papyrus I cant find this step of the Use Case?), followed by definition of Signals in each Protocol(what is the equivalent in Papyrus). Then you created Ports on/in Capsule Roles in a Structure Diagram(Composite Structure in Papyrus?) that are typed by the suitable Protocol. And the Roles have property of Base or Conjugate of the Protocol. What is the corresponding Use Case in Papyrus with UML-RT?
3. Again, in Rose-RT, the Use Case continued by creating State Machines for the dynamic behaviours of Capsules responding to Messages causing Signals on Ports. And, for RealTime systems, of course this is the most important. So we do need the State Machine feature with its codegen.
4. Rose-RT also generated "complete" code - along with a full Framework for Message based communication, timer services, besides threading(Capsules are basically Active Classes with potentially their own thread?),error/exception handling, logging etc. Is the Papyrus UML-RT feature also planned to provide these.
Thank you. If the above gets positive replies, Papyrus would be an awesome tool for real time systems design & development.
Anantha Krishnan.
4. Where can I obtain the official specification document of UML-RT profile - I cant find it on OMG site - is it not approved by OMG yet?
|
|
|
Re: C++ code generation [message #1467789 is a reply to message #1467511] |
Mon, 10 November 2014 05:03   |
Eclipse User |
|
|
|
Anantha Krishnan wrote on Mon, 10 November 2014 04:47
1. I think UML-RT does not support parallel state machines?
2. I have a background working with Rational Rose-RT which has contributed to UML-RT, right? In Rose-RT, it was very intuitive - you created Capsules(Class stereotyped as Capsule with Papyrus/UML-RT profile is OK), then Protocols(in Papyrus I cant find this step of the Use Case?), followed by definition of Signals in each Protocol(what is the equivalent in Papyrus). Then you created Ports on/in Capsule Roles in a Structure Diagram(Composite Structure in Papyrus?) that are typed by the suitable Protocol. And the Roles have property of Base or Conjugate of the Protocol. What is the corresponding Use Case in Papyrus with UML-RT?
3. Again, in Rose-RT, the Use Case continued by creating State Machines for the dynamic behaviours of Capsules responding to Messages causing Signals on Ports. And, for RealTime systems, of course this is the most important. So we do need the State Machine feature with its codegen.
4. Rose-RT also generated "complete" code - along with a full Framework for Message based communication, timer services, besides threading(Capsules are basically Active Classes with potentially their own thread?),error/exception handling, logging etc. Is the Papyrus UML-RT feature also planned to provide these.
1. No, UML-RT does not support parallell state machines (i.e. no multiple orthogonal regions, only one region per state machine).
2, 3, 4. If you have a background in Rose RealTime, you can expect more or less the same. UML-RT for Papyrus will be based on the same concepts as UML-RT for RoseRT including complete code generation and run-time framework. I guess Ansgar can confirm this as well.
/Peter Cigéhn
|
|
|
|
|
|
|
Re: C++ code generation [message #1482146 is a reply to message #1470105] |
Fri, 21 November 2014 09:30  |
Eclipse User |
|
|
|
Back to query reg use of Qompass for state machine modelling and C++ codegen, on Windows8.1 and cygwin64.
I created a simple state machine under the HelloWorld component of Qompass Helloworld example, applied the ContainerRule "StateMachineWCallEvents", went through the transformation and codegen steps.
In trying to build the project that is created, I get the following error.
Building file: ../root/OS_AL/Util/BString.cpp
Invoking: Cygwin C++ Compiler
g++ -DOS_Cygwin -I"C:\Users\pjakrishnan\pprsykndluna3nov2014ws\HelloWorld_monoNode_SystemDepPlan2" -I"C:\Users\pjakrishnan\pprsykndluna3nov2014ws\HelloWorld_monoNode_SystemDepPlan2\root" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"root/OS_AL/Util/BString.d" -MT"root/OS_AL/Util/BString.d" -o "root/OS_AL/Util/BString.o" "../root/OS_AL/Util/BString.cpp"
In file included from ../root/OS_AL/Util/BString.cpp:16:0:
C:\Users\pjakrishnan\pprsykndluna3nov2014ws\HelloWorld_monoNode_SystemDepPlan2/root/OS_AL/ProcessingResources/Thread.h:28:52: fatal error: sys/procfs.h: No such file or directory
compilation terminated.
make: *** [root/OS_AL/Util/BString.o] Error 1
root/OS_AL/Util/subdir.mk:36: recipe for target 'root/OS_AL/Util/BString.o' failed
Is this a problem of Cygwin on Windows, or what am I missing pl.
Anantha Krishnan.
|
|
|
Powered by
FUDForum. Page generated in 0.06374 seconds