/** * @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 ) ) ); } }
/** * {@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 ) ) ); } }
/** * 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 ) ) ) ); } } );
/** * 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 ) ); }
/** * 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 ) ) ) ); }
/** * @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 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 ) ); }
/** * @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 ) );