wei
2020-12-24 eb3a71699bcf371db801165e3af65951b1292706
20201224-3
16个文件已修改
446 ■■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/HDLCommon.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Packet.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/DB_ResidenceData.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,48 +1,29 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.94B44E9C-E1BC-4BF7-812E-FC71E9B623B2" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Entity/FunctionList.cs">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL-ON_iOS/Info.plist">
    <Files>
      <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="220" Column="73" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="922" Column="1" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="111" Column="123" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" Line="91" Column="22" />
      <File FileName="HDL_ON/Entity/Function/Function.cs" Line="612" Column="29" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" Line="90" Column="1" />
      <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="621" Column="1" />
      <File FileName="HDL_ON/Entity/Function/Light.cs" Line="206" Column="10" />
      <File FileName="HDL_ON/Entity/FunctionList.cs" Line="197" Column="22" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="330" Column="54" />
      <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="261" Column="55" />
      <File FileName="HDL_ON/DAL/DriverLayer/Packet.cs" Line="81" Column="8" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" Line="599" Column="53" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs" Line="416" Column="79" />
      <File FileName="HDL_ON/Entity/Function/Function.cs" Line="498" Column="41" />
      <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="246" Column="16" />
      <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="147" Column="33" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" Line="549" Column="30" />
      <File FileName="HDL-ON_iOS/Info.plist" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="DriverLayer" expanded="True" />
                <Node name="Mqtt" expanded="True" />
                <Node name="Server" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True">
                <Node name="Function" expanded="True" />
                <Node name="FunctionList.cs" selected="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="2-Classification" expanded="True" />
                  <Node name="3-Intelligence" expanded="True">
                    <Node name="Scene" expanded="True" />
                  </Node>
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="AC" expanded="True" />
                    <Node name="Light" expanded="True" />
                  </Node>
                </Node>
              </Node>
            <Node name="HDL-ON_Android" expanded="True">
              <Node name="Assets" expanded="True" />
            </Node>
            <Node name="HDL-ON_Android" expanded="True" />
            <Node name="HDL-ON_iOS" expanded="True" />
            <Node name="HDL-ON_iOS" expanded="True">
              <Node name="Resources" expanded="True" />
              <Node name="Info.plist" selected="True" />
            </Node>
          </Node>
        </State>
      </Pad>
@@ -64,7 +45,7 @@
    <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
HDL-ON_Android/Assets/Language.ini
@@ -399,6 +399,7 @@
377=全宅区域
378=变化时间
379=变化速度
380=此处功能暂未开放~
400=欢迎回家
401=二维码失效,请重试
402=重试
HDL-ON_iOS/Resources/Language.ini
@@ -399,6 +399,7 @@
377=全宅区域
378=变化时间
379=变化速度
380=此处功能暂未开放~
400=欢迎回家
401=二维码失效,请重试
402=重试
HDL_ON/Common/ApiUtlis.cs
@@ -159,38 +159,36 @@
                        {
                            deviceList = new DevcieApiPack();
                        }
                        {
                            if (FunctionList.List.GetDeviceFunctionList().Count > 0)
                            {
                                for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;)
                            for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;)
                            {
                                var localFunction = FunctionList.List.GetDeviceFunctionList()[i];
                                if (localFunction.functionCategory == FunctionCategory.Music)
                                {
                                    var localFunction = FunctionList.List.GetDeviceFunctionList()[i];
                                    if (localFunction.functionCategory == FunctionCategory.Music)
                                    i++;
                                    continue;
                                }
                                var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
                                if (newFunction == null)//如果云端最新数据没有该条数据,则本地需要删掉该数据记录
                                {
                                    FunctionList.List.DeleteFunction(localFunction);
                                }
                                else
                                {
                                    MainPage.Log($"deviceType:{localFunction.spk} local:{localFunction.modifyTime} server:{newFunction.modifyTime}");
                                    i++;
                                    if (localFunction.modifyTime != newFunction.modifyTime)
                                    {
                                        i++;
                                        continue;
                                        //可优化
                                        localFunction.name = newFunction.name;
                                        localFunction.collect = newFunction.collect;
                                        localFunction.modifyTime = newFunction.modifyTime;
                                        localFunction.roomIds = newFunction.roomIds;
                                        localFunction.bus = newFunction.bus;
                                        localFunction.SaveFunctionFile();
                                    }
                                    var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
                                    if (newFunction == null)//如果云端最新数据没有该条数据,则本地需要删掉该数据记录
                                    {
                                        FunctionList.List.DeleteFunction(localFunction);
                                    }
                                    else
                                    {
                                        MainPage.Log($"deviceType:{localFunction.spk} local:{localFunction.modifyTime} server:{newFunction.modifyTime}");
                                        i++;
                                        if (localFunction.modifyTime != newFunction.modifyTime)
                                        {
                                            //可优化
                                            localFunction.name = newFunction.name;
                                            localFunction.collect = newFunction.collect;
                                            localFunction.modifyTime = newFunction.modifyTime;
                                            localFunction.roomIds = newFunction.roomIds;
                                            localFunction.bus = newFunction.bus;
                                            localFunction.SaveFunctionFile();
                                        }
                                        deviceList.list.Remove(newFunction);//操作完的数据清理掉,剩下的就是新增的功能
                                    }
                                    deviceList.list.Remove(newFunction);//操作完的数据清理掉,剩下的就是新增的功能
                                }
                            }
                            //处理剩下的新增功能
