18045010223
2025-07-07 0d3a683a0c97154b1f2e6657398664537e4e3e82
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package org.yzh.protocol.commons.transform.attribute;
 
import org.yzh.protocol.t808.T0200;
 
import java.time.LocalDateTime;
 
public abstract class Alarm {
 
    private T0200 location;
 
    private String platformAlarmId;
 
    public T0200 getLocation() {
        return location;
    }
 
    public void setLocation(T0200 location) {
        this.location = location;
    }
 
    public String getPlatformAlarmId() {
        return platformAlarmId;
    }
 
    public void setPlatformAlarmId(String platformAlarmId) {
        this.platformAlarmId = platformAlarmId;
    }
 
    static int buildType(int key, int type) {
        return (key * 100) + type;
    }
 
    //报警来源:0.设备报警 1.苏标报警 127.平台报警
    public int getSource() {
        return 0;
    }
 
    public int getAreaId() {
        return 0;
    }
 
    public int getState() {
        return 1;
    }
 
    //上报时间
    public LocalDateTime getDateTime() {
        if (location == null)
            return null;
        return location.getDeviceTime();
    }
 
    //报警时间
    public LocalDateTime getAlarmTime() {
        if (location == null)
            return null;
        return location.getDeviceTime();
    }
 
    //报警类别<=255
    public int getCategory() {
        return 0;
    }
 
    //报警类型
    public abstract int getAlarmType();
 
    //报警级别
    public int getLevel() {
        return 0;
    }
 
    //gps经度
    public int getLongitude() {
        if (location == null)
            return 0;
        return location.getLongitude();
    }
 
    //gps纬度
    public int getLatitude() {
        if (location == null)
            return 0;
        return location.getLatitude();
    }
 
    //海拔(米)
    public int getAltitude() {
        if (location == null)
            return 0;
        return location.getAltitude();
    }
 
    //速度(公里每小时)
    public int getSpeed() {
        if (location == null)
            return 0;
        return location.getSpeed() / 10;
    }
 
    //车辆状态
    public int getStatusBit() {
        if (location == null)
            return 0;
        return location.getStatusBit();
    }
 
    //序号(同一时间点报警的序号,从0循环累加)
    public int getSequenceNo() {
        return 0;
    }
 
    //附件总数
    public int getFileTotal() {
        return 0;
    }
 
    //扩展信息
    public String getExtra() {
        return null;
    }
}