Search in sources :

Example 1 with NameDefinedCategory

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

the class IntensityGraphModel method addAxisProperties.

private void addAxisProperties() {
    WidgetPropertyCategory xCategory = new NameDefinedCategory("X Axis");
    WidgetPropertyCategory yCategory = new NameDefinedCategory("Y Axis");
    for (AxisProperty axisProperty : AxisProperty.values()) addAxisProperty(X_AXIS_ID, axisProperty, xCategory);
    for (AxisProperty axisProperty : AxisProperty.values()) addAxisProperty(Y_AXIS_ID, axisProperty, yCategory);
}
Also used : WidgetPropertyCategory(org.csstudio.opibuilder.properties.WidgetPropertyCategory) NameDefinedCategory(org.csstudio.opibuilder.properties.NameDefinedCategory)

Example 2 with NameDefinedCategory

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

the class LEDModel method configureProperties.

@Override
protected void configureProperties() {
    super.configureProperties();
    addProperty(new BooleanProperty(PROP_EFFECT3D, "3D Effect", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_SQUARE_LED, "Square LED", WidgetPropertyCategory.Display, false));
    setPropertyVisible(PROP_BOOL_LABEL_POS, false);
    addProperty(new IntegerProperty(PROP_NSTATES, "State Count", WidgetPropertyCategory.Behavior, 2, 2, LEDFigure.MAX_NSTATES));
    setPropertyVisibleAndSavable(PROP_NSTATES, true, false);
    WidgetPropertyCategory category = new NameDefinedCategory("State Fallback");
    addProperty(new StringProperty(PROP_STATE_FALLBACK_LABEL, "Label", category, LEDFigure.DEFAULT_STATE_FALLBACK_LABAL));
    setPropertyVisibleAndSavable(PROP_STATE_FALLBACK_LABEL, false, false);
    addProperty(new ColorProperty(PROP_STATE_FALLBACK_COLOR, "Color", category, LEDFigure.DEFAULT_STATE_FALLBACK_COLOR.getRGB()));
    setPropertyVisibleAndSavable(PROP_STATE_FALLBACK_COLOR, false, false);
    addProperty(new IntegerProperty(PROP_BULB_BORDER, "Bulb border", WidgetPropertyCategory.Display, LEDFigure.DEFAULT_BULB_BORDER_WIDTH));
    addProperty(new ColorProperty(PROP_BULB_BORDER_COLOR, "Bulb border color", WidgetPropertyCategory.Display, LEDFigure.DEFAULT_BULB_BORDER_COLOR.getRGB()));
    for (int state = 0; state < LEDFigure.MAX_NSTATES; state++) {
        category = new NameDefinedCategory(String.format("State %02d", state + 1));
        addProperty(new StringProperty(String.format(PROP_STATE_LABEL, state), "Label", category, LEDFigure.DEFAULT_STATE_LABELS[state]));
        setPropertyVisibleAndSavable(String.format(PROP_STATE_LABEL, state), false, false);
        addProperty(new ColorProperty(String.format(PROP_STATE_COLOR, state), "Color", category, LEDFigure.DEFAULT_STATE_COLORS[state].getRGB()));
        setPropertyVisibleAndSavable(String.format(PROP_STATE_COLOR, state), false, false);
        addProperty(new DoubleProperty(String.format(PROP_STATE_VALUE, state), "Value", category, LEDFigure.DEFAULT_STATE_VALUES[state]));
        setPropertyVisibleAndSavable(String.format(PROP_STATE_VALUE, state), false, false);
    }
}
Also used : IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) WidgetPropertyCategory(org.csstudio.opibuilder.properties.WidgetPropertyCategory) DoubleProperty(org.csstudio.opibuilder.properties.DoubleProperty) NameDefinedCategory(org.csstudio.opibuilder.properties.NameDefinedCategory) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty)

Example 3 with NameDefinedCategory

use of org.csstudio.opibuilder.properties.NameDefinedCategory 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 4 with NameDefinedCategory

use of org.csstudio.opibuilder.properties.NameDefinedCategory 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

NameDefinedCategory (org.csstudio.opibuilder.properties.NameDefinedCategory)4 WidgetPropertyCategory (org.csstudio.opibuilder.properties.WidgetPropertyCategory)4 BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)2 ColorProperty (org.csstudio.opibuilder.properties.ColorProperty)2 IntegerProperty (org.csstudio.opibuilder.properties.IntegerProperty)2 StringProperty (org.csstudio.opibuilder.properties.StringProperty)2 ComboProperty (org.csstudio.opibuilder.properties.ComboProperty)1 DoubleProperty (org.csstudio.opibuilder.properties.DoubleProperty)1 PVNameProperty (org.csstudio.opibuilder.properties.PVNameProperty)1 PVValueProperty (org.csstudio.opibuilder.properties.PVValueProperty)1