@@ -217,6 +215,7 @@
                        if (sceneList == null)
                        {
                            sceneList = new List<Scene>();
                        }
                            for (int i = 0; i < FunctionList.List.scenes.Count;)
                            {
                                var localScene = FunctionList.List.scenes[i];
@@ -226,29 +225,28 @@
                                    continue;
                                }
                                var newScene = sceneList.Find((obj) => obj.userSceneId == localScene.userSceneId);
                                if (newScene == null)//如果云端最新数据没有该条数据,则本地需要删掉该数据记录
                            if (newScene == null)//如果云端最新数据没有该条数据,则本地需要删掉该数据记录
                            {
                                FunctionList.List.DeleteScene(localScene, false);
                            }
                            else
                            {
                                i++;
                                if (localScene.modifyTime != newScene.modifyTime)
                                {
                                    FunctionList.List.DeleteScene(localScene, false);
                                    localScene.name = newScene.name;
                                    localScene.collect = newScene.collect;
                                    localScene.modifyTime = newScene.modifyTime;
                                    localScene.roomIds = newScene.roomIds;
                                    localScene.SaveSceneFile();
                                }
                                else
                                {
                                    i++;
                                    if (localScene.modifyTime != newScene.modifyTime)
                                    {
                                        localScene.name = newScene.name;
                                        localScene.collect = newScene.collect;
                                        localScene.modifyTime = newScene.modifyTime;
                                        localScene.roomIds = newScene.roomIds;
                                        localScene.SaveSceneFile();
                                    }
                                    sceneList.Remove(newScene);//操作完的数据清理掉,剩下的就是新增的功能
                                }
                                sceneList.Remove(newScene);//操作完的数据清理掉,剩下的就是新增的功能
                            }
                            //处理剩下的新增功能
                            foreach (var newScene in sceneList)
                            foreach (var tempScene in sceneList)
                            {
                                newScene.SaveSceneFile();
                                FunctionList.List.scenes.Add(newScene);
                                tempScene.SaveSceneFile();
                                FunctionList.List.scenes.Add(tempScene);
                            }
                        }
                        //如果是一端口需要提前下载场景数据,否则控制不了一端口场景
HDL_ON/Common/HDLCommon.cs
@@ -302,9 +302,9 @@
            //账号在别处登陆,被踢下线 跳转到登录页面
            new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
#if DEBUG
//#if DEBUG
            return;
#endif
//#endif
            Logout();
        }
HDL_ON/Common/R.cs
@@ -12,6 +12,7 @@
        public const int Retry = 402;
        public const int QRCodeIsInvalid = 401;
        public const int WellComBackHome = 400;
        public const int FunctionNotOpen = 380;
        public const int FadeSpeed = 379;
        public const int FadeTime = 378;
        public const int WholeZone = 377;
HDL_ON/DAL/DriverLayer/Control.cs
@@ -82,11 +82,23 @@
            {
                if (_gatewayOnline != value)
                {
                    _gatewayOnline = value;
                    //修改主页连接状态
                    UI.HomePage.LoadEvent_CheckLinkStatus();
                    if (value)
                    if(value)
                    {
                        if (IsRemote)//如果是远程
                        {
                            if (!DB_ResidenceData.Instance.HomeGateway.gatewayStatus)//远程情况下,网关未链接服务器不能修改主页网关状态
                            {
                                new System.Threading.Thread(() => {
                                    System.Threading.Thread.Sleep(3000);
                                    var pm = new DAL.Server.HttpServerRequest();
                                    pm.GetGatewayInfo();
                                }) { IsBackground = true }.Start();
                                return;
                            }
                        }
                        _gatewayOnline = value;
                        //修改主页连接状态
                        HomePage.LoadEvent_CheckLinkStatus();
                        MainPage.Log($"网关在线,刷新设备状态");
                        new System.Threading.Thread(() =>
                        {
@@ -94,6 +106,12 @@
                            FunctionList.List.ReadAllFunctionStatus();
                        })
                        { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }.Start();
                    }
                    else
                    {
                        _gatewayOnline = value;
                        //修改主页连接状态
                        HomePage.LoadEvent_CheckLinkStatus();
                    }
                }
            }
