Skip to content

Instantly share code, notes, and snippets.

@andrewgdunn
Created August 23, 2010 15:18
Show Gist options
  • Save andrewgdunn/545689 to your computer and use it in GitHub Desktop.
Save andrewgdunn/545689 to your computer and use it in GitHub Desktop.
// 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