From a469a96ee8c38f7d98366dcd633e3a15f92fec65 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 01 三月 2021 17:53:52 +0800 Subject: [PATCH] 2021-3-1-1 --- HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs | 64 ++++++++++++++++--------------- 1 files changed, 33 insertions(+), 31 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs index 323e8fd..6eb2862 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs @@ -170,6 +170,7 @@ btnVoiceIcon.X = btnChargeIcon.Right + Application.GetRealWidth(50); btnVoiceIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Voice.png"; btnVoiceIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/VoiceSelect.png"; + btnVoiceIcon.IsSelected = true; FrameWhiteCentet1.AddChidren(btnVoiceIcon); btnVoiceIcon.ButtonClickEvent += (sender, e) => { @@ -280,7 +281,7 @@ //鍚稿姏1妗� var iconPath = this.weepRobotData.Suction == "quiet" ? "FunctionIcon/Electrical/WeepRobot/SuctionSelect.png" : "FunctionIcon/Electrical/WeepRobot/Suction.png"; - menuContr.AddRowMenu(Language.StringByID(StringId.SuctionOneGear), iconPath, this.weepRobotData.Suction == "strong", () => + menuContr.AddRowMenu(Language.StringByID(StringId.SuctionOneGear), iconPath, this.weepRobotData.Suction == "quiet", () => { frameBack.Close(); //鍙戦�佸惛鍔涘懡浠� @@ -298,7 +299,7 @@ //鍚稿姏3妗� iconPath = this.weepRobotData.Suction == "strong" ? "FunctionIcon/Electrical/WeepRobot/SuctionSelect.png" : "FunctionIcon/Electrical/WeepRobot/Suction.png"; - menuContr.AddRowMenu(Language.StringByID(StringId.SuctionThreeGear), iconPath, this.weepRobotData.Suction == "quiet", () => + menuContr.AddRowMenu(Language.StringByID(StringId.SuctionThreeGear), iconPath, this.weepRobotData.Suction == "strong", () => { frameBack.Close(); //鍙戦�佸惛鍔涘懡浠� @@ -476,12 +477,12 @@ //濡傛灉鏄竻鎵姸鎬� if (this.weepRobotData.Cleaning == true) { - //鍚稿姏璋冭妭涓嶅彲鐢� - this.btnSuctionIcon.IsSelected = false; - this.btnSuctionIcon.CanClick = false; + //鍚稿姏璋冭妭鍙敤 + this.btnSuctionIcon.IsSelected = true; + this.btnSuctionIcon.CanClick = true; //澹伴煶涓嶅彲鐢� - this.btnVoiceIcon.IsSelected = false; - this.btnVoiceIcon.CanClick = false; + //this.btnVoiceIcon.IsSelected = false; + //this.btnVoiceIcon.CanClick = false; //娓呮壂妯″紡涓嶅彲鐢� this.btnModeIcon.IsSelected = false; this.btnModeIcon.CanClick = false; @@ -494,12 +495,12 @@ } else { - //鍚稿姏璋冭妭鍙敤 - this.btnSuctionIcon.IsSelected = true; - this.btnSuctionIcon.CanClick = true; + //鍚稿姏璋冭妭涓嶅彲鐢� + this.btnSuctionIcon.IsSelected = false; + this.btnSuctionIcon.CanClick = false; //澹伴煶鍙敤 - this.btnVoiceIcon.IsSelected = true; - this.btnVoiceIcon.CanClick = true; + //this.btnVoiceIcon.IsSelected = true; + //this.btnVoiceIcon.CanClick = true; //娓呮壂妯″紡鍙敤 this.btnModeIcon.IsSelected = true; this.btnModeIcon.CanClick = true; @@ -560,41 +561,42 @@ /// </summary> private void RefreshNowDeviceStatuMemory(Function i_LocalDevice) { - foreach (var data in i_LocalDevice.attributes) + for (int i = 0; i < i_LocalDevice.status.Count; i++) { + var data = i_LocalDevice.status[i]; //寮�鍏� - if (data.key == "on_off") { this.weepRobotData.Cleaning = data.realValue.ToLower() == "on"; } + if (data.key == "on_off") { this.weepRobotData.Cleaning = data.value.ToLower() == "on"; } //瀵绘壘鏈哄櫒 - else if (data.key == "seek") { this.weepRobotData.SearchRobot = data.realValue.ToLower() == "true"; } + else if (data.key == "seek") { this.weepRobotData.SearchRobot = data.value.ToLower() == "true"; } //杈瑰埛閲嶇疆 - else if (data.key == "reset_edge_brush") { this.weepRobotData.ResetEdgeBrush = data.realValue.ToLower() == "true"; } + else if (data.key == "reset_edge_brush") { this.weepRobotData.ResetEdgeBrush = data.value.ToLower() == "true"; } //婊氬埛閲嶇疆 - else if (data.key == "reset_roll_brush") { this.weepRobotData.ResetRollBrush = data.realValue.ToLower() == "true"; } + else if (data.key == "reset_roll_brush") { this.weepRobotData.ResetRollBrush = data.value.ToLower() == "true"; } //婊ょ綉閲嶇疆 - else if (data.key == "reset_filter") { this.weepRobotData.ResetFilter = data.realValue.ToLower() == "true"; } + else if (data.key == "reset_filter") { this.weepRobotData.ResetFilter = data.value.ToLower() == "true"; } //鍚稿姏閫夋嫨 - else if (data.key == "suction") { this.weepRobotData.Suction = data.realValue; } + else if (data.key == "suction") { this.weepRobotData.Suction = data.value; } //宸ヤ綔妯″紡 - else if (data.key == "mode") { this.weepRobotData.Mode = data.realValue; } + else if (data.key == "mode") { this.weepRobotData.Mode = data.value; } //娓呮壂鏂瑰悜 - else if (data.key == "direction_control") { this.weepRobotData.DirectionControl = data.realValue; } + else if (data.key == "direction_control") { this.weepRobotData.DirectionControl = data.value; } //澹伴煶寮�鍏� - else if (data.key == "voice_switch") { this.weepRobotData.VoiceSwitch = data.realValue.ToLower() == "true"; } + else if (data.key == "voice_switch") { this.weepRobotData.VoiceSwitch = data.value.ToLower() == "true"; } //娓呮壂闈㈢Н else if (data.key == "clean_area") { - var value = data.realValue; + var value = data.value; if (value != string.Empty) { this.weepRobotData.CleanArea = Convert.ToInt32(value); } } //娓呮壂璁板綍 - else if (data.key == "clean_record") { this.weepRobotData.CleanRecord = data.realValue; } + else if (data.key == "clean_record") { this.weepRobotData.CleanRecord = data.value; } //杈瑰埛瀵垮懡 else if (data.key == "edge_brush") { - var value = data.realValue; + var value = data.value; if (value != string.Empty) { this.weepRobotData.EdgeBrush = Convert.ToInt32(value); @@ -603,7 +605,7 @@ //婊氬埛瀵垮懡 else if (data.key == "roll_brush") { - var value = data.realValue; + var value = data.value; if (value != string.Empty) { this.weepRobotData.RollBrush = Convert.ToInt32(value); @@ -612,7 +614,7 @@ //婊ょ綉瀵垮懡 else if (data.key == "filter") { - var value = data.realValue; + var value = data.value; if (value != string.Empty) { this.weepRobotData.Filter = Convert.ToInt32(value); @@ -621,7 +623,7 @@ //娓呮壂鏃堕棿 else if (data.key == "clean_time") { - var value = data.realValue; + var value = data.value; if (value != string.Empty) { this.weepRobotData.CleanTime = Convert.ToInt32(value); @@ -630,7 +632,7 @@ //鍓╀綑鐢甸噺 else if (data.key == "electricity_left") { - var value = data.realValue; + var value = data.value; if (value != string.Empty) { this.weepRobotData.ElectricityLeft = Convert.ToInt32(value); @@ -651,7 +653,7 @@ /// <summary> /// 鏄惁澶勪簬娓呮壂涓� /// </summary> - public bool Cleaning = true; + public bool Cleaning = false; /// <summary> /// 瀵绘壘鏈哄櫒 /// </summary> @@ -705,7 +707,7 @@ /// </summary> public int Filter = 0; /// <summary> - /// 娓呮壂鏃堕棿(0-432000) + /// 娓呮壂鏃堕棿(0-432000) 鍗曚綅涓哄垎閽� /// </summary> public int CleanTime = 0; /// <summary> -- Gitblit v1.8.0