@Test public void testExportDataSetWithSampleRateButWithoutTriggerOk() throws Exception { final int channelCount = CHANNEL_COUNT; final int dataSize = 10; final int sampleRate = SAMPLE_RATE; final long triggerPos = -1; final DataSet dataSet = createTestDataSet( channelCount, dataSize, sampleRate, triggerPos ); this.exporter.export( dataSet, this.component, this.outputStream ); String[] results = getCsvData(); assertNotNull( results ); int expectedRows = 1 + dataSize; int expectedCols = 2 + channelCount; assertCsvDimensions( results, expectedRows, expectedCols ); }
@Override public void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ) throws IOException { final PrintStream stream = new PrintStream( aStream ); try { writeHeaderRow( stream, createHeaderRowValues( aDataSet ) ); final Channel[] channels = aDataSet.getChannels(); final AcquisitionResult capturedData = aDataSet.getCapturedData(); final int sampleRate = capturedData.getSampleRate(); final int[] values = capturedData.getValues(); final long[] timestamps = capturedData.getTimestamps(); final long triggerPos = capturedData.getTriggerPosition(); for ( int i = 0; i < values.length; i++ ) { writeDataRow( stream, timestamps[i], triggerPos, sampleRate, values[i], channels ); } } finally { stream.flush(); } }
CsvExporter implements Exporter { @Override public void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ) throws IOException { final PrintStream stream = new PrintStream( aStream ); try { writeHeaderRow( stream, createHeaderRowValues( aDataSet ) ); final Channel[] channels = aDataSet.getChannels(); final AcquisitionResult capturedData = aDataSet.getCapturedData(); final int sampleRate = capturedData.getSampleRate(); final int[] values = capturedData.getValues(); final long[] timestamps = capturedData.getTimestamps(); final long triggerPos = capturedData.getTriggerPosition(); for ( int i = 0; i < values.length; i++ ) { writeDataRow( stream, timestamps[i], triggerPos, sampleRate, values[i], channels ); } } finally { stream.flush(); } } }
CsvExporter implements Exporter { @Override public void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ) throws IOException { final PrintStream stream = new PrintStream( aStream ); try { writeHeaderRow( stream, createHeaderRowValues( aDataSet ) ); final Channel[] channels = aDataSet.getChannels(); final AcquisitionResult capturedData = aDataSet.getCapturedData(); final int sampleRate = capturedData.getSampleRate(); final int[] values = capturedData.getValues(); final long[] timestamps = capturedData.getTimestamps(); final long triggerPos = capturedData.getTriggerPosition(); for ( int i = 0; i < values.length; i++ ) { writeDataRow( stream, timestamps[i], triggerPos, sampleRate, values[i], channels ); } } finally { stream.flush(); } } CsvExporter(); }
CsvExporter implements Exporter { @Override public void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ) throws IOException { final PrintStream stream = new PrintStream( aStream ); try { writeHeaderRow( stream, createHeaderRowValues( aDataSet ) ); final Channel[] channels = aDataSet.getChannels(); final AcquisitionResult capturedData = aDataSet.getCapturedData(); final int sampleRate = capturedData.getSampleRate(); final int[] values = capturedData.getValues(); final long[] timestamps = capturedData.getTimestamps(); final long triggerPos = capturedData.getTriggerPosition(); for ( int i = 0; i < values.length; i++ ) { writeDataRow( stream, timestamps[i], triggerPos, sampleRate, values[i], channels ); } } finally { stream.flush(); } } CsvExporter(); @Override void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ); @Override String[] getFilenameExtentions(); @Override String getName(); }
CsvExporter implements Exporter { @Override public void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ) throws IOException { final PrintStream stream = new PrintStream( aStream ); try { writeHeaderRow( stream, createHeaderRowValues( aDataSet ) ); final Channel[] channels = aDataSet.getChannels(); final AcquisitionResult capturedData = aDataSet.getCapturedData(); final int sampleRate = capturedData.getSampleRate(); final int[] values = capturedData.getValues(); final long[] timestamps = capturedData.getTimestamps(); final long triggerPos = capturedData.getTriggerPosition(); for ( int i = 0; i < values.length; i++ ) { writeDataRow( stream, timestamps[i], triggerPos, sampleRate, values[i], channels ); } } finally { stream.flush(); } } CsvExporter(); @Override void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ); @Override String[] getFilenameExtentions(); @Override String getName();  }