use of com.serotonin.m2m2.gviews.component.DynamicGraphicComponent in project ma-modules-public by infiniteautomation.
the class GraphicalViewDwr method saveDynamicGraphicComponent.
@DwrPermission(user = true)
public ProcessResult saveDynamicGraphicComponent(String viewComponentId, double min, double max, boolean displayText, String dynamicImageId) {
ProcessResult response = new ProcessResult();
// Validate
if (min >= max)
response.addContextualMessage("graphicRendererDynamicMin", "viewEdit.graphic.invalidMinMax");
DynamicImage dynamicImage = getDynamicImage(dynamicImageId);
if (dynamicImage == null)
response.addContextualMessage("graphicRendererDynamicImage", "viewEdit.graphic.missingDynamicImage");
if (!response.getHasMessages()) {
DynamicGraphicComponent c = (DynamicGraphicComponent) getViewComponent(viewComponentId);
c.setMin(min);
c.setMax(max);
c.setDisplayText(displayText);
c.tsetDynamicImage(dynamicImage);
resetPointComponent(c);
}
return response;
}
Aggregations