Search in sources :

Example 6 with WidgetPropertyCategory

use of org.csstudio.opibuilder.properties.WidgetPropertyCategory in project yamcs-studio by yamcs.

the class XYGraphModel method addAxisProperties.

private void addAxisProperties() {
    for (int i = 0; i < MAX_AXES_AMOUNT; i++) {
        WidgetPropertyCategory category;
        if (i == 0)
            category = new NameDefinedCategory("Primary X Axis (0)");
        else if (i == 1)
            category = new NameDefinedCategory("Primary Y Axis (1)");
        else
            category = new NameDefinedCategory("Secondary Axis (" + i + ")");
        for (AxisProperty axisProperty : AxisProperty.values()) addAxisProperty(axisProperty, i, category);
    }
}
Also used : WidgetPropertyCategory(org.csstudio.opibuilder.properties.WidgetPropertyCategory) NameDefinedCategory(org.csstudio.opibuilder.properties.NameDefinedCategory)

Example 7 with WidgetPropertyCategory

use of org.csstudio.opibuilder.properties.WidgetPropertyCategory in project yamcs-studio by yamcs.

the class XYGraphModel method addTraceProperty.

private void addTraceProperty(TraceProperty traceProperty, int traceIndex) {
    String propID = makeTracePropID(traceProperty.propIDPre, traceIndex);
    WidgetPropertyCategory category = new NameDefinedCategory("Trace " + traceIndex);
    switch(traceProperty) {
        case NAME:
            addProperty(new StringProperty(propID, traceProperty.toString(), category, "$(" + makeTracePropID(TraceProperty.YPV.propIDPre, traceIndex) + ")"));
            break;
        case ANTI_ALIAS:
            // case CHRONOLOGICAL:
            addProperty(new BooleanProperty(propID, traceProperty.toString(), category, true));
            break;
        case BUFFER_SIZE:
            addProperty(new IntegerProperty(propID, traceProperty.toString(), category, DEFAULT_BUFFER_SIZE, 1, MAX_BUFFER_SIZE));
            break;
        case CONCATENATE_DATA:
            addProperty(new BooleanProperty(propID, traceProperty.toString(), category, true));
            break;
        // break;
        case LINE_WIDTH:
            addProperty(new IntegerProperty(propID, traceProperty.toString(), category, 1, 1, 100));
            break;
        case PLOTMODE:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, PlotMode.stringValues(), 0));
            break;
        case POINT_SIZE:
            addProperty(new IntegerProperty(propID, traceProperty.toString(), category, 4, 1, 200));
            break;
        case POINT_STYLE:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, PointStyle.stringValues(), 0));
            break;
        case TRACE_COLOR:
            addProperty(new ColorProperty(propID, traceProperty.toString(), category, XYGraph.DEFAULT_TRACES_COLOR[traceIndex % XYGraph.DEFAULT_TRACES_COLOR.length]));
            break;
        case TRACE_TYPE:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, TraceType.stringValues(), 0));
            break;
        // break;
        case UPDATE_DELAY:
            addProperty(new IntegerProperty(propID, traceProperty.toString(), category, 100, 0, 655350));
            break;
        case UPDATE_MODE:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, UpdateMode.stringValues(), 0));
            break;
        case XAXIS_INDEX:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, AXES_ARRAY, 0));
            break;
        case XPV:
            addPVProperty(new PVNameProperty(propID, traceProperty.toString(), category, ""), new PVValueProperty(makeTracePropID(TraceProperty.XPV_VALUE.propIDPre, traceIndex), null));
            break;
        case YPV:
            addPVProperty(new PVNameProperty(propID, traceProperty.toString(), category, // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            traceIndex == 0 ? "$(" + PROP_PVNAME + ")" : ""), new PVValueProperty(makeTracePropID(TraceProperty.YPV_VALUE.propIDPre, traceIndex), null));
            break;
        case YAXIS_INDEX:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, AXES_ARRAY, 1));
            break;
        case VISIBLE:
            addProperty(new BooleanProperty(propID, traceProperty.toString(), category, true));
            break;
        default:
            break;
    }
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) WidgetPropertyCategory(org.csstudio.opibuilder.properties.WidgetPropertyCategory) PVValueProperty(org.csstudio.opibuilder.properties.PVValueProperty) NameDefinedCategory(org.csstudio.opibuilder.properties.NameDefinedCategory) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty) PVNameProperty(org.csstudio.opibuilder.properties.PVNameProperty)

Aggregations

WidgetPropertyCategory (org.csstudio.opibuilder.properties.WidgetPropertyCategory)7 BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)5 IntegerProperty (org.csstudio.opibuilder.properties.IntegerProperty)4 NameDefinedCategory (org.csstudio.opibuilder.properties.NameDefinedCategory)4 ColorProperty (org.csstudio.opibuilder.properties.ColorProperty)3 ComboProperty (org.csstudio.opibuilder.properties.ComboProperty)3 DoubleProperty (org.csstudio.opibuilder.properties.DoubleProperty)3 StringProperty (org.csstudio.opibuilder.properties.StringProperty)3 FilePathProperty (org.csstudio.opibuilder.properties.FilePathProperty)1 FontProperty (org.csstudio.opibuilder.properties.FontProperty)1 PVNameProperty (org.csstudio.opibuilder.properties.PVNameProperty)1 PVValueProperty (org.csstudio.opibuilder.properties.PVValueProperty)1