DLL/Android/Shared.Droid.JLCountryCode.dllold mode 100755 new mode 100644 Binary files differ
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/airFreshjinmao_blue.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/airFreshjinmao_white.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/airFreshjinmao.png
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -699,46 +699,60 @@ case SPK.AirFreshJinmao: //1 新风编号 1~200 //2 类型 第三方类型 0:金茂新风 //3 开关 0 - 关机,1 - 开机 byte switchValue = 0; if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff) == true && commandDictionary[FunctionAttributeKey.OnOff] == "on") { switchValue = 1; } //4 运行模式 1 - 通风,2 - 加湿 byte airFreshMode = 1; if (function.GetAttrState(FunctionAttributeKey.Mode) == "fan") if (commandDictionary.ContainsKey(FunctionAttributeKey.Mode) == true && commandDictionary[FunctionAttributeKey.Mode] == "fan") { airFreshMode = 2; } //5 节能舒适选择 1 - 舒适,2 - 节能 byte airFreshEnergy = 1; if( function.GetAttrState(FunctionAttributeKey.Energy)=="true") if (commandDictionary.ContainsKey(FunctionAttributeKey.Energy) == true && commandDictionary[FunctionAttributeKey.Energy] == "true") { airFreshEnergy = 2; } //6 风速档位 0 - 自动,1 - 1档,2 - 2档,3 - 3档 byte airFreshFan = 0; switch(function.GetAttrState(FunctionAttributeKey.FanSpeed)) if (commandDictionary.ContainsKey(FunctionAttributeKey.FanSpeed) == true) { case "auto": airFreshFan = 0; break; case "level_1": airFreshFan = 1; break; case "level_2": airFreshFan = 2; break; case "level_3": airFreshFan = 3; break; switch (commandDictionary[FunctionAttributeKey.FanSpeed]) { case "auto": airFreshFan = 0; break; case "level_1": airFreshFan = 1; break; case "level_2": airFreshFan = 2; break; case "level_3": airFreshFan = 3; break; } } //7 湿度设定 % //8 室内温度值 ℃ //9 室内湿度值 ℃ //10 过滤网剩余 % //11 过滤网使用超时 1 超时 0 无 ControlBytesSend(Command.FreshAirControl_JinMao, subnetId, deviceId, new byte[] { function.bus.LoopId,0, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0 , function.bus.LoopId,0, switchValue , airFreshMode,airFreshEnergy, airFreshFan, Convert.ToByte( function.GetAttrState(FunctionAttributeKey.Humidity)), Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Humidity)), 0,0,0,0 //Convert.ToByte( function.GetAttrState(FunctionAttributeKey.IndoorTemp)), //Convert.ToByte( function.GetAttrState(FunctionAttributeKey.IndoorHumidity)), HDL_ON/DAL/DriverLayer/Packet.cs
@@ -97,7 +97,7 @@ { ddd += bb + ","; } MainPage.Log(ddd); MainPage.Log(((int)command) + " : " + ddd); #endif //处理是否要重发数据 ManagerReceive(subnetID, deviceID, command, usefulBytes); @@ -666,8 +666,8 @@ /// 10 过滤网剩余 % /// 11 过滤网使用超时 1 超时 0 无 true/false airFresh.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[2] == 0 ? "off" : "on"); airFresh.SetAttrState(FunctionAttributeKey.Mode, receiveBytes[3] == 1 ? "humidification" : "fan"); airFresh.SetAttrState(FunctionAttributeKey.Energy, receiveBytes[4] == 1 ? "true" : "false"); airFresh.SetAttrState(FunctionAttributeKey.Mode, receiveBytes[3] == 1 ? "fan" : "humidification"); airFresh.SetAttrState(FunctionAttributeKey.Energy, receiveBytes[4] == 1 ? "false" : "true"); switch (receiveBytes[5]) { case 0: @@ -688,6 +688,8 @@ airFresh.SetAttrState(FunctionAttributeKey.IndoorHumidity, receiveBytes[8].ToString()); airFresh.SetAttrState(FunctionAttributeKey.FilterRemain, receiveBytes[9].ToString()); airFresh.SetAttrState(FunctionAttributeKey.FilterTimeout, receiveBytes[10] == 1 ? "true" : "false"); //设备状态推送 Stan.HdlFormLogic.Current.DeviceStatuPush(airFresh, true); } break; } HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -142,6 +142,10 @@ case SPK.IrLearn: var irLearinPage = new IrLearnPage(); irLearinPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); break; case SPK.AirFreshJinmao: var airFresh1 = new AirFreshControlPage(); airFresh1.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); break; } }; HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs
@@ -44,28 +44,8 @@ if (localDevice != null) { foreach (var attr in updateData) { //var localAttr2 = localDevice.attributes.Find((obj) => obj.key == attr.key); //if (localAttr2 == null) //{ // //本身它就没有这个属性,则不处理 // continue; //} ////更改属性值 //localAttr2.curValue = attr.value; //var localAttr = localDevice.status.Find((obj) => obj.key == attr.key); //if (localAttr == null) //{ // //status是当前设备上报过的属性才会存在,也就是它的个数有可能和attributes不一致 // localAttr = new AttributesStatus() { key = attr.key, value = attr.value }; // localDevice.status.Add(localAttr); //} ////更改属性值 //localAttr.value = attr.value; localDevice.SetAttrState(attr.key, attr.value); { localDevice.SetAttrState(attr.key, attr.value); } //全部界面推送 HdlFormLogic.Current.DeviceStatuPush(localDevice); HDL_ON/UI/UI0-Stan/Logic/HdlFormLogic.cs
@@ -147,7 +147,8 @@ /// 设备状态更新推送 /// </summary> /// <param name="i_LocalDevice">本地设备对象</param> public void DeviceStatuPush(Entity.Function i_LocalDevice) /// <param name="refreshCardContr">是否刷新主页,分类,房间等等的设备卡片的状态,默认不刷新(此变量目前是给bus接收那里使用的)</param> public void DeviceStatuPush(Entity.Function i_LocalDevice, bool refreshCardContr = false) { HdlThreadLogic.Current.RunMain(() => { @@ -155,11 +156,37 @@ { this.ListActionForm[i]?.DeviceStatuPush(i_LocalDevice); } if (refreshCardContr == true) { //刷新主页,分类,房间等等的设备卡片状态 this.RefreshAllDeviceCardControl(i_LocalDevice); } }, ShowErrorMode.NO); } #endregion #region ■ 手动刷新各设备卡片_________________ /// <summary> /// 手动刷新主页,分类,房间等等的设备卡片状态 /// </summary> /// <param name="i_device">需要刷新的设备对象</param> public void RefreshAllDeviceCardControl(Entity.Function i_device) { //刷新主页 UI.HomePage.UpdataFunctionStates(i_device); //刷新分类 UI.ClassificationPage.UpdataInfo(i_device); //刷新房间 UI.RoomPage.UpdataStates(i_device); //刷新功能 UI.FunctionPage.UpdataStates(i_device); } #endregion #region ■ 一般方法___________________________ /// <summary> HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
@@ -59,6 +59,7 @@ case FunctionCategory.AC: case FunctionCategory.FloorHeat: case FunctionCategory.Electric: case FunctionCategory.AirFresh: #region 按钮状态更新 if (cTag == updataFunction.sid + "_Switch") { HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -51,6 +51,10 @@ case SPK.ClothesHanger: vv = ShowFunction.Electric; break; case SPK.AirFreshJinmao: case SPK.AirFreshStandard: vv = ShowFunction.FreshAir; break; } UpdataFunctionOnCount(vv, function.spk); UpdataCloseAllButton(function); @@ -118,6 +122,9 @@ case ShowFunction.Electric: btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); break; case ShowFunction.FreshAir: btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); break; } if (btn.Tag.ToString() == functionCategory + "_onCount") { HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -108,6 +108,10 @@ else if (titleId == StringId.Sensor) { functionList.AddRange(FunctionList.List.GetArmSensorList()); } else if (titleId == StringId.FreshAir) { functionList.AddRange(FunctionList.List.GetAirFreshList()); } functionList.OrderByDescending(o => o.controlCounter).ToList(); HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs
@@ -291,7 +291,7 @@ { frameBack.Close(); //发送节能命令 this.SendOtherComand(this.btnMode1, "energy", "true"); this.SendOtherComand(this.btnMode1, FunctionAttributeKey.Energy, "true"); }); //舒适 @@ -300,7 +300,7 @@ { frameBack.Close(); //发送舒适命令 this.SendOtherComand(this.btnMode1, "energy", "false"); this.SendOtherComand(this.btnMode1, FunctionAttributeKey.Energy, "false"); }); } @@ -338,7 +338,7 @@ { frameBack.Close(); //发送通风命令 this.SendOtherComand(this.btnMode2, "mode", "fan"); this.SendOtherComand(this.btnMode2, FunctionAttributeKey.Mode, "fan"); }); //加湿 @@ -347,7 +347,7 @@ { frameBack.Close(); //发送加湿命令 this.SendOtherComand(this.btnMode2, "mode", "humidification"); this.SendOtherComand(this.btnMode2, FunctionAttributeKey.Mode, "humidification"); }); } @@ -385,7 +385,7 @@ { frameBack.Close(); //发送档位命令 this.SendOtherComand(this.btnFan, "fan", "level_1"); this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_1"); }); //2档 @@ -394,7 +394,7 @@ { frameBack.Close(); //发送档位命令 this.SendOtherComand(this.btnFan, "fan", "level_2"); this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_2"); }); //3档 @@ -403,7 +403,7 @@ { frameBack.Close(); //发送档位命令 this.SendOtherComand(this.btnFan, "fan", "level_3"); this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_3"); }); } @@ -532,9 +532,10 @@ HdlThreadLogic.Current.RunThread(() => { var dic = new Dictionary<string, string>(); dic.Add(comadKey, comadValue); Control.Ins.SendWriteCommand(this.device, dic, true); //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) var dic = this.GetSendComandSample(); dic[comadKey] = comadValue; Control.Ins.SendWriteCommand(this.device, dic); HdlThreadLogic.Current.RunMain(() => { btnIcon.CanClick = true; @@ -552,14 +553,34 @@ 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); //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) var dic = this.GetSendComandSample(); dic[FunctionAttributeKey.OnOff] = statu; Control.Ins.SendWriteCommand(this.device, dic); HdlThreadLogic.Current.RunMain(() => { this.btnSwitch.CanClick = true; }); }); } /// <summary> /// 获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) /// </summary> /// <returns></returns> private Dictionary<string, string> GetSendComandSample() { var dic = new Dictionary<string, string>(); //开关 dic[FunctionAttributeKey.OnOff] = this.airFreshData.Open == true ? "on" : "off"; //模式 dic[FunctionAttributeKey.Mode] = this.airFreshData.Mode; //节能 dic[FunctionAttributeKey.Energy] = this.airFreshData.Energy; //风速 dic[FunctionAttributeKey.FanSpeed] = this.airFreshData.Fan ; return dic; } #endregion @@ -575,15 +596,15 @@ { var data = i_LocalDevice.attributes[i]; //开关 if (data.key == "on_off") { this.airFreshData.Open = data.state == "on"; } if (data.key == FunctionAttributeKey.OnOff) { this.airFreshData.Open = data.state == "on"; } //模式 else if (data.key == "mode") { this.airFreshData.Mode = data.state; } else if (data.key == FunctionAttributeKey.Mode) { this.airFreshData.Mode = data.state; } //节能 else if (data.key == "energy") { this.airFreshData.Energy = data.state; } else if (data.key == FunctionAttributeKey.Energy) { this.airFreshData.Energy = data.state; } //风速 else if (data.key == "fan") { this.airFreshData.Fan = data.state; } else if (data.key == FunctionAttributeKey.FanSpeed) { this.airFreshData.Fan = data.state; } //湿度 else if (data.key == "humidity") else if (data.key == FunctionAttributeKey.Humidity) { if (data.state != string.Empty) { @@ -591,7 +612,7 @@ } } //室内温度 else if (data.key == "indoor_temp") else if (data.key == FunctionAttributeKey.IndoorTemp) { if (data.state != string.Empty) { @@ -599,7 +620,7 @@ } } //室内湿度 else if (data.key == "indoor_humidity") else if (data.key == FunctionAttributeKey.IndoorHumidity) { if (data.state != string.Empty) { @@ -607,7 +628,7 @@ } } //过滤网剩余量 else if (data.key == "filter_remain") else if (data.key == FunctionAttributeKey.FilterRemain) { if (data.state != string.Empty) {