Created
August 23, 2010 15:18
-
-
Save andrewgdunn/545689 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Boolean Error | |
if(!(sensor.data.elementAt(0) instanceof RealValue)) { | |
boolean firstVal = ((BoolValue)sensor.data.elementAt(0)).get(); | |
for(int index = 1; index < sensor.data.size()-1; index++) { | |
boolean indexValue = ( (BoolValue) sensor.data.elementAt(index)).get(); | |
if(indexValue != firstVal) { | |
map.put("booleanError", Value.v(indexValue)); | |
map.put("faultIndex", Value.v(index)); | |
break; | |
} | |
} | |
return map; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment