ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 03-25-2008
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 232
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default GUI - radiobutton

Hello,

-i'm trying to use radiobuttons on a gui, i'm using onPress attibute to change a variable and it works, but visually the radiobuttons don't save the state when closing/open the window. How does this works?..

regards,

Pablo Concha E.
  #2  
Old 03-25-2008
tobias.biemueller tobias.biemueller is offline
Flexsim User
 
Join Date: Aug 2007
Location: Bielefeld, Germany
Posts: 42
Downloads: 22
Uploads: 0
Thanks: 23
Thanked 18 Times in 16 Posts
Rep Power: 164
tobias.biemueller is on a distinguished road
Default

Hello Pablo,

i dont know it exactly, but i found a Thread with nearby the same theme.. (checkbox instead of radiobutton). maybe it helps you a little bit..

http://www.flexsim.com/community/for...read.php?t=312

Tobias
The Following User Says Thank You to tobias.biemueller For This Useful Post:
Pablo Concha (03-25-2008)
  #3  
Old 03-25-2008
Pablo Concha Pablo Concha is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 104
Downloads: 100
Uploads: 1
Thanks: 103
Thanked 52 Times in 37 Posts
Rep Power: 232
Pablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nicePablo Concha is just really nice
Default

Thanks Tobias, i read that post before, tried an example and didn't work... i think i did something wrong, becouse now i tried it again and it did work .

thanks,

Pablo Concha E.
  #4  
Old 03-26-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Pablo,

From my experience you will need to manually check/select the radio button that you want selected when the GUI opens, this applys to check boxes as well. To do this use the OnOpen node in the main GUI node.

The Object Properties GUI uses the following code to set whether or not a check box is checked:

setchecked(node("/Show Name",settingspanel), not(switch_hidelabel( focus)));


The Separator Tab in the Separator's Parameters GUI uses the following code to set the appropriate radio button as selected (Unpack is selected by default):


if(not(getnodenum(node("@>objectfocus+>variables/unpack",c))))
setchecked(node("../Split",c), 1);

As a general rule of thumb "if its been done before then steal it." To steal part of a GUI right click on the GUI you wish to pirate from and select view -> Explore structure. This will open up a tree view of the GUI and you can copy the code and nodes you will need from there.


Good Luck,
Brandon
Flexsim GUI Pirate / Consultant
__________________
thats not normal.
The Following 3 Users Say Thank You to Brandon Peterson For This Useful Post:
Sebastian Schreiber (07-05-2011)
  #5  
Old 07-03-2011
Eike Schulz Eike Schulz is offline
Flexsim User
 
Join Date: May 2011
Posts: 6
Downloads: 3
Uploads: 0
Thanks: 11
Thanked 1 Time in 1 Post
Rep Power: 0
Eike Schulz is on a distinguished road
Default

Thanks for your Tip Brandon,

but how do i correctly reference a radiobutton? I have three radio-buttons that control a global variable. Your on open check works fine and the specific case is executed corresponding to the global variable but the corresponding button is not checked. I tried to reference it via node ranks like this:

setchecked
(node("../2/2/1",c), 1);


but obiously this does not work.
Can you tell me a better (i.e. a working one ) way to reference?

Thanks a lot

Eike Schulz
  #6  
Old 07-03-2011
Eike Schulz Eike Schulz is offline
Flexsim User
 
Join Date: May 2011
Posts: 6
Downloads: 3
Uploads: 0
Thanks: 11
Thanked 1 Time in 1 Post
Rep Power: 0
Eike Schulz is on a distinguished road
Default

Found the solution on my own via "pathtonode()" after some brain crunching. Got confused before because the path differs depending on if you are editing the GUI or using it .
--> When editing it the path is "Main:1/..."
--> When using it it obiously starts with "View: ..."

Now it works fine so thanks again for the idea Brandon!
  #7  
Old 07-03-2011
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

What you'll find is that it's 'c' that changes (sometimes it's the node itself, but it can also be the viewcontrol or the object that contains it)- and that depends how the node is called (it's specified by executefsnode)

If you're not sure for a given node, you can print out the path for c, or to reference the root of the active GUI you can always use node("@",c) and avoid the need to find the full path.

Last edited by Jason Lightfoot; 07-04-2011 at 10:18 AM.
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Eike Schulz (07-07-2011)



All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.