1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2009-2009 - DIGITEO - Antoine ELIAS <antoine.elias@scilab.org>
3 // Copyright (C) 2010-2010 - DIGITEO - Clément DAVID <clement.david@scilab.org>
5 // This file must be used under the terms of the CeCILL.
6 // This source file is licensed as described in the file COPYING, which
7 // you should have received as part of this distribution. The terms
8 // are also available at
9 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13 // Evaluate a block with the context input.
15 // @param hdf5FileToLoad input block file
16 // @param hdf5FileToSave output block file
17 // @param interfaceAlias block interface function ( ex IN_f )
18 // @param hdf5ContextFile input context file
19 function xcosBlockEval(hdf5FileToLoad, hdf5FileToSave, interfaceAlias, hdf5ContextFile)
21 //replace scicos_getvalue by setvalue (call by interfaceAlias)
24 scicos_getvalue = setvalue;
27 ['In block ' + o.gui + ': ' ; txt ; 'current parameter value kept'],..
29 [str,n,line,func]=lasterror();
30 printf('do_eval: error %d - %s in %s at line %d\n', n, str, func, line);
34 // define scicos variables
39 // allocate the context
40 import_from_hdf5(hdf5ContextFile);
41 %scicos_context = struct();
42 [%scicos_context, ierr] = script2var(context, %scicos_context)
44 // Every parameter settings is done, perform block update
46 import_from_hdf5(hdf5FileToLoad);
48 //create a structure with the new context
49 [new_scs_m, y, typ] = interfaceAlias('set', scs_m, []);
51 export_to_hdf5(hdf5FileToSave, "new_scs_m");