Defining Functions for the Custom Wizard Layout

The script main.py follows. It defines all functions executed by the callbacks in the project wizard CustomLayoutWizard. These functions reference the defined layouts using GetComponent().

def onrefreshTabularDataSample(step):
    comp = step.UserInterface.GetComponent("TabularData")
    table = step.Properties["Table"]
    comp.SetPropertyTable(table)

def onrefreshChartSample(step):
    table = step.PreviousStep.Properties["Table"]
    tableValue = table.Value
    rowCount = table.RowCount

    x = []
    y = []
    for rowIndex in range(0, rowCount):
        x.append(tableValue["Table/Time"][rowIndex].Value.Value)
        y.append(tableValue["Table/Pressure"][rowIndex].Value.Value)

    comp = step.UserInterface.GetComponent("Chart")
    comp.Plot(x, y)

def onresetTabularDataSample(step):
    #nothing to do
    pass