Code Packages  1
Add-on code processing modules
Public Member Functions | Protected Member Functions | Properties | Events | List of all members
ChannelData.Channel Class Reference

Provides a reference type to represent a channel More...

Inheritance diagram for ChannelData.Channel:

Public Member Functions

 Channel ()
 Initialize a new instance of the Channel class More...
 
 Channel (string name, string group)
 Initialize a new instance of the Channel class with the specified Name and Group More...
 
override string ToString ()
 Shows the name and group of a channel More...
 
void UpdateStatistics ()
 Updates all statistical values More...
 

Protected Member Functions

void OnPropertyChanged (string name)
 

Properties

string Color [get, set]
 Gets or Sets the color of the channel More...
 
dynamic Data [get, set]
 Gets or Sets the data of the channel More...
 
double Fs [get, set]
 Gets or Sets the sampling rate (Hz) of the channel More...
 
string Group [get, set]
 Gets or Sets the group of the channel More...
 
bool IsSelected [get, set]
 Gets or Sets the selection property of the channel More...
 
string Name [get, set]
 Gets or Sets the name of the channel More...
 
double Period [get]
 Gets the sampling period (Sec) of the channel More...
 
int Samples [get]
 Gets the samples number from the channel More...
 
Stats Statistics [get]
 Holds statistical values More...
 
object Tag [get, set]
 Gets or Sets a Tag object to the channel More...
 
TimeSpan Time [get]
 Gets the total duration of the channel More...
 
string Type [get]
 Gets the Data type of the channel More...
 

Events

PropertyChangedEventHandler PropertyChanged
 

Detailed Description

Provides a reference type to represent a channel

Constructor & Destructor Documentation

◆ Channel() [1/2]

ChannelData.Channel.Channel ( )

Initialize a new instance of the Channel class

Example
The following example instantiates one Channel (c1) and assigns its reference to another channel (c2).
Since the Channel type is a class, the variables pass by reference and not by value.

Channel c1 = new Channel();
Channel c2 = c1;
c2.Name = "c2";
Console.WriteLine(c1.Name + ", " + c2.Name);
c2, c2

◆ Channel() [2/2]

ChannelData.Channel.Channel ( string  name,
string  group 
)

Initialize a new instance of the Channel class with the specified Name and Group

Parameters
namechannel's name
groupchannel's group

Example
The following example instantiates a Channel (c) with a channel name "MyChannel" and group "MyGroup".

Channel c = new Channel("MyChannel", "MyGroup");
Console.WriteLine(c);
MyChannel : MyGroup

Member Function Documentation

◆ OnPropertyChanged()

void ChannelData.Channel.OnPropertyChanged ( string  name)
protected

◆ ToString()

override string ChannelData.Channel.ToString ( )

Shows the name and group of a channel

Example

Channel c = new Channel();
c.Name = "myChannel";
c.Group = "myGroup";
Console.WriteLine(c);
myChannel : myGroup

◆ UpdateStatistics()

void ChannelData.Channel.UpdateStatistics ( )

Updates all statistical values

If the data type is not double array (double[]) NaN is returned

Property Documentation

◆ Color

string ChannelData.Channel.Color
getset

Gets or Sets the color of the channel

◆ Data

dynamic ChannelData.Channel.Data
getset

Gets or Sets the data of the channel

Example

Channel c = new Channel();
c.Data = new double[] { 1, 2, 3};
Console.WriteLine(RealData.ToString(c.Data, "\n"));
1
2
3

◆ Fs

double ChannelData.Channel.Fs
getset

Gets or Sets the sampling rate (Hz) of the channel

Example

Channel c = new Channel();
c.Fs = 200;
Console.WriteLine(c.Fs);
200

◆ Group

string ChannelData.Channel.Group
getset

Gets or Sets the group of the channel

Example

Channel c = new Channel();
c.Group = "my group";
Console.WriteLine(c.Group);
my group

◆ IsSelected

bool ChannelData.Channel.IsSelected
getset

Gets or Sets the selection property of the channel

◆ Name

string ChannelData.Channel.Name
getset

Gets or Sets the name of the channel

Example

Channel c = new Channel();
c.Name = "my channel";
Console.WriteLine(c.Name);
my channel

◆ Period

double ChannelData.Channel.Period
get

Gets the sampling period (Sec) of the channel

Example

Channel c = new Channel();
c.FS = 200;
Console.WriteLine(c.Period);
0,005

◆ Samples

int ChannelData.Channel.Samples
get

Gets the samples number from the channel

Equivalent to Length. If null returns zero.

Example

Channel c = new Channel();
c.Data = new double[] { 1, 2, 3};
Console.WriteLine(c.Samples);
3

◆ Statistics

Stats ChannelData.Channel.Statistics
get

Holds statistical values

◆ Tag

object ChannelData.Channel.Tag
getset

Gets or Sets a Tag object to the channel

◆ Time

TimeSpan ChannelData.Channel.Time
get

Gets the total duration of the channel

Data and FS must have been set appropriately

Example

Channel c = new Channel();
c.FS = 200;
c.Data = new double[4];
Console.WriteLine(c.Time);
00:00:00.0150000

◆ Type

string ChannelData.Channel.Type
get

Gets the Data type of the channel

Example

Channel c = new Channel();
c.Data = new double[] { 1, 2, 3};
Console.WriteLine(c.Type);

Event Documentation

◆ PropertyChanged

PropertyChangedEventHandler ChannelData.Channel.PropertyChanged