Package de.gsi.chart.samples.utils
Class TestDataSetSource
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<TestDataSetSource>
-
- de.gsi.chart.samples.utils.TestDataSetSource
-
- All Implemented Interfaces:
de.gsi.dataset.DataSet,de.gsi.dataset.DataSetMetaData,de.gsi.dataset.event.EventSource,de.gsi.dataset.GridDataSet,java.io.Serializable
public class TestDataSetSource extends de.gsi.dataset.spi.AbstractDataSet<TestDataSetSource> implements de.gsi.dataset.GridDataSet
DataSet source for testing real-time continuous 2D and 3D type data.- Author:
- rstein
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTestDataSetSource.DataInput
-
Field Summary
Fields Modifier and Type Field Description protected java.util.TimeraudioTimerprotected intcircIndexprotected it.unimi.dsi.fastutil.floats.FloatArrayListframeprotected intframeCountprotected intframeSizeprotected it.unimi.dsi.fastutil.floats.FloatArrayList[]historyprotected javax.sound.sampled.TargetDataLinelineprotected de.gsi.dataset.utils.DoubleCircularBufferlineBufferprotected booleanpausedprotected booleanrunningprotected intsamplingRateprotected MidiWaveformSynthesizersynthprotected java.util.TimerTasktaskDataUpdateprotected java.util.TimerTasktraskAudioIOprotected intupdatePeriodprotected java.util.TimerupdateTimer
-
Constructor Summary
Constructors Constructor Description TestDataSetSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfillTestData()doubleget(int dimIndex, int index)doubleget(int dimIndex, int... indices)protected java.util.TimerTaskgetAudioTimerTask()intgetDataCount()protected java.util.TimerTaskgetDataUpdateTask()intgetFrameCount()intgetFrameSize()doublegetGrid(int dimIndex, int index)intgetGridIndex(int dimIndex, double x)TestDataSetSource.DataInputgetInputSource()intgetSamplingRate()int[]getShape()intgetUpdatePeriod()doublegetValue(int dimIndex, double... x)booleanisOutputMuted()static voidmain(java.lang.String[] args)protected voidopenLineIn()voidpause()pauses play back of the data source via the sound cardprotected voidreinitializeData()voidreset()de.gsi.dataset.DataSetset(de.gsi.dataset.DataSet other, boolean copy)voidsetFrameCount(int frameCount)voidsetFrameSize(int frameSize)voidsetInputSource(TestDataSetSource.DataInput inputSource)voidsetOutputMuted(boolean state)voidsetSamplingRate(int samplingRate)voidsetUpdatePeriod(int updatePeriod)voidstart()starts play back of the data source via the sound cardvoidstep()voidstop()stops and resets play back of the data source via the sound card-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, autoNotification, binarySearch, binarySearch, clearMetaInfo, copyAxisDescription, copyDataLabelsAndStyles, copyMetaData, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getStyle, getThis, getValues, getWarningList, hashCode, lock, recomputeLimits, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getAxisDescription, getAxisDescriptions, getDataLabel, getDimension, getIndex, getName, getStyle, getStyle, getValues, lock, recomputeLimits, set, setStyle
-
-
-
-
Field Detail
-
synth
protected transient MidiWaveformSynthesizer synth
-
line
protected transient javax.sound.sampled.TargetDataLine line
-
lineBuffer
protected transient de.gsi.dataset.utils.DoubleCircularBuffer lineBuffer
-
history
protected it.unimi.dsi.fastutil.floats.FloatArrayList[] history
-
frame
protected transient it.unimi.dsi.fastutil.floats.FloatArrayList frame
-
circIndex
protected int circIndex
-
samplingRate
protected int samplingRate
-
frameSize
protected int frameSize
-
frameCount
protected int frameCount
-
updatePeriod
protected int updatePeriod
-
running
protected volatile boolean running
-
paused
protected volatile boolean paused
-
updateTimer
protected transient java.util.Timer updateTimer
-
audioTimer
protected transient java.util.Timer audioTimer
-
traskAudioIO
protected transient java.util.TimerTask traskAudioIO
-
taskDataUpdate
protected transient java.util.TimerTask taskDataUpdate
-
-
Method Detail
-
openLineIn
protected void openLineIn()
-
fillTestData
public void fillTestData()
-
get
public double get(int dimIndex, int index)- Specified by:
getin interfacede.gsi.dataset.DataSet
-
getDataCount
public int getDataCount()
- Specified by:
getDataCountin interfacede.gsi.dataset.DataSet
-
getFrameCount
public int getFrameCount()
-
getFrameSize
public int getFrameSize()
-
getInputSource
public TestDataSetSource.DataInput getInputSource()
-
getSamplingRate
public int getSamplingRate()
-
getUpdatePeriod
public int getUpdatePeriod()
-
getValue
public double getValue(int dimIndex, double... x)- Specified by:
getValuein interfacede.gsi.dataset.DataSet- Overrides:
getValuein classde.gsi.dataset.spi.AbstractDataSet<TestDataSetSource>
-
isOutputMuted
public boolean isOutputMuted()
-
pause
public void pause()
pauses play back of the data source via the sound card
-
reset
public void reset()
-
setFrameCount
public void setFrameCount(int frameCount)
-
setFrameSize
public void setFrameSize(int frameSize)
-
setInputSource
public void setInputSource(TestDataSetSource.DataInput inputSource)
-
setOutputMuted
public void setOutputMuted(boolean state)
-
setSamplingRate
public void setSamplingRate(int samplingRate)
-
setUpdatePeriod
public void setUpdatePeriod(int updatePeriod)
-
start
public void start()
starts play back of the data source via the sound card
-
step
public void step()
-
stop
public void stop()
stops and resets play back of the data source via the sound card
-
getAudioTimerTask
protected java.util.TimerTask getAudioTimerTask()
-
getDataUpdateTask
protected java.util.TimerTask getDataUpdateTask()
-
reinitializeData
protected void reinitializeData()
-
main
public static void main(java.lang.String[] args) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
getShape
public int[] getShape()
- Specified by:
getShapein interfacede.gsi.dataset.GridDataSet
-
getGrid
public double getGrid(int dimIndex, int index)- Specified by:
getGridin interfacede.gsi.dataset.GridDataSet
-
getGridIndex
public int getGridIndex(int dimIndex, double x)- Specified by:
getGridIndexin interfacede.gsi.dataset.GridDataSet
-
get
public double get(int dimIndex, int... indices)- Specified by:
getin interfacede.gsi.dataset.GridDataSet
-
set
public de.gsi.dataset.DataSet set(de.gsi.dataset.DataSet other, boolean copy)- Specified by:
setin interfacede.gsi.dataset.DataSet
-
-