-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathAltitudeZeroBlock.java
More file actions
39 lines (31 loc) · 971 Bytes
/
Copy pathAltitudeZeroBlock.java
File metadata and controls
39 lines (31 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.monstarmike.tlmreader.datablock;
import com.google.common.primitives.Ints;
public class AltitudeZeroBlock extends DataBlock {
// typedef struct
// {
// UINT8 identifier; // Source device = 0x7B
// UINT8 sID; // Secondary ID
// UINT8 spare[2];
// UINT32 altOffset; // Altitude "zero" log
// } STRU_TELE_ALT_ZERO;
private int altOffset;
public AltitudeZeroBlock(byte[] rawData) {
super(rawData);
altOffset = Ints.fromBytes(rawData[8], rawData[9], rawData[10], rawData[11]);
measurementNames.add("Altitude Offset");
measurementUnits.add("m");
measurementFactors.add(0.1);
measurementValues.add((int)getAltOffset());
}
@Override
public boolean areValuesEquals(DataBlock block) {
if (block instanceof AltitudeBlock) {
AltitudeZeroBlock alt = (AltitudeZeroBlock) block;
return alt.altOffset == this.altOffset;
}
return false;
}
public int getAltOffset() {
return altOffset;
}
}