Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » eTrice » change code generation rules?
change code generation rules? [message #1211642] Tue, 26 November 2013 14:50 Go to next message
Stefan Wa is currently offline Stefan WaFriend
Messages: 2
Registered: November 2013
Junior Member
Hello,
I have worked through the provided tutorials and wonder if there is any possibility to change the rules of code generation.
I would like to change them for my own projects and not use the default "translation".

Best regards
Stefan
Re: change code generation rules? [message #1213375 is a reply to message #1211642] Wed, 27 November 2013 07:56 Go to previous messageGo to next message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 220
Registered: July 2009
Senior Member
Hi Stefan,

yes, this is possible.

To be able to do that you have to gain a basic understanding of the eTrice architecture.
I would recommend you read the chapter "eTrice Tool Developer’s Reference" from the eTrice online documentation
(not completely up to date with the current code base).

Basically you will have to create a new generator plugin.
In the code base on git [1] you will find an example
examples/my.etrice.generator
which demonstrates how the eTrice Java generator can be customized.

Please don't hesitate to ask further questions on this channel.

-Henrik

[1] http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/


Am 26.11.2013 19:30, schrieb Stefan Wa:
> Hello,
> I have worked through the provided tutorials and wonder if there is any possibility to change the rules of code generation.
> I would like to change them for my own projects and not use the default "translation".
>
> Best regards
> Stefan
>
Re: change code generation rules? [message #1228445 is a reply to message #1213375] Tue, 07 January 2014 08:47 Go to previous messageGo to next message
Stefan Wa is currently offline Stefan WaFriend
Messages: 2
Registered: November 2013
Junior Member
Hi Henrik,

thanks for help.

i have some troubles with the provided material.
When importing the example my.etrice.generator i get several errormessages.

For example in my.etrice.generator.setup i get "The import org.eclipse cannot be resolved" for
import org.eclipse.etrice.generator.base.ITranslationProvider;
import org.eclipse.etrice.generator.java.Main;

The first two can be easily fixed with quick fix option add package but then i get a new error message on the last import saying
But on import org.eclipse.etrice.generator.java.setup.GeneratorModule; i get
Access restriction: The type GeneratorModule is not accessible due to restriction on required library C:\eclipse\plugins\org.eclipse.etrice.generator.java_0.2.0.S201210110712.jar

How to fix this?

regards
Stefan

[Updated on: Tue, 07 January 2014 09:00]

Report message to a moderator

Re: change code generation rules? [message #1238083 is a reply to message #1228445] Fri, 31 January 2014 10:56 Go to previous message
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 220
Registered: July 2009
Senior Member
Hi Stefan,

sorry for the late answer.

I assume you have installed eTrice 0.3.0?
There the mentioned package isn't visible for other plug-ins.
To be able to use the generator customizations as described I would recommend to use a more recent milestone build.
I'm just about to publish 0.4.0M3 today.

Hope that helps,
Henrik


Am 07.01.2014 09:47, schrieb Stefan Wa:
> Hi Henrik,
>
> thanks for help.
>
> i have some troubles with the provided material.
> When importing the example my.etrice.generator i get several errormessages.
>
> For example in my.etrice.generator.setup i get "The import org.eclipse cannot be resolved" for
> import org.eclipse.etrice.generator.base.ITranslationProvider;
> import org.eclipse.etrice.generator.java.Main;
> import org.eclipse.etrice.generator.java.setup.GeneratorModule;
> The first two can be easily fixed with quick fix option add package but then i get a new error message on the last import saying
> Access restriction: The type GeneratorModule is not accessible due to restriction on required library
> C:\eclipse\plugins\org.eclipse.etrice.generator.java_0.2.0.S201210110712.jar
>
> How to fix this?
>
> regards
> Stefan
Previous Topic:[announce] M2 of eTrice 0.4 released
Next Topic:[announce] M3 of eTrice 0.4 released
Goto Forum:
  


Current Time: Mon Nov 24 12:49:33 GMT 2014

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

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