Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a test function on the second channel group.

  • Loading branch information...
commit e2da2230c3fb1c42ab9e34e67d2797553a50b5cc 1 parent d4b1a63
@jawi authored
View
14 device.test/src/main/java/nl/lxtreme/ols/device/test/TestAcquisitionTask.java
@@ -70,6 +70,7 @@ public AcquisitionResult call() throws Exception
final int[] data;
int rate = 1000000000;
int trigger = -1;
+ int enabledChannels = ( int )( ( 1L << channels ) - 1 );
final double max = ( ( ( 1L << Math.min( 16, channels ) ) - 1L ) & 0xFFFFFFFFL );
final double half = ( max / 2.0 );
@@ -103,6 +104,8 @@ else if ( DATA_FUNCTIONS[8].equals( dataFunction ) )
{
final Random rnd = new Random();
+ boolean state = false;
+
data = new int[dataLength];
for ( int i = 0; i < data.length; i++ )
{
@@ -132,6 +135,15 @@ else if ( DATA_FUNCTIONS[5].equals( dataFunction ) )
{
data[i] = rnd.nextInt();
}
+ else if ( DATA_FUNCTIONS[9].equals( dataFunction ) )
+ {
+ if ( ( i % 4 ) == 0 )
+ {
+ state = !state;
+ }
+ data[i] = state ? 0x00 : 0x8000;
+ enabledChannels = 0x0000FF00;
+ }
this.progressListener.acquisitionInProgress( ( int )( ( i * 100.0 ) / data.length ) );
}
@@ -139,6 +151,6 @@ else if ( DATA_FUNCTIONS[5].equals( dataFunction ) )
trigger = ( int )( data.length * 0.25 );
}
- return new CapturedData( data, trigger, rate, channels, ( int )( ( 1L << channels ) - 1 ) );
+ return new CapturedData( data, trigger, rate, channels, enabledChannels );
}
}
View
2  device.test/src/main/java/nl/lxtreme/ols/device/test/TestDeviceDialog.java
@@ -42,7 +42,7 @@
private static final long serialVersionUID = 1L;
static final String[] DATA_FUNCTIONS = new String[] { "Sawtooth", "All zeros", "Sine", "odd-even", "0x55-0xAA",
- "Random", "I2C sample", "1-Wire sample", "Manchester encoded" };
+ "Random", "I2C sample", "1-Wire sample", "Manchester encoded", "0x80-0x00" };
static final Integer[] CHANNELS = new Integer[] { 1, 4, 8, 16, 32 };
static final Integer[] DATA_LENGTH = new Integer[] { 16, 256, 1024, 4096, 8192, 16384, 32768, 65536, 131072 };
Please sign in to comment.
Something went wrong with that request. Please try again.