From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs | 166 ++++++++++++++++++++++++++++++-------------------------
1 files changed, 90 insertions(+), 76 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs
index c08f7c4..2368509 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs
@@ -127,7 +127,7 @@
//鍚稿姏璋冭妭
this.btnSuctionIcon = new IconViewControl(28);
btnSuctionIcon.Y = ImageControl.Bottom + Application.GetRealHeight(64);
- btnSuctionIcon.X = Application.GetRealWidth(33);
+ //btnSuctionIcon.X = Application.GetRealWidth(33);
btnSuctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Suction.png";
btnSuctionIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/SuctionSelect.png";
FrameWhiteCentet1.AddChidren(btnSuctionIcon);
@@ -138,7 +138,7 @@
};
this.btnSuctionView = new NormalViewControl(80, 54, true);
btnSuctionView.Y = btnSuctionIcon.Bottom + Application.GetRealHeight(10);
- btnSuctionView.X = btnSuctionIcon.X - (Application.GetRealWidth(80) - btnSuctionIcon.Width) / 2;
+ //btnSuctionView.X = btnSuctionIcon.X - (Application.GetRealWidth(80) - btnSuctionIcon.Width) / 2;
btnSuctionView.TextAlignment = TextAlignment.TopCenter;
btnSuctionView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
btnSuctionView.Text = Language.StringByID(StringId.SuctionAdjustment);
@@ -149,7 +149,8 @@
this.btnChargeIcon = new IconViewControl(28);
btnChargeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/ChargeSelect.png";
btnChargeIcon.Y = btnSuctionIcon.Y;
- btnChargeIcon.X = btnSuctionIcon.Right + Application.GetRealWidth(50);
+ //btnChargeIcon.X = btnSuctionIcon.Right + Application.GetRealWidth(50);
+ btnChargeIcon.Gravity = Gravity.CenterHorizontal;
FrameWhiteCentet1.AddChidren(btnChargeIcon);
btnChargeIcon.ButtonClickEvent += (sender, e) =>
{
@@ -164,13 +165,18 @@
btnChargeView.TextID = StringId.Charge;
FrameWhiteCentet1.AddChidren(btnChargeView);
+ //2021.03.09 鑸嶅純鎺夐潤闊冲姛鑳�
+ btnSuctionIcon.X = btnChargeIcon.X - btnSuctionIcon.IconSize - Application.GetRealWidth(50);
+ btnSuctionView.X = btnSuctionIcon.X - (Application.GetRealWidth(80) - btnSuctionIcon.Width) / 2;
+
//澹伴煶鍥炬爣
this.btnVoiceIcon = new IconViewControl(28);
btnVoiceIcon.Y = btnSuctionIcon.Y;
btnVoiceIcon.X = btnChargeIcon.Right + Application.GetRealWidth(50);
btnVoiceIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Voice.png";
btnVoiceIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/VoiceSelect.png";
- FrameWhiteCentet1.AddChidren(btnVoiceIcon);
+ btnVoiceIcon.IsSelected = true;
+ //FrameWhiteCentet1.AddChidren(btnVoiceIcon);
btnVoiceIcon.ButtonClickEvent += (sender, e) =>
{
//鍙戦�侀潤闊冲懡浠�
@@ -182,12 +188,13 @@
btnVoiceView.TextAlignment = TextAlignment.TopCenter;
btnVoiceView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
btnVoiceView.TextID = StringId.Mute;
- FrameWhiteCentet1.AddChidren(btnVoiceView);
+ //FrameWhiteCentet1.AddChidren(btnVoiceView);
//娓呮壂妯″紡鍥炬爣
this.btnModeIcon = new IconViewControl(28);
btnModeIcon.Y = btnSuctionIcon.Y;
- btnModeIcon.X = btnVoiceIcon.Right + Application.GetRealWidth(50);
+ //btnModeIcon.X = btnVoiceIcon.Right + Application.GetRealWidth(50);
+ btnModeIcon.X = btnChargeIcon.Right + Application.GetRealWidth(50);
btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Clean.png";
FrameWhiteCentet1.AddChidren(btnModeIcon);
btnModeIcon.ButtonClickEvent += (sender, e) =>
@@ -219,26 +226,28 @@
btnTitleName.TextID = StringId.WeepRobot;
FrameWhiteCentet2.AddChidren(btnTitleName);
+ //2021.03.09 鑸嶅純鑰楁潗绠$悊
//鑰楁潗绠$悊
- var rowManment = new FrameRowControl();
- rowManment.Height = Application.GetRealHeight(50);
- rowManment.Width = FrameWhiteCentet2.Width;
- rowManment.Y = Application.GetRealHeight(75);
- FrameWhiteCentet2.AddChidren(rowManment);
- rowManment.AddLeftCaption(Language.StringByID(StringId.ConsumablesManagement), 200);
- rowManment.AddBottomLine();
- rowManment.AddRightArrow();
- rowManment.ButtonClickEvent += (sender, e) =>
- {
- var form = new TuyaWeepRobotConsumablesMagPage();
- form.AddForm(this.device, this.weepRobotData);
- };
+ //var rowManment = new FrameRowControl();
+ //rowManment.Height = Application.GetRealHeight(50);
+ //rowManment.Width = FrameWhiteCentet2.Width;
+ //rowManment.Y = Application.GetRealHeight(75);
+ //FrameWhiteCentet2.AddChidren(rowManment);
+ //rowManment.AddLeftCaption(Language.StringByID(StringId.ConsumablesManagement), 200);
+ //rowManment.AddBottomLine();
+ //rowManment.AddRightArrow();
+ //rowManment.ButtonClickEvent += (sender, e) =>
+ //{
+ // var form = new TuyaWeepRobotConsumablesMagPage();
+ // form.AddForm(this.device, this.weepRobotData);
+ //};
//鍘嗗彶璁板綍
var rowHistory = new FrameRowControl();
rowHistory.Height = Application.GetRealHeight(50);
rowHistory.Width = FrameWhiteCentet2.Width;
- rowHistory.Y = rowManment.Bottom;
+ //rowHistory.Y = rowManment.Bottom;
+ rowHistory.Y = Application.GetRealHeight(75);
FrameWhiteCentet2.AddChidren(rowHistory);
rowHistory.AddLeftCaption(Language.StringByID(StringId.HistoryLog), 200);
rowHistory.AddBottomLine();
@@ -280,7 +289,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 +307,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();
//鍙戦�佸惛鍔涘懡浠�
@@ -326,35 +335,38 @@
};
frameBack.Show();
+ //2021.03.09 鑸嶅純闅忔満娓呮壂
//鑿滃崟鎺т欢(娓呮壂妯″紡)
- var menuContr = new DialogTitleMenuControl(4, Language.StringByID(StringId.CleanMode));
+ //var menuContr = new DialogTitleMenuControl(4, Language.StringByID(StringId.CleanMode));
+ var menuContr = new DialogTitleMenuControl(3, Language.StringByID(StringId.CleanMode));
menuContr.X = Application.GetRealWidth(210);
menuContr.Y = Application.GetRealHeight(197);
menuContr.Width = Application.GetRealWidth(160);
- menuContr.Height = Application.GetRealHeight(243);
+ //menuContr.Height = Application.GetRealHeight(243);
+ menuContr.Height = Application.GetRealHeight(203);
dialogBody.AddChidren(menuContr);
//鑷姩娓呮壂
- var iconPath = this.weepRobotData.Mode == "random" ? "FunctionIcon/Electrical/WeepRobot/AutoModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/AutoMode.png";
- menuContr.AddRowMenu(Language.StringByID(StringId.AutoClean), iconPath, this.weepRobotData.Mode == "random", () =>
- {
- frameBack.Close();
- //鍙戦�佹ā寮忓懡浠�
- this.SendComand("mode", "random");
- });
-
- //瀹氱偣娓呮壂
- iconPath = this.weepRobotData.Mode == "smart" ? "FunctionIcon/Electrical/WeepRobot/FixedPointModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/FixedPointMode.png";
- menuContr.AddRowMenu(Language.StringByID(StringId.FixedPointClean), iconPath, this.weepRobotData.Mode == "smart", () =>
+ var iconPath = this.weepRobotData.Mode == "smart" ? "FunctionIcon/Electrical/WeepRobot/AutoModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/AutoMode.png";
+ menuContr.AddRowMenu(Language.StringByID(StringId.AutoClean), iconPath, this.weepRobotData.Mode == "smart", () =>
{
frameBack.Close();
//鍙戦�佹ā寮忓懡浠�
this.SendComand("mode", "smart");
});
- //鍖哄煙娓呮壂
+ //闅忔満娓呮壂
+ //iconPath = this.weepRobotData.Mode == "random" ? "FunctionIcon/Electrical/WeepRobot/FixedPointModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/FixedPointMode.png";
+ //menuContr.AddRowMenu(Language.StringByID(StringId.RandomClean), iconPath, this.weepRobotData.Mode == "random", () =>
+ //{
+ // frameBack.Close();
+ // //鍙戦�佹ā寮忓懡浠�
+ // this.SendComand("mode", "random");
+ //});
+
+ //铻烘棆娓呮壂
iconPath = this.weepRobotData.Mode == "spiral" ? "FunctionIcon/Electrical/WeepRobot/AreaModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/AreaMode.png";
- menuContr.AddRowMenu(Language.StringByID(StringId.AreaClean), iconPath, this.weepRobotData.Mode == "spiral", () =>
+ menuContr.AddRowMenu(Language.StringByID(StringId.SpiralClean), iconPath, this.weepRobotData.Mode == "spiral", () =>
{
frameBack.Close();
//鍙戦�佹ā寮忓懡浠�
@@ -476,12 +488,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 +506,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;
@@ -519,13 +531,14 @@
this.btnModeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/AutoModeSelect.png";
this.btnModeView.TextID = StringId.AutoClean;
}
- else if (this.weepRobotData.Mode == "smart")
- {
- //瀹氱偣娓呮壂
- this.btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/FixedPointMode.png";
- this.btnModeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/FixedPointModeSelect.png";
- this.btnModeView.TextID = StringId.FixedPointClean;
- }
+ //2021.03.09 鑸嶅純闅忔満娓呮壂
+ //else if (this.weepRobotData.Mode == "smart")
+ //{
+ // //闅忔満娓呮壂
+ // this.btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/FixedPointMode.png";
+ // this.btnModeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/FixedPointModeSelect.png";
+ // this.btnModeView.TextID = StringId.RandomClean;
+ //}
else if (this.weepRobotData.Mode == "wall_follow")
{
//娌垮娓呮壂
@@ -535,10 +548,10 @@
}
else if (this.weepRobotData.Mode == "spiral")
{
- //鍖哄煙娓呮壂
+ //铻烘棆娓呮壂
this.btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/AreaMode.png";
this.btnModeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/AreaModeSelect.png";
- this.btnModeView.TextID = StringId.AreaClean;
+ this.btnModeView.TextID = StringId.SpiralClean;
}
else
{
@@ -560,41 +573,42 @@
/// </summary>
private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
{
- foreach (var data in i_LocalDevice.status)
+ for (int i = 0; i < i_LocalDevice.attributes.Count; i++)
{
+ var data = i_LocalDevice.attributes[i];
//寮�鍏�
- if (data.key == "on_off") { this.weepRobotData.Cleaning = data.value.ToLower() == "on"; }
+ if (data.key == "on_off") { this.weepRobotData.Cleaning = data.state.ToLower() == "on"; }
//瀵绘壘鏈哄櫒
- else if (data.key == "seek") { this.weepRobotData.SearchRobot = data.value.ToLower() == "true"; }
+ else if (data.key == "seek") { this.weepRobotData.SearchRobot = data.state.ToLower() == "true"; }
//杈瑰埛閲嶇疆
- else if (data.key == "reset_edge_brush") { this.weepRobotData.ResetEdgeBrush = data.value.ToLower() == "true"; }
+ else if (data.key == "reset_edge_brush") { this.weepRobotData.ResetEdgeBrush = data.state.ToLower() == "true"; }
//婊氬埛閲嶇疆
- else if (data.key == "reset_roll_brush") { this.weepRobotData.ResetRollBrush = data.value.ToLower() == "true"; }
+ else if (data.key == "reset_roll_brush") { this.weepRobotData.ResetRollBrush = data.state.ToLower() == "true"; }
//婊ょ綉閲嶇疆
- else if (data.key == "reset_filter") { this.weepRobotData.ResetFilter = data.value.ToLower() == "true"; }
+ else if (data.key == "reset_filter") { this.weepRobotData.ResetFilter = data.state.ToLower() == "true"; }
//鍚稿姏閫夋嫨
- else if (data.key == "suction") { this.weepRobotData.Suction = data.value; }
+ else if (data.key == "suction") { this.weepRobotData.Suction = data.state; }
//宸ヤ綔妯″紡
- else if (data.key == "mode") { this.weepRobotData.Mode = data.value; }
+ else if (data.key == "mode") { this.weepRobotData.Mode = data.state; }
//娓呮壂鏂瑰悜
- else if (data.key == "direction_control") { this.weepRobotData.DirectionControl = data.value; }
+ else if (data.key == "direction_control") { this.weepRobotData.DirectionControl = data.state; }
//澹伴煶寮�鍏�
- else if (data.key == "voice_switch") { this.weepRobotData.VoiceSwitch = data.value.ToLower() == "true"; }
+ else if (data.key == "voice_switch") { this.weepRobotData.VoiceSwitch = data.state.ToLower() == "true"; }
//娓呮壂闈㈢Н
else if (data.key == "clean_area")
{
- var value = data.value;
+ var value = data.state;
if (value != string.Empty)
{
this.weepRobotData.CleanArea = Convert.ToInt32(value);
}
}
//娓呮壂璁板綍
- else if (data.key == "clean_record") { this.weepRobotData.CleanRecord = data.value; }
+ else if (data.key == "clean_record") { this.weepRobotData.CleanRecord = data.state; }
//杈瑰埛瀵垮懡
else if (data.key == "edge_brush")
{
- var value = data.value;
+ var value = data.state;
if (value != string.Empty)
{
this.weepRobotData.EdgeBrush = Convert.ToInt32(value);
@@ -603,7 +617,7 @@
//婊氬埛瀵垮懡
else if (data.key == "roll_brush")
{
- var value = data.value;
+ var value = data.state;
if (value != string.Empty)
{
this.weepRobotData.RollBrush = Convert.ToInt32(value);
@@ -612,7 +626,7 @@
//婊ょ綉瀵垮懡
else if (data.key == "filter")
{
- var value = data.value;
+ var value = data.state;
if (value != string.Empty)
{
this.weepRobotData.Filter = Convert.ToInt32(value);
@@ -621,7 +635,7 @@
//娓呮壂鏃堕棿
else if (data.key == "clean_time")
{
- var value = data.value;
+ var value = data.state;
if (value != string.Empty)
{
this.weepRobotData.CleanTime = Convert.ToInt32(value);
@@ -630,7 +644,7 @@
//鍓╀綑鐢甸噺
else if (data.key == "electricity_left")
{
- var value = data.value;
+ var value = data.state;
if (value != string.Empty)
{
this.weepRobotData.ElectricityLeft = Convert.ToInt32(value);
@@ -651,7 +665,7 @@
/// <summary>
/// 鏄惁澶勪簬娓呮壂涓�
/// </summary>
- public bool Cleaning = true;
+ public bool Cleaning = false;
/// <summary>
/// 瀵绘壘鏈哄櫒
/// </summary>
@@ -673,7 +687,7 @@
/// </summary>
public string Suction = string.Empty;
/// <summary>
- /// 宸ヤ綔妯″紡(random:鑷姩娓呮壂 smart:瀹氱偣娓呮壂 wall_follow:娌垮娓呮壂 spiral:鍖哄煙娓呮壂 chargego:鍏呯數)
+ /// 宸ヤ綔妯″紡(smart:鑷姩娓呮壂 random:闅忔満娓呮壂 wall_follow:娌垮娓呮壂 spiral:铻烘棆娓呮壂 chargego:鍏呯數)
/// </summary>
public string Mode = string.Empty;
/// <summary>
@@ -705,7 +719,7 @@
/// </summary>
public int Filter = 0;
/// <summary>
- /// 娓呮壂鏃堕棿(0-432000)
+ /// 娓呮壂鏃堕棿(0-432000) 鍗曚綅涓哄垎閽�
/// </summary>
public int CleanTime = 0;
/// <summary>
--
Gitblit v1.8.0