X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fengine%2FWhileLoop.cxx;h=bb2a5eef1a429ec5436bf078b976ed0b404edc67;hb=c9208a8ef7f32a620d9650908588320ff159a167;hp=d20e2f30c04d79cd26199df421b424a1efce03d3;hpb=a84e60a749da66dffb73297fa5082b70b9d62f7d;p=modules%2Fyacs.git diff --git a/src/engine/WhileLoop.cxx b/src/engine/WhileLoop.cxx index d20e2f30c..bb2a5eef1 100644 --- a/src/engine/WhileLoop.cxx +++ b/src/engine/WhileLoop.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2006-2019 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #include "WhileLoop.hxx" #include "Runtime.hxx" #include "OutputPort.hxx" @@ -19,6 +38,15 @@ WhileLoop::WhileLoop(const std::string& name):Loop(name),_conditionPort(NAME_OF_ WhileLoop::WhileLoop(const WhileLoop& other, ComposedNode *father, bool editionOnly):Loop(other,father,editionOnly), _conditionPort(other._conditionPort,this) { + //Copy Data linking + std::vector< std::pair > linksToReproduce=other.getSetOfInternalLinks(); + std::vector< std::pair >::iterator iter=linksToReproduce.begin(); + for(;iter!=linksToReproduce.end();++iter) + { + OutPort* pout = iter->first; + InPort* pin = iter->second; + edAddLink(getOutPort(other.getPortName(pout)),getInPort(other.getPortName(pin))); + } } void WhileLoop::init(bool start) @@ -33,7 +61,7 @@ void WhileLoop::exUpdateState() return; if(_inGate.exIsReady()) { - setState(YACS::TOACTIVATE); + setState(YACS::ACTIVATED); _node->exUpdateState(); if(_conditionPort.isLinkedOutOfScope()) if(_conditionPort.isEmpty()) @@ -56,24 +84,12 @@ void WhileLoop::exUpdateState() } } -int WhileLoop::getNumberOfInputPorts() const -{ - return StaticDefinedComposedNode::getNumberOfInputPorts()+1; -} - Node *WhileLoop::simpleClone(ComposedNode *father, bool editionOnly) const { return new WhileLoop(*this,father,editionOnly); } -std::list WhileLoop::getSetOfInputPort() const -{ - list ret=StaticDefinedComposedNode::getSetOfInputPort(); - ret.push_back((InputPort *)&_conditionPort); - return ret; -} - -InputPort *WhileLoop::getInputPort(const std::string& name) const throw(Exception) +InputPort *WhileLoop::getInputPort(const std::string& name) const throw(YACS::Exception) { if(name==NAME_OF_INPUT_CONDITION) return (InputPort*)&_conditionPort; @@ -104,9 +120,9 @@ YACS::Event WhileLoop::updateStateOnFinishedEventFrom(Node *node) } void WhileLoop::checkLinkPossibility(OutPort *start, - const std::set& pointsOfViewStart, + const std::list& pointsOfViewStart, InPort *end, - const std::set& pointsOfViewEnd) throw(Exception) + const std::list& pointsOfViewEnd) throw(YACS::Exception) { DEBTRACE("WhileLoop::checkLinkPossibility"); }