use of com.serotonin.m2m2.vo.bean.ImageValueBean in project ma-core-public by infiniteautomation.
the class DataPointDetailsDwr method getFlipbookData.
@DwrPermission(user = true)
public ProcessResult getFlipbookData(int limit) {
HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
DataPointVO vo = Common.getUser(request).getEditPoint();
PointValueFacade facade = new PointValueFacade(vo.getId());
List<PointValueTime> values = facade.getLatestPointValues(limit);
Collections.reverse(values);
List<ImageValueBean> result = new ArrayList<ImageValueBean>();
for (PointValueTime pvt : values) {
ImageValue imageValue = (ImageValue) pvt.getValue();
String uri = ImageValueServlet.servletPath + ImageValueServlet.historyPrefix + pvt.getTime() + "_" + vo.getId() + "." + imageValue.getTypeExtension();
result.add(new ImageValueBean(Functions.getTime(pvt), uri));
}
ProcessResult response = new ProcessResult();
response.addData("images", result);
addAsof(response);
return response;
}
Aggregations