Search in sources :

Example 1 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-core-public by infiniteautomation.

the class PointEventDetectorVO method getImplementations.

public static List<ImplDefinition> getImplementations(int dataType) {
    if (definitions == null) {
        List<ImplDefinition> d = new ArrayList<>();
        d.add(new ImplDefinition(TYPE_ANALOG_HIGH_LIMIT, null, "pointEdit.detectors.highLimit", new int[] { DataTypes.NUMERIC }));
        d.add(new ImplDefinition(TYPE_ANALOG_LOW_LIMIT, null, "pointEdit.detectors.lowLimit", new int[] { DataTypes.NUMERIC }));
        d.add(new ImplDefinition(TYPE_POINT_CHANGE, null, "pointEdit.detectors.change", new int[] { DataTypes.BINARY, DataTypes.MULTISTATE, DataTypes.NUMERIC, DataTypes.ALPHANUMERIC }));
        d.add(new ImplDefinition(TYPE_BINARY_STATE, null, "pointEdit.detectors.state", new int[] { DataTypes.BINARY }));
        d.add(new ImplDefinition(TYPE_MULTISTATE_STATE, null, "pointEdit.detectors.state", new int[] { DataTypes.MULTISTATE }));
        d.add(new ImplDefinition(TYPE_ALPHANUMERIC_STATE, null, "pointEdit.detectors.state", new int[] { DataTypes.ALPHANUMERIC }));
        d.add(new ImplDefinition(TYPE_ALPHANUMERIC_REGEX_STATE, null, "pointEdit.detectors.regexState", new int[] { DataTypes.ALPHANUMERIC }));
        d.add(new ImplDefinition(TYPE_STATE_CHANGE_COUNT, null, "pointEdit.detectors.changeCount", new int[] { DataTypes.BINARY, DataTypes.MULTISTATE, DataTypes.ALPHANUMERIC }));
        d.add(new ImplDefinition(TYPE_NO_CHANGE, null, "pointEdit.detectors.noChange", new int[] { DataTypes.BINARY, DataTypes.MULTISTATE, DataTypes.NUMERIC, DataTypes.ALPHANUMERIC }));
        d.add(new ImplDefinition(TYPE_NO_UPDATE, null, "pointEdit.detectors.noUpdate", new int[] { DataTypes.BINARY, DataTypes.MULTISTATE, DataTypes.NUMERIC, DataTypes.ALPHANUMERIC, DataTypes.IMAGE }));
        d.add(new ImplDefinition(TYPE_POSITIVE_CUSUM, null, "pointEdit.detectors.posCusum", new int[] { DataTypes.NUMERIC }));
        d.add(new ImplDefinition(TYPE_NEGATIVE_CUSUM, null, "pointEdit.detectors.negCusum", new int[] { DataTypes.NUMERIC }));
        d.add(new ImplDefinition(TYPE_ANALOG_RANGE, null, "pointEdit.detectors.range", new int[] { DataTypes.NUMERIC }));
        // d.add(new ImplDefinition(TYPE_ANALOG_CHANGE, null, "pointEdit.detectors.analogChange",
        // new int[] { DataTypes.NUMERIC }));
        d.add(new ImplDefinition(TYPE_SMOOTHNESS, null, "pointEdit.detectors.smoothness", new int[] { DataTypes.NUMERIC }));
        definitions = d;
    }
    List<ImplDefinition> impls = new ArrayList<>();
    for (ImplDefinition def : definitions) {
        if (def.supports(dataType))
            impls.add(def);
    }
    return impls;
}
Also used : ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) ArrayList(java.util.ArrayList)

Example 2 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-core-public by infiniteautomation.

the class BaseChartRenderer method getImplementations.

public static List<ImplDefinition> getImplementations(int dataType) {
    ensureDefinitions();
    List<ImplDefinition> impls = new ArrayList<ImplDefinition>();
    for (ImplDefinition def : definitions) {
        if (def.supports(dataType))
            impls.add(def);
    }
    return impls;
}
Also used : ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) ArrayList(java.util.ArrayList)

Example 3 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-core-public by infiniteautomation.

the class BaseTextRenderer method getImplementation.

public static List<ImplDefinition> getImplementation(int dataType) {
    ensureDefinitions();
    List<ImplDefinition> impls = new ArrayList<ImplDefinition>(definitions.size());
    for (ImplDefinition def : definitions) {
        if (def.supports(dataType))
            impls.add(def);
    }
    return impls;
}
Also used : ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) ArrayList(java.util.ArrayList)

Example 4 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-core-public by infiniteautomation.

the class BaseTextRenderer method getExportTypes.

public static List<String> getExportTypes() {
    ensureDefinitions();
    List<String> result = new ArrayList<String>(definitions.size());
    for (ImplDefinition def : definitions) result.add(def.getExportName());
    return result;
}
Also used : ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) ArrayList(java.util.ArrayList)

Example 5 with ImplDefinition

use of com.serotonin.m2m2.view.ImplDefinition in project ma-core-public by infiniteautomation.

the class DataPointDwr method getTextRendererOptions.

/**
 * Get a list of available Chart Renderers for this point
 *
 * @param vo
 * @return
 */
@DwrPermission(user = true)
public ProcessResult getTextRendererOptions(int dataTypeId) {
    ProcessResult response = new ProcessResult();
    List<ImplDefinition> list = BaseTextRenderer.getImplementation(dataTypeId);
    response.addData("options", list);
    return response;
}
Also used : ImplDefinition(com.serotonin.m2m2.view.ImplDefinition) ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Aggregations

ImplDefinition (com.serotonin.m2m2.view.ImplDefinition)9 ArrayList (java.util.ArrayList)7 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)3 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)2 StringStringPair (com.serotonin.db.pair.StringStringPair)1 ShareUser (com.serotonin.m2m2.view.ShareUser)1 AnonymousUser (com.serotonin.m2m2.vo.AnonymousUser)1 DataPointVO (com.serotonin.m2m2.vo.DataPointVO)1 User (com.serotonin.m2m2.vo.User)1 DataPointBean (com.serotonin.m2m2.web.dwr.beans.DataPointBean)1 HashMap (java.util.HashMap)1