@@ -103,23 +121,10 @@
        /// </summary>
        public string GatewayId = "";
        bool _isRemote = false;
        /// <summary>
        /// 是否为远程连接
        /// </summary>
        public bool IsRemote
        {
            get
            {
                return _isRemote;
            }
            set
            {
                _isRemote = value;
                //修改主页连接状态
                HomePage.LoadEvent_CheckLinkStatus();
            }
        }
        public bool IsRemote = false;
        /// <summary>
        /// 通讯地址IP
        /// </summary>
@@ -183,7 +188,9 @@
        /// </summary>
        public void SearchLoaclGateway()
        {
            MainPage.Log($"搜索本地网关列表,网关类型:{DB_ResidenceData.Instance.GatewayType}");
            var ggg = DB_ResidenceData.Instance.GatewayType == 0 ? "一端口" : "A网关";
            var ggg1 = MainPage.InternetStatus == 1 ? "4G" : "wifi";
            MainPage.Log($"搜索网关列表,网关类型:{ggg};网络类型:{ggg1}");
            if (MainPage.InternetStatus == 0)
            {
                Ins.GatewayOnline = false;
@@ -328,6 +335,35 @@
                    MainPage.Log($"发送HDL-Link数据:{functionControlDataJson}");
                }
            }
        }
        /// <summary>
        /// 全开全关功能
        /// </summary>
        public void SwtichFunctions(bool open,List<Function> functions)
        {
            var count = 0;
            var logString = open ? "打开" : "关闭";
            List<ApiAlinkControlActionObj> actionObjs = new List<ApiAlinkControlActionObj>();
            Dictionary<string, string> d = new Dictionary<string, string>();
            d.Add(FunctionAttributeKey.OnOff, open ? "on" : "off");
            var pm = new DAL.Server.HttpServerRequest();
            foreach (var temp in functions)
            {
                logString += temp.spk + ":" + temp.sid;
                var apiControlData = temp.GetApiControlData(d);
                actionObjs.Add(apiControlData);
                count++;
                if (count > 9)
                {
                    var result = pm.ControlDevice(actionObjs);
                    actionObjs = new List<ApiAlinkControlActionObj>();
                    count = 0;
                    MainPage.Log(logString);
                    logString = "";
                }
            }
            var pack = pm.ControlDevice(actionObjs);
            MainPage.Log(logString);
        }
        public void SendApiReadCommand(List<string> functionIds)
@@ -500,7 +536,7 @@
                    var device = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceModule>(bodyJObj.objects.ToString());
                    if (device.device_mac == DB_ResidenceData.Instance.residenceGatewayMAC)
                    {
                        //本地搜索网关成功
                        MainPage.Log("本地搜索网关成功");
                        Control.Ins.IsSearchLocalGatewaySuccessful = true;
                        Ins.GatewayOnline = true;
                        if (!string.IsNullOrEmpty(device.gatewayId))
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -158,6 +158,10 @@
        {
            foreach (var f in scene.functions)
            {
                if(f.localFunction == null)
                {
                    continue;
                }
                switch (f.localFunction.functionType)
                {
                    case FunctionType.Curtain:
HDL_ON/DAL/DriverLayer/Packet.cs
@@ -91,6 +91,14 @@
                }
                //处理接收到的数据
                UdpPacket_DataProcessing(subnetID, deviceID, command, usefulBytes);
#if DEBUG
                string ddd = "";
                foreach(var bb in usefulBytes)
                {
                    ddd += bb + ",";
                }
                MainPage.Log(ddd);
#endif
                //处理是否要重发数据
                ManagerReceive(subnetID, deviceID, command, usefulBytes);
            }
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -186,9 +186,14 @@
                        Topic = $"/user/{MqttInfoConfig.Current.HomeGatewayInfo.gatewayId}/app/thing/property/send",
                        QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce
                    };
                    var topicBusStatus = new MqttTopicFilter()
                    {
                        Topic = $"/BusGateWayToClient/MacMask/Common",
                        QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce
                    };
                    Utlis.WriteLine("开始订阅!");
                    var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { topicFilterBusGateWayToClient, topicFilterPush2 , topicAlinkStatus });
                    var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { topicFilterBusGateWayToClient, topicFilterPush2, topicAlinkStatus, topicBusStatus });
                    if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0)
                    {
                        isSubscribeSuccess = true;
@@ -269,7 +274,6 @@
                                }
                                else
                                {
                                    MainPage.Log($"mqtt data");
                                    SetGatewayOnlineResetCheck();
                                    var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey);
                                    
