Package com.serotonin.m2m2.vo

Examples of com.serotonin.m2m2.vo.DataPointVO


        // no op
    }

    protected void jsonWriteDataPoint(ObjectWriter writer, String key, PointComponent comp) throws IOException,
            JsonException {
        DataPointVO dataPoint = comp.tgetDataPoint();
        if (dataPoint == null)
            writer.writeEntry(key, null);
        else
            writer.writeEntry(key, dataPoint.getXid());
    }
View Full Code Here


        else
            writer.writeEntry(key, dataPoint.getXid());
    }

    protected void jsonWriteDataPoint(Map<String, Object> map, String key, PointComponent comp) {
        DataPointVO dataPoint = comp.tgetDataPoint();
        if (dataPoint == null)
            map.put(key, null);
        else
            map.put(key, dataPoint.getXid());
    }
View Full Code Here

    }

    protected void jsonReadDataPoint(JsonValue jsonXid, PointComponent comp) throws JsonException {
        if (jsonXid != null) {
            String xid = jsonXid.toString();
            DataPointVO dataPoint = new DataPointDao().getDataPoint(xid);
            if (dataPoint == null)
                throw new TranslatableJsonException("emport.error.missingPoint", xid);
            if (!comp.definition().supports(dataPoint.getPointLocator().getDataTypeId()))
                throw new TranslatableJsonException("emport.error.component.incompatibleDataType", xid, definition()
                        .getExportName());
            comp.tsetDataPoint(dataPoint);
        }
    }
View Full Code Here

        else {
            // Create the script engine.
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine engine = manager.getEngineByName("js");

            DataPointVO point = tgetDataPoint();

            // Put the values into the engine scope.
            engine.put("value", value.getValue().getObjectValue());
            engine.put("htmlText", Functions.getHtmlText(point, value));
            engine.put("renderedText", Functions.getRenderedText(point, value));
View Full Code Here

        return EVAL_BODY_INCLUDE;
    }

    void addChartPoint(String xid, String color) throws JspException {
        DataPointVO dataPointVO = getDataPointVO(view, xid);
        points.add(new JspViewChartPoint(dataPointVO, color));
    }
View Full Code Here

    public int doStartTag() throws JspException {
        // Find the custom view.
        JspView view = getJspView();

        // Find the point.
        DataPointVO dataPointVO = getDataPointVO(view, xid);

        // Add the point to the view
        int id = view.addPoint(dataPointVO, raw, disabledValue, time);

        // Add the id for the point to the page context.
View Full Code Here

    public int doStartTag() throws JspException {
        // Find the custom view.
        JspView view = getJspView();

        // Find the point.
        DataPointVO dataPointVO = getDataPointVO(view, xid);

        // Write the value into the page.
        JspWriter out = pageContext.getOut();
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();

        DataPointRT dataPointRT = Common.runtimeManager.getDataPoint(dataPointVO.getId());
        if (dataPointRT == null)
            write(out, disabledValue);
        else {
            PointValueTime pvt = dataPointRT.getPointValue();

            if (pvt != null && pvt.getValue() instanceof ImageValue) {
                // Text renderers don't help here. Create a thumbnail.
                Map<String, Object> model = new HashMap<String, Object>();
                model.put("point", dataPointVO);
                model.put("pointValue", pvt);
                write(out, BaseDwr.generateContent(request, "imageValueThumbnail.jsp", model));
            }
            else {
                int hint = raw ? TextRenderer.HINT_RAW : TextRenderer.HINT_FULL;
                write(out, dataPointVO.getTextRenderer().getText(pvt, hint));
            }
        }

        return EVAL_BODY_INCLUDE;
    }
View Full Code Here

    @DwrPermission(user = true)
    public WatchListState addToWatchList(int pointId) {
        HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
        User user = Common.getUser();
        DataPointVO point = new DataPointDao().getDataPoint(pointId);
        if (point == null)
            return null;
        WatchList watchList = getWatchList(user);

        // Check permissions.
View Full Code Here

        User user = Common.getUser();
        WatchList watchList = getWatchList(user);
        WatchListCommon.ensureWatchListEditPermission(user, watchList);
        List<DataPointVO> points = watchList.getPointList();

        DataPointVO point;
        for (int i = 0; i < points.size(); i++) {
            point = points.get(i);
            if (point.getId() == pointId) {
                points.set(i, points.get(i - 1));
                points.set(i - 1, point);
                break;
            }
        }
View Full Code Here

        User user = Common.getUser();
        WatchList watchList = getWatchList(user);
        WatchListCommon.ensureWatchListEditPermission(user, watchList);
        List<DataPointVO> points = watchList.getPointList();

        DataPointVO point;
        for (int i = 0; i < points.size(); i++) {
            point = points.get(i);
            if (point.getId() == pointId) {
                points.set(i, points.get(i + 1));
                points.set(i + 1, point);
                break;
            }
        }
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.vo.DataPointVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.