JLChen
2020-06-04 6d55af8792cf8fbef0055e677b900fc352dba9a2
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Shared
{
    [System.Serializable]
    public class DoorLock : DoorLockInfo
    {
 
        public DoorLock () : base ()
        {
            this.Type = DeviceType.DoorLock;
            DeviceTextID = 10104;// SimpleControl.R.MyInternationalizationString.DoorLock;
        }
 
        /// <summary>
        /// 物理回路 
        /// </summary>
        public byte PhysicsLoopID;
 
        public bool isDoorLockConverter = false;
 
        /// <summary>
        /// 用户指纹列表  
        /// </summary>
        public List<DoorLockFingerprintInfo> fingerprintList = new List<DoorLockFingerprintInfo> ();
        /// <summary>
        /// 用户密码列表  
        /// </summary>
        public List<DoorLockPasswrodInfo> passwordList = new List<DoorLockPasswrodInfo> ();
        /// <summary>
        /// 用户感应卡列表
        /// </summary>
        public List<DoorLockProximityCardInfo> proximityCarList = new List<DoorLockProximityCardInfo> ();
        /// <summary>
        /// 用户临时密码列表 
        /// </summary>
        public List<byte []> tempPasswordList = new List<byte []> ();
        /// <summary>
        /// 历史记录列表 
        /// </summary>
        public List<DoorLockStateAndAlarmInfo> stateAndAlarmList = new List<DoorLockStateAndAlarmInfo> ();
 
        /// <summary>
        /// 门锁场景目标列表 
        /// </summary>
        public List<DoorLockSceneTargets> doorLockSceneTargetsList = new List<DoorLockSceneTargets> ();
 
        /// <summary>
        /// 开关
        /// </summary>
        public byte Power;
        /// <summary>
        /// 门锁编号
        /// </summary>
        public int DoorLockNum;
        /// <summary>
        /// 门锁用户ID
        /// </summary>
        public byte DoorLockUserID;
        /// <summary>
        /// 可用次数 
        /// </summary>
        public byte LockNum;
        public string Enable;//0 :unable / 1:enable   / 失败 0xF5
        public string Times;//可用次数,0 ~ 15
        public string VailidTimeH;//65532
        public string VailidTimeL;//时间段低位
        public int VailidTime;//时间段高位
        public string tempPasswordRemark;//临时密码
        public int tempPasswordID;//临时密码
        public string tempPasswordText1;//密码6位中的第1位
        public string tempPasswordText2;
        public string tempPasswordText3;
        public string tempPasswordText4;
        public string tempPasswordText5;
        public string tempPasswordText6;//密码6位中的第6位
        public string dynamicTempPassword;//动态临时密码 
        public string tempPasswordImage = "DoorLockPic/door_lock_ headshot.png";
 
        //public string  RemoteDoorLockPassword ;
 
        /// <summary>
        ///按日期搜索列表
        /// </summary>
        public readonly List<string> DateSearchList = new List<string> ();
        /// <summary>
        ///按用户搜索列表
        /// </summary>
        public readonly List<string> UserearchList = new List<string> ();
        /// <summary>
        ///按通知搜索列表
        /// </summary>
        public readonly List<string> NoticeSearchList = new List<string> ();
        /// <summary>
        ///按警报搜索列表
        /// </summary>
        public readonly List<string> AlarmSearchList = new List<string> ();
 
        /// <summary>
        /// The scene target 
        /// </summary>
 
        public readonly List<string> doorLockSceneEditedScenePath = new List<string> ();
        public readonly List<byte> doorLockSceneTargetsSerialNum = new List<byte> ();
        public string doorLockSceneRemark;//开锁场景备注
        public int doorLockSceneTargetsMethod;//开锁场景的方式
        public int doorLockSceneTargetsUserID;//开锁场景当前的用户ID
        public byte doorLockSceneTargetsControlType; //控制的设备类型
        public byte doorLockSceneTargetSunbetID;//目标子网号 
        public byte doorLockSceneTargetDeviceID;//目标设备号 
        public byte doorLockSceneTargetLoopID;//目标分区号 
        public byte doorLockSceneTargetsParameter1;// Control_changjing 
        public byte doorLockSceneTargetParameter2;// Control_minute—singute—singal_adj 
        public byte doorLockSceneParameter3;// Control_second—singal_adj
        public int doorLockAlarmRemindType;//开锁场景的方式
 
        //存放报警场景的通知
        // public System.Collections.Generic.Dictionary<string, bool> NotificationContent = new Dictionary<string, bool> ();
 
        //存放已经选中场景目标
        public System.Collections.Generic.Dictionary<string, bool> HaveSceneTargets = new Dictionary<string, bool> ();
 
        //存放已经编辑的场景列表
        public System.Collections.Generic.Dictionary<string, string> DictionaryList = new Dictionary<string, string> ();
 
        /// <summary>
        /// 是否选择推送
        /// </summary>
        public bool ShowMessageFormulaBar = false;
 
        public void AddDoorLockPassword (string value)
        {
            var key = this.SubnetID + "_" + this.DeviceID;
            UserConfig.Instance.RemoteDoorLockPasswordList.Remove (key);
            UserConfig.Instance.RemoteDoorLockPasswordList.Add (key, value);
            UserConfig.Instance.SaveUserConfig ();
        }
        public string GetDoorLockPassword ()
        {
            string value = null;
            var key = this.SubnetID + "_" + this.DeviceID;
            UserConfig.Instance.RemoteDoorLockPasswordList.TryGetValue (key, out value);
            return value;
        }
 
    }
    /// <summary>
    /// 门锁密码列表信息
    /// </summary>
    [System.Serializable]
    public class DoorLockPasswrodInfo
    {
        public string passwordRemark;
        public string passwordImage = "";
        public int userPasswordID;
    }
 
    /// <summary>
    /// 用户指纹列表信息
    /// </summary>
    [System.Serializable]
    public class DoorLockFingerprintInfo
    {
        public string fingerprintRemark;
        public string fingerprintImage = "";
        public int userFingerprintID;
        public readonly List<string> sceneFingerprintTargetList = new List<string> ();//目标列表
    }
 
 
    /// <summary>
    /// 门锁感应卡列表信息
    /// </summary>
    [System.Serializable]
    public class DoorLockProximityCardInfo
    {
        public string proximityCardRemark;
        public string proximityCardImage = "";
        public int proximityCardID;
    }
 
    /// <summary>
    /// 门锁状态和报警信息
    /// </summary>
    [System.Serializable]
    public class DoorLockStateAndAlarmInfo
    {
        /// <summary>
        /// 门锁开锁类型对应1 2 3 6
        /// </summary>
        public byte DoorLockType;
 
        /// <summary>
        /// 门锁开锁用户ID
        /// </summary>
        public int UserID;
 
        /// <summary>
        /// 年
        /// </summary>
        public string DoorLockYear;
 
        /// <summary>
        ///  月
        /// </summary>
        public string DoorLockMonth;
 
        /// <summary>
        /// 日
        /// </summary>
        public string DoorLockDay;
 
        /// <summary>
        /// 时
        /// </summary>
        public string DoorLockHour;
 
        /// <summary>
        /// 分
        /// </summary>
        public string DoorLockMinute;
 
        /// <summary>
        /// 秒
        /// </summary>
        public string DoorLockSec;
 
    }
 
    /// <summary>
    /// 门锁场景目标
    /// </summary>
    [System.Serializable]
    public class DoorLockSceneTargets
    {
        public byte LoopID;//  门锁编号
        public byte Type;//  场景类型 (1:开锁/2:报警 /:0无效) 
        public byte SceneMethod;//  开锁场景的方式  报警和开锁只有一有效
        public byte UserID;//用户ID 
        public int TargetSerialNum;//目标序号
        public int ControlType; //控制的设备类型
        public int TargetSunbetID;//目标子网号   
        public int TargetDeviceID;//目标设备号 
        public int TargetLoopID;//目标分区号 
        public int Parameter1;// Control_changjing          
        public int Parameter2;// Control_minute—singute—singal_adj
        public int Parameter3;// Control_second—singal_adj 
    }
}