/** * @return */ public AcquisitionResult getCapturedData() { if ( this.dataSet == null ) { return null; } return this.dataSet.getCapturedData(); }
/** * {@inheritDoc} */ @Override public AcquisitionResult getData() { return this.dataSet.getCapturedData(); }
/** * Returns whether or not there's captured data to display. * * @return <code>true</code> if there's captured data, <code>false</code> * otherwise. */ public boolean hasCapturedData() { final DataSet currentDataSet = getCurrentDataSet(); return ( currentDataSet != null ) && ( currentDataSet.getCapturedData() != null ); }
/** * Returns the current acquisition results. * * @return the captured data, never <code>null</code>. */ private AcquisitionResult getAcquisitionData() { return getCurrentDataSet().getCapturedData(); }
/** * Returns whether or not there is timing data available. * * @return <code>true</code> if there is timing data available, * <code>false</code> otherwise. */ protected boolean hasTimingData() { final DataSet currentDataSet = getCurrentDataSet(); if ( ( currentDataSet == null ) || ( currentDataSet.getCapturedData() == null ) ) { return false; } return currentDataSet.getCapturedData().hasTimingData(); }
/** * Returns whether or not there is trigger data available. * * @return <code>true</code> if there is trigger data available, * <code>false</code> otherwise. */ protected boolean hasTriggerData() { final DataSet currentDataSet = getCurrentDataSet(); if ( ( currentDataSet == null ) || ( currentDataSet.getCapturedData() == null ) ) { return false; } return currentDataSet.getCapturedData().hasTriggerData(); }
/** * Stores the captured results to the given ZIP-output stream. * <p> * If the given project does not have capture results, this method does * nothing. * </p> * * @param aProject * the project to write the capture results for; * @param aZipOS * the ZIP output stream to write the capture results to. * @throws IOException * in case of I/O problems. */ protected void storeCapturedResults( final Project aProject, final ZipOutputStream aZipOS ) throws IOException { final DataSet dataSet = aProject.getDataSet(); if ( dataSet.getCapturedData() == null ) { return; } final ZipEntry zipEntry = new ZipEntry( FILENAME_CAPTURE_RESULTS ); aZipOS.putNextEntry( zipEntry ); aProject.writeData( new OutputStreamWriter( aZipOS ) ); }
final AcquisitionResult capturedData = aDataSet.getCapturedData(); final long triggerPos = capturedData.getTriggerPosition(); final int sampleRate = capturedData.getSampleRate();
/** * Returns the given resource as project with captured data. * * @param aResource * the resource URL of the resource to get as datafile. * @return the data container with the given resource as captured data. */ public static AcquisitionResult getCapturedData( final URL aResource ) throws IOException { InputStream is = aResource.openStream(); try { final Project project = new StubTestProject(); project.readData( new InputStreamReader( is ) ); return project.getDataSet().getCapturedData(); } finally { HostUtils.closeResource( is ); } }
final AcquisitionResult capturedData = aDataSet.getCapturedData();
/** * {@inheritDoc} */ public void gotoTriggerPosition() { final AcquisitionResult capturedData = getCurrentDataSet().getCapturedData(); if ( ( capturedData != null ) && capturedData.hasTriggerData() ) { final long position = capturedData.getTriggerPosition(); this.mainFrame.gotoPosition( 0, position ); } }
/** * {@inheritDoc} */ @Override public void export( final DataSet aDataSet, final JComponent aComponent, final OutputStream aStream ) throws IOException { final PrintWriter writer = new PrintWriter( aStream ); try { final AcquisitionResult capturedData = aDataSet.getCapturedData(); final double timescale = getTimebase( capturedData.getSampleRate() ); writePreamble( writer, aDataSet, timescale ); writeVariableDump( writer, aDataSet ); writeDataDump( writer, capturedData, timescale ); } finally { writer.flush(); } }
final String twText; if ( ( aDataSet != null ) && ( aDataSet.getCapturedData() != null ) ) final AcquisitionResult model = aDataSet.getCapturedData();
/** * @param aWriter * @param aContainer */ protected void writeVariableDump( final PrintWriter aWriter, final DataSet aDataSet ) { final AcquisitionResult capturedData = aDataSet.getCapturedData(); final int channelCount = capturedData.getChannels(); final int channelMask = capturedData.getEnabledChannels(); writeOpenDeclaration( aWriter, "dumpvars" ); for ( int i = 0; i < channelCount; i++ ) { if ( ( channelMask & ( 1 << i ) ) == 0 ) { continue; } writeSingleVariableDefinition( aWriter, i ); } writeCloseDeclaration( aWriter ); } }
@Override public void run() { JComponent viewComp = null; if ( aDataSet.getCapturedData().hasTimingData() ) { viewComp = new SignalDiagramComponent( SignalDiagramController.this ); } else { viewComp = new StateViewComponent( SignalDiagramController.this ); } setViewComponent( viewComp ); // Make sure the view is updated accordingly... getZoomController().restoreZoomLevel(); // optionally center the view on the trigger moment... boolean autoCenterOnTrigger = UIManager.getBoolean( UIManagerKeys.AUTO_CENTER_TO_TRIGGER_AFTER_CAPTURE ); final AcquisitionResult capturedData = aDataSet.getCapturedData(); // Issue #181 if ( autoCenterOnTrigger && ( capturedData != null ) && capturedData.hasTriggerData() ) { scrollToTimestamp( capturedData.getTriggerPosition() ); } } } );
/** * {@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 ); } }
final AcquisitionResult capturedData = dataSet.getCapturedData();