Reputation: 5
I have a problem to manually remove/delete the agents from my assembler block (delay part). I would like to remove/delete the agents in the assembler with the click of a button. I think the problem is that remove() only removes the agents in the queue part of the assembler and not of the delay part right?
The "Reset" button should remove all agents from the two queue blocks and the assembler block.
I wrote the following code in the action of the button. Unfortunately the if condition doesn't work. Nevertheless, the agent remains in the delay part of the assembler. Does anyone have a solution suggestion for me?
while(Lager_Oberteile.size() > 0) {
Agent agent = Lager_Oberteile.removeFirst();
}
while(Lager_Plättchen.size() > 0) {
Agent agent = Lager_Plättchen.removeFirst();
}
if (Klebestation.delaySize() == 1) {
Klebestation.remove(Oberteil_Plättchen_geklebt) ;
}
offene_Aufträge = 0;
Thanks.
Upvotes: 0
Views: 82
Reputation: 1
Another way is to access the Delay within the service within the assembler (these are nested blocks essentially) and remove the agent from the delay:
So to remove the oldest agent in the assembler's delay, you can use
myAssemblerBlock.service.delay.stopDelay(agent);
Upvotes: 0
Reputation: 9421
First you need to know what agent is in the delay of the assember, one way is to do this:
Agent a=assembler.delayGet(0); //the first agent in the delay
assembler.remove(a);
Done
Upvotes: 0