From c47c3ec2488961b3a006aaebcb03dba582f8b19b Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期四, 12 三月 2020 17:08:42 +0800 Subject: [PATCH] 2020-03-12-1 --- ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs | 203 +++++++++++++++++++++++++------------------------- 1 files changed, 102 insertions(+), 101 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs index 4075385..342da8f 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs @@ -63,7 +63,7 @@ this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; TopView view = new TopView(); this.AddChidren(view.TopRowView(true)); - view.toptitleNameBtn.Text = Name; + view.toptitleNameBtn.Text = Name; view.clickBtn.MouseDownEventHandler += (sender, e) => { UserView.HomePage.Instance.ScrollEnabled = true; @@ -87,8 +87,9 @@ var roomlists = Method.GetRoomList(IfType, Config.Instance.Home.CurrentFloorId); if (roomlists.Count == 0) { - ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱 - return; + //杩斿洖娌℃湁鎴块棿闅愯棌涓嬮潰鏁村潡; + devicetypehorizontalScrol.Height = 0; + middle.Height = 0; } /// 璁惧绫诲瀷鍒楄〃 var deviceTypeList = Method.GetDevice(IfType); @@ -98,110 +99,110 @@ devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft); middle.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft); ///妤煎眰鐐瑰嚮浜嬩欢 - view.foolrclickBtn.MouseUpEventHandler+= (sender, e) => - { - var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; - this.AddChidren(flMain); - flMain.MouseUpEventHandler += (sender2, e2) => + view.foolrclickBtn.MouseUpEventHandler += (sender, e) => { - flMain.RemoveFromParent(); - }; - var foolrbjicon = new FrameLayout - { - - Width = Application.GetRealWidth(450), - Height = Application.GetRealHeight(780), - X = Application.GetRealWidth(1080 - 468 - 35), - Y = Application.GetRealHeight(184), - BackgroundImagePath = "Item/SelectFloor_Right.png", - }; - flMain.AddChidren(foolrbjicon); - - var btnfoolrtext = new Button - { - Width = Application.GetRealWidth(450), - Height = Application.GetRealHeight(150), - TextAlignment = TextAlignment.CenterLeft, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - X = Application.GetRealWidth(80), - TextID = MyInternationalizationString.selecfoolr, - TextSize = 14, - }; - foolrbjicon.AddChidren(btnfoolrtext); - - var foolrbj = new VerticalScrolViewLayout - { - - Width = Application.GetRealWidth(450), - Height = foolrbjicon.Height - btnfoolrtext.Height, - X = Application.GetRealWidth(80), - Y = btnfoolrtext.Bottom, - }; - foolrbjicon.AddChidren(foolrbj); - - foreach (var foolr in Config.Instance.Home.FloorDics) - { - var foolrRowLayout = new RowLayout + var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; + this.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender2, e2) => + { + flMain.RemoveFromParent(); + }; + var foolrbjicon = new FrameLayout { - Height = Application.GetRealHeight(150), - LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + + Width = Application.GetRealWidth(450), + Height = Application.GetRealHeight(780), + X = Application.GetRealWidth(1080 - 468 - 35), + Y = Application.GetRealHeight(184), + BackgroundImagePath = "Item/SelectFloor_Right.png", }; - foolrbj.AddChidren(foolrRowLayout); + flMain.AddChidren(foolrbjicon); - var btnfoolricon = new Button + var btnfoolrtext = new Button { - Width = Application.GetRealWidth(81), - Height = Application.GetRealHeight(81), - UnSelectedImagePath = "Floor/Floor.png", - Gravity = Gravity.CenterVertical, - }; - foolrRowLayout.AddChidren(btnfoolricon); - - var btnfoolrname = new Button - { - Width = Application.GetRealWidth(250), + Width = Application.GetRealWidth(450), Height = Application.GetRealHeight(150), - Text = foolr.Value, TextAlignment = TextAlignment.CenterLeft, - TextColor = ZigbeeColor.Current.LogicBtnCancelColor, - Tag = foolr.Key, - X = btnfoolricon.Right + Application.GetRealWidth(12), + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + X = Application.GetRealWidth(80), + TextID = MyInternationalizationString.selecfoolr, TextSize = 14, }; - foolrRowLayout.AddChidren(btnfoolrname); - if (view.foolrnameBtn.Text == foolr.Value) + foolrbjicon.AddChidren(btnfoolrtext); + + var foolrbj = new VerticalScrolViewLayout { - btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png"; - btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor; + + Width = Application.GetRealWidth(450), + Height = foolrbjicon.Height - btnfoolrtext.Height, + X = Application.GetRealWidth(80), + Y = btnfoolrtext.Bottom, + }; + foolrbjicon.AddChidren(foolrbj); + + foreach (var foolr in Config.Instance.Home.FloorDics) + { + var foolrRowLayout = new RowLayout + { + Height = Application.GetRealHeight(150), + LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + }; + foolrbj.AddChidren(foolrRowLayout); + + var btnfoolricon = new Button + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + UnSelectedImagePath = "Floor/Floor.png", + Gravity = Gravity.CenterVertical, + }; + foolrRowLayout.AddChidren(btnfoolricon); + + var btnfoolrname = new Button + { + Width = Application.GetRealWidth(250), + Height = Application.GetRealHeight(150), + Text = foolr.Value, + TextAlignment = TextAlignment.CenterLeft, + TextColor = ZigbeeColor.Current.LogicBtnCancelColor, + Tag = foolr.Key, + X = btnfoolricon.Right + Application.GetRealWidth(12), + TextSize = 14, + }; + foolrRowLayout.AddChidren(btnfoolrname); + if (view.foolrnameBtn.Text == foolr.Value) + { + btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png"; + btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor; + } + + EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) => + { + + roomhorizontalScrol.RemoveAll(); + devicetypehorizontalScrol.RemoveAll(); + middle.RemoveAll(); + view.foolrnameBtn.Text = btnfoolrname.Text; + flMain.RemoveFromParent(); + var list = Method.GetRoomList(IfType, btnfoolrname.Tag.ToString()); + if (list.Count == 0) + { + devicetypehorizontalScrol.Height = 0; + middle.Height = 0; + } + else + { + devicetypehorizontalScrol.Height = Application.GetRealHeight(280); + middle.Height = Application.GetRealHeight(1920 - 40 - 184 - 280 - 200); + } + AllRoomView(list, deviceTypeList); + }; + foolrRowLayout.MouseUpEventHandler += foolrnameclick; + btnfoolrname.MouseUpEventHandler += foolrnameclick; + } - EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) => - { - - roomhorizontalScrol.RemoveAll(); - devicetypehorizontalScrol.RemoveAll(); - middle.RemoveAll(); - view.foolrnameBtn.Text = btnfoolrname.Text; - flMain.RemoveFromParent(); - var list = Method.GetRoomList(IfType, btnfoolrname.Tag.ToString()); - if (list.Count == 0) - { - devicetypehorizontalScrol.Height= 0; - middle.Height = 0; - } - else - { - devicetypehorizontalScrol.Height= Application.GetRealHeight(280); - middle.Height= Application.GetRealHeight(1920 - 40 - 184 - 280 - 200); - } - AllRoomView(list, deviceTypeList); - }; - foolrRowLayout.MouseUpEventHandler += foolrnameclick; - btnfoolrname.MouseUpEventHandler += foolrnameclick; - - } - - }; + }; AllRoomView(roomlists, deviceTypeList); } /// <summary> @@ -284,7 +285,7 @@ /// 鍔犺浇璇ュ尯鍩熸墍鏈夎澶囪鍥炬柟娉� /// </summary>0 /// <param name="devicelist">Devicelist.</param> - void AllDeviceTypeView(List<DeviceUI> devicelist) + void AllDeviceTypeView(List<CommonDevice> devicelist) { var devicetypelist = Method.GetDeviceTypeList(IfType, devicelist); devicetypehorizontalScrol.RemoveAll(); @@ -366,18 +367,18 @@ /// </summary> /// <param name="deviceTypelist">Device typelist.</param> /// <param name="devicelist">璁惧鍒楄〃</param> - void ConditionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist) + void ConditionDeviceView(List<DeviceType> deviceTypelist, List<CommonDevice> devicelist) { middle.RemoveAll(); foreach (var common in devicelist) { - if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type)) + if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.Type)) { continue; } if (IfType == "condition_mould") { - if (common.CommonDevice.IasDeviceType != 13) + if (common.IasDeviceType != 13) {//鑷姩鍖栨ā鏉垮彧鏀寔绾㈠浼犳劅鍣� continue; } @@ -417,7 +418,7 @@ deviceFramelayout.AddChidren(deviceRow); var devicename = new Button { - Text = common.CommonDevice.DeviceEpointName, + Text = LocalDevice.Current.GetDeviceEpointName(common), TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.LogicTextBlackColor, SelectedTextColor = ZigbeeColor.Current.LogicAddColor, @@ -437,7 +438,7 @@ devicename.IsSelected = true; var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; this.AddChidren(flMain); - CurrentDeviceState.CurrentDeviceView(flMain, common.CommonDevice, false, IfType); + CurrentDeviceState.CurrentDeviceView(flMain, common, false, IfType); }; deviceFramelayout.MouseUpEventHandler += devicclick; -- Gitblit v1.8.0