[Scilab-users] XCos cscope parameter change beafore sim

classic Classic list List threaded Threaded
4 messages Options
Grzegorz Grzegorz
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] XCos cscope parameter change beafore sim

Hi all,

I want to change background color and other settings of XCos CSCOPE block beafore simulation starts. I was trying with pre_xcos_simulate hook but without success. This is an example code which I want to setup cscope with.

// post_xcos_simulate
list_fig=winsid();
for i=1:length(list_fig)
h=get_figure_handle(list_fig(i));
axes = h.children;
axes.grid = [1,1];
axes.grid_style = [9,10];
poliline = axes.children;
poliline.polyline_style = 2;
end

Thanks for help.
Regards Grzegorz

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Clément David-2 Clément David-2
Reply | Threaded
Open this post in threaded view
|

Re: XCos cscope parameter change beafore sim

Hello,

Nice idea and it works fine.

Using the attached file I'm able to cleanup all opened graphic windows
at simulation start and to update plot properties at the end of the
simulation.

To check, I just used :

exec setup_plot.sce
xcos SCI/modules/xcos/demos/Command.zcos
// start the simulation on the Xcos window


--
Clément

Le mardi 23 septembre 2014 à 08:14 +0200, Grzegorz Skiba a écrit :

> Hi all,
>
>
> I want to change background color and other settings of XCos CSCOPE
> block beafore simulation starts. I was trying with pre_xcos_simulate
> hook but without success. This is an example code which I want to
> setup cscope with.
>
>
> // post_xcos_simulate
> list_fig=winsid();
> for i=1:length(list_fig)
> h=get_figure_handle(list_fig(i));
> axes = h.children;
> axes.grid = [1,1];
> axes.grid_style = [9,10];
> poliline = axes.children;
> poliline.polyline_style = 2;
> end
>
>
> Thanks for help.
>
> Regards Grzegorz
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users

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

setup_plot.sce (537 bytes) Download Attachment
Grzegorz Grzegorz
Reply | Threaded
Open this post in threaded view
|

Re: XCos cscope parameter change beafore sim

Thanks for help your Clément,

Is there any chance to do the same at simulation start? I can scan scs_m object in the pre_xcos_simulate and find CSCOPE blocks and change its rpar/ipar parameters - but this way I can only change block parameters not the plot properties like grid_style or polyline_style. Maybe it is possible to create graphics window in pre_xcos_simulation ,change default parameters and than somehow force xcos to use created windows instead of creating new with CSCOPE init procedure ?

Regards Grzegorz




2014-09-30 14:22 GMT+02:00 Clément David <[hidden email]>:
Hello,

Nice idea and it works fine.

Using the attached file I'm able to cleanup all opened graphic windows
at simulation start and to update plot properties at the end of the
simulation.

To check, I just used :

exec setup_plot.sce
xcos SCI/modules/xcos/demos/Command.zcos
// start the simulation on the Xcos window


--
Clément

Le mardi 23 septembre 2014 à 08:14 +0200, Grzegorz Skiba a écrit :
> Hi all,
>
>
> I want to change background color and other settings of XCos CSCOPE
> block beafore simulation starts. I was trying with pre_xcos_simulate
> hook but without success. This is an example code which I want to
> setup cscope with.
>
>
> // post_xcos_simulate
> list_fig=winsid();
> for i=1:length(list_fig)
> h=get_figure_handle(list_fig(i));
> axes = h.children;
> axes.grid = [1,1];
> axes.grid_style = [9,10];
> poliline = axes.children;
> poliline.polyline_style = 2;
> end
>
>
> Thanks for help.
>
> Regards Grzegorz
>
> _______________________________________________
> 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
Clément David-2 Clément David-2
Reply | Threaded
Open this post in threaded view
|

Re: XCos cscope parameter change beafore sim

Yes, you can perform anything on the pre_xcos_simulate hook.

If you want to set some specific scope attribute I suggest you to fix
the scope ID on block's parameters, create and setup it on the
pre_xcos_simulation hook. If a scope with the same ID is already
displayed, it will be re-used at simulation time.

--
Clément

Le mardi 30 septembre 2014 à 15:51 +0200, Grzegorz Skiba a écrit :

> Thanks for help your Clément,
>
>
> Is there any chance to do the same at simulation start? I can scan
> scs_m object in the pre_xcos_simulate and find CSCOPE blocks and
> change its rpar/ipar parameters - but this way I can only change block
> parameters not the plot properties like grid_style or polyline_style.
> Maybe it is possible to create graphics window in
> pre_xcos_simulation ,change default parameters and than somehow force
> xcos to use created windows instead of creating new with CSCOPE init
> procedure ?
>
>
> Regards Grzegorz
>
>
>
>
>
> 2014-09-30 14:22 GMT+02:00 Clément David
> <[hidden email]>:
>         Hello,
>        
>         Nice idea and it works fine.
>        
>         Using the attached file I'm able to cleanup all opened graphic
>         windows
>         at simulation start and to update plot properties at the end
>         of the
>         simulation.
>        
>         To check, I just used :
>        
>         exec setup_plot.sce
>         xcos SCI/modules/xcos/demos/Command.zcos
>         // start the simulation on the Xcos window
>        
>        
>         --
>         Clément
>        
>         Le mardi 23 septembre 2014 à 08:14 +0200, Grzegorz Skiba a
>         écrit :
>         > Hi all,
>         >
>         >
>         > I want to change background color and other settings of XCos
>         CSCOPE
>         > block beafore simulation starts. I was trying with
>         pre_xcos_simulate
>         > hook but without success. This is an example code which I
>         want to
>         > setup cscope with.
>         >
>         >
>         > // post_xcos_simulate
>         > list_fig=winsid();
>         > for i=1:length(list_fig)
>         > h=get_figure_handle(list_fig(i));
>         > axes = h.children;
>         > axes.grid = [1,1];
>         > axes.grid_style = [9,10];
>         > poliline = axes.children;
>         > poliline.polyline_style = 2;
>         > end
>         >
>         >
>         > Thanks for help.
>         >
>         > Regards Grzegorz
>         >
>        
>         > _______________________________________________
>         > 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


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