@@ -286,10 +290,19 @@
                                        {
                                            packet.Bytes = e.ApplicationMessage.Payload;
                                        }
#if DEBUG
                                        string ddd = "";
                                        foreach (var bb in packet.Bytes)
                                        {
                                            ddd += bb + ",";
                                        }
                                        MainPage.Log($"mqtt bus data:{ddd}");
#endif
                                        packet.Manager();
                                    }
                                    else
                                    {
                                        MainPage.Log($"mqtt A-Link data");
                                        //A协议数据处理
                                        var revString = Encoding.UTF8.GetString(bytes);
                                        Control.Ins.UpdataFunctionStatus(revString,null);
@@ -312,25 +325,9 @@
                    //(3)ConnectedHandler
                    if (RemoteMqttClient.ConnectedHandler == null)
                    {
                        RemoteMqttClient.UseConnectedHandler(async (e) => {
                            if (DB_ResidenceData.Instance.HomeGateway.gatewayStatus)
                            {
                                Control.Ins.GatewayOnline = true;
                            }
                            else
                            {
                                //new System.Threading.Thread(() => {
                                //    while(true)
                                //    {
                                //        System.Threading.Thread.Sleep(1000);
                                //        if (DB_ResidenceData.Instance.HomeGateway.GatewayOnline)
                                //        {
                                //            Control.Ins.GatewayOnline = true;
                                //            break;
                                //        }
                                //    }
                                //}) { IsBackground = true }.Start();
                            }
                        RemoteMqttClient.UseConnectedHandler(async (e) =>
                        {
                            Control.Ins.GatewayOnline = true;
                            IfNeedReadAllDeviceStatus = true;
                            Utlis.WriteLine($"============>Mqtt远程连接成功");
                            SendPushSignOut();
@@ -655,7 +652,6 @@
        /// 是否需要读取一次所有设备状态
        /// </summary>
        static bool IfNeedReadAllDeviceStatus = true;
        //public static bool IsGatewayOnline = true;
        /// <summary>
        /// 设置网关在线标志,并重置CheckGateway参数
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -571,15 +571,14 @@
                            if (mHomeGatewayRes.Count > 0)
                            {
                                DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
                                if (mHomeGatewayRes[0].gatewayStatus)
                                {
                                    //DriverLayer.Control.Ins.IsRemote = true;
                                    DriverLayer.Control.Ins.GatewayOnline = true;
                                }
                                else
                                {
                                    DriverLayer.Control.Ins.GatewayOnline = false;
                                }
                                //if (mHomeGatewayRes[0].gatewayStatus)
                                //{
                                //    DriverLayer.Control.Ins.GatewayOnline = true;
                                //}
                                //else
                                //{
                                //    DriverLayer.Control.Ins.GatewayOnline = false;
                                //}
                                DB_ResidenceData.Instance.SaveResidenceData();
                                return revertObj.Code;
                            }
@@ -615,8 +614,10 @@
                var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString());
                if (mHomeGatewayRes != null)
                {
                    DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes;
                    DB_ResidenceData.Instance.SaveResidenceData();
                    if(mHomeGatewayRes.gatewayStatus)
                    {
                        DriverLayer.Control.Ins.GatewayOnline = true;
                    }
                }
            }
            return revertObj.Code;
HDL_ON/Entity/DB_ResidenceData.cs
@@ -274,7 +274,6 @@
        /// <returns></returns>
        static byte[] ReadResidenceInfo()
        {
                MainPage.Log("get file Instance ");
            var fileName = "DB_ResidenceData";
            FileStream fs = null;
            try
@@ -302,7 +301,6 @@
            }
            finally
            {
                MainPage.Log("get file  ");
                try
                {
                    if (fs != null)
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -193,7 +193,7 @@
            {
                if (b)
                {
                    etAccount.Text = "13697499568";// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568
                    etAccount.Text = "18824864143";// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568
                }
                else
                {
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -345,48 +345,91 @@
                {
                    try
                    {
                        switch (functionCategory)
                        if (DB_ResidenceData.Instance.GatewayType == 0 && !Control.Ins.IsRemote)
                        {
                            case ShowFunction.AC:
                                foreach (var f in FunctionList.List.aCs)
                                {
                                    f.trait_on_off.curValue = onoff;
                                    Dictionary<string, string> d = new Dictionary<string, string>();
                                    d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                    Control.Ins.SendWriteCommand(f, d);
                                    System.Threading.Thread.Sleep(100);
                                }
                                break;
                            case ShowFunction.FloorHeating:
                                foreach (var f in FunctionList.List.floorHeatings)
                                {
                                    f.trait_on_off.curValue = onoff;
                                    Dictionary<string, string> d = new Dictionary<string, string>();
                                    d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                    Control.Ins.SendWriteCommand(f, d);
                                    System.Threading.Thread.Sleep(100);
                                }
                                break;
                            case ShowFunction.Light:
                                foreach (var f in FunctionList.List.lights)
                                {
                                    f.trait_on_off.curValue = onoff;
                                    Dictionary<string, string> d = new Dictionary<string, string>();
                                    d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                    Control.Ins.SendWriteCommand(f, d);
                                    System.Threading.Thread.Sleep(100);
                                }
                                break;
                            case ShowFunction.Electric:
                                foreach (var f in FunctionList.List.electricals)
                                {
                                    f.trait_on_off.curValue = onoff;
                                    Dictionary<string, string> d = new Dictionary<string, string>();
                                    d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                    Control.Ins.SendWriteCommand(f, d);
                                    System.Threading.Thread.Sleep(100);
                                }
                                break;
                            switch (functionCategory)
                            {
                                case ShowFunction.AC:
                                    foreach (var f in FunctionList.List.aCs)
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                    }
                                    break;
                                case ShowFunction.FloorHeating:
                                    foreach (var f in FunctionList.List.floorHeatings)
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                    }
                                    break;
                                case ShowFunction.Light:
                                    foreach (var f in FunctionList.List.lights)
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                    }
                                    break;
                                case ShowFunction.Electric:
                                    foreach (var f in FunctionList.List.electricals)
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                    }
                                    break;
                            }
                        }
                        else
                        {
                            switch (functionCategory)
                            {
                                case ShowFunction.AC:
                                    List<Function> acList = new List<Function>();
                                    foreach(var f in FunctionList.List.aCs)
                                    {
                                        acList.Add(f);
                                    }
                                    Control.Ins.SwtichFunctions(onoff == "on", acList);
                                    break;
                                case ShowFunction.FloorHeating:
                                    List<Function> fhList = new List<Function>();
                                    foreach (var f in FunctionList.List.floorHeatings)
                                    {
                                        fhList.Add(f);
                                    }
                                    Control.Ins.SwtichFunctions(onoff == "on", fhList);
                                    break;
                                case ShowFunction.Light:
                                    List<Function> lightList = new List<Function>();
                                    foreach (var f in FunctionList.List.lights)
                                    {
                                        lightList.Add(f);
                                    }
                                    Control.Ins.SwtichFunctions(onoff == "on", lightList);
                                    break;
                                case ShowFunction.Electric:
                                    List<Function> eleList = new List<Function>();
                                    foreach (var f in FunctionList.List.electricals)
                                    {
                                        eleList.Add(f);
                                    }
                                    Control.Ins.SwtichFunctions(onoff == "on", eleList);
                                    break;
                            }
                        }
                    }
                    catch (Exception ex)
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
old mode 100755 new mode 100644
@@ -336,6 +336,7 @@
            userTypeView.AddChidren(btnUserTypeName);
            #endregion
            #region 住宅管理
            if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
            {
                #region ---住宅管理区域
@@ -524,6 +525,15 @@
            }
            else
            {
                residenceInfoView.AddChidren(new Button()
                {
                    Y = Application.GetRealHeight(20),
                    TextAlignment = TextAlignment.Center,
                    TextSize = CSS_FontSize.TextFontSize,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextID = StringId.FunctionNotOpen,
                });
                #region F3阶段
                #region ---安放区域
                //residenceArmView = new FrameLayout()
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
@@ -38,7 +38,7 @@
                    bodyView.btnWindSpeed.UnSelectedImagePath = uAc.curFanImage;
                    if(uAc.trait_on_off.curValue.ToString() == "on")
                    {
                        bodyView.arcBar.IsOffline = true;
                        bodyView.arcBar.IsOffline = false;
                        bodyView.btnSwitch.IsSelected = true;
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                        if (uAc.trait_mode.curValue.ToString() == "fan")
@@ -52,7 +52,7 @@
                    }
                    else
                    {
                        bodyView.arcBar.IsOffline = false;
                        bodyView.arcBar.IsOffline = true;
                        bodyView.btnSwitch.IsSelected = false;
                        bodyView.arcBar.IsClickable = false;
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";