<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Take care that the getvalue function is
overloaded by Scilab to silently evaluate and chack the arguments
that are given by expression based variables defined in the Xcos
context<br>
<br>
Basing your bload dialog on a other function will breaks this
behavior...<br>
<br>
Serge Steer<br>
INRIA<br>
Le 25/07/2013 10:11, <a class="moz-txt-link-abbreviated" href="mailto:martin.highUp@gmx.net">martin.highUp@gmx.net</a> a écrit :<br>
</div>
<blockquote
cite="mid:trinity-8ab29176-753f-4192-85d2-26941919897b-1374739911499@3capp-gmx-bs05"
type="cite">
<div style="font-family: Verdana;font-size: 12.0px;">
<div><span style="font-family: Verdana, sans-serif, Arial,
'Trebuchet MS'; font-size: 13px; line-height: 1.6em;">Hello</span></div>
<div class="signature">
<div> </div>
<div>I am writing on an application using Scilab and Xcos.
Right now I am working on a specialised replacement for
“getvalue(..)” (GUI to edit parameters of Xcos blocks)
written in Java.</div>
<div>Now I need to access the current Scilab workspace
(execute an expression and get back the result) from Java --
something like { x =
myScilab.getResultFromExpression("2.0*sin(foo)") } with an
error message in case of a non-valid expression. Current
means that the java code of interest is run through JIMS and
shall access its calling Scilab environment.</div>
<div>Where can I find this functionality?</div>
<div> </div>
<div>What I tried:</div>
<div>Javasci:</div>
<div> </div>
<div>Used in a separated session it provides roughly the asked
functionality. See the example included in Javasci.</div>
<div>Used within an existing Scilab session I run in some
problems.</div>
<div> </div>
<div>The sci.open() does not return when called from within a
Scilab session and is probably not needed as there are
static methods like Scilab.getInCurrentScilabSession(..),
too.</div>
<div>sci.get(..) is working when I skip sci.open(). Maybe that
is the cause for the further problem with sci.execException.</div>
<div> </div>
<div>Scilab.getInCurrentScilabSession(“foo”) is working
(returning a Scilab variables content) but I found one
strange behaviour:</div>
<div>Scilab.getInCurrentScilabSession(“foo * 2”) returns the
value of foo, not 2*foo and does not thow an Exception. This
happens also when called as separate session.</div>
<div> </div>
<div>When called from within a running Scialb session
sci.execException(“X2C_JAVA_ACCESS = 987”) (or any other
valid expression) throws</div>
<div> </div>
<div>org.scilab.modules.javasci.JavasciException$ScilabErrorException:
A Scilab error occurred: winqueryreg: Cannot query value of
this type.</div>
<div>Code: 999</div>
<div><br>
and called one more time:</div>
<div> </div>
<div>org.scilab.modules.javasci.JavasciException$ScilabErrorException:
A Scilab error occurred: Method invocation: An error
occurred during the data retrieving in Java:An exception has
been thrown in calling the method
getValueFromExpression_1:org.scilab.modules.javasci.JavasciException$ScilabErrorException:
A Scilab error occurred: winqueryreg: Cannot query value of
this type.Code: 999</div>
<div>Code: 999</div>
<div> </div>
<div>In a separate session as in the Javasci example that
works.</div>
<div><br>
</div>
<div>Do you have hints where to dig to get something like
getResultFromExpression("2.0*sin(foo)") working?</div>
<div> </div>
<div> </div>
<div>Thanks</div>
<div> </div>
<div>Martin</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>