GraphPage::AddDuplicateWithData

 

Description

Batching ploting.

Syntax

int AddDuplicateWithData( StringArray & saItems, const DuplicateWithDataInfo & info )

Parameters

saItems
[input]Data to batch plot
info
[input]plot settings
struct DuplicateWithDataInfo
{
        int        nMatchSheets; // ODuplicateMatchSheet
        int        nMatchCols; // ODuplicateMatchCol
        int        nModifier; // PageModifierMatchType
        LPCSTR  lpcszUDL;

        bool       bAppend;
        bool       bInexact; // for Book and Sheet   
        bool       bUseAsso; // for column only
        bool       bRescaleAxes;
        bool       bRescaleClmp;
        LPCSTR  lpcszPresetSName;
        LPCSTR  lpcszPresetLName;
};

enum ODuplicateMatchSheet
{
        MATCHSHEET_IGNORE = -1,
        MATCHSHEET_INDEX,
        MATCHSHEET_SHORT_NAME,
        MATCHSHEET_LONG_NAME,
};

enum ODuplicateMatchCol
{
        MATCHCOLUMN_IGNORE = -1,
        MATCHCOLUMN_SHORT_NAME,
        MATCHCOLUMN_LONG_NAME,
        MATCHCOLUMN_INDEX,
};

typedef enum tagPageModifierMatchType
{
        PMMT_IGNORE     = -2, 
        PMMT_AUTO       = -1,
        PMMT_OFFSET     = 0,
        PMMT_SNAME,
        PMMT_LNAME,
        PMMT_UNIT,
        PMMT_COMMENT,
        PMMT_PARAM,
        PMMT_PARAM_END          = PMMT_PARAM + PARAMS_MAX_NUM,
        PMMT_USERPARAM          = PMMT_PARAM_END,
        PMMT_USERPARAM_END      = PMMT_USERPARAM + UDL_MAX_NUM,
} PageModifierMatchType;

Return

Returns 0 on successful exit and -1 on failure.

Examples

EX1

void DuplicateWithData_ex()
{
        Worksheet wks;
        wks.Create("origin");
        string strFile = GetAppPath(TRUE) + "Samples\\Curve Fitting\\Multiple Gaussians.dat";
        ASCIMP ascimp;
        wks.GetASCIMP(ascimp);
        if( 0 != wks.ImportASCII(strFile, ascimp) )
                return;
                
        GraphPage gp;
        gp.Create("origin");
        GraphLayer gl = gp.Layers(0);
        
        Curve cc(wks, 0, 1);
        gl.AddPlot(cc, IDM_PLOT_LINE);
        gl.Rescale();
        
        StringArray saItems;
        const DuplicateWithDataInfo info;
        info.nMatchSheets = MATCHSHEET_IGNORE;
        info.nMatchCols = MATCHCOLUMN_IGNORE;
        info.nModifier = PMMT_OFFSET;
        info.bUseAsso = true;
        info.bRescaleAxes = 1;
        info.bRescaleClmp = 1;
        info.bAppend = true;
        gp.GetDuplicateWithData(saItems, info);
        gp.AddDuplicateWithData(saItems, info);
        return;
}

See Also

GraphPage::GetDuplicateWithData

Header to Include

origin.h