| package templates.m2m.sw |
| |
| import com.inchron.realtime.root.model.ModeGroup |
| import org.eclipse.app4mc.amalthea.model.ModeLabel |
| import org.eclipse.app4mc.amalthea.model.ModeLiteral |
| import templates.AbstractAmaltheaInchronTransformer |
| import templates.utils.AmltCacheModel |
| |
| class ModeLabelTransformer extends AbstractAmaltheaInchronTransformer { |
| |
| var AmltCacheModel cacheModel |
| |
| |
| public def create inchronModelFactory.createModeGroup createModeGroup(ModeLabel amltModeLabel){ |
| |
| cacheModel = customObjsStore.getInstance(AmltCacheModel) |
| |
| it.name=amltModeLabel.name |
| |
| var amltModeLiteralInitialValue= amltModeLabel.initialValue |
| |
| |
| amltModeLiteralInitialValue?.containingMode?.literals?.forEach[literal, index|{ |
| createMode(literal,index, it) |
| }] |
| |
| it.initialMode = cacheModel.amltModeLiteralInchronModeMap.get(amltModeLiteralInitialValue) |
| |
| cacheModel.addInchronModeGroup(it) |
| } |
| |
| |
| |
| public def create inchronModelFactory.createMode createMode(ModeLiteral amltModeLiteral, int index, ModeGroup inchronModeGroup){ |
| |
| it.name=amltModeLiteral.name |
| it.value=index |
| |
| inchronModeGroup.modes.add(it) |
| |
| cacheModel.amltModeLiteralInchronModeMap.put(amltModeLiteral, it) |
| } |
| } |