Package mgui.interfaces.plots
Class PlotXYDataSource<T extends MguiNumber>
java.lang.Object
mgui.interfaces.plots.PlotXYDataSource<T>
- All Implemented Interfaces:
InterfaceDataSource<T>,InterfaceDataSourceXY<T>,NamedDataSource
- Direct Known Subclasses:
PlotTimeSeriesDataSource,VariablePlotXYDataSource
public class PlotXYDataSource<T extends MguiNumber> extends java.lang.Object implements InterfaceDataSourceXY<T>, NamedDataSource
Plot data source for X-Y data sets.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description protected booleanbatchprotected intcursorprotected booleanemissionprotected booleanresetprotected java.util.ArrayList<DataSourceListener>sourceListenersprotected intvar_countprotected java.util.HashMap<java.lang.String,java.util.List<XYData<T>>>xyprotected java.util.HashMap<java.lang.String,java.util.List<XYData<T>>>xy_data -
Constructor Summary
Constructors Constructor Description PlotXYDataSource()PlotXYDataSource(int var_count) -
Method Summary
Modifier and Type Method Description voidaddDataSourceListener(DataSourceListener l)protected java.util.List<XYData<T>>appendChannel(java.lang.String channel, int size)protected voidfireEmission(int size)Fires a source emission of sizesize, and updates the cursor.protected voidfireReset()Informs listeners that this data source has been reset (i.e., the XY signal history should be destroyed.intgetChannelCount()Returns the number of Y channels in this source.java.util.List<java.lang.String>getChannelNames()intgetChannelSize(java.lang.String channel)java.util.List<T>getSourceSignal()Returns a list of typeT, representing a signal emission.byte[]getSourceSignalAsBytes()Returns an array of bytes, representing a signal emission.java.util.List<T>getSourceSignalX(int i)Returns the X data corresponding to this signal's i'th channel.java.util.List<T>getSourceSignalX(java.lang.String channel)java.util.List<XYData<T>>getSourceSignalXY(int i)Returns the X-Y data corresponding to this signal's i'th channel.java.util.List<XYData<T>>getSourceSignalXY(java.lang.String channel)java.util.List<T>getSourceSignalY(int i)Returns the Y data corresponding to this signal's i'th channel.java.util.List<T>getSourceSignalY(java.lang.String channel)voidremoveDataSourceListener(DataSourceListener l)voidreset()Resets this data source.voidsetBatch(boolean b)Informs this data source to treat all subsequent operations as a batch job; i.e., do not fire any events.voidsetChannelNames(java.util.List<java.lang.String> names)voidsetX(java.lang.String channel, java.util.List<T> x)voidsetXY(java.lang.String channel, java.util.List<XYData<T>> new_xy)voidsetY(java.lang.String channel, java.util.List<T> y)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
batch
protected boolean batch -
emission
protected boolean emission -
reset
protected boolean reset -
sourceListeners
-
xy_data
-
xy
-
cursor
protected int cursor -
var_count
protected int var_count
-
-
Constructor Details
-
PlotXYDataSource
public PlotXYDataSource() -
PlotXYDataSource
public PlotXYDataSource(int var_count)
-
-
Method Details
-
getSourceSignal
Description copied from interface:InterfaceDataSourceReturns a list of typeT, representing a signal emission.- Specified by:
getSourceSignalin interfaceInterfaceDataSource<T extends MguiNumber>- Returns:
-
getSourceSignalAsBytes
public byte[] getSourceSignalAsBytes()Description copied from interface:InterfaceDataSourceReturns an array of bytes, representing a signal emission.- Specified by:
getSourceSignalAsBytesin interfaceInterfaceDataSource<T extends MguiNumber>- Returns:
-
getChannelSize
public int getChannelSize(java.lang.String channel) -
getSourceSignalXY
Description copied from interface:InterfaceDataSourceXYReturns the X-Y data corresponding to this signal's i'th channel.- Specified by:
getSourceSignalXYin interfaceInterfaceDataSourceXY<T extends MguiNumber>- Returns:
-
getSourceSignalX
Description copied from interface:InterfaceDataSourceXYReturns the X data corresponding to this signal's i'th channel.- Specified by:
getSourceSignalXin interfaceInterfaceDataSourceXY<T extends MguiNumber>- Returns:
-
getSourceSignalY
Description copied from interface:InterfaceDataSourceXYReturns the Y data corresponding to this signal's i'th channel.- Specified by:
getSourceSignalYin interfaceInterfaceDataSourceXY<T extends MguiNumber>- Returns:
-
getSourceSignalXY
-
getSourceSignalX
-
getSourceSignalY
-
setChannelNames
public void setChannelNames(java.util.List<java.lang.String> names)- Specified by:
setChannelNamesin interfaceNamedDataSource
-
getChannelNames
public java.util.List<java.lang.String> getChannelNames()- Specified by:
getChannelNamesin interfaceNamedDataSource
-
getChannelCount
public int getChannelCount()Description copied from interface:InterfaceDataSourceXYReturns the number of Y channels in this source.- Specified by:
getChannelCountin interfaceInterfaceDataSourceXY<T extends MguiNumber>- Returns:
-
addDataSourceListener
- Specified by:
addDataSourceListenerin interfaceInterfaceDataSource<T extends MguiNumber>
-
removeDataSourceListener
- Specified by:
removeDataSourceListenerin interfaceInterfaceDataSource<T extends MguiNumber>
-
setX
-
setY
-
appendChannel
-
setXY
-
setBatch
public void setBatch(boolean b)Informs this data source to treat all subsequent operations as a batch job; i.e., do not fire any events. Events will be fired, if necessary, when this method is called withb == false.- Parameters:
b-
-
reset
public void reset() throws java.io.IOExceptionResets this data source.- Throws:
java.io.IOException
-
fireEmission
protected void fireEmission(int size)Fires a source emission of sizesize, and updates the cursor.- Parameters:
size-
-
fireReset
protected void fireReset()Informs listeners that this data source has been reset (i.e., the XY signal history should be destroyed.
-