Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend')
-rw-r--r--plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend37
1 files changed, 20 insertions, 17 deletions
diff --git a/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend b/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend
index 2ee75e9b4..e39ec1fdd 100644
--- a/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend
+++ b/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend
@@ -15,28 +15,31 @@
package org.eclipse.etrice.dctools
import java.util.Map
-import org.eclipse.etrice.core.RoomStandaloneSetup
import org.eclipse.etrice.core.fsm.fSM.ModelComponent
-import org.eclipse.etrice.core.genmodel.fsm.ExtendedFsmGenBuilder
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import com.google.inject.Inject
+import org.eclipse.etrice.core.genmodel.fsm.ExtendedFsmGenBuilderFactory
+import org.eclipse.etrice.core.genmodel.fsm.NullDiagnostician
class GenModelAccess {
- Map<ModelComponent, GraphContainer> cache = newHashMap
-
- def public clearCache() {
- cache.clear
+ @Inject
+ private ExtendedFsmGenBuilderFactory fsmGenBuilderFactory
+
+ Map<ModelComponent, GraphContainer> cache = newHashMap
+
+ def public clearCache() {
+ cache.clear
+ }
+
+ def public GraphContainer get(ModelComponent mc) {
+ if(!cache.containsKey(mc)) {
+ val builder = fsmGenBuilderFactory.create(new NullDiagnostician)
+ val gc = builder.createTransformedModel(mc)
+ builder.withCommonData(gc)
+ cache.put(mc, gc)
}
- def public GraphContainer get(ModelComponent mc) {
- if(!cache.containsKey(mc)) {
- val injector = new RoomStandaloneSetup().createInjector
- val builder = new ExtendedFsmGenBuilder(injector);
- val gc = builder.createTransformedModel(mc)
- builder.withCommonData(gc)
- cache.put(mc, gc)
- }
-
- return cache.get(mc)
- }
+ return cache.get(mc)
+ }
} \ No newline at end of file

Back to the top