70 using namespace YACS::ENGINE;
71 using namespace YACS::HMI;
76 std::map<int, std::string>
m;
77 m[1] =
"\nUse the [Ctrl] Drag_N_Drop method if you want to create a input/output link without the associated control link";
92 GuiContext::getCurrent()->_lastErrorMessage = ex.
what();
95 std::map<int, std::string> ProcInvoc::_typeNameMap;
99 ProcInvoc::ProcInvoc()
139 if (dynamic_cast<YACS::ENGINE::Bloc*>(node)) nodeType =
BLOC;
140 else if (dynamic_cast<YACS::ENGINE::PythonNode*>(node)) nodeType =
PYTHONNODE;
141 else if (dynamic_cast<YACS::ENGINE::PyFuncNode*>(node)) nodeType =
PYFUNCNODE;
142 else if (dynamic_cast<YACS::ENGINE::CORBANode*>(node)) nodeType =
CORBANODE;
143 else if (dynamic_cast<YACS::ENGINE::CppNode*>(node)) nodeType =
CPPNODE;
144 else if (dynamic_cast<YACS::ENGINE::SalomeNode*>(node)) nodeType =
SALOMENODE;
145 else if (dynamic_cast<YACS::ENGINE::SalomePythonNode*>(node)) nodeType =
SALOMEPYTHONNODE;
146 else if (dynamic_cast<YACS::ENGINE::XmlNode*>(node)) nodeType =
XMLNODE;
147 else if (dynamic_cast<YACS::ENGINE::SplitterNode*>(node)) nodeType =
SPLITTERNODE;
148 else if (dynamic_cast<YACS::ENGINE::ForLoop*>(node)) nodeType =
FORLOOP;
149 else if (dynamic_cast<YACS::ENGINE::WhileLoop*>(node)) nodeType =
WHILELOOP;
150 else if (dynamic_cast<YACS::ENGINE::Switch*>(node)) nodeType =
SWITCH;
151 else if (dynamic_cast<YACS::ENGINE::ForEachLoop*>(node)) nodeType =
FOREACHLOOP;
152 else if (dynamic_cast<YACS::ENGINE::OptimizerLoop*>(node)) nodeType =
OPTIMIZERLOOP;
153 else if (dynamic_cast<YACS::ENGINE::PresetNode*>(node)) nodeType =
PRESETNODE;
154 else if (dynamic_cast<YACS::ENGINE::OutNode*>(node)) nodeType =
OUTNODE;
155 else if (dynamic_cast<YACS::ENGINE::StudyInNode*>(node)) nodeType =
STUDYINNODE;
156 else if (dynamic_cast<YACS::ENGINE::StudyOutNode*>(node)) nodeType =
STUDYOUTNODE;
163 if (dynamic_cast<YACS::ENGINE::InputPort*>(port)) portType =
INPUTPORT;
164 else if (dynamic_cast<YACS::ENGINE::OutputPort*>(port)) portType =
OUTPUTPORT;
165 else if (dynamic_cast<YACS::ENGINE::InputDataStreamPort*>(port)) portType =
INPUTDATASTREAMPORT;
166 else if (dynamic_cast<YACS::ENGINE::OutputDataStreamPort*>(port)) portType =
OUTPUTDATASTREAMPORT;
183 std::string position,
187 :
Command(), _catalog(catalog), _compoName(compo), _typeName(type),
188 _position(position), _name(name), _newCompoInst(newCompoInst), _swCase(swCase)
190 DEBTRACE(
"CommandAddNodeFromCatalog " << compo <<
" " << type <<
" " << position <<
" " << name);
213 DEBTRACE(
"CommandAddNodeFromCatalog::localExecute");
216 Node *nodeToClone = 0;
243 if (father && nodeToClone)
245 son = nodeToClone->
clone(0);
306 throw YACS::Exception(
"node from catalog is not correct: check if catalog is up to date!");
315 DEBTRACE(
"CommandAddNode::localExecute() : " << ex.
what());
325 DEBTRACE(
"CommandAddNodeFromCatalog::localReverse");
356 DEBTRACE(
"CommandAddNodeFromCatalog::localReverse(): " << ex.
what());
365 std::string newParent)
366 :
Command(), _position(position), _newParent(newParent)
380 DEBTRACE(
"CommandReparentNode::localExecute");
398 if (oldFather == newFather)
400 if (
ComposedNode *cnode = dynamic_cast<ComposedNode*>(node))
401 if (cnode->isInMyDescendance(newFather))
402 throw YACS::Exception(
"reparent a node to one of it's children is impossible");
403 if (
Loop *loop = dynamic_cast<Loop*>(newFather))
404 if (!loop->edGetDirectDescendants().empty())
406 if (
DynParaLoop * dpl = dynamic_cast<DynParaLoop*>(newFather))
407 if (dpl->getExecNode() != NULL)
408 throw YACS::Exception(
"Already an execution node in the new parent of type dynamic loop");
409 Node *nodeSameName = 0;
418 throw YACS::Exception(
"there is already a child of same name in the new parent");
444 DEBTRACE(
"CommandReparentNode::localExecute() : " << ex.
what());
494 DEBTRACE(
"CommandReparentNode::localReverse() : " << ex.
what());
508 std::string newParent,
510 bool toSaveRestoreLinks)
511 :
Command(), _position(position), _newParent(newParent), _type(type), _toSaveRestoreLinks(toSaveRestoreLinks)
527 DEBTRACE(
"CommandPutInComposedNode::localExecute");
555 Node* composednode = 0;
557 for (list<Node*>::iterator it = children.begin(); it != children.end(); ++it)
562 composednode = (*it);
589 (
dynamic_cast<SubjectComposedNode*
>(scomposednode))->houseKeepingAfterCutPaste(
false, snode);
600 DEBTRACE(
"CommandPutInComposedNode::localExecute() : " << ex.
what());
614 DEBTRACE(
"CommandPutInComposedNode::localReverse");
660 DEBTRACE(
"CommandPutInComposedNode::localReverse() : " << ex.
what());
669 std::string position,
670 std::string newParent,
672 :
Command(), _fromproc(fromproc), _position(position), _newParent(newParent), _newName(
""), _clone(0), _case(swCase)
690 DEBTRACE(
"CommandCopyNode::localExecute");
708 if (
Loop *loop = dynamic_cast<Loop*>(newFather))
709 if (!loop->edGetDirectDescendants().empty())
716 bool sameName =
true;
743 if(theswitch->edGetNode(
_case))
746 theCase=theswitch->getMaxCase()+1;
748 theswitch->edSetNode(theCase,
_clone);
764 DEBTRACE(
"CommandCopyNode::localExecute() : " << ex.
what());
798 DEBTRACE(
"CommandCopyNode::localReverse(): " << ex.
what());
808 :
Command(), _position(position), _name(name)
823 DEBTRACE(
"CommandRenameNode::localExecute");
841 DEBTRACE(
"CommandRenameNode::localExecute() : " << ex.
what());
850 DEBTRACE(
"CommandRenameNode::localReverse");
864 DEBTRACE(
"CommandRenameNode::localReverse() : " << ex.
what());
874 :
Command(), _oldName(oldName), _newName(newName)
887 DEBTRACE(
"CommandRenameContainer::localExecute");
904 scont-> update(
RENAME, 0, scont);
909 DEBTRACE(
"CommandRenameContainer::localExecute() : " << ex.
what());
913 return (container != 0);
918 DEBTRACE(
"CommandRenameContainer::localReverse");
930 scont-> update(
RENAME, 0, scont);
935 DEBTRACE(
"CommandRenameContainer::localReverse() : " << ex.
what());
939 return (container != 0);
947 :
Command(), _position(position), _oldName(oldName), _newName(newName), _portType(portType)
949 DEBTRACE(
"CommandRenameInDataPort::CommandRenameInDataPort "
961 DEBTRACE(
"CommandRenameInDataPort::localExecute");
978 throw Exception(
"there is already a port with the new name");
987 sport->update(
RENAME, 0, sport);
991 DEBTRACE(
"CommandRenameInDataPort::localExecute() : " << ex.
what());
1000 DEBTRACE(
"CommandRenameInDataPort::localReverse");
1017 throw Exception(
"there is already a port with the old name");
1026 sport->update(
RENAME, 0, sport);
1030 DEBTRACE(
"CommandRenameInDataPort::localReverse() : " << ex.
what());
1040 std::string oldName,
1042 :
Command(), _position(position), _oldName(oldName), _newName(newName), _portType(portType)
1044 DEBTRACE(
"CommandRenameOutDataPort::CommandRenameOutDataPort "
1056 DEBTRACE(
"CommandRenameOutDataPort::localExecute");
1072 throw Exception(
"there is already a port with the new name");
1081 sport->update(
RENAME, 0, sport);
1085 DEBTRACE(
"CommandRenameOutDataPort::localExecute() : " << ex.
what());
1094 DEBTRACE(
"CommandRenameOutDataPort::localReverse");
1110 throw Exception(
"there is already a port with the old name");
1119 sport->update(
RENAME, 0, sport);
1123 DEBTRACE(
"CommandRenameOutDataPort::localReverse() : " << ex.
what());
1133 std::string typeName)
1134 :
Command(), _catalog(catalog), _typeName(typeName)
1136 DEBTRACE(
"CommandAddDataTypeFromCatalog::CommandAddDataTypeFromCatalog: " << typeName);
1141 string ret =
"CommandAddDataTypeFromCatalog " +
_typeName;
1155 DEBTRACE(
"CommandAddDataTypeFromCatalog::localExecute");
1179 DEBTRACE(
"CommandAddDataTypeFromCatalog::localReverse");
1188 DEBTRACE(
"CommandAddDataTypeFromCatalog::localReverse(): " << ex.
what());
1201 :
Command(), _catalog(catalog), _typePort(type), _node(node), _name(name)
1225 DEBTRACE(
"CommandAddInputPortFromCatalog::localExecute");
1248 _sip = snode->addSubjectInputPort(son,
_name);
1253 DEBTRACE(
"CommandAddInputPortFromCatalog::localExecute() : " << ex.
what());
1255 if (son)
delete son;
1263 DEBTRACE(
"CommandAddInputPortFromCatalog::localReverse");
1290 DEBTRACE(
"CommandAddInputPortFromCatalog::localReverse(): " << ex.
what());
1302 :
Command(), _catalog(catalog), _typePort(type), _node(node), _name(name)
1326 DEBTRACE(
"CommandAddOutputPortFromCatalog::localExecute");
1349 _sop = snode->addSubjectOutputPort(son,
_name);
1354 DEBTRACE(
"CommandAddOutputPortFromCatalog::localExecute() : " << ex.
what());
1356 if (son)
delete son;
1364 DEBTRACE(
"CommandAddOutputPortFromCatalog::localReverse");
1391 DEBTRACE(
"CommandAddOutputPortFromCatalog::localReverse(): " << ex.
what());
1403 :
Command(), _catalog(catalog), _typePort(type), _node(node), _name(name)
1417 DEBTRACE(
"CommandAddIDSPortFromCatalog");
1428 DEBTRACE(
"CommandAddIDSPortFromCatalog::localExecute");
1448 _sip = snode->addSubjectIDSPort(son,
_name);
1452 DEBTRACE(
"CommandAddIDSPortFromCatalog::localExecute() : " << ex.
what());
1454 if (son)
delete son;
1462 DEBTRACE(
"CommandAddIDSPortFromCatalog::localReverse");
1489 DEBTRACE(
"CommandAddIDSPortFromCatalog::localReverse(): " << ex.
what());
1501 :
Command(), _catalog(catalog), _typePort(type), _node(node), _name(name)
1503 DEBTRACE(
"CommandAddODSPortFromCatalog");
1526 DEBTRACE(
"CommandAddODSPortFromCatalog::localExecute");
1546 _sop = snode->addSubjectODSPort(son,
_name);
1550 DEBTRACE(
"CommandAddODSPortFromCatalog::localExecute() : " << ex.
what());
1552 if (son)
delete son;
1560 DEBTRACE(
"CommandAddODSPortFromCatalog::localReverse");
1587 DEBTRACE(
"CommandAddODSPortFromCatalog::localReverse(): " << ex.
what());
1601 :
Command(), _node(node), _port(port), _isUp(isUp), _rank(-1)
1603 DEBTRACE(
"CommandOrderInputPorts");
1610 string ret =
"CommandOrderInputPorts " +
_node +
" " +
_port +
" " + s.str();
1623 if (!father)
return false;
1628 list<InputPort*>::iterator pos = find(plist.begin(), plist.end(), portToMove);
1633 if(pos == plist.begin())
1636 do { pos--; isUp--; }
while (isUp);
1641 if (pos == plist.end())
1642 pos = plist.begin();
1648 if (pos != plist.end())
1649 portBefore = (*pos);
1651 plist.remove(portToMove);
1655 pos = find(plist.begin(), plist.end(), portBefore);
1657 for (list<InputPort*>::iterator it = plist.begin(); it != pos; ++it)
1659 plist.insert(pos, portToMove);
1663 _rank = plist.size();
1664 plist.push_back(portToMove);
1670 snode->update(
ORDER,
true, sport);
1671 snode->update(
SYNCHRO,
true, sport);
1675 DEBTRACE(
"CommandOrderInputPorts::localExecute() : " << ex.
what());
1679 return (father != 0);
1688 int isUpRev = -
_isUp;
1689 if (isUpRev == 0) isUpRev =1;
1693 if (!father)
return false;
1698 list<InputPort*>::iterator pos = find(plist.begin(), plist.end(), portToMove);
1702 if(pos == plist.begin())
1705 do { pos--; isUpRev--; }
while (isUpRev);
1710 if (pos == plist.end())
1711 pos = plist.begin();
1713 do { pos++; isUpRev++; }
while (isUpRev<0);
1717 if (pos != plist.end())
1718 portBefore = (*pos);
1720 plist.remove(portToMove);
1724 pos = find(plist.begin(), plist.end(), portBefore);
1726 for (list<InputPort*>::iterator it = plist.begin(); it != pos; ++it)
1728 plist.insert(pos, portToMove);
1732 _rank = plist.size();
1733 plist.push_back(portToMove);
1739 snode->update(
ORDER,
true, sport);
1740 snode->update(
SYNCHRO,
true, sport);
1744 DEBTRACE(
"CommandOrderInputPorts::localExecute() : " << ex.
what());
1748 return (father != 0);
1759 :
Command(), _node(node), _port(port), _isUp(isUp), _rank(-1)
1761 DEBTRACE(
"CommandOrderOutputPorts");
1768 string ret =
"CommandOrderOutputPorts " +
_node +
" " +
_port +
" " + s.str();
1781 if (!father)
return false;
1786 list<OutputPort*>::iterator pos = find(plist.begin(), plist.end(), portToMove);
1791 if(pos == plist.begin())
1794 do { pos--; isUp--; }
while (isUp);
1799 if (pos == plist.end())
1800 pos = plist.begin();
1806 if (pos != plist.end())
1807 portBefore = (*pos);
1809 plist.remove(portToMove);
1813 pos = find(plist.begin(), plist.end(), portBefore);
1815 for (list<OutputPort*>::iterator it = plist.begin(); it != pos; ++it)
1817 plist.insert(pos, portToMove);
1821 _rank = plist.size();
1822 plist.push_back(portToMove);
1828 snode->update(
ORDER,
false, sport);
1829 snode->update(
SYNCHRO,
false, sport);
1833 DEBTRACE(
"CommandOrderOutputPorts::localExecute() : " << ex.
what());
1837 return (father != 0);
1846 int isUpRev = -
_isUp;
1847 if (isUpRev == 0) isUpRev =1;
1851 if (!father)
return false;
1856 list<OutputPort*>::iterator pos = find(plist.begin(), plist.end(), portToMove);
1860 if(pos == plist.begin())
1863 do { pos--; isUpRev--; }
while (isUpRev);
1868 if (pos == plist.end())
1869 pos = plist.begin();
1871 do { pos++; isUpRev++; }
while (isUpRev<0);
1875 if (pos != plist.end())
1876 portBefore = (*pos);
1878 plist.remove(portToMove);
1882 pos = find(plist.begin(), plist.end(), portBefore);
1884 for (list<OutputPort*>::iterator it = plist.begin(); it != pos; ++it)
1886 plist.insert(pos, portToMove);
1890 _rank = plist.size();
1891 plist.push_back(portToMove);
1897 snode->update(
ORDER,
false, sport);
1898 snode->update(
SYNCHRO,
false, sport);
1902 DEBTRACE(
"CommandOrderOutputPorts::localExecute() : " << ex.
what());
1906 return (father != 0);
1912 std::string startnode, std::string startport,
TypeOfElem startportType,
1913 std::string endnode, std::string endport,
TypeOfElem endportType)
1914 :
Command(), _elemType(elemType), _startnode(startnode), _startport(startport),
1915 _endnode(endnode), _endport(endport), _startportType(startportType), _endportType(endportType)
1917 DEBTRACE(
"CommandDestroy::CommandDestroy");
1931 DEBTRACE(
"CommandDestroy::localExecute");
2022 pair<OutPort*,InPort*> keymap = pair<OutPort*,InPort*>(outp,inp);
2032 pair<Node*,Node*> keymap = pair<Node*,Node*>(outn,inn);
2048 throw Exception(
"Command Destroy not implemented for that type");
2063 DEBTRACE(
"CommandDestroy::localExecute() : " << ex.
what());
2071 DEBTRACE(
"CommandDestroy::localReverse");
2081 :
Command(), _node(node), _port(port), _value(value)
2083 DEBTRACE(
"CommandSetInPortValue::CommandSetInPortValue " << node <<
" " << port <<
" " << value);
2095 DEBTRACE(
"CommandSetInPortValue::localExecute");
2108 dnode =
dynamic_cast<DataNode*
>(node);
2114 DEBTRACE(
"CommandSetInPortValue::localExecute() : " << ex.
what());
2130 PyGILState_STATE gstate = PyGILState_Ensure();
2138 strval =
"\"" +
_value +
"\"";
2142 inp->
edInit(
"Python", result);
2145 PyGILState_Release(gstate);
2151 DEBTRACE(
"CommandSetInPortValue::localExecute() : " << ex.
what());
2153 PyGILState_Release(gstate);
2161 DEBTRACE(
"CommandSetInPortValue::localReverse");
2174 dnode =
dynamic_cast<DataNode*
>(node);
2180 DEBTRACE(
"CommandSetInPortValue::localExecute() : " << ex.
what());
2196 PyObject *result = Py_None;
2197 PyGILState_STATE gstate = PyGILState_Ensure();
2212 inp->
edInit(
"Python", result);
2214 PyGILState_Release(gstate);
2220 DEBTRACE(
"CommandSetInPortValue::localExecute() : " << ex.
what());
2222 PyGILState_Release(gstate);
2233 :
Command(), _node(node), _port(port), _value(value)
2235 DEBTRACE(
"CommandSetOutPortValue::CommandSetOutPortValue " << node <<
" " << port <<
" " << value);
2247 DEBTRACE(
"CommandSetOutPortValue::localExecute");
2259 dnode =
dynamic_cast<DataNode*
>(node);
2265 DEBTRACE(
"CommandSetOutPortValue::localExecute() : " << ex.
what());
2270 if (!outpp && !outsp)
2272 DEBTRACE(
"Set value on output port only possible on a presetPort or a studyPort");
2279 DEBTRACE(
"Set value on output port only possible on a dataNode");
2302 strval =
"\"" +
_value +
"\"";
2309 DEBTRACE(
"CommandSetOutPortValue::localExecute() : " << ex.
what());
2315 PyGILState_STATE gstate = PyGILState_Ensure();
2326 DEBTRACE(
"CommandSetOutPortValue::localExecute() : " << ex.
what());
2329 PyGILState_Release(gstate);
2334 PyGILState_Release(gstate);
2340 DEBTRACE(
"CommandSetOutPortValue::localReverse");
2352 dnode =
dynamic_cast<DataNode*
>(node);
2358 DEBTRACE(
"CommandSetOutPortValue::localExecute() : " << ex.
what());
2363 if (!outpp && !outsp)
2365 DEBTRACE(
"Set value on output port only possible on a presetPort or a studyPort");
2372 DEBTRACE(
"Set value on output port only possible on a dataNode");
2388 PyObject *result = Py_None;
2398 strval =
"\"" +
_value +
"\"";
2406 DEBTRACE(
"CommandSetOutPortValue::localExecute() : " << ex.
what());
2412 PyGILState_STATE gstate = PyGILState_Ensure();
2423 DEBTRACE(
"CommandSetOutPortValue::localExecute() : " << ex.
what());
2426 PyGILState_Release(gstate);
2431 PyGILState_Release(gstate);
2439 :
Command(), _switch(aSwitch), _value(value)
2441 DEBTRACE(
"CommandSetSwitchSelect::CommandSetSwitchSelect");
2453 DEBTRACE(
"CommandSetSwitchSelect::localExecute");
2461 int val = atoi(
_value.c_str());
2469 DEBTRACE(
"CommandSetSwitchSelect::localExecute() : " << ex.
what());
2477 DEBTRACE(
"CommandSetSwitchSelect::localReverse");
2491 DEBTRACE(
"CommandSetSwitchSelect::localReverse() : " << ex.
what());
2502 :
Command(), _switch(aSwitch), _node(node), _value(value)
2504 DEBTRACE(
"CommandSetSwitchCase::CommandSetSwitchCase");
2517 DEBTRACE(
"CommandSetSwitchCase::localExecute");
2520 DEBTRACE(
"CommandSetSwitchCase::localExecute");
2524 int val = atoi(
_value.c_str());
2527 throw YACS::Exception(
"Set Switch Case impossible: value already used");
2533 DEBTRACE(
"CommandSetSwitchCase::localExecute OK " << val);
2537 ssw->update(
SETCASE, val, snode);
2543 DEBTRACE(
"CommandSetSwitchCase::localExecute() : " << ex.
what());
2551 DEBTRACE(
"CommandSetSwitchCase::localReverse");
2554 DEBTRACE(
"CommandSetSwitchCase::localReverse");
2561 throw YACS::Exception(
"Set Switch Case impossible: value already used");
2565 DEBTRACE(
"CommandSetSwitchCase::localReverse OK " << val);
2569 ssw->update(
SETCASE, val, snode);
2575 DEBTRACE(
"CommandSetSwitchCase::localReverse() : " << ex.
what());
2585 :
Command(), _forLoop(forLoop), _value(value)
2587 DEBTRACE(
"CommandSetForLoopSteps::CommandSetForLoopSteps");
2600 DEBTRACE(
"CommandSetForLoopSteps::localExecute");
2603 DEBTRACE(
"CommandSetForLoopSteps::localExecute");
2608 int val = atoi(
_value.c_str());
2617 DEBTRACE(
"CommandSetForLoopSteps::localExecute() : " << ex.
what());
2625 DEBTRACE(
"CommandSetForLoopSteps::localReverse");
2628 DEBTRACE(
"CommandSetForLoopSteps::localReverse");
2640 DEBTRACE(
"CommandSetForLoopSteps::localReverse() : " << ex.
what());
2650 :
Command(), _whileLoop(whileLoop), _value(value)
2652 DEBTRACE(
"CommandSetWhileCondition::CommandSetWhileCondition");
2664 DEBTRACE(
"CommandSetWhileCondition::localExecute");
2671 bool val = atoi(
_value.c_str());
2680 DEBTRACE(
"CommandSetWhileCondition::localExecute() : " << ex.
what());
2688 DEBTRACE(
"CommandSetWhileCondition::localReverse");
2702 DEBTRACE(
"CommandSetWhileCondition::localReverse() : " << ex.
what());
2712 :
Command(), _forEach(forEach), _value(value)
2714 DEBTRACE(
"CommandSetForEachBranch::CommandSetForEachBranch");
2726 DEBTRACE(
"CommandSetForEachBranch::localExecute");
2733 int val = atoi(
_value.c_str());
2745 DEBTRACE(
"CommandSetForEachBranch::localExecute() : " << ex.
what());
2753 DEBTRACE(
"CommandSetForEachBranch::localReverse");
2770 DEBTRACE(
"CommandSetForEachBranch::localReverse() : " << ex.
what());
2779 :
Command(), _optimizer(optimizer), _alglib(alglib), _symbol(symbol)
2794 DEBTRACE(
"CommandSetAlgo::localExecute");
2805 spo->update(
UPDATE, 0, spo);
2809 spo->update(
UPDATE, 0, spo);
2817 DEBTRACE(
"CommandSetAlgo::localExecute() : " << ex.
what());
2825 DEBTRACE(
"CommandSetAlgo::localReverse");
2834 spo->update(
UPDATE, 0, spo);
2838 spo->update(
UPDATE, 0, spo);
2846 DEBTRACE(
"CommandSetAlgo::localReverse() : " << ex.
what());
2856 std::string inNode, std::string inPort,
TypeOfElem inPortType,
bool control)
2857 :
Command(), _outNode(outNode), _outPort(outPort), _outPortType(outPortType),
2858 _inNode(inNode), _inPort(inPort), _inPortType(inPortType), _control(control)
2860 DEBTRACE(
"CommandAddLink::CommandAddLink "<<outNode<<
"."<<outPort<<
"->"<<inNode<<
"."<<inPort<<
" "<<control);
2874 DEBTRACE(
"CommandAddLink::localExecute");
2885 bool preexistingControl =
false;
2889 ComposedNode* father = ComposedNode::getLowestCommonAncestor(outn2,inn2);
2890 if(outn2==father || inn2==father)
2891 preexistingControl =
true;
2901 preexistingControl =
true;
2917 if (dynamic_cast<OutputDataStreamPort*>(outp))
2938 ComposedNode* father = ComposedNode::getLowestCommonAncestor(outn,inn);
2939 if(outn==father || inn==father)
return true;
2948 if (!preexistingControl)
2950 pair<Node*,Node*> keyLink(outn,inn);
2955 if (!sfno || !sfni)
return true;
2964 DEBTRACE(
"CommandAddLink::localExecute() : " << ex.
what());
2972 DEBTRACE(
"CommandAddLink::localReverse");
3022 DEBTRACE(
"CommandAddLink::localReverse(): " << ex.
what());
3031 :
Command(), _outNode(outNode), _inNode(inNode)
3033 DEBTRACE(
"CommandAddControlLink::CommandAddControlLink "<<outNode<<
"-->>"<<inNode);
3044 DEBTRACE(
"CommandAddControlLink::localExecute");
3054 ComposedNode *cla = ComposedNode::getLowestCommonAncestor(outn,inn);
3060 cla = ComposedNode::getLowestCommonAncestor(outn->
getFather(),
3073 DEBTRACE(
"CommandAddControlLink::localExecute() : " << ex.
what());
3081 DEBTRACE(
"CommandAddControlLink::localReverse");
3104 DEBTRACE(
"CommandAddControlLink::localReverse(): " << ex.
what());
3113 :
Command(), _name(name), _containerToClone(refContainer), _subcont(0)
3115 DEBTRACE(
"CommandAddContainerBase::CommandAddContainerBase " << name <<
" " << refContainer);
3124 DEBTRACE(
"CommandAddContainerBase::localExecute");
3158 DEBTRACE(
"CommandAddContainerBase::localExecute() : " << ex.
what());
3166 DEBTRACE(
"CommandAddContainerBase::localReverse");
3181 DEBTRACE(
"CommandAddContainer::localExecute() : " << ex.
what());
3224 :
Command(), _position(position), _properties(properties)
3226 DEBTRACE(
"CommandSetNodeProperties::CommandSetNodeProperties " << position);
3238 DEBTRACE(
"CommandSetNodeProperties::localExecute");
3259 DEBTRACE(
"CommandSetNodeProperties::localExecute() : " << ex.
what());
3267 DEBTRACE(
"CommandSetNodeProperties::localReverse");
3287 DEBTRACE(
"CommandSetNodeProperties::localReverse() : " << ex.
what());
3296 std::map<std::string,std::string> properties)
3297 :
Command(), _compoinstance(compoinstance), _properties(properties)
3299 DEBTRACE(
"CommandSetComponentInstanceProperties::CommandSetComponentInstanceProperties " << compoinstance);
3311 DEBTRACE(
"CommandSetComponentInstanceProperties::localExecute");
3332 DEBTRACE(
"CommandSetComponentInstanceProperties::localExecute() : " << ex.
what());
3340 DEBTRACE(
"CommandSetComponentInstanceProperties::localReverse");
3359 DEBTRACE(
"CommandSetComponentInstanceProperties::localReverse() : " << ex.
what());
3368 std::map<std::string,std::string> properties)
3369 :
Command(), _container(container), _properties(properties)
3371 DEBTRACE(
"CommandSetContainerProperties::CommandSetContainerProperties " << container);
3383 DEBTRACE(
"CommandSetContainerProperties::localExecute");
3403 DEBTRACE(
"CommandSetContainerProperties::localExecute() : " << ex.
what());
3411 DEBTRACE(
"CommandSetContainerProperties::localReverse");
3427 DEBTRACE(
"CommandSetContainerProperties::localReverse() : " << ex.
what());
3436 std::map<std::string,std::string> properties)
3437 :
Command(), _nodeName(node), _portName(port), _isInport(isInport), _properties(properties)
3439 DEBTRACE(
"CommandSetDSPortProperties::CommandSetDSPortProperties " << node <<
"." << port <<
" " << isInport);
3453 DEBTRACE(
"CommandSetDSPortProperties::localExecute");
3469 DEBTRACE(
"CommandSetDSPortProperties::localExecute() : " << ex.
what());
3477 DEBTRACE(
"CommandSetDSPortProperties::localReverse");
3492 DEBTRACE(
"CommandSetDSPortProperties::localReverse() : " << ex.
what());
3501 std::string endnode, std::string endport,
3502 std::map<std::string,std::string> properties)
3503 :
Command(), _startNodeName(startnode), _startPortName(startport),
3504 _endNodeName(endnode), _endPortName(endport),
3505 _properties(properties)
3507 DEBTRACE(
"CommandSetLinkProperties::CommandSetLinkProperties " );
3519 DEBTRACE(
"CommandSetLinkProperties::localExecute");
3536 std::pair<OutPort*,InPort*> keymap = std::pair<OutPort*,InPort*>(outDSPort,inDSPort);
3538 subject->update(
SETVALUE, 0, subject);
3543 DEBTRACE(
"CommandSetDSPortProperties::localExecute() : " << ex.
what());
3551 DEBTRACE(
"CommandSetLinkProperties::localReverse");
3567 std::pair<OutPort*,InPort*> keymap = std::pair<OutPort*,InPort*>(outDSPort,inDSPort);
3569 subject->update(
SETVALUE, 0, subject);
3574 DEBTRACE(
"CommandSetDSPortProperties::localReverse() : " << ex.
what());
3583 :
Command(), _nodeName(node), _funcName(funcName)
3585 DEBTRACE(
"CommandSetFuncNodeFunctionName::CommandSetFuncNodeFunctionName " << node <<
" " <<funcName);
3597 DEBTRACE(
"CommandSetFuncNodeFunctionName::localExecute");
3621 DEBTRACE(
"CommandSetFuncNodeFunctionName::localExecute() : " << ex.
what());
3629 DEBTRACE(
"CommandSetFuncNodeFunctionName::localReverse");
3647 DEBTRACE(
"CommandSetFuncNodeFunctionName::localReverse() : " << ex.
what());
3656 :
Command(), _nodeName(node), _script(script)
3658 DEBTRACE(
"CommandSetInlineNodeScript::CommandSetInlineNodeScript " << node <<
" " <<script);
3670 DEBTRACE(
"CommandSetInlineNodeScript::localExecute");
3683 inlineNode->setScript(
_script);
3686 snode->update(
SYNCHRO,0,snode);
3697 DEBTRACE(
"CommandSetInlineNodeScript::localExecute() : " << ex.
what());
3705 DEBTRACE(
"CommandSetInlineNodeScript::localReverse");
3715 snode->update(
SYNCHRO,0,snode);
3726 DEBTRACE(
"CommandSetInlineNodeScript::localExecute() : " << ex.
what());
3735 std::string container,
3737 :
Command(), _compoName(compoName), _container(container), _name(name), _subcompo(0)
3768 DEBTRACE(
"CommandAddComponentInstance::localExecute() : " << ex.
what());
3776 DEBTRACE(
"CommandAddComponentInstance::localReverse");
3784 YASSERT(!_subcompo->hasServices());
3785 Container *cont = compo->getContainer();
3788 subcont->detachComponent(_subcompo);
3795 DEBTRACE(
"CommandAddComponentInstance::localReverse() : " << ex.
what());
3803 :
Command(), _mode(mode),_nodeName(nodeName)
3805 DEBTRACE(
"CommandSetExecutionMode::CommandSetExecutionMode " << nodeName <<
" " << mode);
3817 DEBTRACE(
"CommandSetExecutionMode::localExecute");
3824 _oldmode = pyNode->getExecutionMode();
3825 pyNode->setExecutionMode(
_mode);
3838 DEBTRACE(
"CommandSetExecutionMode::localExecute() : " << ex.
what());
3846 DEBTRACE(
"CommandSetExecutionMode::localReverse");
3854 pyNode->setExecutionMode(
_oldmode);
3867 DEBTRACE(
"CommandSetExecutionMode::localReverse() : " << ex.
what());
3878 :
Command(), _container(container),_nodeName(nodeName)
3880 DEBTRACE(
"CommandSetContainer::CommandSetContainer " << nodeName <<
" " << container);
3892 DEBTRACE(
"CommandSetContainer::localExecute");
3902 Container* oldcont = pyNode->getContainer();
3904 _oldcont = pyNode->getContainer()->getName();
3905 pyNode->setContainer(cont);
3923 DEBTRACE(
"CommandSetContainer::localExecute() : " << ex.
what());
3931 DEBTRACE(
"CommandSetContainer::localReverse");
3942 pyNode->setContainer(cont);
3960 DEBTRACE(
"CommandSetContainer::localReverse() : " << ex.
what());
3972 std::string container)
3973 :
Command(), _container(container),_instanceName(instanceName)
3975 DEBTRACE(
"CommandAssociateComponentToContainer::CommandAssociateComponentToContainer " << instanceName <<
" " << container);
3987 DEBTRACE(
"CommandAssociateComponentToContainer::localExecute");
4006 scomp->addSubjectReference(subcont);
4007 if (scomp->_subRefContainer)
4008 subcont->moveComponent(scomp->_subRefContainer);
4010 scomp->_subRefContainer = subcont->attachComponent(scomp);
4023 DEBTRACE(
"CommandAssociateComponentToContainer::localExecute() : " << ex.
what());
4031 DEBTRACE(
"CommandAssociateComponentToContainer::localReverse");
4049 scomp->addSubjectReference(subcont);
4050 if (scomp->_subRefContainer)
4051 subcont->moveComponent(scomp->_subRefContainer);
4053 scomp->_subRefContainer = subcont->attachComponent(scomp);
4066 DEBTRACE(
"CommandAssociateComponentToContainer::localReverse() : " << ex.
what());
4076 std::string instanceName)
4077 :
Command(), _service(service), _instanceName(instanceName)
4079 DEBTRACE(
"CommandAssociateServiceToComponent::CommandAssociateServiceToComponent "<< service <<
" " <<instanceName);
4091 DEBTRACE(
"CommandAssociateServiceToComponent::localExecute");
4097 if (
ServiceNode *service = dynamic_cast<ServiceNode*>(node))
4103 service->setComponent(compo);
4111 snode->addSubjectReference(subCompo);
4134 DEBTRACE(
"CommandAssociateServiceToComponent::localExecute() : " << ex.
what());
4142 DEBTRACE(
"CommandAssociateServiceToComponent::localReverse");
4148 if (
ServiceNode *service = dynamic_cast<ServiceNode*>(node))
4169 service->setComponent(compo);
4177 snode->addSubjectReference(subCompo);
4191 DEBTRACE(
"CommandAssociateServiceToComponent::localReverse() : " << ex.
what());
4200 std::string position,
4202 std::string service)
4203 :
Command(), _catalog(catalog), _position(position), _compo(compo), _service(service)
4205 DEBTRACE(
"CommandAddComponentFromCatalog::CommandAddComponentFromCatalog " << position <<
" " << compo <<
" " << service);
4218 DEBTRACE(
"CommandAddComponentFromCatalog::localExecute");
4261 DEBTRACE(
"CommandAddComponentFromCatalog::localExecute() : " << ex.
what());
4269 DEBTRACE(
"CommandAddComponentFromCatalog::localReverse");
4286 subCompo->detachService(ssnode);
4287 if (subCompo->hasServices())
4288 throw YACS::Exception(
"Component instance with services attached, not removed");
4289 Container *cont = compo->getContainer();
4292 subcont->detachComponent(subCompo);
4304 DEBTRACE(
"CommandAddComponentFromCatalog::localReverse() : " << ex.
what());