ch.hei.kart
Interface KartListener


public interface KartListener

Interface to implement if an object is interested in basic kart status changes. An object implementing this interface can be added using the Kart's method addKartListener(). The object will get notified about changes of the most important parameters of the Kart. Note that not all changes in the registers of the kart are announced by this listener interface. If an object needs more details about all the registers of the Kart, it should implement the KartStatusRegisterListener interface and subscribe himself using the method addStatusRegisterListener(KartStatusRegisterListener().

Author:
Nils Chatton (chn@hevs.ch), Christopher Metrailler (mei@hevs.ch), Michael Clausen (clm@hevs.ch)

Method Summary
 void batteryVoltageChanged(Kart kart, float level)
          The battery level has changed.
 void connectionStatusChanged(Kart kart, boolean online)
          The connection status to the Kart has changed.
 void message(Kart kart, java.lang.String message)
          The kart has a message to display, mostly this are cryptic messages just for developers...
 void steeringPositionChanged(Kart kart, int absolutePosition, float normalizedPosition)
          Called by the card whenever the actual steering position has changed.
 void steeringPositionHasReached(Kart kart, boolean reached)
          The steering system has changed its state.
 

Method Detail

steeringPositionChanged

void steeringPositionChanged(Kart kart,
                             int absolutePosition,
                             float normalizedPosition)
Called by the card whenever the actual steering position has changed. This method is part of the KartListener interface and all listeners get notified when the value of the actual steering position has changed.

Parameters:
kart - The kart object.
absolutePosition - The actual position from 0 to max steps (depends kart model!).
normalizedPosition - The actual position from -1 (left) to 1 (right).

steeringPositionHasReached

void steeringPositionHasReached(Kart kart,
                                boolean reached)
The steering system has changed its state. This method is called when either the steering position has just reached its end position (reached = true) or when the steering system has got a new target value and starts the moving to this position (reached = false).

Parameters:
kart - The kart object.
reached - True if the steering target position has reached, false otherwise.

batteryVoltageChanged

void batteryVoltageChanged(Kart kart,
                           float level)
The battery level has changed. This method is called by the kart object whenever the battery level on the kart changes.

Parameters:
kart - The kart object.
level - The battery level from 0 (empty) to 1 (full).

connectionStatusChanged

void connectionStatusChanged(Kart kart,
                             boolean online)
The connection status to the Kart has changed.

Parameters:
kart - The kart object.
online - True if the kart is online, false otherwise.

message

void message(Kart kart,
             java.lang.String message)
The kart has a message to display, mostly this are cryptic messages just for developers...

Parameters:
kart - The kart object.
message - The message.