diff --git a/basic-logic/fallingedge/MyNode.cpp b/basic-logic/fallingedge/MyNode.cpp index e141b9d9..64ce24fc 100644 --- a/basic-logic/fallingedge/MyNode.cpp +++ b/basic-logic/fallingedge/MyNode.cpp @@ -66,9 +66,7 @@ void MyNode::input(Flows::PNodeInfo info, uint32_t index, Flows::PVariable messa Flows::PVariable& input = message->structValue->at("payload"); if(!*input && _lastInput) { - Flows::PVariable outputMessage = std::make_shared(Flows::VariableType::tStruct); - outputMessage->structValue->emplace("payload", std::make_shared(true)); - output(0, outputMessage); + output(0, message); } _lastInput = *input; diff --git a/basic-logic/fallingedge/fallingedge.hni b/basic-logic/fallingedge/fallingedge.hni index f5f893f0..7a3d25cd 100644 --- a/basic-logic/fallingedge/fallingedge.hni +++ b/basic-logic/fallingedge/fallingedge.hni @@ -24,13 +24,13 @@ inputInfo: [ { label: "in", - types: ["bool"] + types: ["any"] } ], outputs:1, outputInfo: [ { - types: ["bool"] + types: ["any"] } ], icon: "function.png", diff --git a/basic-logic/fallingedge/locales/en-US/fallingedge b/basic-logic/fallingedge/locales/en-US/fallingedge index 967e5895..c2e8706f 100644 --- a/basic-logic/fallingedge/locales/en-US/fallingedge +++ b/basic-logic/fallingedge/locales/en-US/fallingedge @@ -4,10 +4,10 @@ "label": { "name": "Name" }, - "paletteHelp": "The output is set to true when the input is set to false. An input of true is ignored.", - "help": "

The output is set to true when the input is set to false.

An input of true is ignored.

", - "input1Description": "The boolean value.", - "output1Description": "true on input of false." + "paletteHelp": "The input message is forwarded when the input is evaluated to false. An input evaluated to true is ignored.", + "help": "

The input message is forwarded when the input is evaluated to false.

An input evaluated to true is ignored.

", + "input1Description": "The value to check.", + "output1Description": "The input message when the input is evaluated to false." } } } diff --git a/basic-logic/risingedge/MyNode.cpp b/basic-logic/risingedge/MyNode.cpp index f82c5624..b5b69792 100644 --- a/basic-logic/risingedge/MyNode.cpp +++ b/basic-logic/risingedge/MyNode.cpp @@ -66,9 +66,7 @@ void MyNode::input(const Flows::PNodeInfo info, uint32_t index, const Flows::PVa Flows::PVariable& input = message->structValue->at("payload"); if(*input) { - Flows::PVariable outputMessage = std::make_shared(Flows::VariableType::tStruct); - outputMessage->structValue->emplace("payload", std::make_shared(true)); - output(0, outputMessage); + output(0, message); } } catch(const std::exception& ex) diff --git a/basic-logic/risingedge/locales/en-US/risingedge b/basic-logic/risingedge/locales/en-US/risingedge index bf171e72..ce537ed1 100644 --- a/basic-logic/risingedge/locales/en-US/risingedge +++ b/basic-logic/risingedge/locales/en-US/risingedge @@ -4,10 +4,10 @@ "label": { "name": "Name" }, - "paletteHelp": "The output is set to true when the input is set to true. An input of false is ignored.", - "help": "

The output is set to true when the input is set to true.

An input of false is ignored.

", - "input1Description": "The boolean value.", - "output1Description": "true on input of true." + "paletteHelp": "The input message is forwarded when the input is evaluated to true. An input evaluated to false is ignored.", + "help": "

The input message is forwarded when the input is evaluated to true.

An input evaluated to false is ignored.

", + "input1Description": "The value to check.", + "output1Description": "The input message when the input is evaluated to true." } } } diff --git a/basic-logic/risingedge/risingedge.hni b/basic-logic/risingedge/risingedge.hni index 10f5ed53..dfaed1e9 100644 --- a/basic-logic/risingedge/risingedge.hni +++ b/basic-logic/risingedge/risingedge.hni @@ -24,13 +24,13 @@ inputInfo: [ { label: "in", - types: ["bool"] + types: ["any"] } ], outputs:1, outputInfo: [ { - types: ["bool"] + types: ["any"] } ], icon: "function.png", diff --git a/variable/variable-in/MyNode.cpp b/variable/variable-in/MyNode.cpp index 306ef8e7..ce136b28 100644 --- a/variable/variable-in/MyNode.cpp +++ b/variable/variable-in/MyNode.cpp @@ -130,7 +130,7 @@ void MyNode::startUpComplete() } } -void MyNode::variableEvent(uint64_t peerId, int32_t channel, std::string variable, Flows::PVariable value) +void MyNode::variableEvent(std::string source, uint64_t peerId, int32_t channel, std::string variable, Flows::PVariable value) { try { @@ -138,6 +138,7 @@ void MyNode::variableEvent(uint64_t peerId, int32_t channel, std::string variabl _lastInput = Flows::HelperFunctions::getTime(); Flows::PVariable message = std::make_shared(Flows::VariableType::tStruct); + message->structValue->emplace("eventSource", std::make_shared(source)); message->structValue->emplace("peerId", std::make_shared(peerId)); message->structValue->emplace("channel", std::make_shared(channel)); message->structValue->emplace("variable", std::make_shared(variable)); diff --git a/variable/variable-in/MyNode.h b/variable/variable-in/MyNode.h index 643cd333..600631b5 100644 --- a/variable/variable-in/MyNode.h +++ b/variable/variable-in/MyNode.h @@ -54,7 +54,7 @@ class MyNode: public Flows::INode std::string _loopPreventionGroup; bool _loopPrevention = false; - virtual void variableEvent(uint64_t peerId, int32_t channel, std::string variable, Flows::PVariable value); + virtual void variableEvent(std::string source, uint64_t peerId, int32_t channel, std::string variable, Flows::PVariable value); }; }