| package templates.m2m.os |
| |
| import com.inchron.realtime.root.model.Model |
| import org.eclipse.app4mc.amalthea.model.OSModel |
| import templates.AbstractAmaltheaInchronTransformer |
| import templates.utils.AmltCacheModel |
| |
| class OSTransformer extends AbstractAmaltheaInchronTransformer{ |
| |
| |
| public def transfromOSModel(OSModel amltHWModel, Model inchronModel) { |
| |
| this.inchronModel=inchronModel |
| |
| val AmltCacheModel cacheModel=customObjsStore.getInstance(AmltCacheModel) |
| |
| amltHWModel.operatingSystems.forEach[amltOS| |
| { |
| var inchronSystem=inchronModelFactory.createGenericSystem |
| |
| inchronSystem.name=amltOS.name+"_SYSTEM" |
| |
| var inchronRtosConfig=inchronModelFactory.createRtosConfig |
| |
| inchronRtosConfig.name=amltOS.name |
| |
| inchronSystem.rtosConfig=inchronRtosConfig |
| |
| //RtosModel with default attributes |
| var inchronRtosModel=inchronModelFactory.createRtosModel |
| |
| inchronRtosModel.name="generic" |
| inchronRtosModel.returnType="void" |
| |
| inchronSystem.rtosModel=inchronRtosModel |
| |
| //Adding Inchron System object to Model |
| inchronModel.systems.add(inchronSystem) |
| |
| cacheModel.addInchronRtosConfig(inchronSystem.rtosConfig) |
| } |
| ] |
| |
| |
| } |
| } |