Public Member Functions | List of all members
DataSet Class Reference

DataSet class is used to specify or handle the settings of a data set (point sequence).
The class can be called from DataManager class, and also from CalculationDefinition , ProbeDefinition , SectionGraph , Study class as a graph data
. More...

Public Member Functions

int GetCols ()
 Returns the number of columns in the data set as an integer. More...
 
Variant GetColumn (int i)
 Returns the list of values for the specified column as a point sequence. More...
 
String GetColumnName (int i)
 Returns the name of the column as a string. More...
 
Variant GetCrossPoints (String &constantComponent, double ref, int col)
 Returns values of all intersections between the specified graph line and reference line as a point sequence. More...
 
double GetCrossPointValue (String &constantComponent, double ref, int col, int i)
 Returns a value of the intersection between the specified graph line and reference line as a real number. More...
 
String GetGroupName ()
 Returns the group name of the data set as a string. More...
 
String GetName ()
 Returns the name of the data set as a string. More...
 
Variant GetRange (int x1, int y1, int x2, int y2)
 Returns the list of values in the specified range in a data set as a point sequence. More...
 
int GetRows ()
 Returns the number of rows in the data set as an integer. More...
 
double GetValue (int i, int j)
 Returns the value of the cell (i, j) as a real number. More...
 
int GetViewOrder ()
 Returns the order for displaying data sets. More...
 
String GetXAxisTitle ()
 Returns the title of the X-axis. More...
 
String GetXAxisUnit ()
 Returns the unit for the X-axis. More...
 
String GetYAxisTitle ()
 Returns the title of the Y-axis. More...
 
String GetYAxisUnit ()
 Returns the unit for the Y-axis. More...
 
virtual bool IsValid ()
 Returns True if an object is valid. More...
 
int NumCrossPoints (String &constantComponent, double ref, int col)
 Returns the number of intersections between the specified line and the reference line. More...
 
void ReadFromFile (String &filename)
 Imports a point sequence file (*.csv, *.txt, *.pa). More...
 
bool SaveGraphImage (String &filename, int width, int height)
 Specifies the size and saves the graph image. More...
 
void SetColumn (int col, String array &list)
 Specifies the vector for the specified column. More...
 
void SetColumnUnit (int col, String &unitname)
 Applies any units for each value in a specified row of a point sequence. More...
 
void SetName (String &name)
 Specifies a name for the data set. More...
 
void SetTable (String array &mat)
 Specifies the point sequence of multidimensional array for the data set. More...
 
void SetValue (int i, int j, double value)
 Specifies a value for the specified cell (i, j). More...
 
void SetViewOrder (int order)
 Specifies the order for displaying data sets. More...
 
void WriteColumn (String &filename, Variant &val)
 Exports the data of the X-axis and a specified line to a file. More...
 
void WriteTable (String &filename)
 Exports data to a file. More...
 

Detailed Description

DataSet class is used to specify or handle the settings of a data set (point sequence).
The class can be called from DataManager class, and also from CalculationDefinition , ProbeDefinition , SectionGraph , Study class as a graph data
.

Example of calling the class object:

app.GetDataManager().GetDataSet(0)

Member Function Documentation

int DataSet::GetCols ( )

Returns the number of columns in the data set as an integer.

Returns
Number of columns in the data set

The column number in the graph is counted from zero.

Variant DataSet::GetColumn ( int  i)

Returns the list of values for the specified column as a point sequence.

Parameters
iColumn number
Returns
Values in the specified column
String DataSet::GetColumnName ( int  i)

Returns the name of the column as a string.

Parameters
iColumn number
Returns
Name of the column in the data set
Variant DataSet::GetCrossPoints ( String &  constantComponent,
double  ref,
int  col 
)

Returns values of all intersections between the specified graph line and reference line as a point sequence.

For example, the value of all intersections at the Y coordinate is returned when the axis for the reference line is X.

Parameters
constantComponentAxis specified as a reference line
X or Y
refReference line value
colColumn number (line number)
Returns
Value of all intersections
double DataSet::GetCrossPointValue ( String &  constantComponent,
double  ref,
int  col,
int  i 
)

Returns a value of the intersection between the specified graph line and reference line as a real number.

For example, the value intersecting on the Y coordinate is returned when axis for the reference line is X.

Parameters
constantComponentAxis specified as a reference line
X or Y
refReference line
colColumn number (line number)
iIntersection ID. The column number is counted from zero. The intersection ID is counted from 1.
Returns
Value of intersections
String DataSet::GetGroupName ( )

Returns the group name of the data set as a string.

Returns
Group name of the data set
String DataSet::GetName ( )

