From ab852818b685086e6b0db4b95936bd247426b815 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 01 二月 2021 16:06:56 +0800
Subject: [PATCH] 涂鸦风扇,净化器,扫地机器人整得差不多了
---
HDL-ON_iOS/Resources/Language.ini | 29 +
HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs | 48 +++
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs | 341 ++++++++++++++++++++---
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotConsumablesMagPage.cs | 123 ++++++++
HDL-ON_Android/Assets/Language.ini | 15 +
HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs | 24 +
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs | 28 -
HDL_ON/Common/R.cs | 63 ++++
HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs | 97 ++++++
HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotHistoryPage.cs | 50 +++
HDL_ON/HDL_ON.projitems | 3
11 files changed, 721 insertions(+), 100 deletions(-)
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index 4e6df03..969bc4e 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -1080,6 +1080,21 @@
1032=娓呮壂妯″紡
1033=鑰楁潗绠$悊
1034=鍘嗗彶璁板綍
+1035=鑷姩娓呮壂
+1036=瀹氱偣娓呮壂
+1037=娌垮娓呮壂
+1038=鍖哄煙娓呮壂
+1039=鎬绘竻娲侀潰绉�
+1040=鎬绘竻娲佹椂闂�
+1041=杈瑰埛鍓╀綑瀵垮懡
+1042=婊氬埛鍓╀綑瀵垮懡
+1043=婊ょ綉鍓╀綑瀵垮懡
+1044=閲嶇疆杈瑰埛
+1045=閲嶇疆婊氬埛
+1046=閲嶇疆婊ょ綉
+1047=鏄惁閲嶇疆杈瑰埛
+1048=鏄惁閲嶇疆婊氬埛
+1049=鏄惁閲嶇疆婊ょ綉
5000=闊充箰
5001=缁勫悎
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index 8440e0e..969bc4e 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -103,7 +103,7 @@
102=Uunassigned
103=Delete the room or not?
104=Transition time
-105=Indoor temp.
+105=Indoor temp.
106=AC
107=Video intercom
108=Sensor
@@ -390,9 +390,6 @@
405=Cozy
406=Meeting
407=Reading
-408=Comfirm
-409=Function brand
-410=You haven't added any platform devices yet
5000=Music
5001=Group
@@ -605,7 +602,7 @@
9049=Incorrect password for many times, the account number is locked!
9050=Verify the face ID
9051=Fail to save the user's face ID
-
+'
9052=The push notification of registration is available.
9053=The push notification of registration is abnormal.
9054=Numeric password verification
@@ -1047,10 +1044,6 @@
406=浼氬
407=闃呰
408=纭娣诲姞
-409=鍔熻兘鍝佺墝
-410=浣犲綋鍓嶈繕鏈坊鍔犱换浣曞钩鍙拌澶�
-411=鍏朵粬骞冲彴璁惧鍧囩敱绗笁鏂规湇鍔″晢鎻愪緵鏀寔
-412=娣诲姞
1000=瀹ゅ唴婀垮害
1001=绔ラ攣
@@ -1087,6 +1080,21 @@
1032=娓呮壂妯″紡
1033=鑰楁潗绠$悊
1034=鍘嗗彶璁板綍
+1035=鑷姩娓呮壂
+1036=瀹氱偣娓呮壂
+1037=娌垮娓呮壂
+1038=鍖哄煙娓呮壂
+1039=鎬绘竻娲侀潰绉�
+1040=鎬绘竻娲佹椂闂�
+1041=杈瑰埛鍓╀綑瀵垮懡
+1042=婊氬埛鍓╀綑瀵垮懡
+1043=婊ょ綉鍓╀綑瀵垮懡
+1044=閲嶇疆杈瑰埛
+1045=閲嶇疆婊氬埛
+1046=閲嶇疆婊ょ綉
+1047=鏄惁閲嶇疆杈瑰埛
+1048=鏄惁閲嶇疆婊氬埛
+1049=鏄惁閲嶇疆婊ょ綉
5000=闊充箰
5001=缁勫悎
@@ -1261,9 +1269,6 @@
7120=闃叉媶鍔熻兘
7121=鍦ㄧ嚎
7122=涓嶅湪绾�
-
-
-
9000=璇蜂娇鐢ㄦ柊鐨勬墜鏈鸿处鍙风櫥褰旳PP
9001=璇蜂娇鐢ㄦ柊鐨勯偖绠辫处鍙风櫥褰旳PP
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 26caecc..90a0a72 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -510,7 +510,7 @@
/// </summary>
public const int SuctionAdjustment = 1025;
/// <summary>
- ///鍚稿姏1妗�
+ /// 鍚稿姏1妗�
/// </summary>
public const int SuctionOneGear = 1026;
/// <summary>
@@ -545,6 +545,67 @@
/// 鍘嗗彶璁板綍
/// </summary>
public const int HistoryLog = 1034;
+ /// <summary>
+ /// 鑷姩娓呮壂
+ /// </summary>
+ public const int AutoClean = 1035;
+ /// <summary>
+ /// 瀹氱偣娓呮壂
+ /// </summary>
+ public const int FixedPointClean = 1036;
+ /// <summary>
+ /// 娌垮娓呮壂
+ /// </summary>
+ public const int WallClean = 1037;
+ /// <summary>
+ /// 鍖哄煙娓呮壂
+ /// </summary>
+ public const int AreaClean = 1038;
+ /// <summary>
+ /// 鎬绘竻娲侀潰绉�
+ /// </summary>
+ public const int TotalCleanArea = 1039;
+ /// <summary>
+ /// 鎬绘竻娲佹椂闂�
+ /// </summary>
+ public const int TotalCleaningTime = 1040;
+ /// <summary>
+ /// 杈瑰埛鍓╀綑瀵垮懡
+ /// </summary>
+ public const int RemainingLifeOfSideBrush = 1041;
+ /// <summary>
+ /// 婊氬埛鍓╀綑瀵垮懡
+ /// </summary>
+ public const int RemainingLifeOfRollerBrush = 1042;
+ /// <summary>
+ /// 婊ょ綉鍓╀綑瀵垮懡
+ /// </summary>
+ public const int RemainingLifeOfFilterScreen = 1043;
+ /// <summary>
+ /// 閲嶇疆杈瑰埛
+ /// </summary>
+ public const int ResetSideBrush = 1044;
+ /// <summary>
+ /// 閲嶇疆婊氬埛
+ /// </summary>
+ public const int ResetRollerBrush = 1045;
+ /// <summary>
+ /// 閲嶇疆婊ょ綉
+ /// </summary>
+ public const int ResetFilterScreen = 1046;
+ /// <summary>
+ /// 鏄惁閲嶇疆杈瑰埛
+ /// </summary>
+ public const int ResetSideBrushMsg = 1047;
+ /// <summary>
+ /// 鏄惁閲嶇疆婊氬埛
+ /// </summary>
+ public const int ResetRollerBrushMsg = 1048;
+ /// <summary>
+ /// 鏄惁閲嶇疆婊ょ綉
+ /// </summary>
+ public const int ResetFilterScreenMsg = 1049;
+
public const int a31Music = 5000;
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 9a6b1e0..19eb0cb 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -327,6 +327,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Controls\CompoundControls\SeekBarImageControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Controls\CompoundControls\FanGearSeekBarControl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Controls\CompoundControls\ProgressBar.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Controls\CompoundControls\BatteryPersentControl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\TuyaWeepRobotConsumablesMagPage.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\TuyaWeepRobotHistoryPage.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)UI\" />
diff --git a/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs b/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
old mode 100644
new mode 100755
index 5386392..60c8d0a
--- a/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
+++ b/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
@@ -74,6 +74,54 @@
}
}
+ /// <summary>
+ /// 閫変腑鐘舵��(閲嶅啓搴曞眰灞炴��)
+ /// </summary>
+ public new bool IsSelected
+ {
+ get { return base.IsSelected; }
+ set
+ {
+ //鍙湁鐘舵�佷笉涓�鏍�,鎵嶅彉鏇�
+ if (base.IsSelected != value)
+ {
+ base.IsSelected = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// 闈為�変腑鐘舵�佺殑鑳屾櫙鍥捐矾寰�(閲嶅啓搴曞眰灞炴��)
+ /// </summary>
+ public new string UnSelectedImagePath
+ {
+ get { return base.UnSelectedImagePath; }
+ set
+ {
+ //鍙湁鍥剧墖涓嶄竴鏍�,鎵嶅彉鏇�
+ if (base.UnSelectedImagePath != value)
+ {
+ base.UnSelectedImagePath = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// 閫変腑鐘舵�佺殑鑳屾櫙鍥捐矾寰�(閲嶅啓搴曞眰灞炴��)
+ /// </summary>
+ public new string SelectedImagePath
+ {
+ get { return base.SelectedImagePath; }
+ set
+ {
+ //鍙湁鍥剧墖涓嶄竴鏍�,鎵嶅彉鏇�
+ if (base.SelectedImagePath != value)
+ {
+ base.SelectedImagePath = value;
+ }
+ }
+ }
+
#endregion
#region 鈻� 鍒濆鍖朹____________________________
diff --git a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs
new file mode 100755
index 0000000..bf88dae
--- /dev/null
+++ b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/BatteryPersentControl.cs
@@ -0,0 +1,97 @@
+锘縰sing Shared;
+using HDL_ON.UI.CSS;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HDL_ON.Stan
+{
+ /// <summary>
+ /// 鐢垫睜鐧惧垎姣旀帶浠�
+ /// </summary>
+ public class BatteryPersentControl : NormalFrameLayout
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鐢垫睜鐧惧垎姣旀樉绀虹殑鍊�
+ /// </summary>
+ private NormalViewControl btnBatteryView = null;
+ /// <summary>
+ /// 杩涘害鏉�
+ /// </summary>
+ private NormalViewControl btnProgress = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢垫睜鐧惧垎姣旀帶浠�
+ /// </summary>
+ public BatteryPersentControl()
+ {
+ //浠ュ浘鐗囩殑璁$畻鏂规硶璁$畻楂樺害
+ this.Height = this.GetPictrueRealSize(25);
+ this.Width = this.GetPictrueRealSize(24) + Application.GetRealWidth(30 + 4);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ public void InitControl()
+ {
+ var btnIcon = new IconViewControl(24);
+ btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Battery.png";
+ this.AddChidren(btnIcon);
+
+ //鐢垫睜鐧惧垎姣�
+ this.btnBatteryView = new NormalViewControl(30, 16, true);
+ btnBatteryView.X = btnIcon.Right + Application.GetRealWidth(4);
+ btnBatteryView.Y = btnIcon.Y + (btnIcon.Height - Application.GetRealHeight(16)) / 2;
+ btnBatteryView.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel;
+ btnBatteryView.TextColor = CSS_Color.PromptingColor1;
+ this.AddChidren(btnBatteryView);
+
+ //杩涘害鏉℃帶浠�
+ this.btnProgress = new NormalViewControl(this.GetPictrueRealSize(15), this.GetPictrueRealSize(8), false);
+ btnProgress.X = this.GetPictrueRealSize(4);
+ btnProgress.Gravity = Gravity.CenterVertical;
+ btnProgress.BackgroundColor = CSS_Color.PromptingColor1;
+ this.AddChidren(btnProgress);
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鐧惧垎姣斿��
+ /// </summary>
+ /// <param name="i_value"></param>
+ public void SetValue(decimal i_value)
+ {
+ int myWidth = (int)((i_value / 100) * this.GetPictrueRealSize(15));
+ this.btnBatteryView.Text = i_value + "%";
+ this.btnProgress.Width = myWidth;
+ if (i_value <= 20)
+ {
+ if (this.btnProgress.BackgroundColor == CSS_Color.PromptingColor1)
+ {
+ //鍙樼孩鑹�
+ this.btnProgress.BackgroundColor = 0xfff62f48;
+ }
+ }
+ else
+ {
+ if (this.btnProgress.BackgroundColor == 0xfff62f48)
+ {
+ //鍙樼孩鑹�
+ this.btnProgress.BackgroundColor = CSS_Color.PromptingColor1;
+ }
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs
index 739bc8c..7fe638d 100644
--- a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs
+++ b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs
@@ -14,13 +14,13 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
- /// 鎺у埗浜嬩欢(涓嶆敮鎸丒nable鍜孌isable,閮藉綊涓篗id)
+ /// 鐐瑰嚮鍚庤嚜鍔ㄨ繕鍘熺姸鎬佺殑鎺у埗浜嬩欢(鍙湁Mid,left,right,up,down)
/// </summary>
- public Action<DirectionEnum> ControlEvent = null;
+ public Action<DirectionEnum> AutoRecoverControlEvent = null;
/// <summary>
- /// 鏄惁浣跨敤鐐瑰嚮鐗规晥,涓�鏃﹁缃负true,鍒欑偣鍑讳箣鍚�,浼氳嚜鍔ㄨ繕鍘熷洖Enable鐘舵��
+ /// 鐐瑰嚮鍚庝笉浼氳繕鍘熺姸鎬佺殑鎺у埗浜嬩欢(鍙湁enable,Mid,left,right,up,down銆� enable:鎵嬫寚鏉惧紑鏂瑰悜閿悗瑙﹀彂)
/// </summary>
- public bool UseClickStau = false;
+ public Action<DirectionEnum> NotRecoverControlEvent = null;
/// <summary>
/// 鑳藉惁鎺у埗鏂瑰悜
/// </summary>
@@ -75,7 +75,8 @@
//寮�鍚瓑寰呯嚎绋�(涓嶅厑璁哥媯鐐�)
this.StartWaitThread();
- this.ControlEvent?.Invoke(DirectionEnum.Mid);
+ this.AutoRecoverControlEvent?.Invoke(DirectionEnum.Mid);
+ this.NotRecoverControlEvent?.Invoke(DirectionEnum.Mid);
};
//涓婃寜閽�
@@ -161,7 +162,7 @@
//涓嶈兘鎺у埗鏂瑰悜
this.CanDirection = false;
}
- else if (direction == DirectionEnum.Enable)
+ else
{
//鑳藉鎺у埗鏂瑰悜
this.CanDirection = true;
@@ -191,19 +192,21 @@
}
//濡傛灉浣跨敤鐗规晥鐨勮瘽
- if (this.UseClickStau == true)
+ if (this.AutoRecoverControlEvent != null)
{
//鍒囨崲鍥剧墖
this.SetDirectionImage(direction);
//寮�鍚瓑寰呯嚎绋�(涓嶅厑璁哥媯鐐�)
this.StartWaitThread();
+
+ this.AutoRecoverControlEvent?.Invoke(direction);
}
else
{
//鍒囨崲鍥剧墖
this.SetDirectionImage(DirectionEnum.Enable);
+ this.NotRecoverControlEvent?.Invoke(DirectionEnum.Enable);
}
- this.ControlEvent?.Invoke(direction);
}
/// <summary>
@@ -213,12 +216,13 @@
private void DirectionDownClickEvent(DirectionEnum direction)
{
//濡傛灉涓嶄娇鐢ㄧ壒鏁堢殑璇�
- if (this.CanClick == false || this.CanDirection == false || this.UseClickStau == true)
+ if (this.CanClick == false || this.CanDirection == false || this.NotRecoverControlEvent == null)
{
return;
}
//鍒囨崲鍥剧墖
this.SetDirectionImage(direction);
+ this.NotRecoverControlEvent?.Invoke(direction);
}
#endregion
@@ -237,7 +241,7 @@
this.CanClick = true;
//濡傛灉涓嶄娇鐢ㄧ壒鏁堢殑璇�
- if (this.UseClickStau == false)
+ if (this.NotRecoverControlEvent != null)
{
return;
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs
index 46a6942..8f55da9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaFanPage.cs
@@ -78,6 +78,8 @@
seekBarContr.MinValue = 1;
seekBarContr.MaxValue = 15;
FrameWhiteCentet1.AddChidren(seekBarContr);
+ seekBarContr.Progress = this.fanData.SpeedLevel;
+ this.btnNowGear.Text = this.fanData.SpeedLevel + Language.StringByID(StringId.Gear);
//寮�鍏冲浘鏍�
this.btnSwitch = new IconViewControl(40);
@@ -94,14 +96,10 @@
//鍒锋柊鐣岄潰鐘舵��
this.RefreshFormStatu(false);
-
- int oldProgressValue = fanData.SpeedLevel;
- int nowProgressValue = fanData.SpeedLevel;
//妗�
var strView = Language.StringByID(StringId.Gear);
seekBarContr.ProgressChangedEvent += (div, value) =>
{
- nowProgressValue = value;
this.btnNowGear.Text = value + strView;
//婊戝姩涓�
if (div == 0) { this.fanData.IsProgressing = true; }
@@ -110,28 +108,10 @@
{
this.fanData.IsProgressing = false;
this.fanData.ProgressEndTime = DateTime.Now;
+ //鍙戦�侀閫熷懡浠�
+ this.SendSpeedComand(value);
}
};
-
- HdlThreadLogic.Current.RunThread(() =>
- {
- while (this.Parent != null)
- {
- if (nowProgressValue != oldProgressValue)
- {
- //鍙戦�侀閫熷懡浠�
- this.SendSpeedComand(nowProgressValue);
- oldProgressValue = nowProgressValue;
- }
- System.Threading.Thread.Sleep(1000);
- }
- //鐣岄潰鍏抽棴鏃�
- if (nowProgressValue != oldProgressValue)
- {
- //鍙戦�侀閫熷懡浠�
- this.SendSpeedComand(nowProgressValue);
- }
- });
}
#endregion
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotConsumablesMagPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotConsumablesMagPage.cs
new file mode 100755
index 0000000..3d4d4c0
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotConsumablesMagPage.cs
@@ -0,0 +1,123 @@
+锘縰sing Shared;
+using HDL_ON.Stan;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HDL_ON.Entity;
+using HDL_ON.DriverLayer;
+
+namespace HDL_ON.UI
+{
+ /// <summary>
+ /// 娑傞甫鎵湴鏈哄櫒浜鸿�楁潗绠$悊鐣岄潰
+ /// </summary>
+ public class TuyaWeepRobotConsumablesMagPage: EditorCommonForm
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_device">璁惧瀵硅薄</param>
+ /// <param name="robotData">鎵湴鏈哄櫒浜烘暟鎹�</param>
+ public void ShowForm(Function i_device, TuyaWeepRobotPage.WeepRobotData robotData)
+ {
+ base.SetTitleText(Language.StringByID(StringId.ConsumablesManagement));
+
+ //杈瑰埛
+ this.InitBrushControl(i_device, robotData.EdgeBrush, robotData.ResetEdgeBrush,
+ Language.StringByID(StringId.RemainingLifeOfSideBrush),
+ Language.StringByID(StringId.ResetSideBrush),
+ Language.StringByID(StringId.ResetSideBrushMsg), "reset_edge_brush");
+
+ //婊氬埛
+ this.InitBrushControl(i_device, robotData.RollBrush, robotData.ResetRollBrush,
+ Language.StringByID(StringId.RemainingLifeOfRollerBrush),
+ Language.StringByID(StringId.ResetRollerBrush),
+ Language.StringByID(StringId.ResetRollerBrushMsg), "reset_roll_brush");
+
+ //婊ょ綉
+ this.InitBrushControl(i_device, robotData.Filter, robotData.ResetFilter,
+ Language.StringByID(StringId.RemainingLifeOfFilterScreen),
+ Language.StringByID(StringId.ResetFilterScreen),
+ Language.StringByID(StringId.ResetFilterScreenMsg), "reset_filter");
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栬竟鍒锋帶浠�
+ /// </summary>
+ /// <param name="i_device">璁惧瀵硅薄</param>
+ /// <param name="i_brushValue">杈瑰埛瀵垮懡</param>
+ /// <param name="i_brushStatu">杈瑰埛鐘舵��</param>
+ private void InitBrushControl(Function i_device, int i_brushValue, bool i_brushStatu, string i_brushText,
+ string i_resetText, string i_resetMsg, string i_comand)
+ {
+ var myView = bodyFrameLayout.GetChildren(bodyFrameLayout.ChildrenCount - 1);
+ var frameBack = new NormalFrameLayout();
+ frameBack.Y = myView == null ? Application.GetRealHeight(12) : myView.Bottom + Application.GetRealHeight(12);
+ frameBack.Width = Application.GetRealWidth(343);
+ frameBack.Height = Application.GetRealHeight(100);
+ frameBack.Radius = (uint)Application.GetRealWidth(12);
+ frameBack.BackgroundColor = CSS.CSS_Color.MainBackgroundColor;
+ frameBack.Gravity = Gravity.CenterHorizontal;
+ bodyFrameLayout.AddChidren(frameBack);
+
+ var row1 = new FrameRowControl();
+ row1.Height = Application.GetRealHeight(50);
+ row1.Width = Application.GetRealWidth(343);
+ frameBack.AddChidren(row1);
+ //杈瑰埛鍓╀綑瀵垮懡
+ var btnbrushText = row1.AddLeftCaption(i_brushText, 200);
+ btnbrushText.TextColor = CSS.CSS_Color.FirstLevelTitleColor;
+ //瀵垮懡鍊�
+ row1.AddMostRightView(i_brushValue + "%", 80);
+ row1.AddBottomLine();
+
+ var row2 = new FrameRowControl();
+ row2.Y = row1.Bottom;
+ row2.Height = Application.GetRealHeight(50);
+ row2.Width = Application.GetRealWidth(343);
+ frameBack.AddChidren(row2);
+ //閲嶇疆杈瑰埛
+ var btnResetText = row2.AddLeftCaption(i_resetText, 200);
+ btnResetText.TextColor = CSS.CSS_Color.FirstLevelTitleColor;
+ //寮�鍏�
+ var btnSwitch = row2.AddMostRightSwitchIcon();
+ btnSwitch.IsSelected = i_brushStatu;
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ if (btnSwitch.IsSelected == true)
+ {
+ //鍙栨秷鐨勮瘽鐩存帴鍙栨秷
+ btnSwitch.CanClick = false;
+ btnSwitch.IsSelected = !btnSwitch.IsSelected;
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ var dic = new Dictionary<string, string>();
+ dic.Add(i_comand, "false");
+ Control.Ins.SendWriteCommand(i_device, dic, true);
+ btnSwitch.CanClick = true;
+
+ }, ShowErrorMode.NO);
+ }
+ else
+ {
+ //寮�鍚渶瑕佺‘璁�
+ this.ShowMassage(ShowMsgType.Confirm, i_resetMsg, () =>
+ {
+ btnSwitch.IsSelected = !btnSwitch.IsSelected;
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ var dic = new Dictionary<string, string>();
+ dic.Add(i_comand, "true");
+ Control.Ins.SendWriteCommand(i_device, dic, true);
+ }, ShowErrorMode.NO);
+ });
+ }
+ };
+ }
+
+ #endregion
+ }
+}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotHistoryPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotHistoryPage.cs
new file mode 100755
index 0000000..865a154
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotHistoryPage.cs
@@ -0,0 +1,50 @@
+锘縰sing Shared;
+using HDL_ON.Stan;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HDL_ON.UI
+{
+ /// <summary>
+ /// 娑傞甫鎵湴鏈哄櫒浜哄巻鍙茶褰�
+ /// </summary>
+ public class TuyaWeepRobotHistoryPage : EditorCommonForm
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="robotData">鎵湴鏈哄櫒浜烘暟鎹�</param>
+ public void ShowForm(TuyaWeepRobotPage.WeepRobotData robotData)
+ {
+ base.SetTitleText(Language.StringByID(StringId.HistoryLog));
+
+ var frameBack = new NormalFrameLayout();
+ frameBack.BackgroundColor = CSS.CSS_Color.MainBackgroundColor;
+ frameBack.Height = Application.GetRealHeight(50) * 2;
+ bodyFrameLayout.AddChidren(frameBack);
+
+ //鎬绘竻娲侀潰绉�
+ var rowArea = new FrameRowControl();
+ rowArea.Height = Application.GetRealHeight(50);
+ frameBack.AddChidren(rowArea);
+ var btnCaption = rowArea.AddLeftCaption(Language.StringByID(StringId.TotalCleanArea), 200);
+ btnCaption.TextColor = CSS.CSS_Color.FirstLevelTitleColor;
+ rowArea.AddMostRightView(robotData.CleanArea + "m虏", 100);
+ rowArea.AddBottomLine();
+
+ //鎬绘竻娲佹椂闂�
+ var rowTime = new FrameRowControl();
+ rowTime.Height = Application.GetRealHeight(50);
+ rowTime.Y = rowArea.Bottom;
+ frameBack.AddChidren(rowTime);
+ btnCaption = rowTime.AddLeftCaption(Language.StringByID(StringId.TotalCleaningTime), 200);
+ btnCaption.TextColor = CSS.CSS_Color.FirstLevelTitleColor;
+ rowTime.AddMostRightView((robotData.CleanTime / 60) + "min", 100);
+ }
+
+ #endregion
+ }
+}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs
index 4ebf58c..323e8fd 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaWeepRobotPage.cs
@@ -17,13 +17,9 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
- /// 鐢垫睜鍥炬爣
+ /// 鐢垫睜鎺т欢
/// </summary>
- private IconViewControl btnBatteryIcon = null;
- /// <summary>
- /// 鐢垫睜鐧惧垎姣旀帶浠�
- /// </summary>
- private NormalViewControl btnBatteryView = null;
+ private BatteryPersentControl btnBattery = null;
/// <summary>
/// 鍚稿姏璋冭妭鍥炬爣
/// </summary>
@@ -60,6 +56,14 @@
/// 鎵湴鏈哄櫒浜烘暟鎹�
/// </summary>
private WeepRobotData weepRobotData = new WeepRobotData();
+ /// <summary>
+ /// 鏄惁鍦ㄦ帶鍒舵柟鍚戜腑
+ /// </summary>
+ private bool directionControling = false;
+ /// <summary>
+ /// 鏂瑰悜鎺у埗缁撴潫鏃堕棿
+ /// </summary>
+ private DateTime directionFinishTime = DateTime.Now.AddDays(-1);
#endregion
@@ -90,25 +94,16 @@
/// </summary>
private void InitFrameWhiteContent1()
{
- //鐢垫睜鍥炬爣
- this.btnBatteryIcon = new IconViewControl(24);
- btnBatteryIcon.X = base.btnRoomName.Right + Application.GetRealWidth(24);
- btnBatteryIcon.Y = base.btnRoomName.Y - (btnBatteryIcon.IconSize - base.btnRoomName.Height) / 2;
- btnBatteryIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Battery.png";
- FrameWhiteCentet1.AddChidren(btnBatteryIcon);
- //鐢垫睜鐧惧垎姣�
- this.btnBatteryView = new NormalViewControl(30, 16, true);
- btnBatteryView.X = btnBatteryIcon.Right + Application.GetRealWidth(4);
- btnBatteryView.Y = btnBatteryIcon.Y + (btnBatteryIcon.Height - Application.GetRealHeight(16)) / 2;
- btnBatteryView.Text = this.weepRobotData.ElectricityLeft + "%";
- btnBatteryView.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel;
- btnBatteryView.TextColor = CSS_Color.PromptingColor1;
- FrameWhiteCentet1.AddChidren(btnBatteryView);
+ //鐢垫睜鎺т欢
+ this.btnBattery = new BatteryPersentControl();
+ btnBattery.X = base.btnRoomName.Right + Application.GetRealWidth(24);
+ FrameWhiteCentet1.AddChidren(btnBattery);
+ btnBattery.Y = base.btnRoomName.Y - (btnBattery.Height - base.btnRoomName.Height) / 2;
+ btnBattery.InitControl();
//閰嶇疆鍙樻洿浜嬩欢
base.SettionFinishEvent += () =>
{
- btnBatteryIcon.X = base.btnRoomName.Right + Application.GetRealWidth(24);
- btnBatteryView.X = btnBatteryIcon.Right + Application.GetRealWidth(4);
+ btnBattery.X = base.btnRoomName.Right + Application.GetRealWidth(24);
};
//鍒濆鍖栦腑闂寸殑閭d釜鍥惧儚鎺у埗鎺т欢
@@ -122,10 +117,11 @@
ImageControl.InitControl("FunctionIcon/Electrical/WeepRobot/ControlEnable.png", "FunctionIcon/Electrical/WeepRobot/ControlDisable.png",
"FunctionIcon/Electrical/WeepRobot/ControlUp.png", "FunctionIcon/Electrical/WeepRobot/ControlDown.png",
"FunctionIcon/Electrical/WeepRobot/ControlLeft.png", "FunctionIcon/Electrical/WeepRobot/ControlRight.png");
- //鎺у埗浜嬩欢(涓嶆敮鎸丒nable鍜孌isable,閮藉綊涓篗id)
- ImageControl.ControlEvent += (select) =>
+ //鎺у埗浜嬩欢(鍙湁enable,Mid,left,right,up,down銆� enable:鎵嬫寚鏉惧紑鏂瑰悜閿悗瑙﹀彂)
+ ImageControl.NotRecoverControlEvent += (select) =>
{
-
+ //鍙戦�佹帶鍒舵柟鍚戝懡浠�
+ this.SendDirectionControlComand(select);
};
//鍚稿姏璋冭妭
@@ -137,6 +133,8 @@
FrameWhiteCentet1.AddChidren(btnSuctionIcon);
btnSuctionIcon.ButtonClickEvent += (sender, e) =>
{
+ //鏄剧ず鍚稿姏璋冭妭閫夋嫨鐣岄潰
+ this.ShowSuctionSelectView();
};
this.btnSuctionView = new NormalViewControl(80, 54, true);
btnSuctionView.Y = btnSuctionIcon.Bottom + Application.GetRealHeight(10);
@@ -149,13 +147,14 @@
//鍏呯數鍥炬爣
this.btnChargeIcon = new IconViewControl(28);
- btnChargeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Charge.png";
- btnChargeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/ChargeSelect.png";
+ btnChargeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/ChargeSelect.png";
btnChargeIcon.Y = btnSuctionIcon.Y;
btnChargeIcon.X = btnSuctionIcon.Right + Application.GetRealWidth(50);
FrameWhiteCentet1.AddChidren(btnChargeIcon);
btnChargeIcon.ButtonClickEvent += (sender, e) =>
{
+ //鍙戦�佸厖鐢靛懡浠�
+ this.SendComand("mode", "chargego");
};
var btnChargeView = new NormalViewControl(80, 18, true);
btnChargeView.Y = btnSuctionView.Y;
@@ -174,6 +173,8 @@
FrameWhiteCentet1.AddChidren(btnVoiceIcon);
btnVoiceIcon.ButtonClickEvent += (sender, e) =>
{
+ //鍙戦�侀潤闊冲懡浠�
+ this.SendComand("voice_switch", this.weepRobotData.VoiceSwitch == true ? "false" : "true");
};
this.btnVoiceView = new NormalViewControl(80, 18, true);
btnVoiceView.Y = btnSuctionView.Y;
@@ -191,6 +192,8 @@
FrameWhiteCentet1.AddChidren(btnModeIcon);
btnModeIcon.ButtonClickEvent += (sender, e) =>
{
+ //鏄剧ず娓呮壂妯″紡閫夋嫨
+ this.ShowCleanModeSelectView();
};
this.btnModeView = new NormalViewControl(80, 54, true);
btnModeView.Y = btnSuctionView.Y;
@@ -227,6 +230,8 @@
rowManment.AddRightArrow();
rowManment.ButtonClickEvent += (sender, e) =>
{
+ var form = new TuyaWeepRobotConsumablesMagPage();
+ form.AddForm(this.device, this.weepRobotData);
};
//鍘嗗彶璁板綍
@@ -240,7 +245,130 @@
rowHistory.AddRightArrow();
rowHistory.ButtonClickEvent += (sender, e) =>
{
+ var form = new TuyaWeepRobotHistoryPage();
+ form.AddForm(this.weepRobotData);
};
+ }
+
+ #endregion
+
+ #region 鈻� 鍚稿姏璋冭妭閫夋嫨_______________________
+
+ /// <summary>
+ /// 鏄剧ず鍚稿姏璋冭妭閫夋嫨鐣岄潰
+ /// </summary>
+ private void ShowSuctionSelectView()
+ {
+ //鏁翠釜鐏拌壊鐣岄潰
+ var frameBack = new Dialog();
+
+ var dialogBody = new NormalFrameLayout();
+ frameBack.AddChidren(dialogBody);
+ dialogBody.ButtonClickEvent = (sender, e) =>
+ {
+ frameBack.Close();
+ };
+ frameBack.Show();
+
+ //鑿滃崟鎺т欢(鍚稿姏璋冭妭)
+ var menuContr = new DialogTitleMenuControl(3, Language.StringByID(StringId.SuctionAdjustment));
+ menuContr.X = Application.GetRealWidth(5);
+ menuContr.Y = Application.GetRealHeight(241);
+ menuContr.Width = Application.GetRealWidth(160);
+ menuContr.Height = Application.GetRealHeight(200);
+ dialogBody.AddChidren(menuContr);
+
+ //鍚稿姏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", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佸惛鍔涘懡浠�
+ this.SendComand("suction", "quiet");
+ });
+
+ //鍚稿姏2妗�
+ iconPath = this.weepRobotData.Suction == "normal" ? "FunctionIcon/Electrical/WeepRobot/SuctionSelect.png" : "FunctionIcon/Electrical/WeepRobot/Suction.png";
+ menuContr.AddRowMenu(Language.StringByID(StringId.SuctionTwoGear), iconPath, this.weepRobotData.Suction == "normal", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佸惛鍔涘懡浠�
+ this.SendComand("suction", "normal");
+ });
+
+ //鍚稿姏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", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佸惛鍔涘懡浠�
+ this.SendComand("suction", "strong");
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 娓呮壂妯″紡閫夋嫨_______________________
+
+ /// <summary>
+ /// 鏄剧ず娓呮壂妯″紡閫夋嫨鐣岄潰
+ /// </summary>
+ private void ShowCleanModeSelectView()
+ {
+ //鏁翠釜鐏拌壊鐣岄潰
+ var frameBack = new Dialog();
+
+ var dialogBody = new NormalFrameLayout();
+ frameBack.AddChidren(dialogBody);
+ dialogBody.ButtonClickEvent = (sender, e) =>
+ {
+ frameBack.Close();
+ };
+ frameBack.Show();
+
+ //鑿滃崟鎺т欢(娓呮壂妯″紡)
+ var menuContr = new DialogTitleMenuControl(4, Language.StringByID(StringId.CleanMode));
+ menuContr.X = Application.GetRealWidth(210);
+ menuContr.Y = Application.GetRealHeight(197);
+ menuContr.Width = Application.GetRealWidth(160);
+ menuContr.Height = Application.GetRealHeight(243);
+ 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", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佹ā寮忓懡浠�
+ this.SendComand("mode", "smart");
+ });
+
+ //鍖哄煙娓呮壂
+ 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", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佹ā寮忓懡浠�
+ this.SendComand("mode", "spiral");
+ });
+
+ //娌垮娓呮壂
+ iconPath = this.weepRobotData.Mode == "wall_follow" ? "FunctionIcon/Electrical/WeepRobot/WallModeSelect.png" : "FunctionIcon/Electrical/WeepRobot/WallMode.png";
+ menuContr.AddRowMenu(Language.StringByID(StringId.WallClean), iconPath, this.weepRobotData.Mode == "wall_follow", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佹ā寮忓懡浠�
+ this.SendComand("mode", "wall_follow");
+ });
}
#endregion
@@ -267,23 +395,60 @@
#region 鈻� 鍙戦�佸悇绉嶅懡浠______________________
/// <summary>
- /// 鍙戦�佸紑鍏冲懡浠�
+ /// 鍙戦�佹帶鍒舵柟鍚戝懡浠�
/// </summary>
- private void SendSwitchComand()
+ /// <param name="direction">鍙湁enable,Mid,left,right,up,down銆� enable:鎵嬫寚鏉惧紑鏂瑰悜閿悗瑙﹀彂</param>
+ private void SendDirectionControlComand(DirectionEnum direction)
{
- //this.btnSwitch.CanClick = false;
+ if (direction == DirectionEnum.Mid)
+ {
+ //鍙戦�佸紑鍏冲懡浠�
+ this.SendComand(FunctionAttributeKey.OnOff, this.weepRobotData.Cleaning == true ? "off" : "on");
+ }
+ else if (direction == DirectionEnum.Enable)
+ {
+ //鍋�
+ this.directionControling = false;
+ this.directionFinishTime = DateTime.Now;
+ this.SendComand("direction_control", "stop");
+ }
+ else if (direction == DirectionEnum.Left)
+ {
+ //宸�
+ this.directionControling = true;
+ this.SendComand("direction_control", "turn_left");
+ }
+ else if (direction == DirectionEnum.Right)
+ {
+ //鍙�
+ this.directionControling = true;
+ this.SendComand("direction_control", "turn_right");
+ }
+ else if (direction == DirectionEnum.Up)
+ {
+ //涓�
+ this.directionControling = true;
+ this.SendComand("direction_control", "forward");
+ }
+ else if (direction == DirectionEnum.Down)
+ {
+ //涓�
+ this.directionControling = true;
+ this.SendComand("direction_control", "backward");
+ }
+ }
- //string statu = this.btnSwitch.IsSelected == true ? "off" : "on";
- //HdlThreadLogic.Current.RunThread(() =>
- //{
- // var dic = new Dictionary<string, string>();
- // dic.Add(FunctionAttributeKey.OnOff, statu);
- // Control.Ins.SendWriteCommand(this.device, dic, true);
- // HdlThreadLogic.Current.RunMain(() =>
- // {
- // this.btnSwitch.CanClick = true;
- // });
- //});
+ /// <summary>
+ /// 鍙戦�佸懡浠�
+ /// </summary>
+ private void SendComand(string key, string i_value)
+ {
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ var dic = new Dictionary<string, string>();
+ dic.Add(key, i_value);
+ Control.Ins.SendWriteCommand(this.device, dic, true);
+ }, ShowErrorMode.NO);
}
#endregion
@@ -299,21 +464,91 @@
if (this.weepRobotData.VoiceSwitch == true)
{
//闇�瑕佸垏鎹㈠浘鏍�
- if (this.btnVoiceIcon.UnSelectedImagePath != "FunctionIcon/Electrical/WeepRobot/Mute.png")
- {
- this.btnVoiceIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Mute.png";
- this.btnVoiceIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/MuteSelect.png";
- }
+ this.btnVoiceIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Mute.png";
+ this.btnVoiceIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/MuteSelect.png";
}
else
{
//闇�瑕佸垏鎹㈠浘鏍�
- if (this.btnVoiceIcon.UnSelectedImagePath != "FunctionIcon/Electrical/WeepRobot/Voice.png")
+ this.btnVoiceIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Voice.png";
+ this.btnVoiceIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/VoiceSelect.png";
+ }
+ //濡傛灉鏄竻鎵姸鎬�
+ if (this.weepRobotData.Cleaning == true)
+ {
+ //鍚稿姏璋冭妭涓嶅彲鐢�
+ this.btnSuctionIcon.IsSelected = false;
+ this.btnSuctionIcon.CanClick = false;
+ //澹伴煶涓嶅彲鐢�
+ this.btnVoiceIcon.IsSelected = false;
+ this.btnVoiceIcon.CanClick = false;
+ //娓呮壂妯″紡涓嶅彲鐢�
+ this.btnModeIcon.IsSelected = false;
+ this.btnModeIcon.CanClick = false;
+ //鏂瑰悜鎸夐敭涓嶅彲鐢�
+ if (this.directionControling == false && (DateTime.Now - this.directionFinishTime).TotalSeconds >= 2)
{
- this.btnVoiceIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Voice.png";
- this.btnVoiceIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/VoiceSelect.png";
+ //鍦ㄦ墜鍔ㄦ帶鍒舵柟鍚戠殑杩囩▼涓�,涓嶅厑璁稿彉鏇村浘鐗�,骞朵笖缁撴潫涔嬪悗,2绉掑唴涓嶆帴鍙椾换浣曞弽棣�
+ this.ImageControl.SetDirectionImage(DirectionEnum.Disable);
}
}
+ else
+ {
+ //鍚稿姏璋冭妭鍙敤
+ this.btnSuctionIcon.IsSelected = true;
+ this.btnSuctionIcon.CanClick = true;
+ //澹伴煶鍙敤
+ this.btnVoiceIcon.IsSelected = true;
+ this.btnVoiceIcon.CanClick = true;
+ //娓呮壂妯″紡鍙敤
+ this.btnModeIcon.IsSelected = true;
+ this.btnModeIcon.CanClick = true;
+ //鍙樻洿鎺у埗鎺т欢鐨勫浘鐗�
+ if (this.directionControling == false && (DateTime.Now - this.directionFinishTime).TotalSeconds >= 2)
+ {
+ //鍦ㄦ墜鍔ㄦ帶鍒舵柟鍚戠殑杩囩▼涓�,涓嶅厑璁稿彉鏇村浘鐗�,骞朵笖缁撴潫涔嬪悗,2绉掑唴涓嶆帴鍙椾换浣曞弽棣�
+ this.ImageControl.SetDirectionImage(DirectionEnum.Enable);
+ }
+ }
+
+ //娓呮壂妯″紡
+ if (this.weepRobotData.Mode == "random")
+ {
+ //鑷姩娓呮壂
+ this.btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/AutoMode.png";
+ 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;
+ }
+ else if (this.weepRobotData.Mode == "wall_follow")
+ {
+ //娌垮娓呮壂
+ this.btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/WallMode.png";
+ this.btnModeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/WallModeSelect.png";
+ this.btnModeView.TextID = StringId.WallClean;
+ }
+ 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;
+ }
+ else
+ {
+ //娓呮壂妯″紡
+ this.btnModeIcon.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Clean.png";
+ this.btnModeIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/CleanSelect.png";
+ this.btnModeView.TextID = StringId.CleanMode;
+ }
+ //鐢垫睜鐢甸噺
+ this.btnBattery.SetValue(this.weepRobotData.ElectricityLeft);
}
#endregion
@@ -328,7 +563,7 @@
foreach (var data in i_LocalDevice.attributes)
{
//寮�鍏�
- if (data.key == "on_off") { this.weepRobotData.Open = data.realValue.ToLower() == "on"; }
+ if (data.key == "on_off") { this.weepRobotData.Cleaning = data.realValue.ToLower() == "on"; }
//瀵绘壘鏈哄櫒
else if (data.key == "seek") { this.weepRobotData.SearchRobot = data.realValue.ToLower() == "true"; }
//杈瑰埛閲嶇疆
@@ -411,12 +646,12 @@
/// <summary>
/// 鎵湴鏈哄櫒浜虹殑鏁版嵁
/// </summary>
- private class WeepRobotData
+ public class WeepRobotData
{
/// <summary>
- /// 鏄惁鎵撳紑
+ /// 鏄惁澶勪簬娓呮壂涓�
/// </summary>
- public bool Open = true;
+ public bool Cleaning = true;
/// <summary>
/// 瀵绘壘鏈哄櫒
/// </summary>
--
Gitblit v1.8.0