Class Channel
Represents a channel which defines the type and frequency at which data is stored in SQL Race.
Inheritance
Namespace: MESL.SqlRace.Domain
Assembly: MESL.SqlRace.Domain.dll
Syntax
public class Channel : Object, IChannel, IEquatable<Channel>
Remarks
A channel is a single measurable entity for which data can be collected. There are a number of different channel source types; ChannelDataSourceType which can store different data types; DataType
A Parameter is used to collect together associated channels (e.g. multiple sampling frequencies of the same entity) ready for reading. To write data to a specific channel, use the appropriate method on a Session.
Constructors
Channel(UInt32, String, Int64, DataType, ChannelDataSourceType, String, Boolean)
Initialises a new instance of the Channel class Creates a new Channel object based on values passed.
Declaration
public Channel(uint id, string name, long interval, DataType dataType, ChannelDataSourceType dataSourceType, string parameterChannelKey = "", bool inMemory = false)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | id | |
System.String | name | Channel name. |
System.Int64 | interval | Interval between samples. |
DataType | dataType | Type of data contained in the channel. |
ChannelDataSourceType | dataSourceType | Type of data source. |
System.String | parameterChannelKey | The parameter channel key. |
System.Boolean | inMemory | [true] if this channel should be in-memory only (data will never be flushed to disk and retained until the channel is removed); [false] otherwise. |
Fields
DefaultParameterChannelKey
The default parameter channel key
Declaration
public const string DefaultParameterChannelKey = ""
Field Value
Type | Description |
---|---|
System.String |
Properties
DataSource
Gets the ChannelDataSourceType that is providing the data this channel holds.
Declaration
public ChannelDataSourceType DataSource { get; }
Property Value
Type | Description |
---|---|
ChannelDataSourceType |
DataType
Gets the DataType representing the type and size of the data that this channels samples will be.
Declaration
public DataType DataType { get; }
Property Value
Type | Description |
---|---|
DataType |
Id
Gets the channel ID.
Declaration
public uint Id { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
InMemory
Gets a value indicating whether this IChannel should be held in-memory only and never persisted to the file system.
Declaration
public bool InMemory { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Interval
Gets the frequency period of the channel samples (in nanoseconds).
Declaration
public long Interval { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Remarks
For non-periodic RowData or Scalar Channels, this will be set to zero.
Name
Gets the channel name.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
ParameterChannelKey
Gets the parameter channel key, used to identify channels to which this channel should be associated.
Declaration
public string ParameterChannelKey { get; }
Property Value
Type | Description |
---|---|
System.String | The parameter channel key. |
ReadOnly
Gets or sets a value indicating whether this IChannel is read-only.
Declaration
public bool ReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
SampleSizeInBytes
Gets the size in bytes of a sample for this channel.
Declaration
public int SampleSizeInBytes { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
CreateCopy(UInt32)
Creates a copy of this Channel with the channelIdOffset applied.
Declaration
public IChannel CreateCopy(uint channelIdOffset)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | channelIdOffset | The channel id offset to apply. |
Returns
Type | Description |
---|---|
IChannel | A copy of the channel. |
CreatePeriodic(DataType, Int32)
Creates a periodic channel.
Declaration
public static Channel CreatePeriodic(DataType dataType, int sampleInterval)
Parameters
Type | Name | Description |
---|---|---|
DataType | dataType | Type of the data. |
System.Int32 | sampleInterval | The sample interval. |
Returns
Type | Description |
---|---|
Channel | Periodic channel. |
CreateSlowRow(DataType)
Creates a slow row channel.
Declaration
public static Channel CreateSlowRow(DataType dataType)
Parameters
Type | Name | Description |
---|---|---|
DataType | dataType | Type of the data. |
Returns
Type | Description |
---|---|
Channel | Slow row channel. |
CreateSynchro(DataType)
Creates a synchro channel.
Declaration
public static Channel CreateSynchro(DataType dataType)
Parameters
Type | Name | Description |
---|---|---|
DataType | dataType | Type of the data. |
Returns
Type | Description |
---|---|
Channel | Synchro channel. |
Equals(Channel)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Channel obj)
Parameters
Type | Name | Description |
---|---|---|
Channel | obj | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the current object is equal to the |
Equals(Object)
Determines whether the specified System.Object is equal to the current System.Object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current System.Object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the specified System.Object is equal to the current System.Object; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | The |
GetHashCode()
Serves as a hash function for a particular type.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current System.Object. |
ToString()
Returns a System.String that represents the current System.Object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents the current System.Object. |