Class FuelAndElectricConverter
- Namespace
- Geotab.Checkmate.ObjectModel
- Assembly
- Geotab.Checkmate.ObjectModel.dll
public static class FuelAndElectricConverter
- Inheritance
-
FuelAndElectricConverter
- Inherited Members
Methods
ConvertKwhToFuelVolume(float, VolumeUnit)
Convert the kwh to a fuel volume. Purely energy-based.
public static float ConvertKwhToFuelVolume(float kwhValue, VolumeUnit volumeUnit = VolumeUnit.Liter)
Parameters
kwhValuefloatThe kilowatt-hour energy value
volumeUnitVolumeUnitThe fuel volume unit.
Returns
- float
The fuel volume which contains the same energy.
Exceptions
- NotSupportedException
The VolumeUnit is not supported.
LocalizeElectricEconomy(float, ElectricEnergyEconomyUnit?, ElectricEnergyEconomyUnit?)
Converts to the localized electric energy economy.
public static float? LocalizeElectricEconomy(float economyIn, ElectricEnergyEconomyUnit? destUnit, ElectricEnergyEconomyUnit? sourceUnit = null)
Parameters
economyInfloatInput electric energy economy.
destUnitElectricEnergyEconomyUnit?Destination unit.
sourceUnitElectricEnergyEconomyUnit?Source unit, defaults to L/100 km.
Returns
- float?
The localized fuel economy.
Exceptions
- NotSupportedException
A FuelEconomyUnit is not supported.
LocalizeElectricEnergy(float, ElectricEnergyUnit, ElectricEnergyUnit)
Converts to the localized electric energy unit.
public static float LocalizeElectricEnergy(float energyIn, ElectricEnergyUnit destUnit, ElectricEnergyUnit sourceUnit = ElectricEnergyUnit.KilowattHour)
Parameters
energyInfloatInput energy volume.
destUnitElectricEnergyUnitDestination unit.
sourceUnitElectricEnergyUnitSource unit, defaults to kWh.
Returns
- float
The local value.
Exceptions
- NotSupportedException
A ElectricEnergyUnit is not supported.
LocalizeElectricPower(float, ElectricEnergyEconomyUnit?, ElectricEnergyEconomyUnit?)
Converts to the localized electric power unit. Reuses the electric economy unit but treats anything not W based as kW
public static float LocalizeElectricPower(float powerIn, ElectricEnergyEconomyUnit? destUnit, ElectricEnergyEconomyUnit? sourceUnit = null)
Parameters
powerInfloatInput power.
destUnitElectricEnergyEconomyUnit?Destination unit.
sourceUnitElectricEnergyEconomyUnit?Source unit, defaults to kWh.
Returns
- float
The local value.
Exceptions
- NotSupportedException
A ElectricEnergyUnit is not supported.
LocalizeFuelEconomy(float, FuelEconomyUnit?, FuelEconomyUnit?)
Converts to the localized fuel economy.
public static float? LocalizeFuelEconomy(float economyIn, FuelEconomyUnit? destUnit, FuelEconomyUnit? sourceUnit = FuelEconomyUnit.LitersPer100Km)
Parameters
economyInfloatInput fuel economy.
destUnitFuelEconomyUnit?Destination unit.
sourceUnitFuelEconomyUnit?Source unit, defaults to L/100 km.
Returns
- float?
The localized fuel economy.
Exceptions
- NotSupportedException
A FuelEconomyUnit is not supported.
LocalizeFuelVolume(float, VolumeUnit?, VolumeUnit?)
Converts to the localized fuel volume.
public static float LocalizeFuelVolume(float volumeIn, VolumeUnit? destUnit, VolumeUnit? sourceUnit = VolumeUnit.Liter)
Parameters
volumeInfloatInput fuel volume.
destUnitVolumeUnit?Destination unit.
sourceUnitVolumeUnit?Source unit, defaults to liters.
Returns
- float
The local value.
Exceptions
- NotSupportedException
A VolumeUnit is not supported.