| | |
| | | /// 各防区的行控件
|
| | | /// </summary>
|
| | | private Dictionary<int, List<FrameLayout>> dicRowFrame = new Dictionary<int, List<FrameLayout>>();
|
| | | /// <summary>
|
| | | /// 桌布控件
|
| | | /// </summary>
|
| | | private FrameLayout frameTable = null;
|
| | | /// <summary>
|
| | | /// 开放这个控件出来,有点用
|
| | | /// </summary>
|
| | | private NormalViewControl btnTime = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | /// </summary>
|
| | | public SafeguardLogControl()
|
| | | {
|
| | | this.BackgroundColor = UserCenterColor.Current.White;
|
| | | this.Radius = 17;
|
| | | this.Height = Application.GetRealHeight(260);
|
| | | this.Height = Application.GetRealHeight(260 + 44);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <param name="dicInfo">防区报警信息</param>
|
| | | public void InitControl(string dayText, Dictionary<int, List<SafeguardAlarmInfo>> dicInfo)
|
| | | {
|
| | | this.frameTable = new FrameLayout();
|
| | | frameTable.Gravity = Gravity.CenterHorizontal;
|
| | | frameTable.Radius = 8;
|
| | | frameTable.Height= Application.GetRealHeight(260);
|
| | | frameTable.Width = Application.GetRealWidth(968);
|
| | | frameTable.BackgroundColor = UserCenterColor.Current.White;
|
| | | this.AddChidren(frameTable);
|
| | |
|
| | | //记录时间
|
| | | var btnTime = new NormalViewControl(300, 58, true);
|
| | | btnTime.X = Application.GetRealWidth(92);
|
| | | this.btnTime = new NormalViewControl(300, 58, true);
|
| | | btnTime.X = Application.GetRealWidth(35);
|
| | | btnTime.Y = Application.GetRealHeight(29);
|
| | | btnTime.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnTime.TextID = R.MyInternationalizationString.uRecordTime;
|
| | | this.AddChidren(btnTime);
|
| | | this.frameTable.AddChidren(btnTime);
|
| | |
|
| | | //日期
|
| | | string month = dayText.Substring(4, 2);
|
| | | string day = dayText.Substring(6, 2);
|
| | | var btnDay = new NormalViewControl(300, 58, true);
|
| | | btnDay.X = this.Width - Application.GetRealWidth(300 + 89);
|
| | | btnDay.X = frameTable.Width - Application.GetRealWidth(300 + 35);
|
| | | btnDay.Y = btnTime.Y;
|
| | | btnDay.TextColor = UserCenterColor.Current.TextColor2;
|
| | | btnDay.TextAlignment = TextAlignment.CenterRight;
|
| | | btnDay.Text = month + Language.StringByID(R.MyInternationalizationString.Month) + day + Language.StringByID(R.MyInternationalizationString.Day);
|
| | | this.AddChidren(btnDay);
|
| | | this.frameTable.AddChidren(btnDay);
|
| | |
|
| | | //线
|
| | | var btnLine = new NormalViewControl(Application.GetRealWidth(904), ControlCommonResourse.BottomLineHeight, false);
|
| | | btnLine.X = Application.GetRealWidth(86);
|
| | | btnLine.X = Application.GetRealWidth(29);
|
| | | btnLine.Y = Application.GetRealHeight(98);
|
| | | btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
|
| | | this.AddChidren(btnLine);
|
| | | this.frameTable.AddChidren(btnLine);
|
| | |
|
| | | //预创建五大防区的桌布
|
| | | var listId = new List<int>() { 1, 2, 4, 5, 3 };
|
| | |
| | | var frame1 = new FrameLayout();
|
| | | frame1.Height = Application.GetRealHeight(10);
|
| | | frame1.Y = tempY == 0 ? Application.GetRealHeight(98) : tempY;
|
| | | this.AddChidren(frame1);
|
| | | this.frameTable.AddChidren(frame1);
|
| | | dicFrame[listId[i]] = frame1;
|
| | | dicRowFrame[listId[i]] = new List<FrameLayout>();
|
| | |
|
| | |
| | | }
|
| | | //变更高度
|
| | | frame1.Height = listRow[listRow.Count - 1].Bottom + Application.GetRealHeight(55);
|
| | | this.Height = frame1.Bottom;
|
| | | this.frameTable.Height = frame1.Bottom;
|
| | | this.Height = frame1.Bottom + Application.GetRealHeight(44);
|
| | | tempY = frame1.Bottom;
|
| | | }
|
| | | else
|
| | |
| | | if (dicInfo == null || dicInfo.Count == 0)
|
| | | {
|
| | | //今日无任何报警记录
|
| | | btnMsg = new NormalViewControl(this.Width, Application.GetRealHeight(58), false);
|
| | | btnMsg.Y = btnLine.Bottom + Application.GetRealHeight(29);
|
| | | btnMsg = new NormalViewControl(frameTable.Width, Application.GetRealHeight(60), false);
|
| | | btnMsg.Y = btnLine.Bottom + Application.GetRealHeight(28);
|
| | | btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnMsg.TextID = R.MyInternationalizationString.uNowDayNotHadAlarmLog;
|
| | | btnMsg.TextAlignment = TextAlignment.Center;
|
| | | this.AddChidren(btnMsg);
|
| | | this.frameTable.AddChidren(btnMsg);
|
| | | }
|
| | | //添加底部阴影特效
|
| | | this.btnTime.AddBottomShadow(this.frameTable);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | FrameLayout frame = dicFrame[zoneId];
|
| | | //图标
|
| | | var btnIcon = new IconViewControl(69);
|
| | | btnIcon.X = Application.GetRealWidth(86);
|
| | | btnIcon.X = Application.GetRealWidth(29);
|
| | | btnIcon.Y = Application.GetRealHeight(23);
|
| | | //只会是1~5
|
| | | if (zoneId == 1 || zoneId == 2)
|
| | |
| | | frame.AddChidren(btnIcon);
|
| | | //防区名
|
| | | var btnName = new NormalViewControl(400, 58, true);
|
| | | btnName.X = Application.GetRealWidth(167);
|
| | | btnName.X = Application.GetRealWidth(109);
|
| | | btnName.Y = Application.GetRealHeight(35);
|
| | | btnName.Text = HdlSafeguardLogic.Current.GetGarrisonText(zoneId);
|
| | | frame.AddChidren(btnName);
|
| | | //已启动
|
| | | var btnStatu = new NormalViewControl(300, 46, true);
|
| | | btnStatu.X = frame.Width - Application.GetRealWidth(300 + 89);
|
| | | btnStatu.X = frame.Width - Application.GetRealWidth(300 + 35);
|
| | | btnStatu.Y = Application.GetRealHeight(35);
|
| | | btnStatu.TextSize = 12;
|
| | | btnStatu.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | |
| | | if (realHeight > 0)
|
| | | {
|
| | | //变更整个控件的真实高度
|
| | | this.Height = realHeight;
|
| | | this.frameTable.Height = realHeight;
|
| | | this.Height = realHeight + Application.GetRealHeight(44);
|
| | | }
|
| | | //添加底部阴影特效
|
| | | this.btnTime.AddBottomShadow(this.frameTable);
|
| | |
|
| | | return value;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | //房间
|
| | | var btnRoom = new NormalViewControl(165, 58, true);
|
| | | btnRoom.X = Application.GetRealWidth(92);
|
| | | btnRoom.X = Application.GetRealWidth(35);
|
| | | btnRoom.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnRoom.Text = alarmInfo.RoomName;
|
| | | rowFrame.AddChidren(btnRoom);
|
| | |
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(alarmInfo.DeviceAddr, alarmInfo.DeviceEpoint);
|
| | | var device = Common.LocalDevice.Current.GetDevice(mainkeys);
|
| | | var btnDevice = new NormalViewControl(271, 58, true);
|
| | | btnDevice.X = Application.GetRealWidth(256);
|
| | | btnDevice.X = Application.GetRealWidth(199);
|
| | | btnDevice.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnDevice.Text = device == null ? alarmInfo.DeviceName : Common.LocalDevice.Current.GetDeviceEpointName(device);
|
| | | rowFrame.AddChidren(btnDevice);
|
| | | //报警信息
|
| | | var btnMsg = new NormalViewControl(303, 58, true);
|
| | | btnMsg.X = Application.GetRealWidth(527);
|
| | | btnMsg.X = Application.GetRealWidth(469);
|
| | | btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | //电池电量
|
| | | if (alarmInfo.BatteryMsg != null)
|
| | |
| | | rowFrame.AddChidren(btnMsg);
|
| | | //时间:时分秒
|
| | | var btnTime = new NormalViewControl(176, 58, true);
|
| | | btnTime.X = Application.GetRealWidth(829);
|
| | | btnTime.X = Application.GetRealWidth(772);
|
| | | btnTime.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnTime.TextAlignment = TextAlignment.CenterRight;
|
| | | btnTime.Text = alarmInfo.Time;
|