From 4c586bb23cdcae56ae4e4c62e90e148dc10b9d90 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 17 五月 2022 14:19:31 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' into wxr1215 --- HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs | 142 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 142 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs new file mode 100644 index 0000000..1350a45 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Panel/PanelHelpPage.cs @@ -0,0 +1,142 @@ +锘縰sing System; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI.UI2.FuntionControlView.Panel +{ + public class PanelHelpPage : DeviceFunctionCardCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鍥炬爣 + /// </summary> + private IconViewControl btnIcon = null; + /// <summary> + /// 鏂囨湰鎺т欢 + /// </summary> + private NormalViewControl btnSuctionView = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭 + /// </summary> + public override void InitFrameWhiteContent() + { + base.ShowColltionButton = false; + base.SetTitleText(Language.StringByID(StringId.SmartPanel)); + + //娣诲姞绗簩绱㈠紩椤� + this.AddSecondPage(); + //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + this.InitFrameWhiteContent1(); + //鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 + this.InitFrameWhiteContent2(); + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + //璇诲彇鐘舵�� + new System.Threading.Thread(() => + { + DriverLayer.Control.Ins.SendReadCommand(device); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + /// </summary> + private void InitFrameWhiteContent1() + { + btnIcon = new IconViewControl(198) + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealWidth(146), + UnSelectedImagePath = "FunctionIcon/Panel/PanelHelpNormalBgIcon.png", + SelectedImagePath = "FunctionIcon/Panel/PanelHelpAlarmBgIcon.png", + }; + FrameWhiteCentet1.AddChidren(btnIcon); + + btnSuctionView = new NormalViewControl(300, 84, true) + { + Gravity = Gravity.CenterHorizontal, + Y = btnIcon.Bottom, + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.MainColor, + SelectedTextColor = CSS_Color.AuxiliaryColor2, + //BackgroundColor = 0xFFFF0000 + }; + FrameWhiteCentet1.AddChidren(btnSuctionView); + } + + /// <summary> + /// 鍒濆鍖栫浜屼釜绱㈠紩椤电殑鍐呭 + /// </summary> + private void InitFrameWhiteContent2() + { + var paging = new ArmSensorHistroyPaging(device); + paging.InitFrame(FrameWhiteCentet2); + } + + #endregion + + #region 鈻� 璁惧鐘舵�佸弽棣坃______________________ + + /// <summary> + /// 璁惧鐘舵�佸弽棣� + /// </summary> + /// <param name="i_LocalDevice"></param> + public override void DeviceStatuPush(Function i_LocalDevice) + { + //涓嶆槸鍚屼竴涓笢瑗� + if (this.device.sid != i_LocalDevice.sid) { return; } + + //鍒锋柊鐣岄潰鐘舵�� + this.RefreshFormStatu(); + } + + #endregion + + #region 鈻� 鍙戦�佸悇绉嶅懡浠______________________ + + #endregion + + #region 鈻� 鍒锋柊鐣岄潰鐘舵�乢______________________ + + /// <summary> + /// 鍒锋柊鐣岄潰鐘舵�� + /// </summary> + private void RefreshFormStatu() + { + Application.RunOnMainThread(() => { + var temp = device.attributes.Find((sta) => sta.key == "alarm_status"); + if (temp != null) + { + if (temp.state == "alarm") + { + btnIcon.IsSelected = true; + btnSuctionView.TextID = StringId.InAlarming; + btnSuctionView.IsSelected = true; + } + else + { + btnIcon.IsSelected = false; + btnSuctionView.TextID = StringId.Monitoring; + btnSuctionView.IsSelected = false; + } + } + }); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + #endregion + } +} -- Gitblit v1.8.0