Skip to content

Instantly share code, notes, and snippets.

@zjuhasz
Created August 3, 2017 14:33
Show Gist options
  • Save zjuhasz/31e9bf60fa684604435dc25b5ac84726 to your computer and use it in GitHub Desktop.
Save zjuhasz/31e9bf60fa684604435dc25b5ac84726 to your computer and use it in GitHub Desktop.
import org.tenkiv.daqc.DaqcQuantity
import tec.uom.se.ComparableQuantity
import javax.measure.Quantity
import javax.measure.quantity.Temperature as TypeTemperature
import javax.measure.quantity.Pressure as TypePressure
// Example of creating a DaqcQuantity which can be any of a sealed group of quantity types.
sealed class MyChannelQuantity<Q: Quantity<Q>>(quantity: ComparableQuantity<Q>) : DaqcQuantity<Q>(quantity) {
class Temperature(quantity: ComparableQuantity<TypeTemperature>) : MyChannelQuantity<TypeTemperature>(quantity)
class Pressure(quantity: ComparableQuantity<TypePressure>) : MyChannelQuantity<TypePressure>(quantity)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment