blob: 81d37b27d2cd904c69cfdc8a12a1ef8893137fc9 [file] [log] [blame]
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)
}
]
}
}