| | |
| | | /// </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);
|