JLChen
2021-03-10 f9de7b8e7a567d71e336965117dd9ceb22be07c0
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>