A
Anders Eriksson
I have a xml file that is a sequence. in this xml file there are
commands for a laser marking system.
Threre are two kinds of commands
MoveAxis
Document
MoveAxis is used to move the axis of the machine so that the item being
marked is under the laser.
Document is the layout file and it has to be executed(marked)
These command can be in any order and any number, but usually there is a
MoveAxis and then a Document, followed by a MoveAxis, etc
The moveAxis command is an async command so it will return directly.
When the axis has reached its position an ReachPosition event will be
triggered by the hardware.
The Document.execute is also an async command and will also return
directly. When the document has been marked an LaserEnd event will be
triggered by the hardware.
my problem is that I need to "wait" for each event before continuing
with the next command in the xml file.
I feel like this could be solved using a State Pattern or State Machine?
But I don't get how!
All samples are either so simple that I can't rework them for this or so
complicated that I don't understand them.
Is State Pattern/State Machine (are there any differences?) the way to
go or is there a more appropriate way of solving this problem?
// Anders
commands for a laser marking system.
Threre are two kinds of commands
MoveAxis
Document
MoveAxis is used to move the axis of the machine so that the item being
marked is under the laser.
Document is the layout file and it has to be executed(marked)
These command can be in any order and any number, but usually there is a
MoveAxis and then a Document, followed by a MoveAxis, etc
The moveAxis command is an async command so it will return directly.
When the axis has reached its position an ReachPosition event will be
triggered by the hardware.
The Document.execute is also an async command and will also return
directly. When the document has been marked an LaserEnd event will be
triggered by the hardware.
my problem is that I need to "wait" for each event before continuing
with the next command in the xml file.
I feel like this could be solved using a State Pattern or State Machine?
But I don't get how!
All samples are either so simple that I can't rework them for this or so
complicated that I don't understand them.
Is State Pattern/State Machine (are there any differences?) the way to
go or is there a more appropriate way of solving this problem?
// Anders