C# Class AK.F1.Timing.Live.LiveData

Provides statis utility methods for parsing F1 timing primitives. This class is .
Show file Open project: simoneb/ak-f1-timing

Public Methods

Method Description
ParseDouble ( string s ) : double

Parses a System.Double from the specified string.

ParseInt32 ( string s ) : int

Parses a System.Int32 from the specified string.

ParseTime ( string s ) : System.TimeSpan

Parses a System.TimeSpan from the specified string.

This method is capabable of parsing all known grid time formats, including: lap, sector interval gap, elapsed session and remaining session times. It will not parse interval or gaps times in the ##L format.

ToDriverStatus ( GridColumnColour colour ) : DriverStatus

Converts the specified timing colour into a AK.F1.Timing.Messages.Driver.DriverStatus.

ToGridColumn ( byte column, SessionType currentSessionType ) : GridColumn

Converts the specified timing coloum index to a AK.F1.Timing.Messages.Driver.GridColumn.

ToGridColumnColour ( byte colour ) : GridColumnColour

Converts the specified timing colour into a AK.F1.Timing.Messages.Driver.GridColumnColour.

ToPostedTimeType ( GridColumnColour colour ) : PostedTimeType

Converts the specified timing colour into a AK.F1.Timing.Messages.Driver.PostedTimeType.

ToSessionStatus ( string s ) : SessionStatus

Converts the specified timing status value to a AK.F1.Timing.Messages.Session.SessionStatus.

ToSessionType ( int value ) : SessionType

Converts the specified timing session value into a AK.F1.Timing.Messages.Session.SessionType.

Method Details

ParseDouble() public static method

Parses a System.Double from the specified string.
/// Thrown when is incorrectly formatted. ///
public static ParseDouble ( string s ) : double
s string The string to parse.
return double

ParseInt32() public static method

Parses a System.Int32 from the specified string.
/// Thrown when is incorrectly formatted. ///
public static ParseInt32 ( string s ) : int
s string The string to parse.
return int

ParseTime() public static method

Parses a System.TimeSpan from the specified string.
This method is capabable of parsing all known grid time formats, including: lap, sector interval gap, elapsed session and remaining session times. It will not parse interval or gaps times in the ##L format.
/// Thrown when is incorrectly formatted. ///
public static ParseTime ( string s ) : System.TimeSpan
s string The string to parse.
return System.TimeSpan

ToDriverStatus() public static method

Converts the specified timing colour into a AK.F1.Timing.Messages.Driver.DriverStatus.
/// Thrown when could not be converted. ///
public static ToDriverStatus ( GridColumnColour colour ) : DriverStatus
colour GridColumnColour The value to convert.
return DriverStatus

ToGridColumn() public static method

Converts the specified timing coloum index to a AK.F1.Timing.Messages.Driver.GridColumn.
public static ToGridColumn ( byte column, SessionType currentSessionType ) : GridColumn
column byte The value to convert.
currentSessionType SessionType The current session.
return GridColumn

ToGridColumnColour() public static method

Converts the specified timing colour into a AK.F1.Timing.Messages.Driver.GridColumnColour.
/// Thrown when could not be converted. ///
public static ToGridColumnColour ( byte colour ) : GridColumnColour
colour byte The value to convert.
return GridColumnColour

ToPostedTimeType() public static method

Converts the specified timing colour into a AK.F1.Timing.Messages.Driver.PostedTimeType.
/// Thrown when could not be converted. ///
public static ToPostedTimeType ( GridColumnColour colour ) : PostedTimeType
colour GridColumnColour The value to convert.
return PostedTimeType

ToSessionStatus() public static method

Converts the specified timing status value to a AK.F1.Timing.Messages.Session.SessionStatus.
/// Thrown when could not be converted. ///
public static ToSessionStatus ( string s ) : SessionStatus
s string The value to convert.
return SessionStatus

ToSessionType() public static method

Converts the specified timing session value into a AK.F1.Timing.Messages.Session.SessionType.
/// Thrown when could not be converted. ///
public static ToSessionType ( int value ) : SessionType
value int The value to convert.
return SessionType