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 05-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 How to make a custom GUI for creating an item ?

This is pretty straight forward but I unable to figure it out. I want to create a simple GUI with a create button on it. I want that whenever I hit this button, only then should the source create an item. If someone could attach a simple model demonstrating this it will be a great help.
  #2  
Old 05-30-2013
mark.gormley mark.gormley is offline
Flexsim User
 
Join Date: Oct 2008
Posts: 58
Downloads: 12
Uploads: 0
Thanks: 32
Thanked 63 Times in 29 Posts
Rep Power: 181
mark.gormley has a spectacular aura aboutmark.gormley has a spectacular aura about
Default

Simple suggestion that may work in your instance but won’twork in all instances (for example creating multiple objects at the same timeis not supported):
  • Create a source with an inter arrival time of 0.
  • Close the output on reset of the source.
  • Close the output on exit of the source.
  • Create a GUI and drag on a button.
  • On the OnPress event of the button create a pointer to the source (or use a global variable) and call an openoutput command on it.
The Following User Says Thank You to mark.gormley For This Useful Post:
mearjun (05-30-2013)
  #3  
Old 05-30-2013
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

Or you could use a Queue instead of a Source. In the Queue's OnMessage trigger, select the Create Flowitems picklist option. Then send a message to the queue from the OnPress of your button.
Attached Files
File Type: fsm createflowitem_onpress.fsm (32.2 KB, 94 views)
  #4  
Old 05-30-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

Quote:
Originally Posted by Phil BoBo View Post
Or you could use a Queue instead of a Source. In the Queue's OnMessage trigger, select the Create Flowitems picklist option. Then send a message to the queue from the OnPress of your button.
Thanks for the example. For now I am using the code that you used in your model, but for the sake of understanding, what exactly is happening on the message trigger of the queue. I did not get the part where you have used the for command. Also, I am unable to understand how applicationcommand() works.
  #5  
Old 05-30-2013
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

You don't have to understand exactly how it works. It is a picklist option that was selected from the dropdown menu; you can just use it.

But just fyi:
That applicationcommand() is setting the flowitem's creationtime and updating the default tracked variables (WIP and TimeInSystem) for the newly created flowitem copy.
  #6  
Old 05-30-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.. the only reason I want to understand it in detail is so that I can write more advanced code in case I need to do something specific.
The Following User Says Thank You to mearjun For This Useful Post:
Raphael Smith (06-06-2013)


Thread Thread Starter Forum Replies Last Post
What is involved in creating new TASKTYPE_ commands Vadim Fooks Q&A 0 05-05-2013 03:11 PM
Creating new variables to analize the model Flavio Brito Q&A 1 06-02-2010 03:16 PM
how to add custom draw code trigger in flow item LINWEIXU Q&A 10 09-10-2009 12:19 AM
the accurate time of creating a TS? qin tian Q&A 1 05-26-2008 06:23 PM
Creating fsm-Files Ralfi Q&A 4 10-16-2007 06:07 PM


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.