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;
}
Aggregations