stella.roof
Class RoofInfo

java.lang.Object
  extended by stella.roof.RoofInfo

public class RoofInfo
extends Object

NEEDS UPDATE 16.10.02 A helper class collecting as much information about a roof as possible. The information gathered consists of 24 individual triggers. They can be represented in the STELLA-roof curcuit by checking the (potentialfree) bridges in the following relays (see also JRoofView):

*: Not potential free, but on the same potential used for retrieving S0-S3 (limit switch failure, motor protection, roof open, roof shut).

The individual switches T1-T24 mean (normally in a N/S-pair):


Field Summary
private  boolean open
          If this is true, the roof is open and no problems have been seen.
private static String OPEN
          The trigger state without the leading 0F of the roof for total open.
private  boolean shut
          If this is true, the roof is closed and no problems have been seen.
private static String SHUT
          The trigger state without the leading 0F of the roof for total shut.
private  Trigger[] t24
          The status of all triggers.
 
Constructor Summary
RoofInfo()
          Constructs a new roof-info whithout any information in it.
 
Method Summary
 Trigger[] getTriggers()
          Returns all triggers.
 boolean isOpen()
          Returns true, if the roof is open and all switches have reported in the state necessary for a true, flawless open.
 boolean isShut()
          Returns true, if the roof is shut and all switches have reported in the state necessary for a true, flawless close.
static RoofInfo parse(String raw)
          Returns a new roof info object, parsed from a hex-representation of the idividual bits T1-T24.
 void setTrigger(Trigger[] trigger)
          Sets all triggers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPEN

private static final String OPEN
The trigger state without the leading 0F of the roof for total open.

See Also:
Constant Field Values

SHUT

private static final String SHUT
The trigger state without the leading 0F of the roof for total shut.

See Also:
Constant Field Values

t24

private Trigger[] t24
The status of all triggers.


open

private boolean open
If this is true, the roof is open and no problems have been seen.


shut

private boolean shut
If this is true, the roof is closed and no problems have been seen.

Constructor Detail

RoofInfo

public RoofInfo()
Constructs a new roof-info whithout any information in it. All trigger arrays are constructed, but not assigned with any triggers.

Method Detail

parse

public static RoofInfo parse(String raw)
Returns a new roof info object, parsed from a hex-representation of the idividual bits T1-T24. Input to this method is the direct reading of a roof switch, like !0F07A3FAFF. The first three characters are not used, thus the actual string parsed looks like:
              0SAABBCC
       
Herein, S is the 4-bit hex-representation of S0 to S3, AA to CC is a hex-representation of T1-T20, Meaning that the last four bits are not used, but reserved for direct assignment to T21-T24.

As T21-T24 cannot be deduced directly (relay fully wired), it is constructed from S's and T's in the following way:

       T21 = !S0 & !S1 & T10 & T12 & T19 & T1 & !T23
       T22 = !S0 & !S1 & T10 & T12 & T19 & T2 & !T24
       T23 = !S0 & !S1 & T10 & T12 & T20 & T3 & !T21
       T24 = !S0 & !S1 & T10 & T12 & T20 & T4 & !T22
       


isOpen

public boolean isOpen()
Returns true, if the roof is open and all switches have reported in the state necessary for a true, flawless open. This equals the triggers in OPEN.


isShut

public boolean isShut()
Returns true, if the roof is shut and all switches have reported in the state necessary for a true, flawless close. This equals the triggers in SHUT.


getTriggers

public Trigger[] getTriggers()
Returns all triggers.


setTrigger

public void setTrigger(Trigger[] trigger)
Sets all triggers.