Table of Contents

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

id Id

The Id.

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 Id

The Id.

device Device

The device.

dateTime DateTime?

The DateTime of the Log record.

longitude double

The longitude.

latitude double

The latitude.

speed float

The 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 LogRecord

The value.

Properties

DateTime

Gets or sets the date and time the log was recorded.

public DateTime? DateTime { get; set; }

Property Value

DateTime?

The DateTime of the event.

Device

Gets or sets the Device this log belongs to.

public Device? Device { get; set; }

Property Value

Device

Device

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

bool?

bool true if this instance is last active; otherwise, false.

Latitude

Gets or sets the latitude of the log record.

public double Latitude { get; set; }

Property Value

double

double

Longitude

Gets or sets the longitude of the log record.

public double Longitude { get; set; }

Property Value

double

double

Speed

Gets or sets the logged speed or an invalid speed (in km/h).

public float Speed { get; set; }

Property Value

float

float

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 double

The longitude a.

latitudeA double

The latitude a.

longitudeB double

The longitude b.

latitudeB double

The 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

ISimpleCoordinate

Returns

double

Result in kilometers.

DistanceTo(LogRecord)

Calculates the distance between two lat/long points in kilometers.

public double DistanceTo(LogRecord logRecord)

Parameters

logRecord LogRecord

LogRecord

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 LogRecord

The firstRecord.

lastRecord LogRecord

The lastRecord.

boxSize int

The area of the desired bounding boxes in kilometres squared

Returns

IList<IList<ISimpleCoordinate>>

The IList<T> of IList<T> containing two bounding boxes.

ToSimpleCoordinate()

Gets the Coordinate of the log record.

public ISimpleCoordinate? ToSimpleCoordinate()

Returns

ISimpleCoordinate

the coordinate of the log.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.