Objectives
Objective is an ABSTRACT base class used by the project, whose child objects include the following:
Each Objective defines a set criteria that a Mover can either fulfill or not at any given point. As an example, a Mover fulfills the criteria of a Station when it is parked at the Station's configured track position.
When a Mover satisfies the requirements of the Objective, the Objective provides a Reference to the Mover through which new Mover commands can be issued.
Common Methods
The objects listed above all share some common methods, which are implemented in the parent Objective base class.
RegisterMover
RegisterMover( NewMover : Mover )
Adds a Mover to the list of Tracked Movers that the objective is currently monitoring. If the input Mover has already been added to the Tracked Movers list, the method call is ignored.
1 2 |
|
The code above is similar in functionality to:
1 |
|
Stations include some unique features regarding mover registration. See Station Object for more details.
RegisterMoverList
RegisterMoverList( NewMoverList : MoverList )
Provides the same functionality as RegisterMover, but for a group of movers represented as a MoverList.
1 |
|
UnregisterMover
RegisterMover( ExistingMover : Mover )
Removes a Mover from the list of Tracked Movers that the objective is currently monitoring. If the input Mover is not already tracked by the objective, the method call is ignored.
1 2 |
|
Because the Mover would not be registered with the Station when it arrives, the Station would not report that the Mover is InPosition. The code above is functionally identical to:
1 |
|
UnregisterCurrent
UnregisterCurrent( )
Automatically unregisters whatever mover is listed as CurrentMover for the Objective
Here the MoverInPosition status output changes. The mover is still physically located at the Station position, but since it is no longer registered, it cannot report MoverInPosition.
1 2 3 |
|
UnregisterCurrent
to indicate to the trigger that any processing that needs to be done with this mover has been completed.
1 2 3 4 |
|
UnregisterAll
UnregisterAll()
Automatically unregisters every mover from the Tracked Movers list
1 2 3 4 |
|
Properties
CurrentMover
REFERENCE TO Mover
Current mover is the Reference output through which Movers can be addressed contextually via an Objective. Let's look at a simple example:
1 2 |
|
And as a Reference, this CurrentMover output accepts any Method call instructions that a base Mover object could. E.g.:
1 2 |
|
TrackedMoverCount
USINT
Returns the number of movers being tracked by this objective.
TrackedMovers
ARRAY OF POINTER TO Mover
Returns an array of pointers to all the movers tracked by this object.
Note that this returns a pointer. To access properties or methods of a mover the pointer must be dereferenced with the ^
(caret) operator such as Objective.TrackedMovers[0]^.TrackInfo.TrackPosition
.