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 11-27-2007
Iulian Marin Ion Iulian Marin Ion is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 14
Downloads: 53
Uploads: 0
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 155
Iulian Marin Ion is on a distinguished road
Default GUI & linked variables

Hy,

I would ask for a few support if posible.

The attached model has nothing else than a GUI + one Global Variable.

I am trying to develop a GUI with a tree structure (tab controls inside tab controls and variables as leafs - not sure if correcly applying the tab controls).

The GUI variables must be linked to the object variables or GlobalVariables.

The first problem is comming from the fact that I can not put an "edit variable" inside of the tab control other size than the size of the tab (or it might be another rule for the tab to host text mostly?).

I have finaly tried and succeded to put the edit areas inside a groupbox. I am not sure if this is correct or if this is the meaning. The solution with the groupbox works partialy since I was not able to update the GlobalVariable.

I have also tried to compare with MAIN:/project/model/Tools/settings/fullhistory from the DEMO GUI (this button is quit similar inside of a groupbox, etc) but I was not able to find that path in my tree.

I have tried with different levels of tab controls and Aplly buttons but only one of the variables updates the Global Variable (all can extract it in a correct manner).

I am sure that I am not applying the correct objects or the proper order, or that something is missing.

Highly appreciate if someone could provide some advice on this matter.

The explanations that I have provided might not be enough clear so there is no need to answer to that. If more easy just post a sample with the desired structure "2 - 3 levels of tab controls inside tab controls and "edit variables" on diferent levels, connected to a GlobalVariable with posibility to update de Global Variable from any of the described GUI variables".

Thank you very much for your support.

Iulian
  #2  
Old 11-27-2007
Iulian Marin Ion Iulian Marin Ion is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 14
Downloads: 53
Uploads: 0
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 155
Iulian Marin Ion is on a distinguished road
Default GUI & linked variables

Sorry I forgot to attach the file. Please see the attached.

All the best,

Iulian
Attached Files
File Type: zip GUI test01.zip (56.0 KB, 336 views)
  #3  
Old 11-27-2007
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Iulian,
Unfortunately, the "live" value of a global variable is not stored in the tree. The value that you see in the tree is only the "reset" value for that global variable. It will only be applied to the "live" value after a compile and when you apply the Global Variables gui (specifically when refreshglobalvariables() is called). You could use refreshglobalvariables() to apply it when the user hits the Apply button, but my suggestion is to use the coldlinkx attribute to apply it directly using script. Remove the hotlink attribute from the edit, and add a coldlinkx attribute. Then give it the following code:

Code:
if(eventdata)// the value needs to be applied
{
    variable1 = stringtonum(getviewtext(c));
}
else // the value needs to be retrieved
{
    setviewtext(c, numtostring(variable1, 0, 3));
}
The eventdata variable tells you whether or not the gui is being applied or retrieve (1 means apply from the gui to whatever you're linking to, and 0 means retrieve from the link and apply it to the values in the window). When eventdata is 1, I set variable1 to whatever the text of the edit is, and when eventdata is 0, and set the text of the edit to whatever the value of variable1 is.

Good Luck
The Following 2 Users Say Thank You to Anthony Johnson For This Useful Post:
mbaccalaro (03-20-2014)



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.