X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=blobdiff_plain;f=scilab%2Fmodules%2Fxcos%2Fmacros%2FxcosCodeGeneration.sci;h=d5b4ea9875b706dfaa0982f2deba08907c1fa505;hp=a5ff2507b554df11e15dea6663a62cb866782c11;hb=36af0ffc5305e2a3fc3d679d2fbc76aabb8aa8de;hpb=566c3bd52b601e4f5abbd477dbd55296062d909f diff --git a/scilab/modules/xcos/macros/xcosCodeGeneration.sci b/scilab/modules/xcos/macros/xcosCodeGeneration.sci index a5ff250..d5b4ea9 100644 --- a/scilab/modules/xcos/macros/xcosCodeGeneration.sci +++ b/scilab/modules/xcos/macros/xcosCodeGeneration.sci @@ -11,36 +11,41 @@ // function xcosCodeGeneration(hdf5FileToLoad, hdf5FileToSave) - -//-- BJ : Alias Warning Function - prot = funcprot(); - funcprot(0); - hilite_obj = xcosShowBlockWarning; - unhilite_obj = xcosClearBlockWarning; - funcprot(prot); - //-- end - - // This will create a scs_m variable. - status = import_from_hdf5(hdf5FileToLoad); - if ~status then - error(msprintf(gettext("%s: Unable to import data from %s"), "xcosCodeGeneration", hdf5FileToLoad)); - end - - ierr = execstr("[ok] = do_compile_superblock42(scs_m, [], [], %f); ", 'errcatch'); - if ierr <> 0 then - [msg, err] = lasterror(); - disp(msg); - deletefile(hdf5FileToSave); - return; - end - - if ok then - status = export_to_hdf5(hdf5FileToSave, "XX"); + + //-- BJ : Alias Warning Function + prot = funcprot(); + funcprot(0); + hilite_obj = xcosShowBlockWarning; + unhilite_obj = xcosClearBlockWarning; + funcprot(prot); + //-- end + + // This will create a scs_m variable. + status = import_from_hdf5(hdf5FileToLoad); if ~status then - error(msprintf(gettext("%s: Unable to export ''XX'' to %s"), "xcosCodeGeneration", hdf5FileToSave)); + error(msprintf(gettext("%s: Unable to import data from %s"), "xcosCodeGeneration", hdf5FileToLoad)); + end + + // define scicos variables + %scicos_prob = %f + %scicos_debug_gr = %f + needcompile = 4; + + ierr = execstr("[ok, XX] = do_compile_superblock42(scs_m, [], [], %f); ", 'errcatch'); + if ierr <> 0 then + [msg, err] = lasterror(); + disp(msg); + deletefile(hdf5FileToSave); + return; + end + + if ok then + status = export_to_hdf5(hdf5FileToSave, "XX"); + if ~status then + error(msprintf(gettext("%s: Unable to export ''XX'' to %s"), "xcosCodeGeneration", hdf5FileToSave)); + end + else + deletefile(hdf5FileToSave); end - else - deletefile(hdf5FileToSave); - end endfunction