| | |
| | | //吸力调节
|
| | | 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);
|
| | |
| | | };
|
| | | 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);
|
| | |
| | | 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) =>
|
| | | {
|
| | |
| | | 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.UnSelectedImagePath = "FunctionIcon/Electrical/WeepRobot/Voice.png";
|
| | | btnVoiceIcon.SelectedImagePath = "FunctionIcon/Electrical/WeepRobot/VoiceSelect.png";
|
| | | btnVoiceIcon.IsSelected = true;
|
| | | FrameWhiteCentet1.AddChidren(btnVoiceIcon);
|
| | | //FrameWhiteCentet1.AddChidren(btnVoiceIcon);
|
| | | btnVoiceIcon.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //发送静音命令
|
| | |
| | | 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) =>
|
| | |
| | | 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();
|
| | |
| | | };
|
| | | 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);
|
| | |
|
| | | //自动清扫
|
| | |
| | | });
|
| | |
|
| | | //随机清扫
|
| | | 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 == "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";
|
| | |
| | | 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.RandomClean;
|
| | | }
|
| | | //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")
|
| | | {
|
| | | //沿墙清扫
|
| | |
| | | /// </summary>
|
| | | private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
|
| | | {
|
| | | for (int i = 0; i < i_LocalDevice.status.Count; i++)
|
| | | for (int i = 0; i < i_LocalDevice.attributes.Count; i++)
|
| | | {
|
| | | var data = i_LocalDevice.status[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);
|
| | |
| | | //滚刷寿命
|
| | | else if (data.key == "roll_brush")
|
| | | {
|
| | | var value = data.value;
|
| | | var value = data.state;
|
| | | if (value != string.Empty)
|
| | | {
|
| | | this.weepRobotData.RollBrush = Convert.ToInt32(value);
|
| | |
| | | //滤网寿命
|
| | | else if (data.key == "filter")
|
| | | {
|
| | | var value = data.value;
|
| | | var value = data.state;
|
| | | if (value != string.Empty)
|
| | | {
|
| | | this.weepRobotData.Filter = Convert.ToInt32(value);
|
| | |
| | | //清扫时间
|
| | | else if (data.key == "clean_time")
|
| | | {
|
| | | var value = data.value;
|
| | | var value = data.state;
|
| | | if (value != string.Empty)
|
| | | {
|
| | | this.weepRobotData.CleanTime = Convert.ToInt32(value);
|
| | |
| | | //剩余电量
|
| | | else if (data.key == "electricity_left")
|
| | | {
|
| | | var value = data.value;
|
| | | var value = data.state;
|
| | | if (value != string.Empty)
|
| | | {
|
| | | this.weepRobotData.ElectricityLeft = Convert.ToInt32(value);
|