Field Summary |
|
static final int |
LAMP_FLASHING Constant to be used for registerState, getCurrentLampState |
static final int |
LAMP_OFF Constant to be used for registerState, getCurrentLampState |
static final int |
LAMP_ON Constant to be used for registerState, getCurrentLampState |
static final int |
PROTOCOL_V1 Constant that may be used for the protocol parameter of getNormalModeState() |
static final int |
STATE_APPROACHING_BWD Constant that may be returned by getNormalModeState() |
static final int |
STATE_APPROACHING_FWD Constant that may be returned by getNormalModeState() |
static final int |
STATE_ERROR_NO_BLOCK Constant that may be returned by getNormalModeState() |
static final int |
STATE_ERROR_OPERATION_MODE Constant that may be returned by getNormalModeState() or getState() |
static final int |
STATE_ERROR_UNKNOWN_PROTOCOL Constant that may be returned by getNormalModeState() |
static final int |
STATE_FULL_MANUAL_MODE Constant that may be returned by getNormalModeState() |
static final int |
STATE_IDLE Constant that may be returned by getNormalModeState() |
static final int |
STATE_IN_STATION Constant that may be returned by getNormalModeState() |
static final int |
STATE_OCCUPIED Constant that may be returned by getNormalModeState() |
static final int |
STATE_OFFLINE Constant that may be returned by getNormalModeState() |
Method Summary |
|
bool |
canSemiManualMoveBackward() Checks if train can be moved backward in semi manual block mode. |
bool |
canSemiManualMoveForward() Checks if train can be moved forward in semi manual block mode. |
bool |
doSemiManualMoveBackward() Move train backward in semi manual block mode. |
bool |
doSemiManualMoveForward() Tries to move train forward in semi manual block mode. |
Coaster |
getCoaster() Returns the coaster this block belongs to |
int |
getCurrentLampState() Gets the lamp status of the block like it would be displayed on the control panel. |
String |
getName() Returns the name of the block as specified in the section settings |
int |
getNormalModeState(int protocol) Returns the current state when not in scripted operation mode. |
int |
getNumberOfTrainsOnBlock() Returns the number of trains on the block |
Section |
getSection() Returns the section as part of this block |
int |
getState() Returns the current state when in scripted operation mode. |
void |
registerState(int state, String text, int lampMode) Associate a user definable int value with text and lamp state. The text and lamp state will be shown on the ride panel. |
void |
setAdvanceBwdEnabled(bool enabled) Enables or disables the Advance BWD button on the control panel for this block. |
void |
setAdvanceBwdVisible(bool visible) Shows or hides the Advance BWD button on the control panel for this block. |
void |
setAdvanceFwdEnabled(bool enabled) Enables or disables the Advance FWD button on the control panel for this block. |
void |
setAdvanceFwdVisible(bool visible) Shows or hides the Advance FWD button on the control panel for this block. |
void |
setEnableMultipleTrainsOnBlockWarning(bool enabled) Enables or disables the warning that will show when multiple trains on this block are detected. |
void |
setState(int state) Sets the current state in scripted operation mode. The state's int value can be custom and needs to be registered prior using registerState() |
Field Detail |
Method Detail |
public final bool canSemiManualMoveBackward()
Checks if train can be moved backward in semi manual block mode.
Returns:
true if train can be moved, false if not possible or not in semi manual block mode.
Since:
2.6.4.0
public final bool canSemiManualMoveForward()
Checks if train can be moved forward in semi manual block mode.
Returns:
true if train can be moved, false if not possible or not in semi manual block mode.
Since:
2.6.4.0
public final bool doSemiManualMoveBackward()
Move train backward in semi manual block mode.
Similar to pressing the block's Backward button on the control panel.
Returns:
true if train could be moved, false if not possible or not in semi manual block mode.
Since:
2.6.4.0
public final bool doSemiManualMoveForward()
Tries to move train forward in semi manual block mode.
Similar to pressing the block's Forward button on the control panel.
Returns:
true if train could be moved, false if not possible or not in semi manual block mode.
Since:
2.6.4.0
public final Coaster getCoaster()
Returns the coaster this block belongs to
Returns:
coaster this block belongs to
Since:
2.5.7.0
public final int getCurrentLampState()
Gets the lamp status of the block like it would be displayed on the control panel.
3 states are possible. Off: no train on the block. On: train is on the block. Flashing: train is approaching to the block.
Returns:
LAMP_OFF, LAMP_ON, or LAMP_FLASHING
Since:
2.6.4.0
public final String getName()
Returns the name of the block as specified in the section settings
public final int getNormalModeState(int protocol)
Returns the current state when not in scripted operation mode.
In normal operation mode, it will return one of the STATE_ constants (See above) depending on the used protocol. In scripted operation mode, this method has no use and will always return STATE_ERROR_OPERATION_MODE. In scripted operation mode, the getState() method should be used instead.
Parameters:
protocol | - | Needs to be PROTOCOL_V1. Depending on the used protocol, different states can be returned. Currently there is only one supported protocol which is PROTOCOL_V1 |
Returns:
value representing state of normal operation mode (see STATE_ constants)
Since:
2.5.1.0
public final int getNumberOfTrainsOnBlock()
Returns the number of trains on the block
public final Section getSection()
Returns the section as part of this block
public final int getState()
Returns the current state when in scripted operation mode.
In scripted operation mode, it will return the value that was set with setState(). In all other operation modes, it will always return STATE_ERROR_OPERATION_MODE. For normal operation modes, there is a special method getNormalModeState() that can be used to detect the block's state.
Returns:
custom user value representing state that was set using setState()
public final void registerState(int state, String text, int lampMode)
Associate a user definable int value with text and lamp state. The text and lamp state will be shown on the ride panel.
This method has only effect when the coaster is in scripted operation mode, otherwise is should not be used.
Parameters:
state | - | user definable value that acts as a enumerator, should be >= 0, negative values will be used internally for errors. | |
text | - | display text of the control panel's text field for this block | |
lampMode | - | display mode of the control panel's lamp for this block (Accepts LAMP_OFF, LAMP_ON, LAMP_FLASHING) |
public final void setAdvanceBwdEnabled(bool enabled)
Enables or disables the Advance BWD button on the control panel for this block.
By default the button is not enabled. The button is used for manual block mode. This method has only effect when the coaster is in scripted operation mode, otherwise it should not be used.
public final void setAdvanceBwdVisible(bool visible)
Shows or hides the Advance BWD button on the control panel for this block.
By default the button is not visible. The button is used for manual block mode. This method has only effect when the coaster is in scripted operation mode, otherwise it should not be used.
public final void setAdvanceFwdEnabled(bool enabled)
Enables or disables the Advance FWD button on the control panel for this block.
By default the button is not enabled. The button is used for manual block mode. This method has only effect when the coaster is in scripted operation mode, otherwise it should not be used.
public final void setAdvanceFwdVisible(bool visible)
Shows or hides the Advance FWD button on the control panel for this block.
By default the button is not visible. The button is used for manual block mode. This method has only effect when the coaster is in scripted operation mode, otherwise it should not be used.
public final void setEnableMultipleTrainsOnBlockWarning(bool enabled)
Enables or disables the warning that will show when multiple trains on this block are detected.
By default the warning is enabled. It may make sense to disable the warning for special multi-move block scripts. This method has only effect when the coaster is in scripted operation mode, otherwise it should not be used and the method call will be ignored.
Parameters:
enabled | - | false: do not show warning, true: show warning (default) |
Since:
2.5.7.4
public final void setState(int state)
Sets the current state in scripted operation mode. The state's int value can be custom and needs to be registered prior using registerState()
This method has only effect when the coaster is in scripted operation mode, otherwise it may not be used.
Parameters:
state | - | int value that was previously registered using registerState() |