diff options
author | Shashank | 2017-05-29 12:40:26 +0530 |
---|---|---|
committer | Shashank | 2017-05-29 12:40:26 +0530 |
commit | 0345245e860375a32c9a437c4a9d9cae807134e9 (patch) | |
tree | ad51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/scinotes/macros | |
download | scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2 scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip |
CMSCOPE changed
Diffstat (limited to 'modules/scinotes/macros')
-rwxr-xr-x | modules/scinotes/macros/buildmacros.bat | 11 | ||||
-rwxr-xr-x | modules/scinotes/macros/buildmacros.sce | 16 | ||||
-rwxr-xr-x | modules/scinotes/macros/cleanmacros.bat | 13 | ||||
-rwxr-xr-x | modules/scinotes/macros/edit_error.bin | bin | 0 -> 3052 bytes | |||
-rwxr-xr-x | modules/scinotes/macros/edit_error.sci | 35 | ||||
-rwxr-xr-x | modules/scinotes/macros/editor.bin | bin | 0 -> 5792 bytes | |||
-rwxr-xr-x | modules/scinotes/macros/editor.sci | 67 | ||||
-rwxr-xr-x | modules/scinotes/macros/lib | bin | 0 -> 316 bytes | |||
-rwxr-xr-x | modules/scinotes/macros/names | 2 |
9 files changed, 144 insertions, 0 deletions
diff --git a/modules/scinotes/macros/buildmacros.bat b/modules/scinotes/macros/buildmacros.bat new file mode 100755 index 000000000..23a827489 --- /dev/null +++ b/modules/scinotes/macros/buildmacros.bat @@ -0,0 +1,11 @@ + +rem Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +rem Copyright (C) 2009 - DIGITEO +rem +rem This file must be used under the terms of the CeCILL. +rem This source file is licensed as described in the file COPYING, which +rem you should have received as part of this distribution. The terms +rem are also available at +rem http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +@..\..\..\bin\scilex -nwni -ns -e exec('buildmacros.sce');quit; diff --git a/modules/scinotes/macros/buildmacros.sce b/modules/scinotes/macros/buildmacros.sce new file mode 100755 index 000000000..2ef3aa8d2 --- /dev/null +++ b/modules/scinotes/macros/buildmacros.sce @@ -0,0 +1,16 @@ + +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO - Allan CORNET <allan.cornet@inria.fr> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +if (isdef("genlib") == %f) then + exec(SCI+"/modules/functions/scripts/buildmacros/loadgenlib.sce"); +end + +genlib("scinoteslib","SCI/modules/scinotes/macros",%f,%t); + diff --git a/modules/scinotes/macros/cleanmacros.bat b/modules/scinotes/macros/cleanmacros.bat new file mode 100755 index 000000000..053cf56f2 --- /dev/null +++ b/modules/scinotes/macros/cleanmacros.bat @@ -0,0 +1,13 @@ + +rem Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +rem Copyright (C) 2009 - DIGITEO +rem +rem This file must be used under the terms of the CeCILL. +rem This source file is licensed as described in the file COPYING, which +rem you should have received as part of this distribution. The terms +rem are also available at +rem http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +@del *.bin 2>NUL +@del lib 2>NUL +@del names 2>NUL diff --git a/modules/scinotes/macros/edit_error.bin b/modules/scinotes/macros/edit_error.bin Binary files differnew file mode 100755 index 000000000..c4ef6cc1c --- /dev/null +++ b/modules/scinotes/macros/edit_error.bin diff --git a/modules/scinotes/macros/edit_error.sci b/modules/scinotes/macros/edit_error.sci new file mode 100755 index 000000000..315e0f044 --- /dev/null +++ b/modules/scinotes/macros/edit_error.sci @@ -0,0 +1,35 @@ +// +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO - Allan CORNET +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt +// + +function answ = edit_error(clearerror) + if (argn(2) == 0) then + clearerror = %f; + end + [str, n, line, func] = lasterror(clearerror); + if (n > 0) then + if (func == "") then + answ = gettext("The last error did not occur inside a Scilab macro."); + else + p = get_function_path(func); + if (p <> []) then + editor(p, line, func); + answ = gettext("Opening file ") + p + gettext(" on line ") + .. + msprintf("%d",line) + gettext(" of the source file of the function ") + func; + else + answ = gettext("The source file of the function ") + func + .. + gettext(" was not found in any library path"); + end + end + else + answ = gettext("There is no recorded error"); + end +endfunction + diff --git a/modules/scinotes/macros/editor.bin b/modules/scinotes/macros/editor.bin Binary files differnew file mode 100755 index 000000000..0a540dab6 --- /dev/null +++ b/modules/scinotes/macros/editor.bin diff --git a/modules/scinotes/macros/editor.sci b/modules/scinotes/macros/editor.sci new file mode 100755 index 000000000..07da1236d --- /dev/null +++ b/modules/scinotes/macros/editor.sci @@ -0,0 +1,67 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +// This function is designed to call the godd "editor" according the values in +// the preferences file. +// This function can take any type of arguments. +function editor(varargin) + if ~isfile(SCIHOME + "/XConfiguration.xml") then + cmd = makeCommand("scinotes", varargin); + execstr(cmd); + return; + end + + doc = xmlRead(SCIHOME + "/XConfiguration.xml"); + prefsNode = xmlXPath(doc, "//scinotes/body/scinotes-preferences"); + prefsNode = prefsNode(1); + if prefsNode.attributes.scinotes == "true" then + xmlDelete(doc); + cmd = makeCommand("scinotes", varargin); + execstr(cmd); + elseif prefsNode.attributes("external-cmd") == "true" then + cmd = prefsNode.attributes.cmd; + xmlDelete(doc); + if ~isempty(varargin) then + cmd = cmd + " """ + string(varargin(1)) + """"; + end + unix_w(cmd); + else + cmd = makeCommand(prefsNode.attributes.macro, varargin); + xmlDelete(doc); + execstr(cmd); + end +endfunction + +// Private function +// Params: +// - name: the command name +// - args: a list of arguments +// Return: +// - cmd: the complete command to call with execstr +// +function cmd = makeCommand(name, args) + cmd = name + "("; + N = size(args); + if N ~= 0 then + for i=1:(N-1) + arg = string(args(i)); + if type(args(i)) == 10 then + arg = """" + arg + """"; + end + cmd = cmd + arg + ","; + end + + arg = string(args(N)); + if type(args(N)) == 10 then + arg = """" + arg + """"; + end + cmd = cmd + arg + end + cmd = cmd + ")"; +endfunction diff --git a/modules/scinotes/macros/lib b/modules/scinotes/macros/lib Binary files differnew file mode 100755 index 000000000..03e685df8 --- /dev/null +++ b/modules/scinotes/macros/lib diff --git a/modules/scinotes/macros/names b/modules/scinotes/macros/names new file mode 100755 index 000000000..ed44955f8 --- /dev/null +++ b/modules/scinotes/macros/names @@ -0,0 +1,2 @@ +edit_error +editor |