Class AbstractCalculatedPenDatasource
- java.lang.Object
-
- com.inductiveautomation.factorypmi.application.components.chart.easychart.AbstractCalculatedPenDatasource
-
- All Implemented Interfaces:
IPenDatasource
- Direct Known Subclasses:
AbstractFunctionPenDatasource
,ConstantPenDatasource
public class AbstractCalculatedPenDatasource extends java.lang.Object implements IPenDatasource
-
-
Field Summary
Fields Modifier and Type Field Description protected PMIEasyChart
chart
protected Dataset
dataset
protected java.util.Set<PenDataset>
datasets
protected java.util.Date
endDate
The configured end date.protected LoggerEx
log
protected java.util.List<PenData>
pens
protected java.util.Date
startDate
The starting date of the chart.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCalculatedPenDatasource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPen(PenData pen)
Adds a pen to this datasource.Dataset
getDataset()
The underlying dataset that drives this datasourceprotected long
getMillisRange(PenData source)
Returns the range of millis between the first and last points in the given pen datasetint
getNumDatapoints()
Return the number of datapoints currently loaded in this sourcevoid
initRefs(java.util.Map<java.lang.String,PenData> allPens)
Gives the datasource a chance to install references to other pensboolean
isZoomTracking()
True if this datasource should be restarted when the zoom level changes.protected void
setDataset(Dataset dataset)
protected void
setDatasetLater(Dataset dataset)
void
shutdown()
Shuts this datasoure down, if it has re-occurring activity.void
startup(PMIEasyChart chart)
Start this datasouce up.protected void
warn(java.lang.String msg)
-
-
-
Field Detail
-
dataset
protected Dataset dataset
-
pens
protected java.util.List<PenData> pens
-
datasets
protected java.util.Set<PenDataset> datasets
-
chart
protected PMIEasyChart chart
-
startDate
protected java.util.Date startDate
The starting date of the chart. Set instartup(PMIEasyChart)
-
endDate
protected java.util.Date endDate
The configured end date. May be null - this means "up to current time". Set instartup(PMIEasyChart)
-
log
protected final LoggerEx log
-
-
Method Detail
-
addPen
public void addPen(PenData pen)
Description copied from interface:IPenDatasource
Adds a pen to this datasource. All pens will be added before startup() is called for the first time.- Specified by:
addPen
in interfaceIPenDatasource
-
getDataset
public Dataset getDataset()
Description copied from interface:IPenDatasource
The underlying dataset that drives this datasource- Specified by:
getDataset
in interfaceIPenDatasource
-
setDataset
protected void setDataset(Dataset dataset)
-
setDatasetLater
protected void setDatasetLater(Dataset dataset)
-
getNumDatapoints
public int getNumDatapoints()
Description copied from interface:IPenDatasource
Return the number of datapoints currently loaded in this source- Specified by:
getNumDatapoints
in interfaceIPenDatasource
-
getMillisRange
protected long getMillisRange(PenData source)
Returns the range of millis between the first and last points in the given pen dataset
-
initRefs
public void initRefs(java.util.Map<java.lang.String,PenData> allPens)
Description copied from interface:IPenDatasource
Gives the datasource a chance to install references to other pens- Specified by:
initRefs
in interfaceIPenDatasource
-
shutdown
public void shutdown()
Description copied from interface:IPenDatasource
Shuts this datasoure down, if it has re-occurring activity.- Specified by:
shutdown
in interfaceIPenDatasource
-
startup
public void startup(PMIEasyChart chart)
Description copied from interface:IPenDatasource
Start this datasouce up. This should certainly mean that the data gets generated at least once, and possibly more based upon the chart's polling settings. May be called again after shutdown().- Specified by:
startup
in interfaceIPenDatasource
-
warn
protected void warn(java.lang.String msg)
-
isZoomTracking
public boolean isZoomTracking()
Description copied from interface:IPenDatasource
True if this datasource should be restarted when the zoom level changes.- Specified by:
isZoomTracking
in interfaceIPenDatasource
-
-