From a5b3c4bae726ef6770d4bfcbf2f4b50a37ed4a15 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 06 三月 2020 15:31:36 +0800 Subject: [PATCH] 删除了郭雪城的 DeviceUi 这个类 --- ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs | 95 ++++++++++++++++++++++++++++++----------------- 1 files changed, 60 insertions(+), 35 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs index 96f0799..e48fe6c 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs @@ -107,7 +107,8 @@ ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱 - if (Common.Room.Lists.Count == 0) + var listAllRoom = UserCenter.HdlRoomLogic.Current.GetAllListRooms(); + if (listAllRoom.Count == 0) { return; } @@ -266,7 +267,7 @@ dropdown.Visible = false; if (Config.Instance.Home.FloorDics.Count == 0) { - roomlists.AddRange(Common.Room.Lists); + roomlists.AddRange(listAllRoom); } else { @@ -331,14 +332,15 @@ roomTextButton.IsSelected = false; roomTextButton = roomnameBtn; roomnameBtn.IsSelected = true; - var list = new List<DeviceUI>(); - foreach (var device in room.DeviceUIList) + var list = new List<CommonDevice>(); + foreach (var deviceKeys in room.ListDevice) { - if (device.CommonDevice == null) + var device = LocalDevice.Current.GetDevice(deviceKeys); + if (device == null) { continue; } - if (!deviceTypeList.Contains(device.CommonDevice.Type)) + if (!deviceTypeList.Contains(device.Type)) { continue; } @@ -370,14 +372,15 @@ roomTextButton.IsSelected = false; roomTextButton = roomnameBtn; roomnameBtn.IsSelected = true; - var list = new List<DeviceUI>(); - foreach (var device in room.DeviceUIList) + var list = new List<CommonDevice>(); + foreach (var deviceKeys in room.ListDevice) { - if (device.CommonDevice == null) + var device = LocalDevice.Current.GetDevice(deviceKeys); + if (device == null) { continue; } - if (!deviceTypeList.Contains(device.CommonDevice.Type)) + if (!deviceTypeList.Contains(device.Type)) { continue; } @@ -408,29 +411,29 @@ /// <summary> ///鍔犺浇璇ュ尯鍩熸墍鏈夎澶囩殑瑙嗗浘鏂规硶 /// </summary> - void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol) + void AllDeviceTypeView(List<CommonDevice> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol) { List<string> devicetypelist = new List<string>(); devicetypelist.Clear(); #region ------鎺掑垪璁惧绫诲瀷------ - var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput); + var lightjosn = devicelist.Find((device) => device.Type == DeviceType.DimmableLight || device.Type == DeviceType.OnOffOutput); if (lightjosn != null) { devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights)); } - var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice); + var curtainjosn = devicelist.Find((device) => device.Type == DeviceType.WindowCoveringDevice); if (curtainjosn != null) { devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains)); } - var ac = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.Thermostat); + var ac = devicelist.Find((device) => device.Type == DeviceType.Thermostat); if (ac != null) { devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC)); } - var airSwitch = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.AirSwitch); + var airSwitch = devicelist.Find((device) => device.Type == DeviceType.AirSwitch); if (airSwitch != null) { devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch)); @@ -553,13 +556,13 @@ /// 鍔犺浇璇ョ被鍨嬭澶囪鍥炬柟娉� /// </summary> /// <param name="devicelist">璁惧鍒楄〃</param> - void ActionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist) + void ActionDeviceView(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; } @@ -603,14 +606,14 @@ var devicename = new Button { - Text = common.CommonDevice.DeviceEpointName, + Text = common.DeviceEpointName, TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.LogicTextBlackColor, SelectedTextColor = ZigbeeColor.Current.LogicAddColor, TextSize = 14, }; deviceRow.AddChidren(devicename); - switch (common.CommonDevice.Type) + switch (common.Type) { case DeviceType.OnOffOutput: @@ -660,7 +663,7 @@ var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; this.AddChidren(flMain); - CurrentDeviceStateView(flMain, common.CommonDevice, false); + CurrentDeviceStateView(flMain, common, false); }; deviceFramelayout.MouseUpEventHandler += devicclick; bjFramelayout.MouseUpEventHandler += devicclick; @@ -1067,7 +1070,7 @@ ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍� ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級 ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊 - ProgressTextSize = 13,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� + ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害 }; openframelayout.AddChidren(horizontalSeekBarVol); @@ -1358,7 +1361,7 @@ }; openframelayout.AddChidren(horizontalSeekBarRow); var horizontalSeekBarVol = new DiyImageSeekBar - { + { Y = openrowlayout.Bottom, X = Application.GetRealWidth(80), Width = Application.GetRealWidth(920), @@ -1369,7 +1372,7 @@ ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍� ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級 ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊 - ProgressTextSize = 13,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� + ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害 }; openframelayout.AddChidren(horizontalSeekBarVol); @@ -1756,8 +1759,14 @@ Dictionary<string, string> temperaturedictionary = new Dictionary<string, string>(); Dictionary<string, string> modedictionary = new Dictionary<string, string>(); Dictionary<string, string> speeddictionary = new Dictionary<string, string>(); - - + dictionary(temperaturedictionary, "TaskType", "5"); + dictionary(modedictionary, "TaskType", "5"); + dictionary(modedictionary, "Data1", "3"); + dictionary(speeddictionary, "TaskType", "5"); + dictionary(speeddictionary, "Data1", "6"); + taskListInfo.Add(temperaturedictionary); + taskListInfo.Add(modedictionary); + taskListInfo.Add(speeddictionary); #endregion #region 绌鸿皟View @@ -1806,15 +1815,14 @@ }; devicefra.AddChidren(PickerViewfra); - + //閬尅绌鸿皟婊戝姩view锛� var pausePickerViewfra = new FrameLayout { Y = openframelayout.Bottom, Height = Application.GetRealHeight(600), + BackgroundColor = 0x60ffffff, }; devicefra.AddChidren(pausePickerViewfra); - - var mUIPickerView = new UIPickerView { @@ -1849,6 +1857,9 @@ mList1.Add(i.ToString() + " " + "鈩�"); } mUIPickerView.setNPicker(mList1, mList2, mList3); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2); ///榛樿鐘舵�� @@ -1887,9 +1898,13 @@ #endregion - + //榛樿26,鑷姩,涓 + int indextemperature = 10, indexmode = 2, indexspeed = 1; mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) => { + indextemperature = s1; + indexmode = s2; + indexspeed = s3; if (openBtnSelected.Visible) { SelectedDeviceStatusaction = "yes"; @@ -1907,14 +1922,16 @@ }; #endregion - //榛樿26,鑷姩,涓 - int indextemperature = 10, indexmode = 2, indexspeed = 1; + if (edit && TaskList != null) { foreach (var value in TaskList) { if (TaskList.Count == 1) { + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2); //鏁扮粍鍙湁涓�涓厓绱犺鏄庡綋鍓嶇┖璋冪姸鎬佷负鍏筹紱 openBtnSelected.Visible = false; closeBtnSelected.Visible = true; @@ -1925,6 +1942,9 @@ } else { + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2); openBtnSelected.Visible = true; closeBtnSelected.Visible = false; pausePickerViewfra.Height = Application.GetRealHeight(0); @@ -2018,6 +2038,9 @@ ///纭浜嬩欢 EventHandler<MouseEventArgs> openclick = (sender, e) => { + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2); //娓呴櫎涔嬪墠鏁版嵁锛� taskListInfo.Clear(); //鍔犺浇鏂版暟鎹紱 @@ -2051,7 +2074,9 @@ ///鍙栨秷浜嬩欢 EventHandler<MouseEventArgs> closeclick = (sender, e) => { - + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1); + mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2); //娓呴櫎涔嬪墠鏁版嵁锛� taskListInfo.Clear(); dictionary(modedictionary, "TaskType", "5"); @@ -2084,9 +2109,9 @@ { if (!edit) { - var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), - Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), - Language.StringByID(MyInternationalizationString.confrim)); + var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, + Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), + Language.StringByID(MyInternationalizationString.confrim)); alert.Show(); return; } -- Gitblit v1.8.0