- April 22, 2015 at 2:43 pm #4498JamesB007Participant
I’ve just built the Microwave Oven example application and I’m trying to understand what I’m left with, with respect to the C code that was generated from the UML diagrams.
I’ve tried to compile the source code in Visual Studio 2013 but I just get a load of errors. Most recently (on seven different lines of code in TIM_bridge.c) …
“IntelliSense: argument of type “const Escher_Date_t *” is incompatible with parameter of type “const time_t *” c:\Users\eljb2\Personal Documents – Not Backed Up\Visual\MicrowaveOven\src\TIM_bridge.c 266 19 MicrowaveTEst1″
“IntelliSense: cannot open source file “stdafx.h” c:\Users\eljb2\Personal Documents – Not Backed Up\Visual\MicrowaveOven\src\TIM_bridge.c 35 1 MicrowaveTEst1″
I’d like to understand more about what the C code is doing and how to work with it after it’s been generated by xtUML.
PLease can you help?
April 23, 2015 at 3:44 am #4501keithbrownKeymaster
- This topic was modified 6 years, 2 months ago by Bob Mulvey.
When you use “Build Project” inside BridgePoint, the translation (aka model compiler) translates the model into C and then uses the eclipse CDT & gcc to compile the code into a runnable EXE that is put under the Debug/ folder inside the project.
This translation process creates some lightweight architecture that includes a main function that runs the event loops.
xtUML provides two mechanisms to integrate an xtUML Model with Legacy (aka Realized) code. This is an advanced topic that is best approached after you have a solid understanding of the fundamentals of xtUML modeling, execution and translation.
We have a self-paced online course called “Modeling with xtUML” at https://xtuml.org/learn/on-line-courses/ that will teach you these fundamentals and introduce the topic of integrating with Realized code in Module 18.April 23, 2015 at 2:55 pm #4502Lee RiemenschneiderParticipant
I just tried the Microwave source in VS 2013. I got one bogus error, telling me to use localtime_s, and 8 warnings, Escher_Date_t (long) incompatible with time_t (long long) on my system. Since TIM is a domain you can “replace” it with a modified version to change things like the localtime error. You can also do the same with sys_types.h to get rid of the warnings. You want to put these modified files in the gen folder, not the src folder, and then build the project again. Turn off the CDT part of the build or it’ll fail on localtime_s.April 23, 2015 at 11:50 pm #4504cortKeymaster
The C code generated from xtUML models is mostly “vanilla ANSI C”. A few exceptions exist like getting access to a timebase from the platform. “Time” and “date” are a bit messy in the C World and have never been quite compatible between various platforms (like Windows, Unix and embedded targets).
The advice from Keith and Lee look good. I expect you have compiled your Microwave by now.
- You must be logged in to reply to this topic.