Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2018-11-02 11:21:09 +0000
committerHenrik Rentz-Reichert2018-11-02 11:21:09 +0000
commit4a4f56a2254b837c625f5170076f9b502a168db9 (patch)
tree3e844013b5363f01641d55b75b5d8492212bb4e9 /plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c
parent87079c0333f8ce2653abc0a1cb475261960eb619 (diff)
downloadorg.eclipse.etrice-4a4f56a2254b837c625f5170076f9b502a168db9.tar.gz
org.eclipse.etrice-4a4f56a2254b837c625f5170076f9b502a168db9.tar.xz
org.eclipse.etrice-4a4f56a2254b837c625f5170076f9b502a168db9.zip
Bug 540707 - introduce switch for transition data generation
* introduced the switch with default false * introduced the switch in the launcher tab * added a preference for the initialization of launcher settings Change-Id: I4ff792e47ada1964fe8b2b16bafe4acbcce3cbd4
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c')
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
index 7fb278604..b1aa47ff5 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
@@ -42,12 +42,15 @@ import org.eclipse.etrice.core.room.RoomModel
import org.eclipse.etrice.core.room.util.RoomHelpers
import org.eclipse.etrice.generator.generic.ILanguageExtension
import org.eclipse.xtext.util.Pair
+import org.eclipse.etrice.generator.c.setup.GeneratorOptionsHelper
+import org.eclipse.etrice.generator.c.Main
@Singleton
class CExtensions implements ILanguageExtension {
@Inject protected IDiagnostician diagnostician
@Inject protected extension RoomHelpers
+ @Inject protected extension GeneratorOptionsHelper
override String getTypedDataDefinition(EObject msg) {
if (msg instanceof Message) {
@@ -343,9 +346,13 @@ class CExtensions implements ILanguageExtension {
}
}
- val dataArg = ", "+GENERIC_DATA_NAME
- val typedData = typeName+" "+GENERIC_DATA_NAME + " = "+deRef+"(("+castTypeName+") generic_data__et);\n"
- val typedArgList = ", "+typeName+" "+GENERIC_DATA_NAME
+ val dataName = if (Main.settings.isOldStyleTransitionData && data.deprecatedName!==null && !data.deprecatedName.trim.empty)
+ data.deprecatedName
+ else
+ GENERIC_DATA_NAME
+ val dataArg = ", "+dataName
+ val typedData = typeName+" "+dataName + " = "+deRef+"(("+castTypeName+") generic_data__et);\n"
+ val typedArgList = ", "+typeName+" "+dataName
return newArrayList(dataArg, typedData, typedArgList);
}

Back to the top