auto_LoadDataset_CycleIndexΒΆ

auto_LoadDataset loads a 2D datasets from a data file opened with the function auto_ImportData or nc_open. A third channel must contain an index channel. For each value in the index channel a separate dataset can be created.

hvData = hvData = auto_LoadDataset_CycleIndex(ssDiagram, ssXName, ssYName, ssIndexName, bXSort, rvIndex)
hvData = auto_LoadDataset_CycleIndexEx(hLayer, ncid, ssXName, ssYName, ssIndexName, bXSort)
hvData = auto_LoadDataset_CycleIndexEx(hLayer, ncid, ssXName, ssYName, ssIndexName, bXSort, rvIndex)

Return Value

hvData is a vector of handles of the new datasets (see example). In case of an error, the first handle is 0.

Parameters

ssDiagram

ssDiagram is the name of the diagram in which the dataset should be displayed.

hLayer

hLayer is the diagram handle (see PageGetLayerHandle).

ssXName

ssXName is the channel name with the x-coordinates. Check the channel name spelling in the dialog box File=>Import Data.

ssYName

ssYName is the channel name with the y-coordinates. Check the channel name spelling in the dialog box File=>Import Data.

ssIndexName

ssIndexName is the channel name with the index values. The function expects interger values greater than 0, for example 1, 2, 3, etc.

bXSort

If bXSort is set to TRUE (1), the x-coordinates for each curve are sorted.

rvIndex

rvIndex is a vector with index values to create. If the value 0 is given, alle datasets are created.

ncid

ncid Identifies the netCDF file, see nc_open.

Comment

The function creates one dataset (curve) for each index value. The index value must be greater than 0 and an integer value. Example [1,1,1,2,2,2,2,3,3]. For this index value three cuves are created.

Example

hvData = auto_LoadDataset_CycleIndex("Diagramm 1", "CA", "p_cyl1", "Index", TRUE, [1,2,3])
if (hvData[1] == 0) {
    MessageBoxError("Cannot create dataset '%s, %s, %s'", "CA", "p_cyl1", "Index");
    return TRUE;
}

Example

auto_AddToUI("Examples", "Example 1: Cycle", "RS_Example_cycleindex");

def RS_Example_cycleindex()
{
    svFile = auto_GetFileNameDialog(1);
    if (svFile[1] == "DLG_CANCEL") {
        return;
    }
    auto_LoadTemplate(GetRootDirectory() + "samples/automate/Example.ipw");
    auto_SetImportOptions(2);
    auto_ImportData(svFile[1]);
    auto_LoadDataset_CycleIndex("Diagramm 1", "EngSpd", "SAETrq", "Index", TRUE, [1,2,3]);
    auto_LoadDataset_CycleIndex("Diagramm 2", "EngSpd", "SAEPwr", "Index", TRUE, 0);  // alle laden
    auto_ScaleAxes();
    auto_UpdatePage();
}

History

Version Description
R2016.6 Documentation added

id-1627322