Search in sources :

Example 1 with AnalogGraphicComponent

use of com.serotonin.m2m2.gviews.component.AnalogGraphicComponent in project ma-modules-public by infiniteautomation.

the class GraphicalViewDwr method saveAnalogGraphicComponent.

@DwrPermission(user = true)
public ProcessResult saveAnalogGraphicComponent(String viewComponentId, double min, double max, boolean displayText, String imageSetId) {
    ProcessResult response = new ProcessResult();
    // Validate
    if (min >= max)
        response.addContextualMessage("graphicRendererAnalogMin", "viewEdit.graphic.invalidMinMax");
    ImageSet imageSet = getImageSet(imageSetId);
    if (imageSet == null)
        response.addContextualMessage("graphicRendererAnalogImageSet", "viewEdit.graphic.missingImageSet");
    if (!response.getHasMessages()) {
        AnalogGraphicComponent c = (AnalogGraphicComponent) getViewComponent(viewComponentId);
        c.setMin(min);
        c.setMax(max);
        c.setDisplayText(displayText);
        c.tsetImageSet(imageSet);
        resetPointComponent(c);
    }
    return response;
}
Also used : AnalogGraphicComponent(com.serotonin.m2m2.gviews.component.AnalogGraphicComponent) ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) ImageSet(com.serotonin.m2m2.view.ImageSet) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Aggregations

AnalogGraphicComponent (com.serotonin.m2m2.gviews.component.AnalogGraphicComponent)1 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)1 ImageSet (com.serotonin.m2m2.view.ImageSet)1 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)1