From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 44 ++++++++++++++++++++++++++------------------ 1 files changed, 26 insertions(+), 18 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs index cfdf0b0..83a522d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs @@ -38,12 +38,15 @@ /// <param name="deviceMac">璁惧Mac鍦板潃</param> public void ShowForm(string deviceMac) { - this.listNewDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac); + this.listNewDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceMac); if (listNewDevice.Count == 0) { //瀵瑰簲鍗曠函鍙湁200鍥炶矾鐨勮澶� - listNewDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac)); + listNewDevice.Add(HdlDeviceCommonLogic.Current.GetOTADevice(deviceMac)); } + + //娣诲姞鏂拌澶囩殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshAllForm = true; //璁剧疆鏍囬淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice)); @@ -57,6 +60,8 @@ this.SetDoorTime(); //鏂板叆缃戠殑璁惧,娓呯┖鎺夊畠鐨勬埧闂� this.ClearDeviceFromRoom(); + //娣诲姞璁惧鐨勬椂鍊�,鍏抽棴宸﹀垝鑿滃崟鐨勬湭鍒嗛厤鐣岄潰 + MainPage.LeftListRoomViewFrom.Instance?.CloseUnallocatedRoomForm(); } /// <summary> @@ -77,7 +82,7 @@ framePic.Y = Application.GetRealHeight(58); bodyFrameLayout.AddChidren(framePic); - var imageFile = Common.LocalDevice.Current.GetRealDeviceIcon(listNewDevice); + var imageFile = HdlDeviceCommonLogic.Current.GetRealDeviceIcon(listNewDevice); string fullName = IO.FileUtils.GetImageFilePath(imageFile); #if Android @@ -97,13 +102,14 @@ btnpictrue.UnSelectedImagePath = imageFile; framePic.AddChidren(btnpictrue); - string nameValue = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]); + string nameValue = HdlDeviceCommonLogic.Current.GetDeviceMacName(listNewDevice[0]); this.saveDefultName = nameValue; //璁惧澶囨敞 string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote); - string deviceName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]); + string deviceName = HdlDeviceCommonLogic.Current.GetDeviceMacName(listNewDevice[0]); this.btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2); + this.btnNote.txtInput.MaxByte = 48;//闄愬埗鍙兘杈撳叆48涓瓧鑺� listview.AddChidren(btnNote); btnNote.InitControl(); //鍒掔嚎 @@ -112,7 +118,7 @@ { if (btnNote.Text.Trim() == string.Empty) { - btnNote.Text = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]); + btnNote.Text = HdlDeviceCommonLogic.Current.GetDeviceMacName(listNewDevice[0]); return; } //淇敼鍚嶅瓧 @@ -121,7 +127,7 @@ //璁惧绫诲瀷 caption = Language.StringByID(R.MyInternationalizationString.uDeviceType); - deviceName = Common.LocalDevice.Current.GetDeviceObjectText(listNewDevice); + deviceName = HdlDeviceCommonLogic.Current.GetDeviceObjectText(listNewDevice); var btnType = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2); btnType.UseClickStatu = false; listview.AddChidren(btnType); @@ -155,7 +161,7 @@ } var room = HdlRoomLogic.Current.GetRoomByDevice(device); - string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device); + string mainKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device); if (room == null) { //杩欓噷鏈夌偣鐗规畩,濡傛灉鍥炶矾娌℃湁璁剧疆鏈夊尯鍩熺殑鏃跺��,鎵嶈缃� @@ -169,7 +175,7 @@ } } //淇濆瓨璁惧鎴块棿绱㈠紩 - Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys); + HdlRoomLogic.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys); }; //鏇村閰嶇疆 @@ -186,13 +192,15 @@ //鏀瑰悕瀛� btnNote.txtInput.FinishInputEvent(); + this.CloseForm(); + var form = new DeviceMacInfoEditorForm(); form.AddForm(this.listNewDevice[0].DeviceAddr); }; bodyFrameLayout.AddChidren(btnHelp); //搴曠嚎 int lineWidth = btnHelp.GetRealWidthByText(); - var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false); + var btnLine = new NormalViewControl(lineWidth, HdlControlResourse.BottomLineHeight, false); btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor; btnLine.Gravity = Gravity.CenterHorizontal; btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8); @@ -221,7 +229,7 @@ //璁惧缂栬緫 var btnTile = new NormalViewControl(800, 60, true); - btnTile.X = ControlCommonResourse.XXLeft; + btnTile.X = HdlControlResourse.XXLeft; btnTile.TextSize = 15; btnTile.TextColor = UserCenterColor.Current.TextColor2; btnTile.TextID = R.MyInternationalizationString.uDeviceEditor; @@ -257,11 +265,11 @@ /// </summary> /// <param name="i_deviceName">deviceName.</param> /// <param name="mode">鏄惁鏄剧ず閿欒</param> - private async void DeviceReName(string i_deviceName, ShowErrorMode mode = ShowErrorMode.YES) + private void DeviceReName(string i_deviceName, ShowErrorMode mode = ShowErrorMode.YES) { //淇敼MAC鍚� string deviceName = i_deviceName.Trim(); - var result = await Common.LocalDevice.Current.ReMacName(this.listNewDevice, deviceName, mode); + var result = HdlDeviceCommonLogic.Current.ReMacName(this.listNewDevice, deviceName, mode); if (result == false) { return; @@ -273,18 +281,18 @@ /// <summary> /// 璁剧疆鍏ㄩ儴鍥炶矾鐨勯粯璁ゅ悕瀛� /// </summary> - private async void SetAllEpointName() + private void SetAllEpointName() { foreach (var device in this.listNewDevice) { - if ((device is OTADevice) || Common.LocalDevice.Current.GetSimpleEpointName(device) != string.Empty) + if ((device is OTADevice) || HdlDeviceCommonLogic.Current.GetSimpleEpointName(device) != string.Empty) { //鏈夊悕瀛椾笉澶勭悊 continue; } //鑾峰彇绔偣鍚嶅瓧 - var epointName = Common.LocalDevice.Current.GetDeviceEpointName(device); - await Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO); + var epointName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device); + HdlDeviceCommonLogic.Current.ReName(device, epointName, ShowErrorMode.NO); } } @@ -320,7 +328,7 @@ HdlRoomLogic.Current.DeleteDevice(device); HdlRoomLogic.Current.DeleteLoveDevice(device); } - Common.LocalDevice.Current.DeleteRealDeviceFromRoom(this.listNewDevice[0]); + HdlRoomLogic.Current.DeleteRealDeviceFromRoom(this.listNewDevice[0]); } #endregion -- Gitblit v1.8.0