Class LogRecord
- Namespace
- Geotab.Checkmate.ObjectModel
- Assembly
- Geotab.Checkmate.ObjectModel.dll
Record of log entries containing data for a device's position and speed at a specific date and time.
[ReportClass]
public class LogRecord : Entity, IEntity, IComparable, IIdentifiable, IDateTimeProvider, IDeviceProvider, ILastActive
- Inheritance
-
LogRecord
- Implements
- Derived
- Inherited Members
Constructors
LogRecord()
Initializes a new instance of the LogRecord class.Initializes a new instance of the LogRecord class.
public LogRecord()
LogRecord(Id?)
Initializes a new instance of the LogRecord class.Initializes a new instance of the LogRecord class.
public LogRecord(Id? id)
Parameters
LogRecord(Id?, Device?, DateTime?, double, double, float)
Initializes a new instance of the LogRecord class.Initializes a new instance of the LogRecord class.
protected LogRecord(Id? id, Device? device, DateTime? dateTime, double longitude, double latitude, float speed)
Parameters
id
IdThe Id.
device
DeviceThe device.
dateTime
DateTime?The DateTime of the Log record.
longitude
doubleThe longitude.
latitude
doubleThe latitude.
speed
floatThe speed.
LogRecord(LogRecord)
Initializes a new instance of the LogRecord class.Initializes a new instance of the LogRecord class.
protected LogRecord(LogRecord value)
Parameters
value
LogRecordThe value.
Properties
DateTime
Gets or sets the date and time the log was recorded.
public DateTime? DateTime { get; set; }
Property Value
Device
Gets or sets the Device this log belongs to.
public Device? Device { get; set; }
Property Value
IsLastActive
Gets or sets a value indicating whether this instance is the last active record in the vehicle's active period. Possible values are:.
- false: The record is within the active period and not the last active record
- true: The record is within the active period and is the last active record
- null: The record is not within the active period (ex. GPS heartbeat)
public bool? IsLastActive { get; set; }
Property Value
Latitude
Gets or sets the latitude of the log record.
public double Latitude { get; set; }
Property Value
Longitude
Gets or sets the longitude of the log record.
public double Longitude { get; set; }
Property Value
Speed
Gets or sets the logged speed or an invalid speed (in km/h).
public float Speed { get; set; }
Property Value
Methods
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.
DistanceBetweenPoints(double, double, double, double)
Calculates the distance between two lat/long points, returns result in kilometers Formula from www.best.com/~williams/avform.htm.
public static double DistanceBetweenPoints(double longitudeA, double latitudeA, double longitudeB, double latitudeB)
Parameters
longitudeA
doubleThe longitude a.
latitudeA
doubleThe latitude a.
longitudeB
doubleThe longitude b.
latitudeB
doubleThe latitude b.
Returns
- double
The distance.
DistanceTo(ISimpleCoordinate)
Calculates the distance between two lat/long points in kilometers.
public double DistanceTo(ISimpleCoordinate coordinate)
Parameters
coordinate
ISimpleCoordinate
Returns
- double
Result in kilometers.
DistanceTo(LogRecord)
Calculates the distance between two lat/long points in kilometers.
public double DistanceTo(LogRecord logRecord)
Parameters
Returns
- double
Result in kilometers.
EnforceReadOnly()
This method is called whenever a property of the log record is modified. Can be used by a deriving class to enforce that the class is read only.
protected virtual void EnforceReadOnly()
GetExtent(IEnumerable<LogRecord>)
Calculates Coordinate list representing an extent that fully covers the LogRecord(s).
public static IList<ISimpleCoordinate>? GetExtent(IEnumerable<LogRecord> logRecords)
Parameters
logRecords
IEnumerable<LogRecord>The log records.
Returns
- IList<ISimpleCoordinate>
The ISimpleCoordinate list.
GetExtentsFromStartAndEndPoint(LogRecord, LogRecord, int)
Given a set of LogRecords, get two bounding boxes, one about the start of the set (based on time), same for the end of the set.
public static IList<IList<ISimpleCoordinate>> GetExtentsFromStartAndEndPoint(LogRecord firstRecord, LogRecord lastRecord, int boxSize)
Parameters
firstRecord
LogRecordThe firstRecord.
lastRecord
LogRecordThe lastRecord.
boxSize
intThe area of the desired bounding boxes in kilometres squared
Returns
ToSimpleCoordinate()
Gets the Coordinate of the log record.
public ISimpleCoordinate? ToSimpleCoordinate()
Returns
- ISimpleCoordinate
the coordinate of the log.
ToString()
public override string ToString()