Package com.serotonin.m2m2.view

Examples of com.serotonin.m2m2.view.ImplDefinition


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

        return DEFINITIONS;
    }

    public static ViewComponent newInstance(String name) {
        ImplDefinition def = ImplDefinition.findByName(getImplementations(), name);
        try {
            return resolveClass(def).newInstance();
        }
        catch (Exception e) {
            throw new ShouldNeverHappenException("Error finding component with name '" + name + "': " + e.getMessage());
View Full Code Here

            String type = json.getString("type");
            if (type == null)
                throw new TranslatableJsonException("emport.error.component.missing", "type", getExportTypes());

            ImplDefinition def = ImplDefinition.findByExportName(getImplementations(), type);

            if (def == null)
                throw new TranslatableJsonException("emport.error.text.invalid", "type", type, getExportTypes());

            return resolveClass(def);
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.ImplDefinition

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.