黄学彪
2020-12-14 e90209beae6a4e822cecb18e6889f8bda23f630e
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
File was renamed from ZigbeeApp/Shared/Phone/Common/Logic/HdlDevicePanelLogic.cs
@@ -5,7 +5,7 @@
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace Shared.Phone
namespace Shared.Phone.UserCenter
{
    /// <summary>
    /// 干接点的逻辑
@@ -65,7 +65,7 @@
            Panel.KeyNum keyNum = (Panel.KeyNum)panel.DeviceEpoint;
            var result = this.GetPanelColorInfoAsync(panel, keyNum);
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
@@ -93,7 +93,7 @@
            Panel.KeyNum keyNum = (Panel.KeyNum)panel.DeviceEpoint;
            var result = this.GetPanelColorInfoAsync(panel, keyNum);
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
@@ -443,7 +443,7 @@
                //设置亮度调节失败
                string msg = Language.StringByID(R.MyInternationalizationString.uSetLightRegulationFail);
                //拼接上【网关回复超时】的Msg
                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowTipMsg(msg);
                return false;
@@ -550,7 +550,7 @@
            var result = await panel.GetProximitySensorAsync();
            panel = null;
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
@@ -585,7 +585,7 @@
            panel = null;
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
@@ -597,7 +597,7 @@
                //接近传感配置失败
                string msg = Language.StringByID(R.MyInternationalizationString.SetPannelProximityFail);
                //拼接上【网关回复超时】的Msg
                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowTipMsg(msg);
                return false;
@@ -627,7 +627,7 @@
            panel = null;
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
@@ -639,7 +639,7 @@
                //矫正温度失败
                string msg = Language.StringByID(R.MyInternationalizationString.DataCorrectionFailed);
                //拼接上【网关回复超时】的Msg
                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowTipMsg(msg);
                return false;
@@ -678,7 +678,7 @@
                //获取按键面板节能模式信息失败
                string msg = Language.StringByID(R.MyInternationalizationString.uGetPanelEnergyConservationInfoFail);
                //拼接上【网关回复超时】的Msg
                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowErrorMsg(msg);
                return null;
@@ -740,7 +740,7 @@
                //节能模式配置失败
                string msg = Language.StringByID(R.MyInternationalizationString.uSetEnergyConservationFail);
                //拼接上【网关回复超时】的Msg
                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowTipMsg(msg);
                return false;
@@ -863,7 +863,7 @@
            var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(device);
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
@@ -875,7 +875,7 @@
                //获取设备配置信息失败
                string msg = Language.StringByID(R.MyInternationalizationString.uGetDeviceConfigureInfoFail);
                //拼接上【网关回复超时】的Msg
                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowErrorMsg(msg);
                return null;
@@ -918,7 +918,7 @@
        /// <returns></returns>
        public async Task<List<int>> GetDryContactFunction(Panel panel, int level1 = -1, int level2 = -1, bool reLevel3 = false)
        {
            string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(panel);
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(panel);
            if (dicDryContactFunction.ContainsKey(mainkeys) == false)
            {
                //创建对象
@@ -995,7 +995,7 @@
        {
            var result = await panel.GetPanelPrivateFunctionsAsync(parameter);
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
@@ -1007,7 +1007,7 @@
                //获取按键功能类信息失败
                string msg = Language.StringByID(R.MyInternationalizationString.uGetPanelFunctionInfoFail);
                //拼接上【网关回复超时】的Msg
                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowErrorMsg(msg);
                return null;
@@ -1031,7 +1031,7 @@
        {
            var result = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(panel, (Panel.KeyMode)i_value);
            //共通错误检测
            string error = HdlCheckLogic.Current.CheckGatewayErrorCode(result);
            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
            if (error != null)
            {
                this.ShowErrorMsg(error);
@@ -1043,7 +1043,7 @@
                //设备属性变更失败
                string msg = Language.StringByID(R.MyInternationalizationString.uDeviceAttributeChangedFail);
                //拼接上【网关回复超时】的Msg
                msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, result);
                msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, result);
                this.ShowErrorMsg(msg);
                return false;
@@ -1108,7 +1108,7 @@
            {
                //获取震动反馈配置信息失败
                string errorMsg = Language.StringByID(R.MyInternationalizationString.uGetVibrationFeedbackSettionFail);
                errorMsg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(errorMsg, null, "回复超时", false);
                errorMsg = UserCenterLogic.CombineGatewayTimeOutMsg(errorMsg, null, "回复超时", false);
                this.ShowTipMsg(errorMsg);
                return null;
            }
@@ -1140,7 +1140,7 @@
            {
                //设置震动反馈配置信息失败
                string errorMsg = Language.StringByID(R.MyInternationalizationString.uSetVibrationFeedbackSettionFail);
                errorMsg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(errorMsg, null, "回复超时", false);
                errorMsg = UserCenterLogic.CombineGatewayTimeOutMsg(errorMsg, null, "回复超时", false);
                this.ShowTipMsg(errorMsg);
                return false;
            }
@@ -1204,7 +1204,7 @@
        /// <returns></returns>
        private List<int> GetDryContactFunctionFromLocation(Panel panel, int level1 = -1, int level2 = -1)
        {
            string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(panel);
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(panel);
            if (dicDryContactFunction.ContainsKey(mainkeys) == false)
            {
                return null;
@@ -1254,7 +1254,7 @@
        /// <param name="level2"></param>
        private void SetDryContactFunctionToMemory(Panel panel, List<int> listLevel, int level1, int level2)
        {
            string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(panel);
            string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(panel);
            if (dicDryContactFunction.ContainsKey(mainkeys) == false)
            {
                //创建对象
@@ -1300,7 +1300,7 @@
        /// </summary>
        private void SaveDryContactFunctionToLocaltion()
        {
            HdlFileLogic.Current.SaveFileContent(HdlFileNameResourse.DryContactFunctionFile, dicDryContactFunction);
            HdlFileLogic.Current.SaveFileContent(DirNameResourse.DryContactFunctionFile, dicDryContactFunction);
        }
        /// <summary>
@@ -1309,7 +1309,7 @@
        private void LoadDryContactFunctionFromLocaltion()
        {
            this.dicDryContactFunction = new Dictionary<string, DryContactFunctionInfo>();
            byte[] filebyte = HdlFileLogic.Current.ReadFileByteContent(HdlFileNameResourse.DryContactFunctionFile);
            byte[] filebyte = HdlFileLogic.Current.ReadFileByteContent(DirNameResourse.DryContactFunctionFile);
            if (filebyte == null)
            {
                return;