]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
Merge remote branch 'origin/V7_dev' into V8_0_0_BR V8_0_0rc1
authorvsr <vsr@opencascade.com>
Tue, 9 Feb 2016 14:59:32 +0000 (17:59 +0300)
committervsr <vsr@opencascade.com>
Tue, 9 Feb 2016 14:59:32 +0000 (17:59 +0300)
src/evalyfx/YACSEvalPort.cxx
src/evalyfx/YACSEvalPort.hxx
src/evalyfx/YACSEvalResource.cxx
src/evalyfx_swig/test1.py [new file with mode: 0644]

index 190fa1ef2d636850dc50072ca72ee2707e9a483f..a1658c85d2576054114d3ec71feffc610d7b4cd4 100644 (file)
@@ -123,6 +123,11 @@ bool YACSEvalInputPort::isOKForLock() const
   return hasDefaultValueDefined();
 }
 
+bool YACSEvalInputPort::isLocked() const
+{
+  return _isLocked;
+}
+
 bool YACSEvalInputPort::hasDefaultValueDefined() const
 {
   return _ptr->edIsManuallyInitialized();
index eeb4ecf990063481581a5dbe27e0ab60b32ff789..f81032ac1b0fe6b49485fed96c952def6da00085 100644 (file)
@@ -98,6 +98,7 @@ public:
   YACSEVALYFX_EXPORT std::string getName() const;
   YACSEVALYFX_EXPORT std::string getTypeOfData() const;
   YACSEVALYFX_EXPORT bool isOKForLock() const;
+  YACSEVALYFX_EXPORT bool isLocked() const;
   //
   YACSEVALYFX_EXPORT bool hasDefaultValueDefined() const;
   YACSEVALYFX_EXPORT YACSEvalAny *getDefaultValueDefined() const;
index aa9df200acc79f76002292a021a69fab318e4355..92d1d419a9e16d054f9c21f6d965a3823c1624d2 100644 (file)
@@ -86,6 +86,7 @@ void YACSEvalVirtualYACSContainer::set(YACSEvalResource *gf, YACS::ENGINE::Conta
   if(_cont)
     _cont->decrRef();
   _cont=cont;
+  _cont->incrRef();
   _propertyMap=listOfPropertiesInYACSContainer();
 }
 
diff --git a/src/evalyfx_swig/test1.py b/src/evalyfx_swig/test1.py
new file mode 100644 (file)
index 0000000..e52a597
--- /dev/null
@@ -0,0 +1,46 @@
+# bug revealed by otgui on 8/2/16. Several lock/unlock session. test1.xml is Cogeneration.xml.
+
+def buildScheme(fname):
+    import SALOMERuntime
+    import loader
+    SALOMERuntime.RuntimeSALOME.setRuntime()
+    r=SALOMERuntime.getSALOMERuntime()
+    p=r.createProc("run")
+    cont=p.createContainer("MyWonderfulContainer","Salome")
+    td=p.createType("double","double")
+    n0=r.createScriptNode("Salome","PyScript0")
+    p.edAddChild(n0)
+    q=n0.edAddInputPort("q",td)
+    e=n0.edAddInputPort("e",td)
+    c=n0.edAddInputPort("c",td)
+    ep=n0.edAddOutputPort("ep",td)
+    n0.setScript("ep=1-(q/((e/((1-0.05)*0.54))+(c/0.8)))")
+    n0.setExecutionMode("remote")
+    n0.setContainer(cont)
+    p.saveSchema(fname)
+    pass
+
+fname="test1.xml"
+import evalyfx
+session=evalyfx.YACSEvalSession()
+session.launch()
+efx=evalyfx.YACSEvalYFX.BuildFromFile(fname)
+efx.setParallelizeStatus(False)
+inps=efx.getFreeInputPorts()
+outps=efx.getFreeOutputPorts()
+for inp in inps:
+    inp.setSequenceOfValuesToEval([0.2,0.3])
+efx.lockPortsForEvaluation(inps,outps)
+rss=efx.giveResources()
+rss[0][0].setWantedMachine("localhost")
+a,b=efx.run(session) ; assert(a)
+efx.unlockAll()
+for ii,inp in enumerate(inps):
+    inp.setSequenceOfValuesToEval([0.5,0.6,0.7])
+efx.lockPortsForEvaluation(inps,outps)
+a,b=efx.run(session) ; assert(a)
+efx.unlockAll()
+for ii,inp in enumerate(inps):
+    inp.setSequenceOfValuesToEval([0.5,0.6,0.7])
+efx.lockPortsForEvaluation(inps,outps)
+a,b=efx.run(session) ; assert(a)