Search in sources :

Example 6 with VStringArray

use of org.diirt.vtype.VStringArray in project yamcs-studio by yamcs.

the class ChannelsFormulaFunction method calculate.

@Override
public Object calculate(final List<Object> args) {
    // Retrieve the new names
    VStringArray value = (VStringArray) args.get(0);
    List<String> newNames = null;
    if (value != null) {
        newNames = value.getData();
    }
    return calculateImpl(newNames);
}
Also used : VStringArray(org.diirt.vtype.VStringArray)

Example 7 with VStringArray

use of org.diirt.vtype.VStringArray in project yamcs-studio by yamcs.

the class ConcatStringArrayFunction method calculate.

@Override
public Object calculate(List<Object> args) {
    VStringArray stringArray = (VStringArray) args.get(0);
    if (stringArray == null) {
        return null;
    }
    StringBuffer sb = new StringBuffer();
    for (String str : stringArray.getData()) {
        sb.append(str);
    }
    return ValueFactory.newVString(sb.toString(), stringArray, stringArray);
}
Also used : VStringArray(org.diirt.vtype.VStringArray) VString(org.diirt.vtype.VString)

Example 8 with VStringArray

use of org.diirt.vtype.VStringArray in project yamcs-studio by yamcs.

the class TableUnionFunction method calculate.

@Override
public Object calculate(final List<Object> args) {
    VString columnName = (VString) args.get(0);
    VStringArray columnValues = (VStringArray) args.get(1);
    List<VTable> tables = new ArrayList<>();
    for (int i = 2; i < args.size(); i++) {
        Object object = args.get(i);
        tables.add((VTable) object);
    }
    return VTableFactory.union(columnName, columnValues, tables.toArray(new VTable[tables.size()]));
}
Also used : VString(org.diirt.vtype.VString) VTable(org.diirt.vtype.VTable) ArrayList(java.util.ArrayList) VStringArray(org.diirt.vtype.VStringArray)

Aggregations

VStringArray (org.diirt.vtype.VStringArray)8 VString (org.diirt.vtype.VString)4 VNumberArray (org.diirt.vtype.VNumberArray)3 VNumber (org.diirt.vtype.VNumber)2 VType (org.diirt.vtype.VType)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)1 IWidgetPropertyChangeHandler (org.csstudio.opibuilder.properties.IWidgetPropertyChangeHandler)1 ArrayFigure (org.csstudio.swt.widgets.figures.ArrayFigure)1 ListInt (org.diirt.util.array.ListInt)1 ListNumber (org.diirt.util.array.ListNumber)1 VDoubleArray (org.diirt.vtype.VDoubleArray)1 VEnum (org.diirt.vtype.VEnum)1 VEnumArray (org.diirt.vtype.VEnumArray)1 VTable (org.diirt.vtype.VTable)1 IFigure (org.eclipse.draw2d.IFigure)1 Dimension (org.eclipse.draw2d.geometry.Dimension)1