public class WaysideController
extends java.lang.Object
Constructor and Description |
---|
WaysideController() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getAuthority(int blockId)
Checks the TrackModel to determine if a block has authority.
|
static boolean |
getCrossing(int blockId)
Checks the TrackModel to determine if a block is occupied.
|
static boolean |
getSignal(int blockId)
Checks the TrackModel to determine if a switch is active.
|
static int |
getSpeed(int blockId) |
static boolean |
getSwitch(int blockId)
Checks the TrackModel to determine if a switch is active.
|
static void |
init()
Initiallizes the WaysideController.
|
static boolean |
isOccupied(int blockId)
Checks the TrackModel to determine if a block is occupied.
|
static void |
openWindow()
Displays the WC UI.
|
static boolean |
setSwitch(int blockId,
boolean value)
Accepts a switch position suggestion from CTC.
|
static void |
suggest(Suggestion[] suggestion)
How CTC presents a suggestion of speed and authority for each train.
|
public static void init()
public static void openWindow()
public static void suggest(Suggestion[] suggestion)
Suggestion
class.
IMPLEMENTATION SUBJECT TO CHANGE.
TODO: throw custom Exception if the WC does not does not have PLC uploaded.suggestion
- an array of Suggestion objects, one for each train.public static boolean isOccupied(int blockId)
blockId
- the line-specific number of the block in question.public static boolean getSignal(int blockId)
blockId
- the line-specific number of the block of the signal in question.public static boolean setSwitch(int blockId, boolean value)
blockId
- the line-specific number of the block in question.value
- the position which is being requested.public static boolean getSwitch(int blockId)
blockId
- the line-specific number of the block of the switch in question.public static boolean getCrossing(int blockId)
blockId
- the line-specific number of the block in question.public static boolean getAuthority(int blockId)
blockId
- the line-specific number of the block in question.public static int getSpeed(int blockId)