Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/SubSystemRunnerGen.xtend')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/SubSystemRunnerGen.xtend136
1 files changed, 68 insertions, 68 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/SubSystemRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/SubSystemRunnerGen.xtend
index 69247fcb3..f5ed5b2aa 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/SubSystemRunnerGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/SubSystemRunnerGen.xtend
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * CONTRIBUTORS:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator.java.gen
-
-import com.google.inject.Inject
-import com.google.inject.Singleton
-import org.eclipse.etrice.core.genmodel.etricegen.Root
-import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
-import org.eclipse.etrice.core.genmodel.etricegen.SystemInstance
-import org.eclipse.etrice.generator.base.IGeneratorFileIo
-import org.eclipse.etrice.generator.generic.RoomExtensions
-
-@Singleton
-class SubSystemRunnerGen {
-
- @Inject IGeneratorFileIo fileIO
- @Inject extension RoomExtensions roomExt
-
- def doGenerate(Root root) {
- for (sc: root.subSystemInstances) {
- val path = sc.subSystemClass.generationTargetPath+sc.subSystemClass.getPath
- val infopath = sc.subSystemClass.generationInfoPath+sc.subSystemClass.getPath
- val file = sc.subSystemClass.name+"Runner.java"
- fileIO.generateFile("generating SubSystemRunner implementation", path, infopath, file, root.generate(sc))
- }
- }
-
- def generate(Root root, SubSystemInstance ssc) {
- val cc = ssc.subSystemClass
- '''
- /**
- * @author generated by eTrice
- *
- * this class contains the main function running component «ssc.name»
- * it instantiates «ssc.name» and starts and ends the lifecycle
- */
-
- package «cc.getPackage()»;
-
- import org.eclipse.etrice.runtime.java.modelbase.RTSystem;
- import org.eclipse.etrice.runtime.java.modelbase.SubSystemRunnerBase;
-
- class «cc.name+"Runner"» extends SubSystemRunnerBase {
-
- /**
- * main function
- * creates the main component and starts and stops the lifecycle
- */
- public static void main(String[] args) {
- // instantiate the main component
- RTSystem sys = «IF ssc.eContainer instanceof SystemInstance»new RTSystem("«(ssc.eContainer as SystemInstance).name»")«ELSE»null«ENDIF»;
- «cc.name» main_component = new «cc.name»(sys, "«ssc.name»");
-
- run(main_component, args);
- }
- };
- '''
- }
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.java.gen
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import org.eclipse.etrice.core.genmodel.etricegen.Root
+import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
+import org.eclipse.etrice.core.genmodel.etricegen.SystemInstance
+import org.eclipse.etrice.generator.base.IGeneratorFileIo
+import org.eclipse.etrice.generator.generic.RoomExtensions
+
+@Singleton
+class SubSystemRunnerGen {
+
+ @Inject IGeneratorFileIo fileIO
+ @Inject extension RoomExtensions roomExt
+
+ def doGenerate(Root root) {
+ for (sc: root.subSystemInstances) {
+ val path = sc.subSystemClass.generationTargetPath+sc.subSystemClass.getPath
+ val infopath = sc.subSystemClass.generationInfoPath+sc.subSystemClass.getPath
+ val file = sc.subSystemClass.name+"Runner.java"
+ fileIO.generateFile("generating SubSystemRunner implementation", path, infopath, file, root.generate(sc))
+ }
+ }
+
+ def generate(Root root, SubSystemInstance ssc) {
+ val cc = ssc.subSystemClass
+ '''
+ /**
+ * @author generated by eTrice
+ *
+ * this class contains the main function running component «ssc.name»
+ * it instantiates «ssc.name» and starts and ends the lifecycle
+ */
+
+ package «cc.getPackage()»;
+
+ import org.eclipse.etrice.runtime.java.modelbase.RTSystem;
+ import org.eclipse.etrice.runtime.java.modelbase.SubSystemRunnerBase;
+
+ class «cc.name+"Runner"» extends SubSystemRunnerBase {
+
+ /**
+ * main function
+ * creates the main component and starts and stops the lifecycle
+ */
+ public static void main(String[] args) {
+ // instantiate the main component
+ RTSystem sys = «IF ssc.eContainer instanceof SystemInstance»new RTSystem("«(ssc.eContainer as SystemInstance).name»")«ELSE»null«ENDIF»;
+ «cc.name» main_component = new «cc.name»(sys, "«ssc.name»");
+
+ run(main_component, args);
+ }
+ };
+ '''
+ }
} \ No newline at end of file

Back to the top