/** * Returns all channel labels. * * @return an array of all channel's label, never <code>null</code>. */ public Channel[] getAllChannels() { return getCurrentDataSet().getChannels(); }
final Channel[] channels = aDataSet.getChannels();
/** * {@inheritDoc} */ @Override public void clearAnnotations() { for ( Channel channel : getCurrentDataSet().getChannels() ) { channel.clearAnnotations(); } repaintMainFrame(); }
final Channel[] channels = aDataSet.getChannels();
/** * Creates a new DataSetImpl instance. * * @param aCapturedData * the captured data of this data set; * @param aOld * the old data set to template. */ public DataSetImpl( final AcquisitionResult aCapturedData, final DataSet aOld, final boolean aRetainAnnotations ) { this.propertyChangeSupport = new PropertyChangeSupport( this ); this.capturedData = aCapturedData; this.cursorsEnabled = aOld.isCursorsEnabled(); this.channels = createChannels( aCapturedData.getChannels(), aCapturedData.getEnabledChannels(), aRetainAnnotations, aOld.getChannels() ); this.cursors = createCursors( Ols.MAX_CURSORS, aOld.getCursors() ); }
/** * {@inheritDoc} */ @Override public void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ) throws IOException { final PrintStream stream = new PrintStream( aStream ); try { // Write header row... 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(); // Write data... for ( int i = 0; i < values.length; i++ ) { // Write data row... writeDataRow( stream, timestamps[i], triggerPos, sampleRate, values[i], channels ); } } finally { stream.flush(); } }
/** * Writes down all variable definitions. * * @param aWriter * the print writer to write to, cannot be <code>null</code>; * @param aContainer * the data container to take the channel information from, cannot be * <code>null</code>. */ protected void writeVariableDefinitions( final PrintWriter aWriter, final DataSet aDataSet ) { final AcquisitionResult capturedData = aDataSet.getCapturedData(); final int channelMask = capturedData.getEnabledChannels(); final Channel[] channelLabels = aDataSet.getChannels(); for ( int i = 0; i < channelLabels.length; i++ ) { if ( ( channelMask & ( 1 << i ) ) == 0 ) { continue; } String label = channelLabels[i].getLabel(); if ( StringUtils.isEmpty( label ) ) { label = "channel" + i; } writeVariable( aWriter, i, label ); } }
SignalElementModel newModel = new SignalElementModel(); final Channel[] newChannelList = aCapturedData.getChannels();