Skip to content

Commit

Permalink
fixed Nodes.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mormul committed Jan 24, 2017
1 parent ec0c7ac commit 8420ee6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/constants/Nodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ public class Nodes {
+ " values.push(context.sensorValues[0]);\n"
+ " returnValue = JSON.parse(msg.payload);\n\n"
+ " if (returnValue) {\n"
+ " var array = [%s];\n"
+ " for (var index in array) {\n"
+ " situations.push({'thing':array[index], 'name': array[index], 'timestamp':\"\" + new Date().getTime(), 'situationtemplate':'%s' , 'occured':true, 'sensorvalues': values});\n"
+ " }\n"
//+ " var array = [%s];\n"
//+ " for (var index in array) {\n"
+ " situations.push({'thing':'%s', 'name': '%s', 'timestamp':\"\" + new Date().getTime(), 'situationtemplate':'%s' , 'occured':true, 'sensorvalues': values});\n"
//+ " }\n"
+ " } else {\n"
+ " var array = [%s];\n"
+ " for (var index in array) {\n"
+ " situations.push({'thing':array[index], 'name': array[index], 'timestamp':\"\" + new Date().getTime(), 'situationtemplate':'%s' , 'occured':false, 'sensorvalues': values});\n"
+ " }\n"
//+ " var array = [%s];\n"
//+ " for (var index in array) {\n"
+ " situations.push({'thing':'%s', 'name': '%s', 'timestamp':\"\" + new Date().getTime(), 'situationtemplate':'%s' , 'occured':false, 'sensorvalues': values});\n"
//+ " }\n"
+ " }\n"
+ " context.values = null;\n"
+ " context.sensorValues = null;\n\n"
Expand Down Expand Up @@ -278,7 +278,7 @@ public static String getANDNode(String numberOfInputs, String objectID, String s
if (things.equals("")) {
things = "\'" + objectID + "\'";
}
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, things, situationTemplateID);
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, situationTemplateID, things, situationTemplateID, situationTemplateID);
}

/**
Expand All @@ -291,7 +291,7 @@ public static String getNULLNode(String objectID, String situationTemplateID, Ob
if (things.equals("")) {
things = "\'" + objectID + "\'";
}
return String.format(nullNode, things, situationTemplateID, things, situationTemplateID);
return String.format(nullNode, things, situationTemplateID, situationTemplateID, things, situationTemplateID, situationTemplateID);
}

/**
Expand All @@ -306,7 +306,7 @@ public static Object getORNode(String numberOfInputs, String objectID, String si
if (things.equals("")) {
things = "\'" + objectID + "\'";
}
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, things, situationTemplateID);
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, situationTemplateID, things, situationTemplateID, situationTemplateID);
}

/**
Expand All @@ -320,7 +320,7 @@ public static Object getXORNode(String numberOfInputs, String objectID, String s
if (things.equals("")) {
things = '\'' + objectID + '\'';
}
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, things, situationTemplateID);
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, situationTemplateID, things, situationTemplateID, situationTemplateID);
}

/**
Expand Down Expand Up @@ -348,7 +348,7 @@ public static Object getORNotNode(String numberOfInputs, String objectID, String
if (things.equals("")) {
things = '\'' + objectID + '\'';
}
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, things, situationTemplateID);
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, situationTemplateID, things, situationTemplateID, situationTemplateID);
}

/**
Expand All @@ -362,7 +362,7 @@ public static Object getXORNotNode(String numberOfInputs, String objectID, Strin
if (things.equals("")) {
things = '\'' + objectID + '\'';
}
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, things, situationTemplateID);
return String.format(accumulationString, numberOfInputs, immediateReturnValue, things, situationTemplateID, situationTemplateID, things, situationTemplateID, situationTemplateID);
}

/**
Expand Down

0 comments on commit 8420ee6

Please sign in to comment.