| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | public void onClick(View view) { |
| | | |
| | | String tempStr = tempEditText.getText().toString(); |
| | | if (TextUtils.isEmpty(tempStr) || TextUtils.isEmpty(tempStr)) { |
| | | if (TextUtils.isEmpty(tempStr)) { |
| | | showToast("设置的温度不能为空"); |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | proDialog.show(); |
| | | switch (gModeState) { |
| | | |
| | | case 1: |
| | | //当前地热模式为普通 |
| | | HDLCommand.geothermalCtrl(appliancesInfo, GeothermalParser.gNormalTemp, tempInt);//普通温度 |
| | | ctrlId = GeothermalParser.gNormalTemp; |
| | | break; |
| | | case 2: |
| | | //当前地热模式为白天 |
| | | HDLCommand.geothermalCtrl(appliancesInfo, GeothermalParser.gDayTemp, tempInt);//白天温度 |
| | | ctrlId = GeothermalParser.gDayTemp; |
| | | break; |
| | | case 3: |
| | | //当前地热模式为夜间 |
| | | HDLCommand.geothermalCtrl(appliancesInfo, GeothermalParser.gNightTemp, tempInt);//夜间温度 |
| | | ctrlId = GeothermalParser.gNightTemp; |
| | | break; |
| | | case 4: |
| | | //当前地热模式为离开 |
| | | HDLCommand.geothermalCtrl(appliancesInfo, GeothermalParser.gLeaveTemp, tempInt);//离开温度 |
| | | ctrlId = GeothermalParser.gLeaveTemp; |
| | | break; |
| | | case 5: |
| | | proDialog.dismiss(); |
| | | //当前地热模式为自动 |
| | | showToast("自动模式,不能控制温度"); |
| | | break; |
| | | default: |
| | | proDialog.dismiss(); |
| | | //当前地热模式为自动 |
| | | showToast("未知模式,不能控制温度"); |
| | | break; |
| | | HDLCommand.geothermalCtrlTemp(appliancesInfo, tempInt);//自动根据当前模式设置当前模式的温度。 |
| | | |
| | | } |
| | | // switch (gModeState) { |
| | | // |
| | | // case 1: |
| | | // //当前地热模式为普通 |
| | | // HDLCommand.geothermalCtrl(appliancesInfo, GeothermalParser.gNormalTemp, tempInt);//普通温度 |
| | | // ctrlId = GeothermalParser.gNormalTemp; |
| | | // break; |
| | | // case 2: |
| | | // //当前地热模式为白天 |
| | | // HDLCommand.geothermalCtrl(appliancesInfo, GeothermalParser.gDayTemp, tempInt);//白天温度 |
| | | // ctrlId = GeothermalParser.gDayTemp; |
| | | // break; |
| | | // case 3: |
| | | // //当前地热模式为夜间 |
| | | // HDLCommand.geothermalCtrl(appliancesInfo, GeothermalParser.gNightTemp, tempInt);//夜间温度 |
| | | // ctrlId = GeothermalParser.gNightTemp; |
| | | // break; |
| | | // case 4: |
| | | // //当前地热模式为离开 |
| | | // HDLCommand.geothermalCtrl(appliancesInfo, GeothermalParser.gLeaveTemp, tempInt);//离开温度 |
| | | // ctrlId = GeothermalParser.gLeaveTemp; |
| | | // break; |
| | | // case 5: |
| | | // proDialog.dismiss(); |
| | | // //当前地热模式为自动 |
| | | // showToast("自动模式,不能控制温度"); |
| | | // break; |
| | | // default: |
| | | // proDialog.dismiss(); |
| | | // //当前地热模式为自动 |
| | | // showToast("未知模式,不能控制温度"); |
| | | // break; |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |