Show / Hide Table of Contents

Interface ISessionBuilder

Interface class contains the signatures of properties and functions to build the text or rational parameter.

Namespace: MAT.AtlasSessionApi
Assembly: MAT.AtlasSessionApi.dll
Syntax
public interface ISessionBuilder

Properties

Committed

Gets the status of parameter details committed into session.

Declaration
bool Committed { get; }
Property Value
Type Description
System.Boolean

NextChannelNumber

Gets and sets the channel number. It is automatically maintained while building the text and rational parameters. User is allowed to change the channel number until and unless it's not overlapped with internal channel id.

Declaration
uint NextChannelNumber { get; set; }
Property Value
Type Description
System.UInt32
Remarks
using (ISessionWriter sessionWriter = new FileSessionWriter("C:\Test.ssn"))
{
    const long sampleInterval = 100000000;
    sessionWriter.NextChannelNumber = 1000;
    var channel = new Channel(sessionWriter.NextChannelNumber, sampleInterval, AtlasSessionApi.DataSource.Periodic);
    sessionWriter.BuildRationalParameter("TestGroup", "Parameter", new Range(-100, 100.0))
                   .OnChannel(channel)
                   .AddToSession();
    sessionWriter.CommitParameters();
}

Methods

AddGroup(Group)

Add the group/sub groups of the parameter.

Declaration
void AddGroup(Group group)
Parameters
Type Name Description
Group group

AddParameter(Parameter)

Add the parameter into session.

Declaration
void AddParameter(Parameter parameter)
Parameters
Type Name Description
Parameter parameter

BuildRationalParameter(String, String, Range)

Builds the text parameter with the given name and group.

Declaration
RationalParameterBuilder BuildRationalParameter(string group, string name, Range physicalRange)
Parameters
Type Name Description
System.String group
System.String name
Range physicalRange
Returns
Type Description
RationalParameterBuilder

Rational parameter builder object.

Remarks
using (ISessionWriter sessionWriter = new FileSessionWriter(@"C:\Test.ssn"))
{
    var subGroups = new List { "SubGroup1", "SubGroup2" };
    sessionWriter.BuildRationalParameter("TestGroup", "Parameter", new Range(-100, 100.0))
                   .Description("Description of Parameter")
                   .SubGroups(subGroups)
                   .Units("kph")
                   .OnPeriodicChannel(Interval.Frequency(10))
                   .AddToSession();
    sessionWriter.CommitParameters();
}

BuildTextParameter(String, String)

Builds the text parameter with the given name and group.

Declaration
TextParameterBuilder BuildTextParameter(string group, string name)
Parameters
Type Name Description
System.String group
System.String name
Returns
Type Description
TextParameterBuilder

Text parameter builder object.

Remarks
using (ISessionWriter sessionWriter1 = new FileSessionWriter(@"C:\Test.ssn"))
{
   var subGroups = new List { "SubGroup1", "SubGroup2" };
   const long sampleInterval = 100000000;
   sessionWriter1.BuildTextParameter("TestGroup", "Parameter")
            .AddLookup(1.0, "One")
            .AddLookup(2.0, "Two")
            .AddLookup(3.0, "Three")
            .AddLookup(4.0, "Four")
            .DefaultValue("One")
            .PhysicalRange(new Range(1, 4))     // Optional: PhysicalRange will automatically calculated by lookup table.
            .SubGroups(subGroups)
            .Description("Description of Parameter")
            .OnPeriodicChannel(sampleInterval, DataType.Unsigned8Bit)
            .AddToSession();
            sessionWriter1.CommitParameters();
}

CommitParameters()

Commits all the related details of the parameters into session. Once parameter is committed it can not be changed.

Declaration
void CommitParameters()
In This Article
Back to top Generated by DocFX