@Test public void testGetMaximumCaptureSizeForOk() { assertEquals( 24576, this.profile.getMaximumCaptureSizeFor( 1 ) ); assertEquals( 12288, this.profile.getMaximumCaptureSizeFor( 2 ) ); assertEquals( 6144, this.profile.getMaximumCaptureSizeFor( 3 ) ); assertEquals( 6144, this.profile.getMaximumCaptureSizeFor( 4 ) ); assertEquals( 4096, this.profile.getMaximumCaptureSizeFor( 5 ) ); assertEquals( 4096, this.profile.getMaximumCaptureSizeFor( 6 ) ); assertEquals( 3072, this.profile.getMaximumCaptureSizeFor( 7 ) ); }
public int getMaximumCaptureSizeFor( final int aChannelGroups ) { final Integer[] sizes = getCaptureSizes(); if ( ( sizes == null ) || ( sizes.length == 0 ) || ( aChannelGroups == 0 ) ) { return -1; } final int maxSize = sizes[0].intValue(); if ( isCaptureSizeBoundToEnabledChannels() ) { int indication = maxSize / aChannelGroups; Integer result = null; for ( int i = sizes.length - 1; i >= 0; i-- ) { if ( sizes[i].compareTo( Integer.valueOf( indication ) ) <= 0 ) { result = sizes[i]; } } return ( result == null ) ? indication : result.intValue(); } return maxSize; }
DeviceProfile implements Cloneable, Comparable<DeviceProfile> { public int getMaximumCaptureSizeFor( final int aChannelGroups ) { final Integer[] sizes = getCaptureSizes(); if ( ( sizes == null ) || ( sizes.length == 0 ) || ( aChannelGroups == 0 ) ) { return -1; } final int maxSize = sizes[0].intValue(); if ( isCaptureSizeBoundToEnabledChannels() ) { int indication = maxSize / aChannelGroups; Integer result = null; for ( int i = sizes.length - 1; i >= 0; i-- ) { if ( sizes[i].compareTo( Integer.valueOf( indication ) ) <= 0 ) { result = sizes[i]; } } return ( result == null ) ? indication : result.intValue(); } return maxSize; } }
DeviceProfile implements Cloneable, Comparable<DeviceProfile> { public int getMaximumCaptureSizeFor( final int aChannelGroups ) { final Integer[] sizes = getCaptureSizes(); if ( ( sizes == null ) || ( sizes.length == 0 ) || ( aChannelGroups == 0 ) ) { return -1; } final int maxSize = sizes[0].intValue(); if ( isCaptureSizeBoundToEnabledChannels() ) { int indication = maxSize / aChannelGroups; Integer result = null; for ( int i = sizes.length - 1; i >= 0; i-- ) { if ( sizes[i].compareTo( Integer.valueOf( indication ) ) <= 0 ) { result = sizes[i]; } } return ( result == null ) ? indication : result.intValue(); } return maxSize; } DeviceProfile(); }
DeviceProfile implements Cloneable, Comparable<DeviceProfile> { public int getMaximumCaptureSizeFor( final int aChannelGroups ) { final Integer[] sizes = getCaptureSizes(); if ( ( sizes == null ) || ( sizes.length == 0 ) || ( aChannelGroups == 0 ) ) { return -1; } final int maxSize = sizes[0].intValue(); if ( isCaptureSizeBoundToEnabledChannels() ) { int indication = maxSize / aChannelGroups; Integer result = null; for ( int i = sizes.length - 1; i >= 0; i-- ) { if ( sizes[i].compareTo( Integer.valueOf( indication ) ) <= 0 ) { result = sizes[i]; } } return ( result == null ) ? indication : result.intValue(); } return maxSize; } DeviceProfile(); @Override DeviceProfile clone(); @Override int compareTo( DeviceProfile aProfile ); @Override boolean equals( final Object aObject ); CaptureClockSource[] getCaptureClock(); Integer[] getCaptureSizes(); int getChannelCount(); int getChannelGroupCount(); NumberingScheme[] getChannelNumberingSchemes(); int getClockspeed(); String getDescription(); String[] getDeviceMetadataKeys(); int getDividerClockspeed(); DeviceInterface getInterface(); int getMaximumCaptureSizeFor( final int aChannelGroups ); int getOpenPortDelay(); Integer getReceiveTimeout(); Integer[] getSampleRates(); int getTriggerStages(); String getType(); @Override int hashCode(); boolean isCaptureSizeBoundToEnabledChannels(); boolean isComplexTriggersSupported(); boolean isDoubleDataRateSupported(); boolean isNoiseFilterSupported(); boolean isOpenPortDtr(); boolean isRleSupported(); boolean isSamplesInReverseOrder(); boolean isTestModeSupported(); boolean isTriggerSupported(); @Override String toString(); }
DeviceProfile implements Cloneable, Comparable<DeviceProfile> { public int getMaximumCaptureSizeFor( final int aChannelGroups ) { final Integer[] sizes = getCaptureSizes(); if ( ( sizes == null ) || ( sizes.length == 0 ) || ( aChannelGroups == 0 ) ) { return -1; } final int maxSize = sizes[0].intValue(); if ( isCaptureSizeBoundToEnabledChannels() ) { int indication = maxSize / aChannelGroups; Integer result = null; for ( int i = sizes.length - 1; i >= 0; i-- ) { if ( sizes[i].compareTo( Integer.valueOf( indication ) ) <= 0 ) { result = sizes[i]; } } return ( result == null ) ? indication : result.intValue(); } return maxSize; } DeviceProfile(); @Override DeviceProfile clone(); @Override int compareTo( DeviceProfile aProfile ); @Override boolean equals( final Object aObject ); CaptureClockSource[] getCaptureClock(); Integer[] getCaptureSizes(); int getChannelCount(); int getChannelGroupCount(); NumberingScheme[] getChannelNumberingSchemes(); int getClockspeed(); String getDescription(); String[] getDeviceMetadataKeys(); int getDividerClockspeed(); DeviceInterface getInterface(); int getMaximumCaptureSizeFor( final int aChannelGroups ); int getOpenPortDelay(); Integer getReceiveTimeout(); Integer[] getSampleRates(); int getTriggerStages(); String getType(); @Override int hashCode(); boolean isCaptureSizeBoundToEnabledChannels(); boolean isComplexTriggersSupported(); boolean isDoubleDataRateSupported(); boolean isNoiseFilterSupported(); boolean isOpenPortDtr(); boolean isRleSupported(); boolean isSamplesInReverseOrder(); boolean isTestModeSupported(); boolean isTriggerSupported(); @Override String toString(); static final String DEVICE_TYPE; static final String DEVICE_DESCRIPTION; static final String DEVICE_INTERFACE; static final String DEVICE_CLOCKSPEED; static final String DEVICE_DIVIDER_CLOCKSPEED; static final String DEVICE_SUPPORTS_DDR; static final String DEVICE_SAMPLERATES; static final String DEVICE_CAPTURECLOCK; static final String DEVICE_CAPTURESIZES; static final String DEVICE_FEATURE_NOISEFILTER; static final String DEVICE_FEATURE_RLE; static final String DEVICE_FEATURE_TEST_MODE; static final String DEVICE_FEATURE_TRIGGERS; static final String DEVICE_TRIGGER_STAGES; static final String DEVICE_TRIGGER_COMPLEX; static final String DEVICE_CHANNEL_COUNT; static final String DEVICE_CHANNEL_GROUPS; static final String DEVICE_CAPTURESIZE_BOUND; static final String DEVICE_CHANNEL_NUMBERING_SCHEMES; static final String DEVICE_OPEN_PORT_DELAY; static final String DEVICE_RECEIVE_TIMEOUT; static final String DEVICE_METADATA_KEYS; static final String DEVICE_SAMPLE_REVERSE_ORDER; static final String DEVICE_OPEN_PORT_DTR; }