public class RoofInfo extends Object
stella.jview.JRoofView):
The individual switches T1-T24 mean (normally in a N/S-pair):
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
RoofInfo()
Constructs a new roof-info whithout any information in it.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
private static final String OPEN
private static final String SHUT
private Trigger[] t24
private boolean open
private boolean shut
public RoofInfo()
public static RoofInfo parse(String raw) throws InitException
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
InitExceptionpublic boolean isOpen()
OPEN.public boolean isShut()
SHUT.public Trigger[] getTriggers()
public void setTrigger(Trigger[] trigger)