DESY ACOP Beans Home

de.desy.acop.displayers.chart
Class AcopTrendChartConsumer

java.lang.Object
  extended by de.desy.acop.displayers.chart.AcopChartConsumer
      extended by de.desy.acop.displayers.chart.AcopTrendChartConsumer
All Implemented Interfaces:
DataConsumer, DoubleSeqConsumer

public class AcopTrendChartConsumer
extends AcopChartConsumer

AcopTrendChartConsumer is a consumer used by AcopTrendChart Each consumer can present one trend line in the chart which shows the time evolution of some remote property. Consumers can be added or removed from the chart in runtime. This consumer works with AcopGraphHistoryParameters which specifiy all the properties required to customize a particular trend line.

Author:
Tilen Kusterle, Cosylab
See Also:
AcopTrendChart, AcopGraphHistoryParameters

Field Summary
static int MAX_POINTS
           
static java.lang.String SEQUENCE_INDEX
           
static java.lang.String SEQUENCE_LENGTH
           
 
Fields inherited from class de.desy.acop.displayers.chart.AcopChartConsumer
acopChartReorg, arraySize, color, disable, dispalyMode, displayerParameters, displayHandle, lastTimestamp, maxNumber, name, SUPPORTED_CHARACTERISTICS, SUPPORTED_CONSUMER_TYPES, textHandle, width, xData, xLabels, yData
 
Constructor Summary
AcopTrendChartConsumer(AcopTrendChart acopTrendChart, java.lang.String name)
          Constructs a new AcopTrendChartConsumer.
 
Method Summary
 double[][] dumpData()
          Returns all data from chart.
 HistoryParameters getHistoryParameters()
          Returns the history parameters if this graph includes history data.
 int getSequenceIndex()
          Returns the sequence index.
 int getSequenceLength()
          Returns the length of the sequence.
 boolean isNormalizedData()
          Returns true if this consumer shows data as normalized.
 boolean isTrendChart()
          Returns true if this graph is a trend.
 void loadHistoryData(double[][] historyData)
          Sets the history data for this graph.
 void setCharacteristics(java.util.Map characteristics)
          Sets new dynamic value characteristics to this data consumer.
 void setDisplayerParameters(AcopGraphParameters displayerParameters)
          Associates AcopGraphParameters with this consumer.
 void setNormalizedData(boolean normalized)
          Sets the data in the consumer normalized or absolute.
 void setSequenceIndex(int sequenceIndex)
          Sets the sequence index.
 void setSequenceLength(int sequenceLength)
          Sets the length of the sequence.
 void setTrendChart(boolean isTrendChart)
          Sets the trend chart mode for this graph.
protected  void updateChart()
           
 void updateValue(long timestamp, double[] value)
          Notifys this consumer about new dynamic value update.
 
Methods inherited from class de.desy.acop.displayers.chart.AcopChartConsumer
applyParameters, destroy, getAcopChart, getArraySize, getColor, getDataConsumer, getDefaultDataConsumer, getDisplayerParameters, getDisplayMode, getLastTimestamp, getName, getPreferredXMax, getPreferredXMin, getPreferredYMax, getPreferredYMin, getSupportedCharacteristics, getSupportedConsumerTypes, getXData, getXLabels, getYData, isChubbyLines, isDataDrawn, refreshPlot, reinitializePlot, setChubbyLines, setColor, setDisplayMode, setPreferredYMax, setPreferredYMin, setXLabels, updateDataState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEQUENCE_LENGTH

public static final java.lang.String SEQUENCE_LENGTH
See Also:
Constant Field Values

SEQUENCE_INDEX

public static final java.lang.String SEQUENCE_INDEX
See Also:
Constant Field Values

MAX_POINTS

public static final int MAX_POINTS
See Also:
Constant Field Values
Constructor Detail

AcopTrendChartConsumer

public AcopTrendChartConsumer(AcopTrendChart acopTrendChart,
                              java.lang.String name)
Constructs a new AcopTrendChartConsumer.

Parameters:
acopTrendChart - parent chart
name - the name of the consumer
Method Detail

updateChart

protected void updateChart()
Overrides:
updateChart in class AcopChartConsumer

setCharacteristics

public void setCharacteristics(java.util.Map characteristics)
Description copied from interface: DataConsumer
Sets new dynamic value characteristics to this data consumer. This is usually called only at initializaation, before first data state or value is updated. Usually carries characteristics such as value minimum or maximum. Name and meaning of atributes is defined with contract betwean data consumer and source implementation.

Specified by:
setCharacteristics in interface DataConsumer
Overrides:
setCharacteristics in class AcopChartConsumer
Parameters:
characteristics - the Map with attri

setDisplayerParameters

public void setDisplayerParameters(AcopGraphParameters displayerParameters)
Description copied from class: AcopChartConsumer
Associates AcopGraphParameters with this consumer.

Overrides:
setDisplayerParameters in class AcopChartConsumer

updateValue

public void updateValue(long timestamp,
                        double[] value)
                 throws CommonException
Description copied from interface: DoubleSeqConsumer
Notifys this consumer about new dynamic value update.

Specified by:
updateValue in interface DoubleSeqConsumer
Overrides:
updateValue in class AcopChartConsumer
Parameters:
timestamp - the time of dynamic value event
value - new value
Throws:
CommonException

isTrendChart

public boolean isTrendChart()
Description copied from class: AcopChartConsumer
Returns true if this graph is a trend.

Overrides:
isTrendChart in class AcopChartConsumer
Returns:
true if this is a trend

setTrendChart

public void setTrendChart(boolean isTrendChart)
Description copied from class: AcopChartConsumer
Sets the trend chart mode for this graph. Can only be set before the first draw.

Overrides:
setTrendChart in class AcopChartConsumer

setNormalizedData

public void setNormalizedData(boolean normalized)
Sets the data in the consumer normalized or absolute. When normalizes all data is scaled to be shown as the percentage of its max-min value.

Parameters:
normalized - true for normalized, false for absolute

isNormalizedData

public boolean isNormalizedData()
Returns true if this consumer shows data as normalized.

Returns:

dumpData

public double[][] dumpData()
Description copied from class: AcopChartConsumer
Returns all data from chart. First index is 0 for X data array and 1 for Y data array.

Overrides:
dumpData in class AcopChartConsumer
Returns:
all dat a from chart in X and Y array

getSequenceIndex

public int getSequenceIndex()
Returns the sequence index.

Returns:
the sequenceIndex

setSequenceIndex

public void setSequenceIndex(int sequenceIndex)
Sets the sequence index.

Parameters:
sequenceIndex - the sequenceIndex to set

getSequenceLength

public int getSequenceLength()
Returns the length of the sequence.

Returns:
the sequenceLength

setSequenceLength

public void setSequenceLength(int sequenceLength)
Sets the length of the sequence.

Parameters:
sequenceLength - the sequenceLength to set

getHistoryParameters

public HistoryParameters getHistoryParameters()
Returns the history parameters if this graph includes history data.

Returns:
the history parameters

loadHistoryData

public void loadHistoryData(double[][] historyData)
Sets the history data for this graph. This first array holds the timestamp and the second array holds the values at those timestamps.

Parameters:
historyData - data array: historyData[0] holds timestamp and historyData[1] holds values


Copyright © 2010. All Rights Reserved.