From: Anthony Geay Date: Tue, 8 Mar 2016 10:18:14 +0000 (+0100) Subject: Manage correctly DISBLED state for ElementaryNode. X-Git-Tag: V7_8_0a2~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c24cacd609cd96fa0151beebb0e42be2c2b553d5;p=modules%2Fyacs.git Manage correctly DISBLED state for ElementaryNode. --- diff --git a/src/engine/ElementaryNode.cxx b/src/engine/ElementaryNode.cxx index fb8225048..129deaa1d 100644 --- a/src/engine/ElementaryNode.cxx +++ b/src/engine/ElementaryNode.cxx @@ -92,17 +92,17 @@ void ElementaryNode::initCommonPartWithoutStateManagement(bool start) for(list::iterator iter2=_setOfInputPort.begin();iter2!=_setOfInputPort.end();iter2++) (*iter2)->exInit(start); _inGate.exReset(); - if(_state == YACS::DISABLED) - { - exDisabledState(); // to refresh propagation of DISABLED state - return; - } } void ElementaryNode::init(bool start) { DEBTRACE("ElementaryNode::init " << getName() << " " << start << " " << _state); initCommonPartWithoutStateManagement(start); + if(_state == YACS::DISABLED) + { + exDisabledState(); // to refresh propagation of DISABLED state + return ; + } setState(YACS::READY); } diff --git a/src/runtime/PythonNode.cxx b/src/runtime/PythonNode.cxx index 1bb27a31d..b6b7bc47d 100644 --- a/src/runtime/PythonNode.cxx +++ b/src/runtime/PythonNode.cxx @@ -815,6 +815,11 @@ PyFuncNode::~PyFuncNode() void PyFuncNode::init(bool start) { initCommonPartWithoutStateManagement(start); + if(_state == YACS::DISABLED) + { + exDisabledState(); // to refresh propagation of DISABLED state + return ; + } if(start) //complete initialization setState(YACS::READY); else if(_state > YACS::LOADED)// WARNING FuncNode has internal vars (CEA usecase) ! Partial initialization (inside a loop). Exclusivity of funcNode. diff --git a/src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py b/src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py index f5c4b110c..ee7278e6a 100644 --- a/src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py +++ b/src/yacsloader_swig/Test/StdAloneYacsLoaderTest1.py @@ -176,6 +176,22 @@ def sum(i): self.assertEqual(endNode_error.getPyObj(),0) pass + def test4(self): + """ test linked to TestSaveLoadRun.test20. This is a smaller test coming from EDF autotest""" + xmlFileName="test4.xml" + p=self.r.createProc("test26") + n=self.r.createScriptNode("","node1") + n.setScript("import os") + p.edAddChild(n) + n.setState(pilot.DISABLED) + # + ex=pilot.ExecutorSwig() + self.assertEqual(p.getState(),pilot.READY) + ex.RunW(p,0) + self.assertEqual(p.getState(),pilot.ACTIVATED) + self.assertEqual(n.getState(),pilot.DISABLED) # <- test is here. + pass + def tearDown(self): del self.r del self.l