Commit dca7a805 authored by Jan Möbius's avatar Jan Möbius

Handle is_connected for inputs as well



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16504 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 876a6e14
...@@ -620,8 +620,8 @@ QString GraphicsScene::generateCode (QString &errors, bool _codeOnly) ...@@ -620,8 +620,8 @@ QString GraphicsScene::generateCode (QString &errors, bool _codeOnly)
QString dName = "ask_user_output_" + found->variableId(); QString dName = "ask_user_output_" + found->variableId();
QString dInputs = ""; QString dInputs = "";
// replace all inputs that are not connectet with user defined value or prepare for asking during execution // replace all inputs that are not connected with user defined value or prepare for asking during execution
foreach (ElementInput *i, found->inputs ()) foreach (ElementInput *i, found->inputs ()){
if (i->isSet ()) if (i->isSet ())
{ {
found->replaceCodeBlock ("is_set", i->inOut ()->name (), "true"); found->replaceCodeBlock ("is_set", i->inOut ()->name (), "true");
...@@ -646,6 +646,13 @@ QString GraphicsScene::generateCode (QString &errors, bool _codeOnly) ...@@ -646,6 +646,13 @@ QString GraphicsScene::generateCode (QString &errors, bool _codeOnly)
} }
} }
// Replace the is_connected block for inputs as well.
if (i->connections ().isEmpty ())
found->replaceCodeBlock ("is_connected", i->inOut ()->name (), "false");
else
found->replaceCodeBlock ("is_connected", i->inOut ()->name (), "true");
}
foreach (ElementFunction *ef, found->functions ()) foreach (ElementFunction *ef, found->functions ())
found->replaceCodeBlock ("function", ef->function ()->name (), "func_" + found->variableId () + "_" + ef->function ()->name ()); found->replaceCodeBlock ("function", ef->function ()->name (), "func_" + found->variableId () + "_" + ef->function ()->name ());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment