From dbc23459fdf4e8b74a5f955fbb9fc631b4babc70 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期三, 17 三月 2021 11:56:16 +0800 Subject: [PATCH] Merge branch 'temp-wxr' into WJC --- HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs | 146 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 146 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs new file mode 100644 index 0000000..aef5a45 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs @@ -0,0 +1,146 @@ +锘縰sing System; +using HDL_ON.DriverLayer; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + public class IrLearnPage : DeviceFunctionCardCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭 + /// </summary> + public override void InitFrameWhiteContent() + { + + base.ShowColltionButton = false; + base.SetTitleText(Language.StringByID(StringId.RemoteControl)); + + //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + this.InitFrameWhiteContent1(); + + } + + /// <summary> + /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹� + /// </summary> + private void InitFrameWhiteContent1() + { + var contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(94), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(296), + Height = Application.GetRealHeight(376), + }; + FrameWhiteCentet1.AddChidren(contentView); + + var row = new FrameLayout() + { + //Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(56), + }; + contentView.AddChidren(row); + + int index = 0; + foreach(var attr in device.attributes) + { + if(index != 0 && index%3==0) + { + row = new FrameLayout() + { + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(56), + }; + contentView.AddChidren(row); + } + + var btn = new Button() + { + Width = Application.GetRealWidth(88), + Height = Application.GetRealHeight(40), + Radius = (uint)Application.GetRealHeight(18), + BorderColor = CSS_Color.PromptingColor1, + BorderWidth = (uint)Application.GetRealWidth(2), + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + SelectedTextColor = CSS_Color.MainBackgroundColor, + SelectedBackgroundColor = CSS_Color.MainColor, + }; + if (attr.value.Count > 0) + { + btn.Text = attr.value[0]; + } + if (index % 3 == 1) + { + btn.Gravity = Gravity.CenterHorizontal; + } + else if (index % 3 == 2) + { + btn.X = Application.GetRealWidth(208); + } + row.AddChidren(btn); + + btn.MouseUpEventHandler = (sender, e) => { + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(attr.key, ""); + Control.Ins.SendWriteCommand(device, d); + + new System.Threading.Thread(() => { + System.Threading.Thread.Sleep(2000); + Application.RunOnMainThread(() => { + btn.IsSelected = false; + }); + }) { IsBackground = true }.Start(); + }; + + + + index++; + } + + } + + + #endregion + + #region 鈻� 璁惧鐘舵�佸弽棣坃______________________ + + /// <summary> + /// 璁惧鐘舵�佸弽棣� + /// </summary> + /// <param name="i_LocalDevice"></param> + public override void DeviceStatuPush(Function i_LocalDevice) + { + return; + } + + #endregion + + #region 鈻� 鍙戦�佸悇绉嶅懡浠______________________ + + #endregion + + #region 鈻� 鍒锋柊鐣岄潰鐘舵�乢______________________ + + /// <summary> + /// 鍒锋柊鐣岄潰鐘舵�� + /// </summary> + private void RefreshFormStatu() + { + return; + } + + #endregion + + } +} -- Gitblit v1.8.0