Search in sources :

Example 1 with DataPointPropertiesTemplateDefinition

use of com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateDefinition in project ma-core-public by infiniteautomation.

the class TemplateDwr method getNewDataPointTemplate.

/**
 * Get a new Data Point Template
 * @return
 */
@DwrPermission(user = true)
public ProcessResult getNewDataPointTemplate() {
    ProcessResult response = new ProcessResult();
    DataPointPropertiesTemplateVO vo = new DataPointPropertiesTemplateVO();
    vo.setDefinition(new DataPointPropertiesTemplateDefinition());
    response.addData("vo", vo);
    return response;
}
Also used : ProcessResult(com.serotonin.m2m2.i18n.ProcessResult) DataPointPropertiesTemplateVO(com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateVO) DataPointPropertiesTemplateDefinition(com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateDefinition) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Example 2 with DataPointPropertiesTemplateDefinition

use of com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateDefinition in project ma-core-public by infiniteautomation.

the class DefaultDataPointPropertiesTemplateFactory method createDefaultBinaryTemplate.

protected DataPointPropertiesTemplateVO createDefaultBinaryTemplate() {
    DataPointPropertiesTemplateVO defaultBinaryPointTemplate = new DataPointPropertiesTemplateVO();
    defaultBinaryPointTemplate.setXid(BINARY_XID);
    defaultBinaryPointTemplate.setName("Binary");
    defaultBinaryPointTemplate.setDataTypeId(DataTypes.BINARY);
    defaultBinaryPointTemplate.setDefaultTemplate(true);
    defaultBinaryPointTemplate.setDefinition(new DataPointPropertiesTemplateDefinition());
    defaultBinaryPointTemplate.setChartColour("");
    defaultBinaryPointTemplate.setPlotType(PlotTypes.STEP);
    defaultBinaryPointTemplate.setLoggingType(LoggingTypes.ON_CHANGE);
    defaultBinaryPointTemplate.setDefaultCacheSize(1);
    BinaryTextRenderer binaryRenderer = new BinaryTextRenderer();
    binaryRenderer.setOneColour("black");
    binaryRenderer.setOneLabel("one");
    binaryRenderer.setZeroColour("blue");
    binaryRenderer.setZeroLabel("zero");
    defaultBinaryPointTemplate.setTextRenderer(binaryRenderer);
    TableChartRenderer binaryChartRenderer = new TableChartRenderer();
    binaryChartRenderer.setLimit(10);
    defaultBinaryPointTemplate.setChartRenderer(binaryChartRenderer);
    return defaultBinaryPointTemplate;
}
Also used : TableChartRenderer(com.serotonin.m2m2.view.chart.TableChartRenderer) BinaryTextRenderer(com.serotonin.m2m2.view.text.BinaryTextRenderer)

Example 3 with DataPointPropertiesTemplateDefinition

use of com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateDefinition in project ma-core-public by infiniteautomation.

the class DefaultDataPointPropertiesTemplateFactory method createDefaultNumericTemplate.

protected DataPointPropertiesTemplateVO createDefaultNumericTemplate() {
    DataPointPropertiesTemplateVO defaultNumericPointTemplate = new DataPointPropertiesTemplateVO();
    defaultNumericPointTemplate.setXid(NUMERIC_XID);
    defaultNumericPointTemplate.setName("Numeric");
    defaultNumericPointTemplate.setDefaultTemplate(true);
    defaultNumericPointTemplate.setDataTypeId(DataTypes.NUMERIC);
    defaultNumericPointTemplate.setDefinition(new DataPointPropertiesTemplateDefinition());
    defaultNumericPointTemplate.setChartColour("");
    defaultNumericPointTemplate.setPlotType(PlotTypes.SPLINE);
    defaultNumericPointTemplate.setLoggingType(LoggingTypes.INTERVAL);
    defaultNumericPointTemplate.setIntervalLoggingPeriod(1);
    defaultNumericPointTemplate.setIntervalLoggingPeriodType(TimePeriods.MINUTES);
    defaultNumericPointTemplate.setIntervalLoggingType(IntervalLoggingTypes.AVERAGE);
    defaultNumericPointTemplate.setDefaultCacheSize(1);
    AnalogRenderer numericTextRenderer = new AnalogRenderer();
    numericTextRenderer.setFormat("0.00");
    defaultNumericPointTemplate.setTextRenderer(numericTextRenderer);
    ImageChartRenderer numericChartRenderer = new ImageChartRenderer();
    numericChartRenderer.setTimePeriod(TimePeriods.DAYS);
    numericChartRenderer.setNumberOfPeriods(1);
    defaultNumericPointTemplate.setChartRenderer(numericChartRenderer);
    return defaultNumericPointTemplate;
}
Also used : AnalogRenderer(com.serotonin.m2m2.view.text.AnalogRenderer) ImageChartRenderer(com.serotonin.m2m2.view.chart.ImageChartRenderer)

