Dear ED Team,
I would like to build a GUI in order to be able to open and close 1 output channel of the warehouse atom (by clicking). The idea is that there are 2 output channels to begin with, which are each linked to a queue. How can I use the GUI to close one of the output channels before any product enters the warehouse?
Thank you very much for your time to look into it!
Close output channel of warehouse atom by using GUI
Re: Close output channel of warehouse atom by using GUI
Hello,
Closing just one output channel is not recommended as the internal code of the atoms usually use the commands openalloc/closealloc which will overwrite your specific openoc and closeoc code.
It would be better to define the maximum number of channels available in a global variable or in a label on your warehouse atom.
Assume that you want to send the product to a random available output channel. The standard code to do this (see sendto strategy 4. A random open channel) is:
Instead of checking all outputchannels (nroc) of the warehouse you could adjust the code so that it only checks the number of channels you want. Assume you've got a label AvailableQueues on your warehouse, the code could look like this:
So, if you want to adjust the available channels using a gui button, you can update the label AvailableQueues of your warehouse atom.
Regards, Marlies
Closing just one output channel is not recommended as the internal code of the atoms usually use the commands openalloc/closealloc which will overwrite your specific openoc and closeoc code.
It would be better to define the maximum number of channels available in a global variable or in a label on your warehouse atom.
Assume that you want to send the product to a random available output channel. The standard code to do this (see sendto strategy 4. A random open channel) is:
Code: Select all
IndexMax(NrOC(c), OCReady(Count,c)*Random(100000))
Code: Select all
IndexMax(Label([AvailableQueues],c) , OCReady(Count,c)*Random(100000))
Regards, Marlies