blob: bffb83cd546f93556cf4bbed3db47825245966d5 [file] [log] [blame]
package templates.m2m.utils;
import org.eclipse.app4mc.amalthea.model.Time
import templates.AbstractAmaltheaInchronTransformer
class TimeTransformer extends AbstractAmaltheaInchronTransformer {
def create inchronModelFactory.createTime createTime(Time amltTime) {
val amltValue = amltTime?.value
it.value = if(amltValue !== null) amltValue.longValue else 0;
switch (amltTime?.unit) {
case S:
it.unit = com.inchron.realtime.root.model.TimeUnit.S
case MS:
it.unit = com.inchron.realtime.root.model.TimeUnit.MS
case US:
it.unit = com.inchron.realtime.root.model.TimeUnit.US
case NS:
it.unit = com.inchron.realtime.root.model.TimeUnit.NS
case PS:
it.unit = com.inchron.realtime.root.model.TimeUnit.PS
case _UNDEFINED_:
it.unit = com.inchron.realtime.root.model.TimeUnit.PS
}
}
}