Class AltitudeSwitch
java.lang.Object
|
+--edu.umn.cs.crisys.RSM
|
+--edu.umn.cs.crisys.ASW
|
+--AltitudeSwitch
- public class AltitudeSwitch
- extends ASW
Title: Altitude Switch
Description: Altitude Switch Implementation for CSCI 5802
This is a sample altitude switch implementation that demonstrates
how one may use the ASW framework to derive a concrete implementation.
Functionally, this just looks at the altitude input from the first altimeter,
ignores its altitude quality, and outputs a DOI command based on whether the
altitude is above or below the threshold. If the inhibit flag is set it does
not output any command to the DOI.
The inner class ASWState is a structure to hold the state information.
Two objects, cur and prev, are instances of this structure.
These hold the current and previous state information of the altitude switch.
This class overrides the init method to initialize its internal state variables
but calls super.init() to open the interfaces. There is no implementation
specific clean-up operations required when stopping the state-machine and so
this class does not override the end() method.
The next method() does the bulk of the work. It takes an interface object as a
parameter. This indicates which interface received a message triggering next
state computation. Note that the object may also be null, indicating that
no interface received message, but just that time has progressed.
Copyright: Copyright (c) 2002 University of Minnesota
Method Summary |
protected void |
init()
Initialization step for the state-machine. |
protected void |
next(java.lang.Object trigger)
Step computation routine of the Altitude Switch. |
Methods inherited from class edu.umn.cs.crisys.ASW |
end |
Methods inherited from class edu.umn.cs.crisys.RSM |
main |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AltitudeSwitch
public AltitudeSwitch()
init
protected void init()
- Initialization step for the state-machine.
Calls the super class init() method to open interface channels
for communication.
- Overrides:
init
in class ASW
next
protected void next(java.lang.Object trigger)
- Step computation routine of the Altitude Switch.
This is called by the state machine driver whenever there is some
change in the environment as detected at the communication interfaces
or when time has progressed.
- Overrides:
next
in class RSM
- Parameters:
Interface
- that received message in this step or null if
next step computation is called due to time progression.