/** * @param aIndex * @param aStartTime * @param aEndTime * @param aSymbol * @return */ private SampleDataAnnotation createAnnotation( final int aIndex, final long aStartTime, final long aEndTime, final int aSymbol ) { return new SampleDataAnnotation( aIndex, aStartTime, aEndTime, String.format( "%1$c (%1$x)", Integer.valueOf( aSymbol ) ) ); } }
/** * Determines the resulting channel label and clears any existing annotations. * * @param aLabel * the default label to use for the channel (in case none is set). */ private void prepareResult( final String aLabel ) { this.annotationListener.clearAnnotations( this.owLineIndex ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.owLineIndex, aLabel ) ); }
/** * {@inheritDoc} */ @Override public int compareTo( final Annotation<String> aOther ) { int result = ( this.channelIdx - aOther.getChannel() ); if ( result == 0 ) { result = getAnnotation().compareTo( aOther.getAnnotation() ); } return result; }
/** * {@inheritDoc} */ @Override public int compareTo( final Annotation<String> aOther ) { int result = ( this.channelIdx - aOther.getChannel() ); if ( result == 0 ) { if ( aOther instanceof DataAnnotation ) { DataAnnotation<?> dataAnnotation = ( DataAnnotation<?> )aOther; result = ( int )( this.startTimestamp - dataAnnotation.getStartTimestamp() ); if ( result == 0 ) { result = ( int )( this.endTimestamp - dataAnnotation.getEndTimestamp() ); if ( result == 0 ) { result = getAnnotation().compareTo( aOther.getAnnotation() ); } } } else { result = getAnnotation().compareTo( aOther.getAnnotation() ); } } return result; }
/** * @param aIndex * @param aStartTime * @param aEndTime * @param aSymbol * @return */ private SampleDataAnnotation createAnnotation( final int aIndex, final long aStartTime, final long aEndTime, final int aSymbol ) { return new SampleDataAnnotation( aIndex, aStartTime, aEndTime, String.format( "%1$c (%1$x)", Integer.valueOf( aSymbol ) ) ); } }
/** * Determines the resulting channel label and clears any existing annotations. * * @param aChannelIndex * the channel index of the channel to prepare; * @param aLabel * the default label to use for the channel (in case none is set). */ private void prepareResult( final int aChannelIndex, final String aLabel ) { this.annotationListener.clearAnnotations( aChannelIndex ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( aChannelIndex, aLabel ) ); } }
/** * Emits a new symbol annotation to the interested listener(s). * * @param aSymbol * the symbol itself; * @param aStartSampleIdx * the start sample index of the symbol; * @param aEndSampleIdx * the end sample index of the symbol. */ private void addEventAnnotation( final int aChannelIdx, final String aEvent, final long aStartTimestamp, final long aEndTimestamp ) { DMX512AnalyzerTask.this.annotationListener.onAnnotation( new SampleDataAnnotation( aChannelIdx, aStartTimestamp, aEndTimestamp, aEvent ) ); }
/** * Prepares everything for the upcoming results. */ private void prepareResults() { // Tell our listeners what line A & B mean... this.pcs.firePropertyChange( PROPERTY_AUTO_DETECT_SCL, null, this.sclIdx == this.lineAidx ? LINE_A : LINE_B ); this.pcs.firePropertyChange( PROPERTY_AUTO_DETECT_SDA, null, this.sdaIdx == this.lineBidx ? LINE_B : LINE_A ); // Update the channel labels... this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.sclIdx, CHANNEL_SCL_NAME ) ); this.annotationListener.clearAnnotations( this.sclIdx ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.sdaIdx, CHANNEL_SDA_NAME ) ); this.annotationListener.clearAnnotations( this.sdaIdx ); }
/** * Emits a new symbol annotation to the interested listener(s). * * @param aSymbol * the symbol itself; * @param aStartSampleIdx * the start sample index of the symbol; * @param aEndSampleIdx * the end sample index of the symbol. */ private void addSymbolAnnotation( final int aChannelIdx, final int aSymbol, final long aStartTimestamp, final long aEndTimestamp ) { DMX512AnalyzerTask.this.annotationListener.onAnnotation( new SampleDataAnnotation( aChannelIdx, aStartTimestamp, aEndTimestamp, String.format( "0x%1$X (%1$c)", Integer.valueOf( aSymbol ) ) ) ); } } );
/** * Determines the channel labels that are used in the annotations and reports * and clears any existing annotations on the decoded channels. */ private void prepareResults() { if ( this.tckIdx >= 0 ) { this.annotationListener.clearAnnotations( this.tckIdx ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.tckIdx, JTAGDataSet.JTAG_TCK ) ); } if ( this.tmsIdx >= 0 ) { this.annotationListener.clearAnnotations( this.tmsIdx ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.tmsIdx, JTAGDataSet.JTAG_TMS ) ); } if ( this.tdiIdx >= 0 ) { this.annotationListener.clearAnnotations( this.tdiIdx ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.tdiIdx, JTAGDataSet.JTAG_TDI ) ); } if ( this.tdoIdx >= 0 ) { this.annotationListener.clearAnnotations( this.tdoIdx ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.tdoIdx, JTAGDataSet.JTAG_TDO ) ); } } }
/** * Emits a new symbol annotation to the interested listener(s). * * @param aChannelIndex * the channel index on which the symbol was found; * @param aSymbol * the symbol itself; * @param aStartSampleIdx * the start sample index of the symbol; * @param aEndSampleIdx * the end sample index of the symbol. */ private void addSymbolAnnotation( final int aChannelIndex, final int aSymbol, final long aStartTimestamp, final long aEndTimestamp ) { this.annotationListener.onAnnotation( new SampleDataAnnotation( aChannelIndex, aStartTimestamp, aEndTimestamp, String.format( "0x%1$X (%1$c)", Integer.valueOf( aSymbol ) ) ) ); }
this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.mosiIdx, label ) ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.misoIdx, label ) ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.io2Idx, "IO2" ) ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.io3Idx, "IO3" ) ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.sckIdx, SPIDataSet.SPI_SCK ) ); this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.csIdx, SPIDataSet.SPI_CS ) );
/** * @param aDataSet * @param aChannelIndex * @param aByteValue * @param aType * @param aTimestamp */ private void reportBusError( final OneWireDataSet aDataSet, final long aStartTimestamp ) { final AcquisitionResult data = this.context.getData(); final int startSampleIdx = Math.max( data.getSampleIndex( aStartTimestamp ), 0 ); aDataSet.reportBusError( this.owLineIndex, startSampleIdx ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.owLineIndex, aStartTimestamp, aStartTimestamp, OneWireDataSet.OW_BUS_ERROR ) ); }
this.annotationListener.onAnnotation( new ChannelLabelAnnotation( this.dataLine, DMX512_DATA_LABEL ) );
/** * @param aDataSet * @param aChannelIndex * @param aByteValue * @param aType * @param aTimestamp */ private void reportData( final OneWireDataSet aDataSet, final long aStartTimestamp, final long aEndTimestamp, final int aByteValue ) { final AcquisitionResult data = this.context.getData(); final int startSampleIdx = Math.max( data.getSampleIndex( aStartTimestamp ), 0 ); final int endSampleIdx = Math.min( data.getSampleIndex( aEndTimestamp ) - 1, data.getTimestamps().length - 1 ); aDataSet.reportData( this.owLineIndex, startSampleIdx, endSampleIdx, aByteValue ); final String annotation = String.format( "0x%X (%c)", Integer.valueOf( aByteValue ), Integer.valueOf( aByteValue ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.owLineIndex, aStartTimestamp, aEndTimestamp, annotation ) ); }
/** * @param aDataSet * @param aChannelIndex * @param aByteValue * @param aType * @param aTimestamp */ private void reportReset( final OneWireDataSet aDataSet, final long aStartTimestamp, final long aEndTimestamp, final boolean aSlaveIsPresent ) { final AcquisitionResult data = this.context.getData(); final int startSampleIdx = Math.max( data.getSampleIndex( aStartTimestamp ), 0 ); final int endSampleIdx = Math.min( data.getSampleIndex( aEndTimestamp ) - 1, data.getTimestamps().length - 1 ); aDataSet.reportReset( this.owLineIndex, startSampleIdx, endSampleIdx, aSlaveIsPresent ); final String annotation = String.format( "Master reset, slave %s present", aSlaveIsPresent ? "is" : "is NOT" ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.owLineIndex, aStartTimestamp, aEndTimestamp, annotation ) ); } }
this.annotationListener.onAnnotation( new SampleDataAnnotation( this.mosiIdx, timestamps[aStartIdx], timestamps[aEndIdx], String.format( formatSpec, Integer.valueOf( mosivalue ) ) ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.misoIdx, timestamps[aStartIdx], timestamps[aEndIdx], String.format( formatSpec, Integer.valueOf( misovalue ) ) ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.mosiIdx, timestamps[aStartIdx], timestamps[aEndIdx], String.format( formatSpec, Integer.valueOf( mosivalue ) ) ) );
this.annotationListener.onAnnotation( new SampleDataAnnotation( this.sdaIdx, timestamps[startOfDecode], I2CDataSet.I2C_START ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.sdaIdx, timestamps[prevIdx], timestamps[idx], annotation ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.sdaIdx, timestamps[idx], I2CDataSet.I2C_NACK ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.sdaIdx, timestamps[idx], I2CDataSet.I2C_ACK ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.sdaIdx, timestamps[idx], I2CDataSet.I2C_STOP ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.sdaIdx, timestamps[idx], I2CDataSet.I2C_START ) );
this.annotationListener.onAnnotation( new SampleDataAnnotation( this.tdiIdx, timestamps[startTdiDataIdx], timestamps[endTdiDataIdx], String.format( "0x%x", new BigInteger( tdiData, 2 ) ) ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.tdoIdx, timestamps[startTdiDataIdx], timestamps[endTdiDataIdx], String.format( "0x%x", new BigInteger( tdoData, 2 ) ) ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.tdiIdx, timestamps[startTdiDataIdx], timestamps[endTdiDataIdx], String.format( "0x%x", new BigInteger( tdiData, 2 ) ) ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.tdoIdx, timestamps[startTdiDataIdx], timestamps[endTdiDataIdx], String.format( "0x%x", new BigInteger( tdoData, 2 ) ) ) ); this.annotationListener.onAnnotation( new SampleDataAnnotation( this.tmsIdx, timestamps[this.startIdx], timestamps[idx], state ) );