Returns the name of the data set as a string.

Returns
Name of the data set
Variant DataSet::GetRange ( int  x1,
int  y1,
int  x2,
int  y2 
)

Returns the list of values in the specified range in a data set as a point sequence.

Parameters
x1Start point in the horizontal position
y1Start point in the vertical position
x2End point in the horizontal position
y2End point in the vertical position
Returns
List of values in the specified range
int DataSet::GetRows ( )

Returns the number of rows in the data set as an integer.

Returns
Number of rows in the data set

The line number is counted from 0.

double DataSet::GetValue ( int  i,
int  j 
)

Returns the value of the cell (i, j) as a real number.

Parameters
iRow number
jColumn number
Returns
Value in the specified cell
int DataSet::GetViewOrder ( )

Returns the order for displaying data sets.

Returns
Order for displaying data sets
String DataSet::GetXAxisTitle ( )

Returns the title of the X-axis.

Returns
X-axis title
String DataSet::GetXAxisUnit ( )

Returns the unit for the X-axis.

Returns
X-axis unit
String DataSet::GetYAxisTitle ( )

Returns the title of the Y-axis.

Returns
Y-axis title
String DataSet::GetYAxisUnit ( )

Returns the unit for the Y-axis.

Returns
Y-axis unit
bool DataSet::IsValid ( )
virtual

Returns True if an object is valid.

Returns
Whether or not the DataSet objects in the list are valid
int DataSet::NumCrossPoints ( String &  constantComponent,
double  ref,
int  col 
)

Returns the number of intersections between the specified line and the reference line.

Parameters
constantComponentAxis specified as a reference line
X or Y
refReference line value
colColumn number (line number)
Returns
Number of intersections

The column number in the graph is counted from zero.

void DataSet::ReadFromFile ( String &  filename)

Imports a point sequence file (*.csv, *.txt, *.pa).

Parameters
filenamePoint sequence file path (*.csv, *.txt, *.pa)
bool DataSet::SaveGraphImage ( String &  filename,
int  width,
int  height 
)

Specifies the size and saves the graph image.

Parameters
filenameFile path (jpeg, png, bmp, svg)
widthWidth of the image (pixel)
heightHeight of the image (height)
Returns
Whether or not the graph image is saved
void DataSet::SetColumn ( int  col,
String array &  list 
)

Specifies the vector for the specified column.

Parameters
colColumn ID
listList of values
void DataSet::SetColumnUnit ( int  col,
String &  unitname 
)

Applies any units for each value in a specified row of a point sequence.

Parameters
colColumn ID
unitnameUnit name

This command is used for point sequence data.
The following are examples. The unit mm is applied as displacement for the displacement dependent point sequence (Intensityvsposition) of a switch component.

Call app.GetDataManager().CreatePointArray("Intensityvsposition")
Call app.GetDataManager().GetDataSet(0).SetName("untitled")
ReDim refarray(2,1)
refarray(0,0) = 11
refarray(0,1) = 1
refarray(1,0) = 22
refarray(1,1) = 1
refarray(2,0) = 33
refarray(2,1) = 1
Call app.GetDataManager().GetDataSet(0).SetTable(refarray)
Call app.GetDataManager().GetDataSet(0).SetColumnUnit(0, "mm")
void DataSet::SetName ( String &  name)

Specifies a name for the data set.

Parameters
nameData set name
void DataSet::SetTable ( String array &  mat)

Specifies the point sequence of multidimensional array for the data set.

Parameters
matMultidimensional array
void DataSet::SetValue ( int  i,
int  j,
double  value 
)

Specifies a value for the specified cell (i, j).

Parameters
iRow number
jColumn number
valueCell value
void DataSet::SetViewOrder ( int  order)

Specifies the order for displaying data sets.

Parameters
Orderfor displaying data sets
void DataSet::WriteColumn ( String &  filename,
Variant &  val 
)

Exports the data of the X-axis and a specified line to a file.

Parameters
filenameFile path
valName or index of the line

The exported file format is determined by the specified extension.

  • ***.txt >>> Text file (tab-delimited)
  • ***.csvj >>> CSV file (comma-delimited)
  • ***.htm or ***.html >>> HTML file
  • Extension not specified >>> Text file (tab-delimited)
void DataSet::WriteTable ( String &  filename)

Exports data to a file.

Parameters
filenameFile path

The file format is determined by the specified extension.

  • ***.txt >>> Text file (tab-delimited)
  • ***.csvj >>> CSV file (comma-delimited)
  • ***.htm or ***.html >>> HTML file
  • Extension not specified >>> Text file (tab-delimited)