1
wxr
2023-04-23 2cd55265ccff3b0a267d7953b2dd9e5dca437aa6
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
123
124
125
126
127
128
129
130
131
132
133
134
135
package com.videogo.ui.message;
 
 
import ezviz.ezopensdk.R;
 
public enum AlarmType {
    /*
           报警类型:
    -1:全部
    10000:人体感应事件
    10001:紧急遥控按钮事件
    10002:移动侦测报警
    10003:婴儿啼哭报警
    10004:门磁报警
    10005:烟感报警
    10006:可燃气体报警
    10008:水浸报警
    10009:紧急按钮报警
    10010:人体感应报警
    10100:IO报警
    10101:IO-1报警
    10102:IO-2报警
    10103:IO-3报警
    10104:IO-4报警
    10105:IO-5报警
    10106:IO-6报警
    10107:IO-7报警
    10108:IO-8报警
    10109:IO-9报警
    10110:IO-10报警
    10111:IO-11报警
    10112:IO-12报警
    10113:IO-13报警
    10114:IO-14报警
    10115:IO-15报警
    10116:IO-16报警
 
        /*
           Alarm type:
    -1:全部
    10000:Human induction events
    10001:Emergency remote control button event
    10002:Motion detection alarm
    10003:Baby crying alarm
    10004:Menci alarm
    10005:Smoke alarm
    10006:Combustible gas alarm
    10008:Flooding alarm
    10009:Emergency button alarm
    10010:Human induction alarm
    10100:IO alarm
    10101:IO-1 alarm
    10102:IO-2 alarm
    10103:IO-3 alarm
    10104:IO-4 alarm
    10105:IO-5 alarm
    10106:IO-6 alarm
    10107:IO-7 alarm
    10108:IO-8 alarm
    10109:IO-9 alarm
    10110:IO-10 alarm
    10111:IO-11 alarm
    10112:IO-12 alarm
    10113:IO-13 alarm
    10114:IO-14 alarm
    10115:IO-15 alarm
    10116:IO-16 alarm
    */
    UNKNOWN(0, R.string.alarm_type_unknown),
    BODY_FEEL(10000, true, R.drawable.message_infrared, R.string.alarm_type_infrared),
    REMOTE_CONTROL(10001, true, R.string.alarm_type_remotecontrol),
    MOTION_DETECTION_ALARM(10002, true, R.string.alarm_type_motion_detection),
    BABY_CRY_ALARM(10003, true, R.drawable.message_infrared, R.string.alarm_type_baby_cry),
    DOOR_ALARM(10004, R.drawable.message_door, R.string.alarm_type_door),
    SMOKE_ALARM(10005, R.drawable.message_smoke, R.string.alarm_type_smoke),
    GAS_ALARM(10006, R.drawable.message_smoke, R.string.alarm_type_gas),
    WATER_ALARM(10008, R.drawable.water_alarm, R.string.alarm_type_water),
    URGENT_BUTTON_ALARM(10009, R.drawable.message_callhelp, R.string.alarm_type_urgent_button),
    BODY_ALARM(10010, R.drawable.message_infrared, R.string.ez_alarm_type_person_alarm);
 
    private int id;
    private boolean hasCamera;
    private int drawableResId;
    private int textResId;
 
    private AlarmType(int id, boolean hasCamera, int drawableResId, int textResId) {
        this.id = id;
        this.hasCamera = hasCamera;
        this.drawableResId = drawableResId;
        this.textResId = textResId;
    }
 
    private AlarmType(int id, boolean hasCamera, int textResId) {
        this.id = id;
        this.hasCamera = hasCamera;
        this.drawableResId = R.drawable.defalut_alarm;
        this.textResId = textResId;
    }
 
    private AlarmType(int id, int drawableResId, int textResId) {
        this.id = id;
        this.drawableResId = drawableResId;
        this.textResId = textResId;
    }
 
    private AlarmType(int id, int textResId) {
        this.id = id;
        this.drawableResId = R.drawable.defalut_alarm;
        this.textResId = textResId;
    }
 
    public int getId() {
        return id;
    }
 
    public boolean hasCamera() {
        return hasCamera;
    }
 
    public int getDrawableResId() {
        return drawableResId;
    }
 
    public int getTextResId() {
        return textResId;
    }
 
    public static AlarmType getAlarmTypeById(int id) {
        for (AlarmType e : AlarmType.values()) {
            if (id == e.id)
                return e;
        }
        return UNKNOWN;
    }
}