blob: 61658b511cf949705bc66f661f634d81b6554d1f [file] [log] [blame]
package templates.m2m.utils;
import com.inchron.realtime.root.model.TimeUnit
import org.eclipse.app4mc.amalthea.model.Time
import templates.AbstractAmaltheaInchronTransformer
class TimeUtilsTransformer extends AbstractAmaltheaInchronTransformer {
def create inchronModelFactory.createTime createTime(Time amltTime) {
it.value = amltTime?.value?.longValue
switch (amltTime?.unit.getName) {
case "s": {
it.unit = TimeUnit.S
}
case "ms": {
it.unit = TimeUnit.MS
}
case "us": {
it.unit = TimeUnit.US
}
case "ns": {
it.unit = TimeUnit.NS
}
case "ps": {
it.unit = TimeUnit.PS
}
}
}
}