| | |
| | | { |
| | | |
| | | } |
| | | Control.controlLostCount = 0; |
| | | |
| | | switch (command) |
| | | { |
| | |
| | | fh.lastState = Language.StringByID(StringId.Auto); |
| | | if(receiveBytes[8]==0) |
| | | { |
| | | }else |
| | | } |
| | | else |
| | | { |
| | | } |
| | | break; |
| | |
| | | } |
| | | } |
| | | break; |
| | | case Command.InstructionPanelKeyACK: |
| | | case Command.ReadInstructionPanelKeyACK: |
| | | byte reACPanel = 0; |
| | | if (receiveBytes.Length == 2) |
| | | { |
| | | reACPanel = 1; |
| | | } |
| | | else if (receiveBytes.Length == 3) |
| | | { |
| | | reACPanel = receiveBytes[2]; |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | foreach (var ac in DB_ResidenceData.residenceData.functionList.aCs) |
| | | { |
| | | if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + reACPanel) |
| | | { |
| | | switch (receiveBytes[0]) |
| | | { |
| | | case 3:// |
| | | ac.on_off = receiveBytes[1] == 1 ? "on" : "off"; |
| | | break; |
| | | case 4: |
| | | case 7: |
| | | case 8: |
| | | case 19: |
| | | ac.curTemp = receiveBytes[1]; |
| | | break; |
| | | case 5: |
| | | ac.curFanIndex = receiveBytes[1]; |
| | | break; |
| | | case 6: |
| | | ac.curModeIndex = receiveBytes[1]; |
| | | break; |
| | | |
| | | } |
| | | ac.lastState = ""; |
| | | ac.lastState += " " + ac.curTemp + ac.curTempTypeString; |
| | | RoomPage.UpdataStates(ac); |
| | | FunctionPage.UpdataStates(ac); |
| | | HomePage.UpdataFunctionStates(ac); |
| | | ClassificationPage.UpdataInfo(ac); |
| | | ACPage.UpdataStates(ac); |
| | | //else if (common.Type == DeviceType.FoolHeatPanel) |
| | | { |
| | | //switch (receiveBytes[0]) |
| | | //{ |
| | | // case 20:// |
| | | // fh.Status = receiveBytes[1]; |
| | | // break; |
| | | // case 21: |
| | | // fh.TemperatureType = receiveBytes[1]; |
| | | // if (receiveBytes[1] == 5) |
| | | // { |
| | | // if (fh.Timer == 0)//时间模式的时间段标志 (0:白天,1:夜晚) (1byte) //20110112加时间段标志 |
| | | // Control.ControlBytesSend(Command.ReadInstructionPanelKey, fh.SubnetID, fh.DeviceID, new byte[] { 26, 2, fh.LoopID }, SendCount.Zero); |
| | | // else |
| | | // Control.ControlBytesSend(Command.ReadInstructionPanelKey, fh.SubnetID, fh.DeviceID, new byte[] { 27, 3, fh.LoopID }, SendCount.Zero); |
| | | // } |
| | | // else |
| | | // Control.ControlBytesSend(Command.ReadInstructionPanelKey, fh.SubnetID, fh.DeviceID, new byte[] { (byte)(receiveBytes[1] + 24), fh.LoopID }, SendCount.Zero); |
| | | // break; |
| | | // case 25: |
| | | // fh.NormalTemperature = receiveBytes[1]; |
| | | // break; |
| | | // case 26: |
| | | // fh.DayTemperature = receiveBytes[1]; |
| | | // break; |
| | | // case 27: |
| | | // fh.NightTemperature = receiveBytes[1]; |
| | | // break; |
| | | // case 28: |
| | | // fh.AwayTemperature = receiveBytes[1]; |
| | | // break; |
| | | //} |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case Command.ReadPanleTempACK://1944 |
| | | case Command.PanleBroadcastTemp: |
| | | foreach (var ac in DB_ResidenceData.residenceData.functionList.aCs) |
| | | { |
| | | if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) |
| | | { |
| | | ac.indoorTemp = receiveBytes[1]; |
| | | FunctionPage.UpdataStates(ac); |
| | | } |
| | | //else if (common.Type == DeviceType.FoolHeatPanel) |
| | | // { |
| | | // var tempFH22 = common as FoolHeatPanel; |
| | | // tempFH22.IndoorTemperature = receiveBytes[1]; |
| | | // UserFHPage.UpdateIndoorTemp(tempFH22.CommonLoopID, receiveBytes[1]); |
| | | // } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | catch (Exception ex) |