Example 4 with DataPointPropertiesTemplateDefinition

use of com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateDefinition in project ma-core-public by infiniteautomation.

the class DefaultDataPointPropertiesTemplateFactory method createDefaultAlphanumericTemplate.

protected DataPointPropertiesTemplateVO createDefaultAlphanumericTemplate() {
    DataPointPropertiesTemplateVO defaultAlphanumericPointTemplate = new DataPointPropertiesTemplateVO();
    defaultAlphanumericPointTemplate.setXid(ALPHANUMERIC_XID);
    defaultAlphanumericPointTemplate.setName("Alphanumeric");
    defaultAlphanumericPointTemplate.setDataTypeId(DataTypes.ALPHANUMERIC);
    defaultAlphanumericPointTemplate.setDefaultTemplate(true);
    defaultAlphanumericPointTemplate.setDefinition(new DataPointPropertiesTemplateDefinition());
    defaultAlphanumericPointTemplate.setChartColour("");
    defaultAlphanumericPointTemplate.setPlotType(PlotTypes.STEP);
    defaultAlphanumericPointTemplate.setLoggingType(LoggingTypes.ON_CHANGE);
    defaultAlphanumericPointTemplate.setDefaultCacheSize(1);
    defaultAlphanumericPointTemplate.setTextRenderer(new PlainRenderer());
    TableChartRenderer alphaChartRenderer = new TableChartRenderer();
    alphaChartRenderer.setLimit(10);
    defaultAlphanumericPointTemplate.setChartRenderer(alphaChartRenderer);
    return defaultAlphanumericPointTemplate;
}
Also used : TableChartRenderer(com.serotonin.m2m2.view.chart.TableChartRenderer) PlainRenderer(com.serotonin.m2m2.view.text.PlainRenderer)

Example 5 with DataPointPropertiesTemplateDefinition

use of com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateDefinition in project ma-core-public by infiniteautomation.

the class DefaultDataPointPropertiesTemplateFactory method createDefaultMultistateTemplate.

protected DataPointPropertiesTemplateVO createDefaultMultistateTemplate() {
    DataPointPropertiesTemplateVO defaultMultistatePointTemplate = new DataPointPropertiesTemplateVO();
    defaultMultistatePointTemplate.setXid(MULTISTATE_XID);
    defaultMultistatePointTemplate.setName("Multistate");
    defaultMultistatePointTemplate.setDataTypeId(DataTypes.MULTISTATE);
    defaultMultistatePointTemplate.setDefaultTemplate(true);
    defaultMultistatePointTemplate.setDefinition(new DataPointPropertiesTemplateDefinition());
    defaultMultistatePointTemplate.setChartColour("");
    defaultMultistatePointTemplate.setPlotType(PlotTypes.STEP);
    defaultMultistatePointTemplate.setLoggingType(LoggingTypes.ON_CHANGE);
    defaultMultistatePointTemplate.setDefaultCacheSize(1);
    defaultMultistatePointTemplate.setTextRenderer(new PlainRenderer());
    TableChartRenderer multistateChartRenderer = new TableChartRenderer();
    multistateChartRenderer.setLimit(10);
    defaultMultistatePointTemplate.setChartRenderer(multistateChartRenderer);
    return defaultMultistatePointTemplate;
}
Also used : TableChartRenderer(com.serotonin.m2m2.view.chart.TableChartRenderer) PlainRenderer(com.serotonin.m2m2.view.text.PlainRenderer)

Aggregations

TableChartRenderer (com.serotonin.m2m2.view.chart.TableChartRenderer)3 PlainRenderer (com.serotonin.m2m2.view.text.PlainRenderer)2 ProcessResult (com.serotonin.m2m2.i18n.ProcessResult)1 ImageChartRenderer (com.serotonin.m2m2.view.chart.ImageChartRenderer)1 AnalogRenderer (com.serotonin.m2m2.view.text.AnalogRenderer)1 BinaryTextRenderer (com.serotonin.m2m2.view.text.BinaryTextRenderer)1 DataPointPropertiesTemplateDefinition (com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateDefinition)1 DataPointPropertiesTemplateVO (com.serotonin.m2m2.vo.template.DataPointPropertiesTemplateVO)1 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)1