Class BaseSessionWriter
This class is the skeleton for session writer class and holds the information about session details, lap, periodic channels, parameters along with rational and text conversions.
Inherited Members
Namespace: MAT.AtlasSessionApi
Assembly: MAT.AtlasSessionApi.dll
Syntax
public abstract class BaseSessionWriter : ISessionWriter, ISessionBuilder, IDisposable
Properties
Channels
Gets the collection of key/value pairs for the channels where key is defined as channel id.
Declaration
public IReadOnlyDictionary<uint, Channel> Channels { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyDictionary<System.UInt32, Channel> |
Committed
Gets the status of the commit.
Declaration
public bool Committed { get; protected set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Conversions
Gets the collection of key/value pairs for the conversions where key is defined as conversion identifier.
Declaration
public IReadOnlyDictionary<string, Conversion> Conversions { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyDictionary<System.String, Conversion> |
Groups
Gets the collection of groups and subgroups of the parameter.
Declaration
public IReadOnlyCollection<Group> Groups { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<Group> |
Laps
Gets the collection od the laps.
Declaration
public IReadOnlyCollection<Lap> Laps { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<Lap> |
NextChannelNumber
Gets and increment next channel id.
Declaration
public uint NextChannelNumber { get; set; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
Parameters
Gets the collection of parameters and their descriptions.
Declaration
public IEnumerable<Parameter> Parameters { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Parameter> |
ParametersByIdentifier
Gets the collection of key/value pairs for the parameters where key is defined as parameter identifier.
Declaration
public IReadOnlyDictionary<string, Parameter> ParametersByIdentifier { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyDictionary<System.String, Parameter> |
SessionItems
Gets the collection of key/value pairs for the session details.
Declaration
public IReadOnlyDictionary<string, string> SessionItems { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyDictionary<System.String, System.String> |
Methods
AddChannel(Channel)
Add a new channel into session.
Declaration
public void AddChannel(Channel channel)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | throw exception if channel is null. |
| System.ArgumentException | throw exception if channel is already added. |
AddGroup(Group)
Add a new group/sub group for parameter.
Declaration
public void AddGroup(Group group)
Parameters
| Type | Name | Description |
|---|---|---|
| Group | group |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | throw exception group is null. |
AddLap(Int32, Int64, LapType)
Add a new lap into session.
Declaration
public abstract void AddLap(int number, long time, LapType type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | number | lap number. |
| System.Int64 | time | lap timestamp. |
| LapType | type | type of the lap. |
AddParameter(Parameter)
Add a new parameter into the session along with it's conversion.
Declaration
public void AddParameter(Parameter parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| Parameter | parameter | parameter object. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | throw exception if validation is failed. |
AddSessionDetails(String, String)
Add a new session details into session.
Declaration
public void AddSessionDetails(string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | detail name. |
| System.String | value | detail value. |
BuildRationalParameter(String, String, Range)
Build the parameter with rational conversion.
Declaration
public RationalParameterBuilder BuildRationalParameter(string group, string name, Range physicalRange)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | group | group name. |
| System.String | name | conversion name. |
| Range | physicalRange | physical range of the parameter. |
Returns
| Type | Description |
|---|---|
| RationalParameterBuilder | rational parameter builder object. |
BuildTextParameter(String, String)
Build the parameter with text conversion.
Declaration
public TextParameterBuilder BuildTextParameter(string group, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | group | group name. |
| System.String | name | parameter name. |
Returns
| Type | Description |
|---|---|
| TextParameterBuilder | text parameter builder object. |
CloseSession(String)
Close the session.
Declaration
public abstract void CloseSession(string extension = "ssn")
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | extension | Close the session with extension, default is ssn. Pass ssv for associated session. |
CommitParameters()
Commits the parameters and it's related information into the session.
Declaration
public abstract void CommitParameters()
Dispose()
Declaration
public abstract void Dispose()
DoWritePeriodicData(UInt32, Int64, Int32, Byte[])
Add the samples into the channel.
Declaration
protected abstract void DoWritePeriodicData(uint channelNumber, long timestamp, int count, byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | channelNumber | chanel id. |
| System.Int64 | timestamp | first sample timestamp. |
| System.Int32 | count | sample count. |
| System.Byte[] | data | byte data array. |
WritePeriodicData(Channel, Int64, Int32, Byte[])
Write the periodic channel data into session.
Declaration
public void WritePeriodicData(Channel channel, long timestamp, int count, byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
| System.Int64 | timestamp | timestamp of first sample. |
| System.Int32 | count | sample count. |
| System.Byte[] | data | byte data array. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Throw argument exception if not periodic channel. |
WritePeriodicValues(Channel, Int64, Byte[], Int32, ByteOrder)
Write the data into session for a given channel. The data can be passed as byte array along with first sample timestamp.
Declaration
public void WritePeriodicValues(Channel channel, long timestamp, byte[] values, int count, ByteOrder byteOrder = ByteOrder.LittleEndian)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
| System.Int64 | timestamp | timestamp of first sample. |
| System.Byte[] | values | byte array of samples. |
| System.Int32 | count | sample count. |
| ByteOrder | byteOrder | byte order for little/big endian. Default is little endian |
WritePeriodicValues(Channel, Int64, Int16[], Int32, ByteOrder)
Write the data into session for a given channel. The data can be passed as short array along with first sample timestamp.
Declaration
public void WritePeriodicValues(Channel channel, long timestamp, short[] values, int count, ByteOrder byteOrder = ByteOrder.LittleEndian)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
| System.Int64 | timestamp | timestamp of first sample. |
| System.Int16[] | values | short array of samples. |
| System.Int32 | count | sample count. |
| ByteOrder | byteOrder | byte order for little/big endian. Default is little endian |
WritePeriodicValues(Channel, Int64, Int32[], Int32, ByteOrder)
Write the data into session for a given channel. The data can be passed as integer array along with first sample timestamp.
Declaration
public void WritePeriodicValues(Channel channel, long timestamp, int[] values, int count, ByteOrder byteOrder = ByteOrder.LittleEndian)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
| System.Int64 | timestamp | timestamp of first sample. |
| System.Int32[] | values | integer array of samples. |
| System.Int32 | count | sample count. |
| ByteOrder | byteOrder | byte order for little/big endian. Default is little endian |
WritePeriodicValues(Channel, Int64, SByte[], Int32, ByteOrder)
Write the data into session for a given channel. The data can be passed as signed byte array along with first sample timestamp.
Declaration
public void WritePeriodicValues(Channel channel, long timestamp, sbyte[] values, int count, ByteOrder byteOrder = ByteOrder.LittleEndian)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
| System.Int64 | timestamp | timestamp of first sample. |
| System.SByte[] | values | signed byte array of samples. |
| System.Int32 | count | sample count. |
| ByteOrder | byteOrder | byte order for little/big endian. Default is little endian |
WritePeriodicValues(Channel, Int64, Single[], Int32, ByteOrder)
Write the data into session for a given channel. The data can be passed as float array along with first sample timestamp.
Declaration
public void WritePeriodicValues(Channel channel, long timestamp, float[] values, int count, ByteOrder byteOrder = ByteOrder.LittleEndian)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
| System.Int64 | timestamp | timestamp of first sample. |
| System.Single[] | values | float array of samples. |
| System.Int32 | count | sample count. |
| ByteOrder | byteOrder | byte order for little/big endian. Default is little endian |
WritePeriodicValues(Channel, Int64, UInt16[], Int32, ByteOrder)
Write the data into session for a given channel. The data can be passed as unsigned short array along with first sample timestamp.
Declaration
public void WritePeriodicValues(Channel channel, long timestamp, ushort[] values, int count, ByteOrder byteOrder = ByteOrder.LittleEndian)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
| System.Int64 | timestamp | timestamp of first sample. |
| System.UInt16[] | values | unsigned short array of samples. |
| System.Int32 | count | sample count. |
| ByteOrder | byteOrder | byte order for little/big endian. Default is little endian |
WritePeriodicValues(Channel, Int64, UInt32[], Int32, ByteOrder)
Write the data into session for a given channel. The data can be passed as unsigned integer array along with first sample timestamp.
Declaration
public void WritePeriodicValues(Channel channel, long timestamp, uint[] values, int count, ByteOrder byteOrder = ByteOrder.LittleEndian)
Parameters
| Type | Name | Description |
|---|---|---|
| Channel | channel | channel object. |
| System.Int64 | timestamp | timestamp of first sample. |
| System.UInt32[] | values | unsigned integer array of samples. |
| System.Int32 | count | sample count. |
| ByteOrder | byteOrder | byte order for little/big endian. Default is little endian |