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 07-17-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default How to make a custom GUI

Hello

I am trying to make a custom GUI for my model such that all the necessary information in the model can be modified and the relevant outputs can be displayed simultaneously. To begin with I am trying to do the following things.

1.) I want to have a checkbox in the GUI. If the check box is selected a particular code lets say code 1 should run. And if it is deselected an alternate code 2 should run.
2.) A value of a certain parameter is calculated at a particular event and stored as label on a queue. I want that whenever this value is updated it should also be displayed on the GUI.

In addition if someone can post a simple model explaining hotlinks, it will be highly appreciated.
  #2  
Old 07-17-2013
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Mearjun,

You could use the hotlink to refer to the label on your queue and it will show and update the value of your label. Add a hotlink to an edit object on your GUI, make it a text node and set the text to: @>objectfocus+>labels/labelname.

For the other question, when should the code run? If you have code somewhere, first check the value of the label(?) where you stored the setting of the checkbox. Then use an if...else statement to run your code.

Esther
The Following User Says Thank You to Esther Bennett For This Useful Post:
Jörg Vogel (07-17-2013)
  #3  
Old 07-17-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

Quote:
Originally Posted by Esther Bennett View Post
Hello Mearjun,

You could use the hotlink to refer to the label on your queue and it will show and update the value of your label. Add a hotlink to an edit object on your GUI, make it a text node and set the text to: @>objectfocus+>labels/labelname.
I added a hotlink to the edit box object and wrote @>objectfocus+>labels/avg_WTBS (the latter being the name of a label on a queue) but it does nothing

Quote:
Originally Posted by Esther Bennett View Post
For the other question, when should the code run? If you have code somewhere, first check the value of the label(?) where you stored the setting of the checkbox. Then use an if...else statement to run your code.
How can I store the setting of a checkbox. Which attribute of the checkbox changes when it is selected or deselected.
  #4  
Old 07-17-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default Need help. Please explain through this sample model

I am attaching a small sample model. Here is what I want to do.

1.) I want that source should only create a part if the checkbox is selected. I have written a non-working code on the "onflow" trigger of the source.
2.) The process time is stored as a label on the processor. I want this info to be displayed in the edit box. The label gets its value in the "process time" code.

I would highly appreciate if you could make this work on this sample model.
Attached Files
File Type: fsm sample.fsm (31.2 KB, 92 views)
  #5  
Old 07-18-2013
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Maerjun,

Did you redirect the GUI to the queue or is it a control GUI? @>objectfocus+ works when the GUI is redirected to the object that holds the >labels/labelname part. If the GUI is not connected to the object you need to replace @>objectfoucs+ with something like MAIN:/project/model/QueueName.

To connect the checkbox to i.e. a label on the Queue, you add a coldlink or hotlink attribute with the same type of link as the editfield, but with a different labelname.

Esther
  #6  
Old 07-22-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default

Quote:
Originally Posted by Esther Bennett View Post
Hello Maerjun,

Did you redirect the GUI to the queue or is it a control GUI? @>objectfocus+ works when the GUI is redirected to the object that holds the >labels/labelname part. If the GUI is not connected to the object you need to replace @>objectfoucs+ with something like MAIN:/project/model/QueueName.
Esther
No because I want it to be a model control GUI. I dont want to replace the Queue's GUI with it.

Quote:
Originally Posted by Esther Bennett View Post
To connect the checkbox to i.e. a label on the Queue, you add a coldlink or hotlink attribute with the same type of link as the editfield, but with a different labelname.
Esther
I did not get what u meant here.

If you or anyone can please help me with a sample model (the one attached above) it will be a gr8 help. Its a very basis model with a source, queue, processor and a sink.. You just have to fill in the blanks...!!
  #7  
Old 07-23-2013
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hello Arjun,

Maybe is your problem the objectfocus. The Objectfocus is updated if you link the GUI to a selected object properly. But you want to create a control GUI. Your Objectfocus is still to MAIN:/project/model/. Now you build your own path to your attribute you want to change from this starting node.
Beware of the hints given in the manual, if you want to change values that are results of scripts and functions.
Interesting commands are "nodetomodelpath(obj or node)" or "nodetopath(obj or node)" to get the path. Please see in the command reference in the help.

Jörg
  #8  
Old 07-23-2013
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

Quote:
Originally Posted by mearjun View Post
I am attaching a small sample model. Here is what I want to do.

1.) I want that source should only create a part if the checkbox is selected. I have written a non-working code on the "onflow" trigger of the source.
2.) The process time is stored as a label on the processor. I want this info to be displayed in the edit box. The label gets its value in the "process time" code.

I would highly appreciate if you could make this work on this sample model.
Hi... i think i got it working...not sure how to use the comand to check the checkbox, so i just coldlinked it to a label on the source.

regards

Pablo
Attached Files
File Type: fsm sample_sol.fsm (31.9 KB, 75 views)
The Following User Says Thank You to Pablo Concha For This Useful Post:
mearjun (07-29-2013)
  #9  
Old 07-29-2013
mearjun mearjun is offline
Flexsim User
 
Join Date: Feb 2012
Posts: 123
Downloads: 5
Uploads: 0
Thanks: 27
Thanked 19 Times in 11 Posts
Rep Power: 119
mearjun will become famous soon enough
Default Thanks a lot

Quote:
Originally Posted by Pablo Concha View Post
Hi... i think i got it working...not sure how to use the comand to check the checkbox, so i just coldlinked it to a label on the source.

regards

Pablo
Hey. thanks a ton man.. U really solved a problem for me.. just to confirm the objectfocus works even for a model control GUI..


Thread Thread Starter Forum Replies Last Post
How to make a custom GUI for creating an item ? mearjun Q&A 5 05-30-2013 05:41 PM
Custom GUI: Graph OnDraw Phil BoBo Tips and Tricks 2 05-16-2013 03:48 AM
Custom Console Phil BoBo User Development 6 12-12-2011 04:19 AM
Why don't run the custom code nie wuwei Q&A 6 09-01-2011 12:41 PM
Custom Block Assignments Jamie Santa Ana Container Terminal (CT) Library 3 02-18-2010 08:58 AM


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.