Class FuelTaxDetail
- Namespace
- Geotab.Checkmate.ObjectModel
- Assembly
- Geotab.Checkmate.ObjectModel.dll
Fuel tax reporting element. The available driving history for a Device is stored as a sequence of such details. Each next detail starts when and where the previous detail ended. A detail is identified by its parameters (enter and exit time, odometer, GPS odometer, latitude and longitude) and its attributes (jurisdiction, Driver, toll road, authority). When any of the attributes changes, the current detail ends and a new detail begins. For more information, see IFTA Guide.
public class FuelTaxDetail : Entity, IEntity, IComparable, IIdentifiable, IDefaultable
- Inheritance
-
FuelTaxDetail
- Implements
- Inherited Members
Constructors
FuelTaxDetail()
public FuelTaxDetail()
Fields
CoordinatePrecision
The precision of coordinate-type values.
public const int CoordinatePrecision = 6
Field Value
DistancePrecision
The precision of distance-type values.
public const int DistancePrecision = 3
Field Value
Properties
Attributes
Gets or sets the attributes.
[Obsolete("Attributes property has been renamed to FuelTaxAttributes.", false)]
public string? Attributes { get; set; }
Property Value
- string
The attributes.
Authority
Gets or sets the authority. 'None' by default.
public string? Authority { get; set; }
Property Value
Device
Gets or sets the Device.
public Device? Device { get; set; }
Property Value
Driver
Gets or sets the Driver.
public Driver? Driver { get; set; }
Property Value
EnterGpsOdometer
Gets or sets the GPS odometer, in km, at the enter time.
public double? EnterGpsOdometer { get; set; }
Property Value
EnterLatitude
Gets or sets the latitude at the enter time.
public double? EnterLatitude { get; set; }
Property Value
EnterLongitude
Gets or sets the longitude at the enter time.
public double? EnterLongitude { get; set; }
Property Value
EnterOdometer
Gets or sets the odometer, in km, at the enter time.
public double? EnterOdometer { get; set; }
Property Value
EnterTime
Gets or sets the time at which the detail begins.
public DateTime? EnterTime { get; set; }
Property Value
ExitGpsOdometer
Gets or sets the GPS odometer, in km, at the exit time.
public double? ExitGpsOdometer { get; set; }
Property Value
ExitLatitude
Gets or sets the latitude at the exit time.
public double? ExitLatitude { get; set; }
Property Value
ExitLongitude
Gets or sets the longitude at the exit time.
public double? ExitLongitude { get; set; }
Property Value
ExitOdometer
Gets or sets the odometer, in km, at the exit time.
public double? ExitOdometer { get; set; }
Property Value
ExitTime
Gets or sets the time at which the detail ends.
public DateTime? ExitTime { get; set; }
Property Value
FuelTaxAttributes
Gets or sets the attributes.
public FuelTaxAttributes? FuelTaxAttributes { get; set; }
Property Value
- FuelTaxAttributes
The attributes.
HasHourlyData
Gets a value indicating whether the details has hourly data.
public bool? HasHourlyData { get; }
Property Value
- bool?
A value indicating whether the details has hourly data.
HourlyGpsOdometer
Gets or sets the GPS odometer values, in km, at each hour within the detail's time interval.
public List<double>? HourlyGpsOdometer { get; set; }
Property Value
HourlyIsOdometerInterpolated
Gets or sets a list of values indicating whether the odometer at the corresponding hour is interpolated.
public List<bool>? HourlyIsOdometerInterpolated { get; set; }
Property Value
HourlyLatitude
Gets or sets the latitude values at each hour within the detail's time interval.
public List<double>? HourlyLatitude { get; set; }
Property Value
HourlyLongitude
Gets or sets the longitude values at each hour within the detail's time interval.
public List<double>? HourlyLongitude { get; set; }
Property Value
HourlyOdometer
Gets or sets the odometer values, in km, at each hour within the detail's time interval.
public List<double>? HourlyOdometer { get; set; }
Property Value
IsClusterOdometer
Gets or sets a value indicating whether the odometer values are based on engine odometer records and/or odometer adjustment records, as opposed to GPS distances alone.
[Obsolete("Superseded by the IsEnterOdometerInterpolated, HourlyIsOdometerInterpolated, and IsExitOdometerInterpolated properties", false)]
public bool? IsClusterOdometer { get; set; }
Property Value
- bool?
A value indicating whether the odometer values are based on engine odometer records and/or odometer adjustment records, as opposed to GPS distances alone.
IsEnterOdometerInterpolated
Gets or sets a value indicating whether the odometer at enter time is interpolated.
public bool? IsEnterOdometerInterpolated { get; set; }
Property Value
IsExitOdometerInterpolated
Gets or sets a value indicating whether the odometer at exit time is interpolated.
public bool? IsExitOdometerInterpolated { get; set; }
Property Value
IsNegligible
Gets a value indicating whether the detail is negligible by time or distance.
public bool? IsNegligible { get; }
Property Value
- bool?
A value indicating whether the detail is negligible by time or distance.
Jurisdiction
Gets or sets the jurisdiction, such as a U.S. state or a Canadian province.
public string? Jurisdiction { get; set; }
Property Value
TollRoad
Gets or sets the toll road name. null by default.
public string? TollRoad { get; set; }
Property Value
Versions
Gets or sets the last processed record versions.
public long[]? Versions { get; set; }
Property Value
- long[]
The last processed record versions.
Methods
AreAttributesEqual(FuelTaxDetail, FuelTaxDetail)
Checks if two FuelTaxDetail elements have the same attributes.
public static bool AreAttributesEqual(FuelTaxDetail detail1, FuelTaxDetail detail2)
Parameters
detail1
FuelTaxDetailThe first detail.
detail2
FuelTaxDetailThe second detail.
Returns
AreEqual(FuelTaxDetail, FuelTaxDetail)
Gets a value indicating if two FuelTaxDetail elements have the same properties.
public static bool AreEqual(FuelTaxDetail detail1, FuelTaxDetail detail2)
Parameters
detail1
FuelTaxDetailThe first detail.
detail2
FuelTaxDetailThe second detail.
Returns
AreUpdatesAvailable()
Gets a value indicating if updates are available for this detail.
public bool AreUpdatesAvailable()
Returns
- bool
True iff there are updates available.
ClearHourlyData()
Clears the detail of hourly data.
public void ClearHourlyData()
Clone()
Creates a new object that is a copy of the current instance.
public override IEntity Clone()
Returns
- IEntity
A new object that is a copy of this instance.
GetDateTime(int)
Calculates the time of an hourly data element.
public DateTime GetDateTime(int hourIndex)
Parameters
hourIndex
intThe hourly data index.
Returns
- DateTime
The time of the hourly data element.
Exceptions
- ArgumentException
If the hourly data index is out of range.
GetDescription()
Gets a thorough description of this detail.
public string GetDescription()
Returns
- string
The detail description.
GetRoadType()
Gets the road type.
public FuelTaxRoadType GetRoadType()
Returns
- FuelTaxRoadType
The road type.
HourIndexBefore(in DateTime)
Calculates the last hourly data index before a point in time.
public int HourIndexBefore(in DateTime toDate)
Parameters
toDate
DateTimeThe end time.
Returns
- int
The last hourly data index before the end time. -1, if there is no such index.
PopulateDefaults()
Populate non-required empty (null) properties with default values.
public void PopulateDefaults()
Round()
Rounds the odometer, GPS odometer and coordinates.
public void Round()
RoundCoordinate(double?)
Rounds a coordinate, in degrees, using CoordinatePrecision.
public static double RoundCoordinate(double? value)
Parameters
value
double?The coordinate.
Returns
- double
The rounded coordinate.
RoundDateTime(in DateTime)
Rounds a .NET DateTime value using a database-supported precision.
public static DateTime RoundDateTime(in DateTime dateTime)
Parameters
dateTime
DateTimeThe given time.
Returns
- DateTime
The rounded time.
RoundDistance(double?)
Rounds a distance, in km, using DistancePrecision.
public static double RoundDistance(double? value)
Parameters
value
double?The distance.
Returns
- double
The rounded distance.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
TrimLeft(in DateTime)
Clips the detail at the nearest hour at or before a given point in time.
public void TrimLeft(in DateTime dateTime)
Parameters
dateTime
DateTimeThe time.
TrimRight(in DateTime)
Clips the detail at the nearest hour at or before a given point in time.
public void TrimRight(in DateTime dateTime)
Parameters
dateTime
DateTimeThe time.
Validate()
Checks that this detail's properties are internally consistent.
public void Validate()
Exceptions
- ArgumentException
If the detail's properties are not internally consistent.
ValidateRange(List<FuelTaxDetail>)
Checks that a contiguous list of details is internally consistent.
public static void ValidateRange(List<FuelTaxDetail> details)
Parameters
details
List<FuelTaxDetail>The details.
Exceptions
- ArgumentException
If successive details: 1) Have the same attributes, or 2) Do not match at the joining point.