question

Martin K5 avatar image
0 Likes"
Martin K5 asked Andrew O commented

How to access non-tree object (Model.parametres) through gui?

Hi,

I would like to ask if it possible to link edit view with model parameter and show it's value?


Thank you.


Martin

FlexSim 22.2.3
guimodel.parametersnon-tree
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Andrew O avatar image Andrew O commented ·

Hi @Martin K5, was one of Jason Lightfoot's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

Use hotlinkx code and test for eventdata being 0 (reading) - otherwise it's applying. The coldlinkx description is valid for hotlinkx

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Martin K5 avatar image Martin K5 commented ·
Thank you for your answer. Would you be so nice and provide me some example refferencing to some parameter?


Thank you.

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ Martin K5 commented ·

You can make a Parameter Table dashboard. By exploring the tree of an open dashboard, you can learn that the edit on the dashboard uses a hotlinkx, as @Jason Lightfoot suggested. The actual code is as follows:

if (isclasstype(focus, "ConstrainedVariable")) {
    if (!eventdata) {
        int precision = get(node("MAIN:/1/8/1/6"));
        string str = function_s(focus, "getEditString", precision);
        setviewtext(c, str);
    } else {
        string str = getviewtext(c);
        function_s(focus, "setFromString", str, 1);
    }
    return 0;
}
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Martin K5 commented ·

Here's a model with a GUI linked to the Source object which contains a field for a Model Parameter and one for a label on the Source.

v2022_Parameter_HotlinkTest.fsm

There may be better listeners than onSelObjChange and onDocChange.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.