| | |
| | | } |
| | | } |
| | | |
| | | |
| | | ///保存设备备注才用gb2312,其他情况用utf8 |
| | | public static Encoding MyEncodingUTF8 = Encoding.UTF8;//Get |
| | | public static Encoding MyEncodingGB2312 |
| | |
| | | { |
| | | case "normal": |
| | | fh.lastState = Language.StringByID(StringId.Normal); |
| | | fh.curTemp = receiveBytes[4]; |
| | | fh.trait_temp.value = receiveBytes[4]; |
| | | break; |
| | | case "day": |
| | | fh.lastState = Language.StringByID(StringId.Day); |
| | | fh.curTemp = receiveBytes[5]; |
| | | fh.trait_temp.value = receiveBytes[5]; |
| | | break; |
| | | case "night": |
| | | fh.lastState = Language.StringByID(StringId.Night); |
| | | fh.curTemp = receiveBytes[6]; |
| | | fh.trait_temp.value = receiveBytes[6]; |
| | | break; |
| | | case "timer": |
| | | fh.lastState = Language.StringByID(StringId.Auto); |
| | | if (receiveBytes[8] == 0) |
| | | { |
| | | fh.timeFlag = 0; |
| | | fh.curTemp = receiveBytes[5]; |
| | | fh.trait_temp.value = receiveBytes[5]; |
| | | } |
| | | else |
| | | { |
| | | fh.timeFlag = 1; |
| | | fh.curTemp = receiveBytes[6]; |
| | | fh.trait_temp.value = receiveBytes[6]; |
| | | } |
| | | break; |
| | | case "away": |
| | | fh.curTemp = receiveBytes[7]; |
| | | fh.trait_temp.value = receiveBytes[7]; |
| | | fh.lastState = Language.StringByID(StringId.Away); |
| | | break; |
| | | } |
| | | fh.lastState += " " + fh.curTemp + fh.tempUnitString; |
| | | fh.lastState += " " + fh.trait_temp.value + fh.tempUnitString; |
| | | RoomPage.UpdataStates(fh); |
| | | FunctionPage.UpdataStates(fh); |
| | | HomePage.UpdataFunctionStates(fh); |
| | |
| | | } |
| | | } |
| | | break; |
| | | case Command.ReadGatewayACK: |
| | | Control.VerGateway(receiveBytes); |
| | | break; |
| | | } |
| | | } |
| | | catch (Exception ex) |