Skip to content

Commit

Permalink
Merge branch 'testing'
Browse files Browse the repository at this point in the history
  • Loading branch information
hfedcba committed Jul 11, 2018
2 parents fb12208 + 38585b0 commit 3321afd
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 20 deletions.
4 changes: 1 addition & 3 deletions basic-logic/fallingedge/MyNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::Variable>(Flows::VariableType::tStruct);
outputMessage->structValue->emplace("payload", std::make_shared<Flows::Variable>(true));
output(0, outputMessage);
output(0, message);
}
_lastInput = *input;

Expand Down
4 changes: 2 additions & 2 deletions basic-logic/fallingedge/fallingedge.hni
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
inputInfo: [
{
label: "in",
types: ["bool"]
types: ["any"]
}
],
outputs:1,
outputInfo: [
{
types: ["bool"]
types: ["any"]
}
],
icon: "function.png",
Expand Down
8 changes: 4 additions & 4 deletions basic-logic/fallingedge/locales/en-US/fallingedge
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"label": {
"name": "Name"
},
"paletteHelp": "The output is set to <code>true</code> when the input is set to <code>false</code>. An input of <code>true</code> is ignored.",
"help": "<p>The output is set to <code>true</code> when the input is set to <code>false</code>.</p><p>An input of <code>true</code> is ignored.</p>",
"input1Description": "The boolean value.",
"output1Description": "<code>true</code> on input of <code>false</code>."
"paletteHelp": "The input message is forwarded when the input is evaluated to <code>false</code>. An input evaluated to <code>true</code> is ignored.",
"help": "<p>The input message is forwarded when the input is evaluated to <code>false</code>.</p><p>An input evaluated to <code>true</code> is ignored.</p>",
"input1Description": "The value to check.",
"output1Description": "The input message when the input is evaluated to <code>false</code>."
}
}
}
4 changes: 1 addition & 3 deletions basic-logic/risingedge/MyNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::Variable>(Flows::VariableType::tStruct);
outputMessage->structValue->emplace("payload", std::make_shared<Flows::Variable>(true));
output(0, outputMessage);
output(0, message);
}
}
catch(const std::exception& ex)
Expand Down
8 changes: 4 additions & 4 deletions basic-logic/risingedge/locales/en-US/risingedge
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"label": {
"name": "Name"
},
"paletteHelp": "The output is set to <code>true</code> when the input is set to <code>true</code>. An input of <code>false</code> is ignored.",
"help": "<p>The output is set to <code>true</code> when the input is set to <code>true</code>.</p><p>An input of <code>false</code> is ignored.</p>",
"input1Description": "The boolean value.",
"output1Description": "<code>true</code> on input of <code>true</code>."
"paletteHelp": "The input message is forwarded when the input is evaluated to <code>true</code>. An input evaluated to <code>false</code> is ignored.",
"help": "<p>The input message is forwarded when the input is evaluated to <code>true</code>.</p><p>An input evaluated to <code>false</code> is ignored.</p>",
"input1Description": "The value to check.",
"output1Description": "The input message when the input is evaluated to <code>true</code>."
}
}
}
4 changes: 2 additions & 2 deletions basic-logic/risingedge/risingedge.hni
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
inputInfo: [
{
label: "in",
types: ["bool"]
types: ["any"]
}
],
outputs:1,
outputInfo: [
{
types: ["bool"]
types: ["any"]
}
],
icon: "function.png",
Expand Down
3 changes: 2 additions & 1 deletion variable/variable-in/MyNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,15 @@ 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
{
if(Flows::HelperFunctions::getTime() - _lastInput < _refractionPeriod) return;
_lastInput = Flows::HelperFunctions::getTime();

Flows::PVariable message = std::make_shared<Flows::Variable>(Flows::VariableType::tStruct);
message->structValue->emplace("eventSource", std::make_shared<Flows::Variable>(source));
message->structValue->emplace("peerId", std::make_shared<Flows::Variable>(peerId));
message->structValue->emplace("channel", std::make_shared<Flows::Variable>(channel));
message->structValue->emplace("variable", std::make_shared<Flows::Variable>(variable));
Expand Down
2 changes: 1 addition & 1 deletion variable/variable-in/MyNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

}
Expand Down

0 comments on commit 3321afd

Please sign in to comment.