Skip to content

Instantly share code, notes, and snippets.

private static Map<String, Value> intermittentError(Sensor sensor) {
Map<String, Value> map = new HashMap<String, Value>();
Map<String, Value> abruptError = abruptError(sensor);
if(abruptError.size() == 0 || sensor.id.equals("ST516"))
return map;
int timeOfFault = ((IntegerValue)(abruptError.get("faultIndex"))).get() + INTERMITTENT_OFFSET;
package gov.dod.army.rdecom.tardec.tcctda;
import org.dxc.api.datatypes.*;
import java.util.Map;
import java.util.HashMap;
/**
*
* @author Jeremy Mange, Michael Duffy, Andrew Dunn
private static void ProcessRecievedData() {
Vector<Map<String, Value>> errorSensors = new Vector<Map<String, Value>>();
for(Object keySet : allSensors.keySet()) {
Sensor individualSensor = (Sensor)allSensors.get(keySet);
individualSensor.removeOutliers();
//Send the individual sensor to our filters, if there is a detected error we will make sure to set the falutIndex.
Map<String, Value> filterSensor = ErrorFinder.errorParams(individualSensor);
// 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;
}
private static void ProcessRecievedData() {
Vector<Map<String, Value>> errorSensors = new Vector<Map<String, Value>>();
for(Object keySet : allSensors.keySet()) {
// Snag the individual sensor
Sensor individualSensor = (Sensor) allSensors.get(keySet);
// remove the outliers
individualSensor.removeOutliers();