[Scilab-users] Unclear How to create toolbox

classic Classic list List threaded Threaded
3 messages Options
marko marko
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Unclear How to create toolbox

Hi; I've written some scripts that I want to load at startup. The
documentation on how to do this  is not clear, including "Build a Toolbox
with Scilab.pdf".
1) There exists no 'cleaner.sce' in the 'contrib' (or any other) directory.
2) We are supposed to copy (??) files like ".start", but the  only such
files included are long and contain a lot of not relevant material. Yet
without advanced knowledge it is not possible to know what to do - start
over? build (somehow) from scratch? Note that the quoted images to use (?)
are sometimes incomplete, several lines missing for the example
'cleaner.sce'.
3) Is one supposed to create his/her own 'builder.sce' file ? Again, not
sure the image is complete in the example.

I notice on one of these help pages Mr. Gudgeon (sorry if mispelled)
suggests editing the file 'scilab.ini'. This file does not exist on my
computer (Windows 7 with scilab 6.0.2). Maybe (?) I'm to create that on my
own?

Please realize that in many years I have discovered the danger to my
computer(s) of ignorantly fooling around with startup files.

I for one would sure appreciate knowing how to actually build a toolbox.
Thanks for comments.

marko



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
hibr01 hibr01
Reply | Threaded
Open this post in threaded view
|

Re: Unclear How to create toolbox

Hi Marco,
 
"There exists no 'cleaner.sce'"
 
cleaner.sce  is build automatically by executing builder.sce.
 
"We are supposed to copy (??) files like ".start", but ..."
 
Most of them you can delete or comment out. One yourtoolbox.start-example w/o help, demos, etc. see below. Search vor xxx or XXX and  exchange it with the name (id) of your toolbox.
 
----------------------------------------- file: etc/mytoolbox.start
 
Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:0000000111 EndFragment:0000015887
function xxxlib=startModule() // small letter toolbox name

    TOOLBOX_NAME  = "xxx"; // small letter toolbox name e.g. mytoolbox
    TOOLBOX_TITLE = "XXX"; // toolbox name, e.g My Toolbox

  mprintf("Start " + TOOLBOX_TITLE + "\n");

  if isdef("xxxlib") then // <--
    warning("Toolbox xxx library is already loaded"); // <--
    return;
  end

  etc_tlbx  = get_absolute_file_path("xxx.start"); // <--
  etc_tlbx  = getshortpathname(etc_tlbx);
  root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") );

//Load  functions library
// =============================================================================
  mprintf("\tLoad macros\n");
  pathmacros = pathconvert( root_tlbx ) + "macros" + filesep();
  xxxlib = lib(pathmacros); // <--

endfunction

xxxlib = startModule(); // <--
clear startModule; // remove startModule on stack
-----------------------------------------
 
-----------------------------------------> file: builder.sce
Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:0000000111 EndFragment:0000010398
mode(-1);
lines(0);

function main_builder()
    TOOLBOX_NAME  = "xxx"; // small letter toolbox name e.g. mytoolbox
    TOOLBOX_TITLE = "XXX"; // toolbox name, e.g My Toolbox
    toolbox_dir   = get_absolute_file_path("builder.sce");

    // Check Scilab's version
    // =============================================================================

    try
        v = getversion("scilab");
    catch
        error(gettext("Scilab 5.3 or more is required."));
    end

    if v(1) < 5 & v(2) < 3 then
        // new API in scilab 5.3
        error(gettext("Scilab 5.3 or more is required."));
    end

    // Check modules_manager module availability
    // =============================================================================

    if ~isdef("tbx_build_loader") then
        error(msprintf(gettext("%s module not installed."), "modules_manager"));
    end

    // Action
    // =============================================================================


    tbx_builder_macros(toolbox_dir);
    if v(1) == 5  then // For Scilab versions 5 and 6 compatibility
        tbx_build_loader(TOOLBOX_NAME, toolbox_dir);
    else
        tbx_build_loader(toolbox_dir);
    end
    tbx_build_cleaner(toolbox_dir);

endfunction
// =============================================================================
main_builder();
clear main_builder; // remove main_builder on stack
// =============================================================================
-----------------------------------------
 
Rename etc/xxx.quit to mytoolbox.quit or when your toolbox name is "mytoolbox". Fill out a decription-file. It is a good idea to download a src distribution of a toolbox and look what others did.
 
'"scilab.ini'. This file does not exist on my computer"
 
Of course not. You have to create it in %APPDATA%\Scilab\scilab-6.0.2\scilab.ini
Take care that you write scilab.ini in small letters.
 
"... of ignorantly fooling around with startup files."
 
These startup file is just for Scilab. It does not harm your operating system in any way.
 
Regards,
 
Hani
Gesendet: Sonntag, 26. Mai 2019 um 23:21 Uhr
Von: "marko" <[hidden email]>
An: [hidden email]
Betreff: [Scilab-users] Unclear How to create toolbox
Hi; I've written some scripts that I want to load at startup. The
documentation on how to do this is not clear, including "Build a Toolbox
with Scilab.pdf".
1) There exists no 'cleaner.sce' in the 'contrib' (or any other) directory.
2) We are supposed to copy (??) files like ".start", but the only such
files included are long and contain a lot of not relevant material. Yet
without advanced knowledge it is not possible to know what to do - start
over? build (somehow) from scratch? Note that the quoted images to use (?)
are sometimes incomplete, several lines missing for the example
'cleaner.sce'.
3) Is one supposed to create his/her own 'builder.sce' file ? Again, not
sure the image is complete in the example.

