[Scilab-users] Xcos custom block - icon path problem
pf
Peter.Fabo at dynamag.com
Tue Oct 15 22:51:51 CEST 2013
Hello Clément,
thank you for confirmation process creating palette during load-time.
(I tried procedure described in the "Xcos Hybrid dynamic systems modeler
and simulator" from 16. june 2010, but template from xcos toolbox
skeleton is probably fresher :-) )
With regards
Peter
Mon, 2013-10-14 at 11:27 +0200, Clément David wrote:
> Hello Peter,
>
> In my view, the palette should be created on toolbox loading (eg. on
> the .start file) because, as you highlight, path may vary between
> built-time and load-time. Furthermore, palette creation does not require
> many computation time and perform only runtime consistency checks.
>
> As a reference, please take a look at the xcos_toolbox_skeleton on the
> SCI/contrib directory.
>
> Regards,
>
> --
> Clément
>
> Le dimanche 13 octobre 2013 à 20:55 +0200, pf a écrit :
> > Hi all,
> >
> > small problem with Xcos palette export (Scilab 5.5.0, Ubuntu 12.04):
> >
> > If I want to create a new palette with Xcos block with graphic icon in
> > 'builder.sce'
> >
> > pal=xcosPal("MyPalette");
> > pal=xcosPalAddBlock(pal, MyInterface("define"), [], mypath
> > +"../macros/icons/myIcon.svg");
> >
> > then macro 'xcosPalAddBlock' create/generate GIF icon in TEMP directory.
> >
> > If I then export palette to file
> >
> > xcosPalExport(pal, mypath + '/MyPalette.pal');
> >
> > in file 'MyPalette.pal' path to GIF icon indicates to TEMP directory
> > (!!!)
> > And when I load palette with a.e. XcosMyModule.start (after new start
> > etc.) with macro
> >
> > xcosPalAdd(mypath + '/MyPalette.pal');
> >
> > icons no longer exists (old TEMP was meantime deleted) and I get block
> > in Palette browser without icons ... :-(
> >
> > I think that the GIF icon would be created in the same directory as
> > original (a.e *.svg, *.jpg ....) image(s) and path in exported palette
> > (*.pal) should point to this directory.
> >
> > ==================================
> >
> > Temporary problem solution - not ideal, but works:
> >
> > -> palette can be created at startup in *.start file, without export,
> > Palette browser load icons from TEMP directory
> >
> >
> > With regards
> > Peter
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > users mailing list
> > users at lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
More information about the users
mailing list