[Scilab-users] Model Name from within interfacing function

classic Classic list List threaded Threaded
5 messages Options
Flo Flo
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Model Name from within interfacing function

Hello everyone,

 

I am using this mailing list for the first time and I don’t know if I do it right but I have a question concerning Xcos:

Is it possible to access the model name of a Xcos model within the interfacing function of a block?

For example I want to use the following code:

 

function [x, y, typ]=MYOWNBLOCK(job, arg1, arg2)

   

    select job

    case "set" then

        x=arg1

        model=arg1.model;

        graphics=arg1.graphics;

       

        model_name = functionToGetModelName();

 

       …

 

      end

 

endfunction

 

 

Regards

Flo

 


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

Re: Model Name from within interfacing function

Hi Florian, 

you can use scs_m object which holds Xcos scheme structure:

--> scs_m.props.title 

but your schema has to be compiled before you use scs_m object in block code. 

Regards Grzegorz 

2015-03-27 16:54 GMT+01:00 Klingenstein, Florian <[hidden email]>:

Hello everyone,

 

I am using this mailing list for the first time and I don’t know if I do it right but I have a question concerning Xcos:

Is it possible to access the model name of a Xcos model within the interfacing function of a block?

For example I want to use the following code:

 

function [x, y, typ]=MYOWNBLOCK(job, arg1, arg2)

   

    select job

    case "set" then

        x=arg1

        model=arg1.model;

        graphics=arg1.graphics;

       

        model_name = functionToGetModelName();

 

       …

 

      end

 

endfunction

 

 

Regards

Flo

 


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



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

Re: Model Name from within interfacing function

Hi Grzegorz,

thanks for your answer. I know that i can use the scs_m-structure but i can't access it from within the interfacing function of the Xcos-Block. Is it possible to compile the scheme in the interfacing function and make scs_m available?

Regards
Flo
Clément David-2 Clément David-2
Reply | Threaded
Open this post in threaded view
|

Re: Model Name from within interfacing function

Hello,

Currently there is no way to retrieve the current diagram (eg. the scs_m
variable) from a block interface function.

For me, block interface function have to be orthogonal to the diagram
structure to decouple thing and ease future evolution. What's your need
there ? Do you want to perform something at the diagram level from an
interface function ?

Regards,

--
Clément

Le mardi 07 avril 2015 à 01:59 -0700, Flo a écrit :

> Hi Grzegorz,
>
> thanks for your answer. I know that i can use the scs_m-structure but i
> can't access it from within the interfacing function of the Xcos-Block. Is
> it possible to compile the scheme in the interfacing function and make scs_m
> available?
>
> Regards
> Flo
>
>
>
> --
> View this message in context: http://mailinglists.scilab.org/Scilab-users-Model-Name-from-within-interfacing-function-tp4031992p4032043.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users


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

Re: Model Name from within interfacing function

Hi Clément,

I have to open a file and the filename contains the name of the diagram :(

Regards
Flo