Skip to content
Snippets Groups Projects
Commit 6810e3be authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

boolean spectrum extraction bug correction

parent c5122494
No related branches found
No related tags found
No related merge requests found
...@@ -382,6 +382,14 @@ public class ExtractionUtils { ...@@ -382,6 +382,14 @@ public class ExtractionUtils {
case TangoConst.Tango_DEV_BOOLEAN: case TangoConst.Tango_DEV_BOOLEAN:
if (extracted instanceof boolean[]) { if (extracted instanceof boolean[]) {
value = extracted; value = extracted;
} else if (extracted instanceof Boolean[]) {
Boolean[] tmp = (Boolean[]) extracted;
boolean[] array = new boolean[tmp.length];
int index = 0;
for (Boolean bool : tmp) {
array[index++] = (bool != null) && bool.booleanValue();
}
value = array;
} else { } else {
byte[] tmp = NumberArrayUtils.extractByteArray(extracted); byte[] tmp = NumberArrayUtils.extractByteArray(extracted);
if (tmp == null) { if (tmp == null) {
...@@ -514,6 +522,21 @@ public class ExtractionUtils { ...@@ -514,6 +522,21 @@ public class ExtractionUtils {
case TangoConst.Tango_DEV_BOOLEAN: case TangoConst.Tango_DEV_BOOLEAN:
if (extracted instanceof boolean[][]) { if (extracted instanceof boolean[][]) {
value = extracted; value = extracted;
} else if (extracted instanceof Boolean[][]) {
Boolean[][] tmp = (Boolean[][]) extracted;
boolean[][] matrix = new boolean[tmp.length][];
int y = 0, x = 0;
for (Boolean[] line : tmp) {
x = 0;
if (line != null) {
matrix[y] = new boolean[line.length];
for (Boolean bool : line) {
matrix[y][x++] = (bool != null) && bool.booleanValue();
}
y++;
}
}
value = matrix;
} else { } else {
byte[][] tmp = NumberMatrixUtils.extractByteMatrix(extracted); byte[][] tmp = NumberMatrixUtils.extractByteMatrix(extracted);
if (tmp == null) { if (tmp == null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment