| | |
| | | data.DeviceEpoint = device.DeviceEpoint;
|
| | | data.DeviceName = device.DeviceName;
|
| | | data.Time = DateTime.Now.ToString("HH:mm:ss");
|
| | | data.RoomName = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
|
| | | data.RoomName = HdlRoomLogic.Current.GetRoomNameByDevice(device);
|
| | | //报警结束
|
| | | data.AlarmMsg = msgInfo.AlarmMsg != string.Empty ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uAlarmFinish);
|
| | | //电池报警
|
| | |
| | |
|
| | | //限制它的长度
|
| | | this.listSafetyAlarmInfo.Insert(0, data);
|
| | | if (this.listSafetyAlarmInfo.Count > UserCenterResourse.Option.SafetyOnedayMaxAlarmMsgCount)
|
| | | if (this.listSafetyAlarmInfo.Count > UserCenterResourse.ResidenceOption.SafetyOnedayMaxAlarmMsgCount)
|
| | | {
|
| | | this.listSafetyAlarmInfo.RemoveAt(this.listSafetyAlarmInfo.Count - 1);
|
| | | }
|
| | |
| | |
|
| | | //限制它的长度
|
| | | this.listSafetyAlarmInfo.Insert(0, data);
|
| | | if (this.listSafetyAlarmInfo.Count > UserCenterResourse.Option.SafetyOnedayMaxAlarmMsgCount)
|
| | | if (this.listSafetyAlarmInfo.Count > UserCenterResourse.ResidenceOption.SafetyOnedayMaxAlarmMsgCount)
|
| | | {
|
| | | this.listSafetyAlarmInfo.RemoveAt(this.listSafetyAlarmInfo.Count - 1);
|
| | | }
|
| | |
| | | var listInfo = new List<SafeguardAlarmInfo>();
|
| | | for (int j = 0; j < info.Count; j++)
|
| | | {
|
| | | if (j == UserCenterResourse.Option.SafetyOnedayMaxAlarmMsgCount)
|
| | | if (j == UserCenterResourse.ResidenceOption.SafetyOnedayMaxAlarmMsgCount)
|
| | | {
|
| | | //每天最多三十条数据
|
| | | break;
|
| | |
| | | }
|
| | | dic[listFile[i]] = listInfo;
|
| | |
|
| | | if (dic.Count == UserCenterResourse.Option.SafetyMaxAlarmMsgDay)
|
| | | if (dic.Count == UserCenterResourse.ResidenceOption.SafetyMaxAlarmMsgDay)
|
| | | {
|
| | | //只要三天的量
|
| | | break;
|
| | |
| | | return alarmInfo;
|
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 获取单个Json数据里面,包含的全部报警信息条数
|
| | | /// </summary>
|
| | | /// <param name="alarmInfo"></param>
|
| | | /// <returns></returns> |
| | | public List<string> GetSensorListAlarmMsg(SafeguardAlarmInfo alarmInfo)
|
| | | {
|
| | | var listMsg = new List<string>();
|
| | | //一条信息里面,它可能包含多个报警
|
| | | if (string.IsNullOrEmpty(alarmInfo.AlarmMsg) == false)
|
| | | {
|
| | | //报警信息
|
| | | listMsg.Add(alarmInfo.AlarmMsg);
|
| | | }
|
| | | if (alarmInfo.BatteryMsg != null)
|
| | | {
|
| | | //电池电量
|
| | | listMsg.Add(alarmInfo.BatteryMsg);
|
| | | }
|
| | | if (alarmInfo.DemolishmentMsg != null)
|
| | | {
|
| | | //被拆报警
|
| | | listMsg.Add(alarmInfo.DemolishmentMsg);
|
| | | }
|
| | |
|
| | | return listMsg;
|
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | msgInfo.DeviceEpoint = device.DeviceEpoint;
|
| | | msgInfo.DeviceName = device.DeviceName;
|
| | | msgInfo.Time = DateTime.Now.ToString("HH:mm:ss");
|
| | | msgInfo.RoomName = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
|
| | | msgInfo.RoomName = HdlRoomLogic.Current.GetRoomNameByDevice(device);
|
| | |
|
| | | //限制它的长度
|
| | | this.listDoorLockAlarmInfo.Insert(0, msgInfo);
|
| | | if (this.listDoorLockAlarmInfo.Count > UserCenterResourse.Option.DoorLockOnedayMaxAlarmMsgCount)
|
| | | if (this.listDoorLockAlarmInfo.Count > UserCenterResourse.ResidenceOption.DoorLockOnedayMaxAlarmMsgCount)
|
| | | {
|
| | | this.listDoorLockAlarmInfo.RemoveAt(this.listDoorLockAlarmInfo.Count - 1);
|
| | | }
|
| | |
| | | var listInfo = new List<DeviceAlarmInfo>();
|
| | | for (int j = 0; j < info.Count; j++)
|
| | | {
|
| | | if (j == UserCenterResourse.Option.DoorLockOnedayMaxAlarmMsgCount)
|
| | | if (j == UserCenterResourse.ResidenceOption.DoorLockOnedayMaxAlarmMsgCount)
|
| | | {
|
| | | //每天最多三十条数据
|
| | | break;
|
| | |
| | | }
|
| | | dic[listFile[i]] = listInfo;
|
| | |
|
| | | if (dic.Count == UserCenterResourse.Option.DoorLockMaxAlarmMsgDay)
|
| | | if (dic.Count == UserCenterResourse.ResidenceOption.DoorLockMaxAlarmMsgDay)
|
| | | {
|
| | | //只要三天的量
|
| | | break;
|