I notice on one of these help pages Mr. Gudgeon (sorry if mispelled)
suggests editing the file 'scilab.ini'. This file does not exist on my
computer (Windows 7 with scilab 6.0.2). Maybe (?) I'm to create that on my
own?

Please realize that in many years I have discovered the danger to my
computer(s) of ignorantly fooling around with startup files.

I for one would sure appreciate knowing how to actually build a toolbox.
Thanks for comments.

marko



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
hibr01 hibr01
Reply | Threaded
Open this post in threaded view
|

Re: Unclear How to create toolbox

Remove the line(s):
 
Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:0000000111 EndFragment:0000015887
 
in the code sections.
 
 
Gesendet: Montag, 27. Mai 2019 um 16:26 Uhr
Von: "Hani Andreas Ibrahim" <[hidden email]>
An: [hidden email]
Betreff: Re: [Scilab-users] Unclear How to create toolbox
Hi Marco,
 
"There exists no 'cleaner.sce'"
 
cleaner.sce  is build automatically by executing builder.sce.
 
"We are supposed to copy (??) files like ".start", but ..."
 
Most of them you can delete or comment out. One yourtoolbox.start-example w/o help, demos, etc. see below. Search vor xxx or XXX and  exchange it with the name (id) of your toolbox.
 
----------------------------------------- file: etc/mytoolbox.start
 
Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:0000000111 EndFragment:0000015887
function xxxlib=startModule() // small letter toolbox name

    TOOLBOX_NAME  = "xxx"; // small letter toolbox name e.g. mytoolbox
    TOOLBOX_TITLE = "XXX"; // toolbox name, e.g My Toolbox

  mprintf("Start " + TOOLBOX_TITLE + "\n");

  if isdef("xxxlib") then // <--
    warning("Toolbox xxx library is already loaded"); // <--
    return;
  end

  etc_tlbx  = get_absolute_file_path("xxx.start"); // <--
  etc_tlbx  = getshortpathname(etc_tlbx);
  root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") );

//Load  functions library
// =============================================================================
  mprintf("\tLoad macros\n");
  pathmacros = pathconvert( root_tlbx ) + "macros" + filesep();
  xxxlib = lib(pathmacros); // <--

endfunction

xxxlib = startModule(); // <--
clear startModule; // remove startModule on stack
-----------------------------------------
 
-----------------------------------------> file: builder.sce
Version:0.9 StartHTML:-1 EndHTML:-1 StartFragment:0000000111 EndFragment:0000010398
mode(-1);
lines(0);

function main_builder()
    TOOLBOX_NAME  = "xxx"; // small letter toolbox name e.g. mytoolbox
    TOOLBOX_TITLE = "XXX"; // toolbox name, e.g My Toolbox
    toolbox_dir   = get_absolute_file_path("builder.sce");

    // Check Scilab's version
    // =============================================================================

    try
        v = getversion("scilab");
    catch
        error(gettext("Scilab 5.3 or more is required."));
    end

    if v(1) < 5 & v(2) < 3 then
        // new API in scilab 5.3
        error(gettext("Scilab 5.3 or more is required."));
    end

    // Check modules_manager module availability
    // =============================================================================

    if ~isdef("tbx_build_loader") then
        error(msprintf(gettext("%s module not installed."), "modules_manager"));
    end

    // Action
    // =============================================================================


    tbx_builder_macros(toolbox_dir);
    if v(1) == 5  then // For Scilab versions 5 and 6 compatibility
        tbx_build_loader(TOOLBOX_NAME, toolbox_dir);
    else
        tbx_build_loader(toolbox_dir);
    end
    tbx_build_cleaner(toolbox_dir);

endfunction
// =============================================================================
main_builder();
clear main_builder; // remove main_builder on stack
// =============================================================================
-----------------------------------------
 
Rename etc/xxx.quit to mytoolbox.quit or when your toolbox name is "mytoolbox". Fill out a decription-file. It is a good idea to download a src distribution of a toolbox and look what others did.
 
'"scilab.ini'. This file does not exist on my computer"
 
Of course not. You have to create it in %APPDATA%\Scilab\scilab-6.0.2\scilab.ini
Take care that you write scilab.ini in small letters.
 
"... of ignorantly fooling around with startup files."
 
These startup file is just for Scilab. It does not harm your operating system in any way.
 
Regards,
 
Hani
Gesendet: Sonntag, 26. Mai 2019 um 23:21 Uhr
Von: "marko" <[hidden email]>
An: [hidden email]
Betreff: [Scilab-users] Unclear How to create toolbox
Hi; I've written some scripts that I want to load at startup. The
documentation on how to do this is not clear, including "Build a Toolbox
with Scilab.pdf".
1) There exists no 'cleaner.sce' in the 'contrib' (or any other) directory.
2) We are supposed to copy (??) files like ".start", but the only such
files included are long and contain a lot of not relevant material. Yet
without advanced knowledge it is not possible to know what to do - start
over? build (somehow) from scratch? Note that the quoted images to use (?)
are sometimes incomplete, several lines missing for the example
'cleaner.sce'.
3) Is one supposed to create his/her own 'builder.sce' file ? Again, not
sure the image is complete in the example.

I notice on one of these help pages Mr. Gudgeon (sorry if mispelled)
suggests editing the file 'scilab.ini'. This file does not exist on my
computer (Windows 7 with scilab 6.0.2). Maybe (?) I'm to create that on my
own?

Please realize that in many years I have discovered the danger to my
computer(s) of ignorantly fooling around with startup files.

I for one would sure appreciate knowing how to actually build a toolbox.
Thanks for comments.

marko



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users