Anchor my custom GUI to the tools?

Anchor my custom GUI to the tools?

enrique.elizaga
Advocate Advocate
18 Views
8 Replies
Message 1 of 9

Anchor my custom GUI to the tools?

enrique.elizaga
Advocate
Advocate

[ FlexSim 18.2.2 ]

Can I make my custom GUI to be anchored with my tools in the tab control (next to view menu) as shown in picture...

16663-toolbox.jpg

0 Likes
Accepted solutions (1)
19 Views
8 Replies
Replies (8)
Message 2 of 9

tanner_p
Not applicable

Could you give a little more information? Custom GUIs will show up automatically in your Toolbox as shown in the picture below:

16698-gui-example.png

0 Likes
Message 3 of 9

tanner_p
Not applicable
Accepted solution
@Enrique Elizaga

In order to have a window that you can anchor (to some extent), I would suggest using a Dashboard as follows:

First, create or open your Custom GUI:

16706-custom-gui.png

Then, open a dashboard and add a "GUI Class" object:

16707-custom-gui-2.png

Then, while in edit mode, select the GUI Class object. In the Quick Properties, find the eyedropper tool next to "Link" and use it to sample your Custom GUI:

16708-custom-gui-3.png

This will create a Custom GUI that will function as a Dashboard window.

16709-custom-gui-example.gif

Hopefully this helps! Feel free to comment back if you're looking for something different or need clarification.

Message 4 of 9

enrique.elizaga
Advocate
Advocate

This is a great workaround. That´s exactly what I´m going to do.

Message 5 of 9

borja_lorenzo4278
Enthusiast
Enthusiast

Hello @tanner.p
Thanks for your answerd. It was helpfully.

How could you access the configuration panel of the GUI inserted in the Dashboard as you explained, WITHOUT having to go to the toolbox and open the Graphical User Interfaces?

And
I would also like to know if it is possible to save this GUI as an object in the library or another solution to make this configuration reproducible in another environment.
How can I make this?

0 Likes
Message 6 of 9

logan_gold
Community Manager
Community Manager

Hey @Borja Lorenzo, the closest thing I've found is to replicate the code that is used when the GUI builder is opened through the Toolbox. This is done with an application command called "opengui":

applicationcommand("opengui", Model.find("/Tools/GUIs/GUI 1"));

The second parameter is just a reference to the GUI that you want to open with the GUI Builder, so you could probably put this code on a button in the Dashboard and reference the GUI Widget by its Control ID. And then you could reference the actual GUI the widget is linked to. You may even be able to put a button in the GUI to do something similar, but I haven't tested either of these options to know for sure.

You can add the GUI to a User/Custom Library by going through the GUI Builder's GUI Option menu and choosing "Assign GUI to User Library". Then you can save off the user library and load it into another model to be able to use the GUI in that model.

0 Likes
Message 7 of 9

borja_lorenzo4278
Enthusiast
Enthusiast

Hi Enrique, thanks for your response.

I apologize for the length of the response, but I am trying to provide as much detail as possible about what is happening since this is very new to me.

I am attaching the simplified model with only the GUI that I am trying to configure.

Your suggestion to insert it into a Dashboard worked, as did the command to call the GUI builder.

The GUI that you can use as a reference and that works well is the one I open from the toolbox.

However, there are certain aspects that do not work quite well:

It is a bit difficult to explain everything that happens.

But I think I am missing something to configure in the synchronization or automatic refresh between the GUI that opens from the toolbox and the one I have linked from the GUI class.

That is why I am attaching the example model.

What I need is for the GUI panel that I link in the GUI class to be as editable and functional as the one I open directly from the Toolbox, as it will be the one offered to the user.

  1. 1- The GUI, when I open it from the toolbox and edit it, does not sync with the one I have in the dashboard and vice versa.

  2. 2- When I try to edit the GUI from the dashboard, the items in the comboboxes do not refresh. From the prints I get, I can infer that the code (User Command and the onSelect of the comboboxes) is executed… but it is not visualized.

  3. 3- When I open the GUI Builder from the button enabled in the dashboard and press F5 to edit the position of the GUI elements, the window opens but is completely minimized. Also, the comboboxes do not work well in this panel. When I close the GUI builder and refresh the GUI Class, it takes default values from the first item in the combobox list, leaving the last selected data.

  4. 4- If in this GUI panel that I open from the “Edit Panel” button on the dashboard, I press Reset, all the comboboxes go blank, which is correct, but when I close the GUI builder and refresh the GUI class, the cb_month takes the value 07 - July.

  5. 5- At some point, I get this message:

VIEW:/active/MainPanel/BackPanel/SplitterXPane/SplitterYPane/SplitterXPane/TabPane~2/TabControl/Dashboard/GraphPanel/DashboardGuiclass8/GUI Class/cb_minute

exception: FlexScript exception: Property “value” accessed on invalid node. at <no path>

On the other hand, I created the “Edit Panel” button as you indicated. I gave the GUI class an ID and inserted a code snippet in the onPress. Conceptually, it wouldn’t make much sense for this button to be accessible to the user since they won’t be editing anything, and the modeler could configure it through the toolbox… but is there any option to add a password to activate the button?

For example, the button is visible, but when pressed, it asks for a password and remembers it for the session.



Additionally, I have tried to add the GUI to the User Library but cannot find the option to add it. I have already created the User Library, but neither from the right-click on the GUI in the Toolbox, from the GUI node, nor from the panel itself do I find the option to add it.
1730119868918.png

Ejemplo GUI.fsm

Thanks in advance

0 Likes
Message 8 of 9

logan_gold
Community Manager
Community Manager
Hey @Borja Lorenzo, can you create a new question with your information and questions? Thanks!
0 Likes
Message 9 of 9

borja_lorenzo4278
Enthusiast
Enthusiast

I has just posted it: GUI Panel Synchronization - FlexSim Community.

Thanks for your response.

0 Likes