Package com.serotonin.m2m2.view.export

Examples of com.serotonin.m2m2.view.export.CsvWriter


      startObject = BinaryValue.parseBinary(startValue);
    else if (dataTypeId == DataTypes.MULTISTATE) {
      try {
        startObject = MultistateValue.parseMultistate(startValue);
      } catch (NumberFormatException e) {
        startObject = new MultistateValue(0);
      }
    } else if (dataTypeId == DataTypes.NUMERIC) {
      try {
        startObject = NumericValue.parseNumeric(startValue);
      } catch (NumberFormatException e) {
View Full Code Here


      }
    } else if (dataTypeId == DataTypes.NUMERIC) {
      try {
        startObject = NumericValue.parseNumeric(startValue);
      } catch (NumberFormatException e) {
        startObject = new NumericValue(0);
      }
    } else {
      if (startValue == null)
        startObject = new AlphanumericValue("");
      else
View Full Code Here

        double newValue = currentValue.getDoubleValue() + change;
        if (newValue > vo.getMax())
            newValue = vo.getMax();
        if (newValue < vo.getMin())
            newValue = vo.getMin();
        return new NumericValue(newValue);
    }
View Full Code Here

        return "publisherEdit.squwk";
    }

    @Override
    protected PublisherVO<? extends PublishedPointVO> createPublisherVO() {
        return new SquwkSenderVO();
    }
View Full Code Here

        model.put("NUMERIC", DataTypes.NUMERIC);
        model.put("IMAGE", DataTypes.IMAGE);

        // Create the individual point charts
        for (PointStatistics pointStat : pointStatistics) {
            PointTimeSeriesCollection ptsc = new PointTimeSeriesCollection(timeZone);

            if (pointStat.getNumericTimeSeries() != null)
                ptsc.addNumericTimeSeries(pointStat.getNumericTimeSeries().plainCopy());
            else if (pointStat.getDiscreteTimeSeries() != null)
                ptsc.addDiscreteTimeSeries(pointStat.getDiscreteTimeSeries().plainCopy());

            if (ptsc.hasData()) {
                if (inlinePrefix != null)
                    model.put("chartName", inlinePrefix + pointStat.getChartName());
                pointStat.setImageData(ImageChartUtils.getChartData(ptsc, POINT_IMAGE_WIDTH, POINT_IMAGE_HEIGHT,
                        reportInstance.getReportStartTime(), reportInstance.getReportEndTime()));
            }
        }

        PointTimeSeriesCollection ptsc = handler.getPointTimeSeriesCollection();
        if (ptsc.hasData()) {
            if (inlinePrefix != null)
                model.put("chartName", inlinePrefix + IMAGE_CONTENT_ID);
            else {
                chartName = "r" + reportInstance.getId() + ".png";
                // The path comes from the servlet path definition in web.xml.
View Full Code Here

/**
* @author Matthew Lohbihler
*/
public class UserCommentCsvStreamer {
    public UserCommentCsvStreamer(PrintWriter out, List<ReportUserComment> comments, Translations translations) {
        CsvWriter csvWriter = new CsvWriter();
        String[] data = new String[5];

        // Write the headers.
        data[0] = translations.translate("users.username");
        data[1] = translations.translate("reports.commentList.type");
        data[2] = translations.translate("reports.commentList.typeKey");
        data[3] = translations.translate("reports.commentList.time");
        data[4] = translations.translate("notes.note");
        out.write(csvWriter.encodeRow(data));

        for (ReportUserComment comment : comments) {
            data[0] = comment.getUsername();
            if (data[0] == null)
                data[0] = translations.translate("common.deleted");
            if (comment.getCommentType() == UserComment.TYPE_EVENT) {
                data[1] = translations.translate("reports.commentList.type.event");
                data[2] = Integer.toString(comment.getTypeKey());
            }
            else if (comment.getCommentType() == UserComment.TYPE_POINT) {
                data[1] = translations.translate("reports.commentList.type.point");
                data[2] = comment.getPointName();
            }
            else {
                data[1] = translations.translate("common.unknown");
                data[2] = "";
            }

            data[3] = comment.getPrettyTime();
            data[4] = comment.getComment();

            out.write(csvWriter.encodeRow(data));
        }

        out.flush();
        out.close();
    }
View Full Code Here

        return KEY;
    }

    @Override
    public ChangeTypeRT createRuntime() {
        return new AlternateBooleanChangeRT();
    }
View Full Code Here

    return alternateBooleanChange;
  }

  @Override
  public PointLocatorRT createRuntime() {
    ChangeTypeRT changeType = getChangeType().createRuntime();
    String startValue = getChangeType().getStartValue();
    DataValue startObject;
    if (dataTypeId == DataTypes.BINARY)
      startObject = BinaryValue.parseBinary(startValue);
    else if (dataTypeId == DataTypes.MULTISTATE) {
View Full Code Here

        return KEY;
    }

    @Override
    public ChangeTypeRT createRuntime() {
        return new IncrementAnalogChangeRT(this);
    }
View Full Code Here

        return KEY;
    }

    @Override
    public ChangeTypeRT createRuntime() {
        return new RandomBooleanChangeRT();
    }
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.view.export.CsvWriter

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.