tzy
2021-03-26 3cebdfad56d78ba04a214fccd1b942a010aeba77
Merge remote-tracking branch 'origin/temp-wxr' into dev-tzy
1个文件已添加
58个文件已修改
15641 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DLL/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Application.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconBlack.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconWhite.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Other/JPush/JPushReceiver.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Resources/Resource.designer.cs 13320 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Public/MsgIcon/TipIconBlack.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Public/MsgIcon/TipIconWhite.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Public/PlusSignIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Packet.cs 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Enumerative/Command.cs 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Scene.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/FunctionList.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Room.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPageBLL.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs 132 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs 314 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs 280 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PirView.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,60 +1,33 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget." />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_Pie.cs">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs">
    <Files>
      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="6" Column="19" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="133" Column="34" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" Line="427" Column="1" />
      <File FileName="HDL-ON_iOS/Info.plist" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/BrandListView.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" />
      <File FileName="HDL_ON/Entity/Function/Scene.cs" />
      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" />
      <File FileName="HDL_ON/UI/MainPage.cs" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" />
      <File FileName="HDL_ON/UI/UI0-Public/PublicAssmebly.cs" />
      <File FileName="HDL_ON/DAL/Server/IMessageCommon.cs" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption.cs" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_Pie.cs" Line="34" Column="1" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs" Line="136" Column="83" />
    </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="Server" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True">
                <Node name="Device" expanded="True" />
                <Node name="Function" expanded="True" />
                <Node name="ResponseEntity" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="CSS" expanded="True" />
                <Node name="UI0-Public" expanded="True" />
                <Node name="UI1-Login" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="2-Classification" expanded="True" />
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="1ContorlPage" expanded="True" />
                    <Node name="EnvironmentalScience" expanded="True">
                      <Node name="EchartsOption_Pie.cs" selected="True" />
                    </Node>
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="PirDevice" expanded="True" />
                  </Node>
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_Android" expanded="True">
              <Node name="Assets" expanded="True">
                <Node name="Phone" expanded="True">
                  <Node name="FunctionIcon" expanded="True" />
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_iOS" expanded="True">
              <Node name="Resources" expanded="True">
                <Node name="Phone" expanded="True">
                  <Node name="FunctionIcon" expanded="True" />
                  <Node name="Public" expanded="True">
                    <Node name="MsgIcon" expanded="True" />
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="1ContorlPage" expanded="True">
                      <Node name="AcControlPage_AddIrButton.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
@@ -71,7 +44,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="Debug|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore />
DLL/.DS_Store
Binary files differ
HDL-ON_Android/Application.cs
@@ -33,7 +33,6 @@
        public override void OnCreate()
        {
            //注册未处理异常事件
            Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "cb89f20750");
            if (Shared.Application.Activity != null)
            {
@@ -47,6 +46,9 @@
            initAll();
        }
        /// <summary>
        /// 所有初始化全部在这个方法实现
        /// </summary>
@@ -60,7 +62,8 @@
            //隐藏虚拟按键
            BaseActivity.IsHideVirualButtons = true;
            //实现安卓返回按键
            BaseActivity.BackKeyAction = () => {
            BaseActivity.BackKeyAction = () =>
            {
                try
                {
                    var result = MainPage.LoadEvent_BackAction();
@@ -97,7 +100,7 @@
                {
                    Language.CurrentLanguage = "English";
                }
                //获取极光推送ID
                GetJPushRegistrationID(activity);
@@ -133,7 +136,8 @@
            BaseActivity.OnResumeAction += (activity) =>
            {
                checkSomeInfo();
            };
            BaseActivity.OnDestroyAction += (activity) =>
            {
@@ -142,7 +146,7 @@
                //UserInfo.Current.unlockTime = DateTime.Now;
            };
            HDLUtils.SetAuthoritiesName("com.hdl.onpro.fileProvider");
@@ -157,14 +161,14 @@
                    //关闭定位服务
                    Shared.Application.StopGPSLocationService();
                }
                  catch(Exception ex)
                catch (Exception ex)
                {
                    Utlis.WriteLine("GetCityInfo catch"+ ex.Message);
                    Utlis.WriteLine("GetCityInfo catch" + ex.Message);
                }
                MainPage.Log($"经纬度:::{lon}:{lat}");
            };
        }
        /// <summary>
@@ -173,8 +177,10 @@
        /// <param name="activity"></param>
        void GetJPushRegistrationID(BaseActivity activity)
        {
            try
            {
                //保存获取的极光服务器上的注册ID到本地文件
                var tokenID = JPushInterface.GetRegistrationID(activity);
                Console.WriteLine("RegistrationID:  " + tokenID);
@@ -364,7 +370,7 @@
            //进入后台mqtt正在连接重置状态
            HDL_ON.DAL.Mqtt.MqttClient.RemoteMqttIsConnecting = false;
            HDL_ON.DriverLayer.UdpSocket._BusSocket.Stop();
        }
        /// <summary>
HDL-ON_Android/Assets/Language.ini
@@ -1409,69 +1409,13 @@
6071=修改名字
6072=确认删除
6073=取消
6074=遥控器不能超过10个?
6074=遥控器不能超过10个
6075=遥控器所属区域:
6076=编辑信息
6077=版本升级
6015=在线
6016=离线
6017=版本号
6018=请输入遥控器名称
6019=提示:遥控器创建后可在功能-电器分类{\r\n}查找使用
6020=推荐按键
6021=请输入按键名称
6022=下一步
6023=电源
6024=音量+
6025=音量-
6026=频道+
6027=频道-
6028=上
6029=下
6030=左
6031=右
6032=静音
6034=确认
6035=播放
6037=退出
6038=菜单
6039=暂停
6040=返回
6041=停止
6042=主页
6043=快进
6044=快退
6045=定时
6046=复制遥控功能
6047=对准遥控器中心按下相同按键
6048=智能遥控器
6049=添加按键
6050=*长按可进行自定义排序
6051=完成
6052=添加成功
6053=可到分类-功能-电器操作使用
6054=所属分类
6055=遥控器名称
6056=所属区域
6057=继续添加
6058=电器
6059=添加失败
6060=重试
6061=匹配遥控器
6062=请点击以下按钮
6063=确认设备是否有响应
6064=控制失败
6065=控制成功
6066=电源开
6067=模式制冷
6068=风速中风
6069=温度26℃
6070=删除设备
6071=修改名字
6072=确认删除
6073=取消
6078=系统维护中~请稍后再试~
6079=获取数据失败
6080=暂时不支持该功能
7000=新建自动化
7001=编辑自动化
HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconBlack.png

HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconWhite.png

HDL-ON_Android/HDL-ON_Android.csproj
@@ -966,22 +966,7 @@
    <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\Pm25Bg.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\0.png" />
    <AndroidAsset Include="Assets\Phone\PirIcon\add.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\VentilateSelect.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\EnergySelect.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan2Select.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan3.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Energy.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan2.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\ComfortableSelect.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan1.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan3Select.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\TempAndHumiBack.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Comfortable.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Humidification.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\HumidificationSelect.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Ventilate.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan1Select.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\Fan\DialogTitleMenuGroud2.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\AC\More.png" />
  </ItemGroup>
  <ItemGroup>
    <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" />
HDL-ON_Android/Other/JPush/JPushReceiver.cs
@@ -98,7 +98,6 @@
        public override void OnRegister(Context context, string p1)
        {
            base.OnRegister(context, p1);
            Utlis.WriteLine("JPushOnRegister: " + p1);
        }
@@ -112,8 +111,6 @@
        //{
        //    try
        //    {
        //        if (JPushMessageInfo.Extras.Contains("Offline") == true)
        //        {
        //            Shared.Application.RunOnMainThread(() =>
@@ -141,7 +138,7 @@
        //}
        /// <summary>
        /// 打开消息显示界面
        /// 打开消息显示界面.010000
        /// </summary>
        /// <param name="context"></param>
        /// <param name="notificationMessage"></param>
HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103191" android:versionName="1.1.202103191" package="com.hdl.onpro">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103241" android:versionName="1.1.202103241" package="com.hdl.onpro">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" />
    <!--  定位权限-->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
HDL-ON_Android/Resources/Resource.designer.cs
Diff too large
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1193,22 +1193,7 @@
      <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\TempIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\TvocIcon.png" />
      <BundleResource Include="Resources\Phone\PirIcon\add.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\Fan\DialogTitleMenuGroud2.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\VentilateSelect.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\EnergySelect.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan2Select.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan3.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Energy.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan2.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\ComfortableSelect.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan1.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan3Select.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\TempAndHumiBack.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Comfortable.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Humidification.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\HumidificationSelect.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Ventilate.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan1Select.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\AC\More.png" />
    </ItemGroup>
    <ItemGroup>
      <ITunesArtwork Include="iTunesArtwork" />
HDL-ON_iOS/Info.plist
@@ -104,9 +104,9 @@
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>CFBundleShortVersionString</key>
    <string>1.1.202103181</string>
    <string>1.1.202103241</string>
    <key>CFBundleVersion</key>
    <string>202103181</string>
    <string>202103241</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Use geographic location to provide services such as weather</string>
    <key>NSAppleMusicUsageDescription</key>
HDL-ON_iOS/Resources/Language.ini
@@ -423,11 +423,11 @@
437=Device List
438=humidity:{0}%    air:{1}    wind:{2}
1000=Room Humidity
1000=Indoor Humidity
1001=V-chip
1002=Anion
1003=Sterilization
1004=Humidify
1004=Humidification
1005=Filter Element Reset
1006=Lighting
1007=Automatic
@@ -499,18 +499,7 @@
1073=Please turn on Bluetooth
1074=Location information(GBS) unavailable
1075=Network unavailable
1076=Select infrared remote control
1077=Air Fresh
1078=Residual filter screen
1079=Energy
1080=Ventilated
;别看下面都一样,都是UI特殊要求整的,再加上考虑英文长度
1081=1st Gear
1082=2nd Gear
1083=3rd Gear
1084=1st Gear
1085=2nd Gear
1086=3rd Gear
1076=Select infrared remote control
5000=Music
5001=Group
@@ -1275,17 +1264,6 @@
1074=位置信息(GBS)不可用
1075=网络不可用
1076=选择红外遥控器
1077=新风
1078=当前滤网剩余
1079=节能
1080=通风
1081=1档
1082=2档
1083=3档
1084=风速1档
1085=风速2档
1086=风速3档
5000=音乐
5001=组合
@@ -1409,69 +1387,13 @@
6071=修改名字
6072=确认删除
6073=取消
6074=遥控器不能超过10个?
6074=遥控器不能超过10个
6075=遥控器所属区域:
6076=编辑信息
6077=版本升级
6015=在线
6016=离线
6017=版本号
6018=请输入遥控器名称
6019=提示:遥控器创建后可在功能-电器分类{\r\n}查找使用
6020=推荐按键
6021=请输入按键名称
6022=下一步
6023=电源
6024=音量+
6025=音量-
6026=频道+
6027=频道-
6028=上
6029=下
6030=左
6031=右
6032=静音
6034=确认
6035=播放
6037=退出
6038=菜单
6039=暂停
6040=返回
6041=停止
6042=主页
6043=快进
6044=快退
6045=定时
6046=复制遥控功能
6047=对准遥控器中心按下相同按键
6048=智能遥控器
6049=添加按键
6050=*长按可进行自定义排序
6051=完成
6052=添加成功
6053=可到分类-功能-电器操作使用
6054=所属分类
6055=遥控器名称
6056=所属区域
6057=继续添加
6058=电器
6059=添加失败
6060=重试
6061=匹配遥控器
6062=请点击以下按钮
6063=确认设备是否有响应
6064=控制失败
6065=控制成功
6066=电源开
6067=模式制冷
6068=风速中风
6069=温度26℃
6070=删除设备
6071=修改名字
6072=确认删除
6073=取消
6078=系统维护中~请稍后再试~
6079=获取数据失败
6080=暂时不支持该功能
7000=新建自动化
7001=编辑自动化
HDL-ON_iOS/Resources/Phone/Public/MsgIcon/TipIconBlack.png

HDL-ON_iOS/Resources/Phone/Public/MsgIcon/TipIconWhite.png

HDL-ON_iOS/Resources/Phone/Public/PlusSignIcon.png

HDL_ON/Common/ApiUtlis.cs
@@ -172,28 +172,6 @@
                                    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)
                                //    //{
                                //    //    //可优化
                                //    //    localFunction.name = newFunction.name;
                                //    //    localFunction.collect = newFunction.collect;
                                //    //    localFunction.modifyTime = newFunction.modifyTime;
                                //    //    localFunction.roomIds = newFunction.roomIds;
                                //    //    localFunction.bus = newFunction.bus;
                                //    //    localFunction.SaveFunctionFile();
                                //    //}
                                //    localFunction = newFunction;
                                //    localFunction.SaveFunctionFile();
                                //    deviceList.list.Remove(newFunction);//操作完的数据清理掉,剩下的就是新增的功能
                                //}
                                if (delFile == localFunction.savePath)
                                {
@@ -202,14 +180,12 @@
                                }
                                delFile = localFunction.savePath;
                                FunctionList.List.DeleteFunction(localFunction);
                            }
                        }
                        //处理剩下的新增功能
                        foreach (var newFunction in deviceList.list) 
                        {
                            MainPage.Log(newFunction.savePath);
                            newFunction.SaveFunctionFile();
                            FunctionList.List.IniFunctionList(newFunction.savePath);
                        }
@@ -369,5 +345,24 @@
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 获取功能信息
        /// </summary>
        public void GetFunctionInfo(string functionId)
        {
            var deviceResult = Ins.HttpRequest.GetDeviceInfo(functionId);
            if (deviceResult.Code == StateCode.SUCCESS)
            {
                MainPage.Log($"读取设备信息成功");
                var packList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                foreach(var function in packList.list)
                {
                    function.SaveFunctionFile();
                    FunctionList.List.IniFunctionList(function.savePath,true);
                }
            }
        }
    }
}
HDL_ON/Common/R.cs
@@ -908,6 +908,9 @@
        public const int yaokongqiquyu = 6075;
        public const int bianjixinxi = 6076;
        public const int banbenshengji = 6077;
        public const int xitongweihuzhong = 6078;
        public const int huoqushujushibao = 6079;
        public const int zanshibuzhichigaigongneng = 6080;
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -463,11 +463,11 @@
                                    byte lightBri = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness));
                                    if (lightBri == 0)
                                    {
                                        b = 100;
                                        b1 = 100;
                                    }
                                    else
                                    {
                                        b = lightBri;
                                        b1 = lightBri;
                                    }
                                }
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] {
@@ -629,6 +629,9 @@
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 });
                                break;
                        }
                        break;
                    case FunctionCategory.AirFresh:
                        break;
                }
                #region 发送命令立即更新UI
@@ -890,6 +893,10 @@
                case Command.SetACMode:
                case Command.ReadFloorHeat:
                case Command.SetFloorHeat:
                case Command.FreshAirRead:
                case Command.FreshAirControl:
                case Command.FreshAirRead_JinMao:
                case Command.FreshAirControl_JinMao:
                    this.sendFlag += string.Format("{0}", target.AddData[0]);
                    break;
                case Command.SetLogicLoopColor:
HDL_ON/DAL/DriverLayer/Packet.cs
@@ -315,7 +315,7 @@
                            if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            {
                                function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[1].ToString());
                                function.SetAttrState(FunctionAttributeKey.IndoorTemp, receiveBytes[2].ToString());
                                function.SetAttrState(FunctionAttributeKey.RoomTemp, receiveBytes[2].ToString());
                                function.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off";
                                acFunction.SetMode(receiveBytes[9],function);
                                acFunction.SetFan(receiveBytes[10],function);
@@ -446,7 +446,7 @@
                                {
                                    indoorTemp = receiveBytes[9];
                                }
                                function.SetAttrState(FunctionAttributeKey.IndoorTemp, indoorTemp);
                                function.SetAttrState(FunctionAttributeKey.RoomTemp, indoorTemp);
                                function.lastState += " " + function.GetAttrState(FunctionAttributeKey.Mode) + new FloorHeating().GetTempUnitString(function);
                                RoomPage.UpdataStates(function);
@@ -621,7 +621,7 @@
                        {
                            if (ac.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            {
                                ac.SetAttrState(FunctionAttributeKey.IndoorTemp, receiveBytes[1].ToString());
                                ac.SetAttrState(FunctionAttributeKey.RoomTemp, receiveBytes[1].ToString());
                                FunctionPage.UpdataStates(ac);
                            }
                        }
@@ -636,6 +636,45 @@
                            Control.Ins.IsSearchLocalGatewaySuccessful = true;
                            Control.Ins.GatewayOnline_Local = true;
                            DAL.Mqtt.MqttClient.DisConnectRemote();//断开mqtt
                        }
                        break;
                    case Command.FreshAirControlACK_JinMao:
                    case Command.FreshAirReadACK_JinMao:
                        var airFresh = FunctionList.List.GetAirFreshList().Find((obj) => obj.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]);
                        if (airFresh != null)
                        {
                            /// 3    开关    0-关机,1-开机
                            /// 4    运行模式    1-通风,2-加湿 humidification/fan
                            /// 5    节能舒适选择    1-舒适,2-节能 true/false
                            /// 6    风速档位    0-自动,1-1档,2-2档,3-3档  level_1/level_2/level_3/auto
                            /// 7    湿度设定    %
                            /// 8    室内温度值    ℃
                            /// 9    室内湿度值    ℃
                            /// 10    过滤网剩余    %
                            /// 11    过滤网使用超时    1 超时 0 无 true/false
                            airFresh.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[2] == 0 ? "off" : "on");
                            airFresh.SetAttrState(FunctionAttributeKey.Mode, receiveBytes[3] == 1 ? "humidification" : "fan");
                            airFresh.SetAttrState(FunctionAttributeKey.Energy, receiveBytes[4] == 1 ? "true" : "false");
                            switch (receiveBytes[5])
                            {
                                case 0:
                                    airFresh.SetAttrState(FunctionAttributeKey.FanSpeed, "auto");
                                    break;
                                case 1:
                                    airFresh.SetAttrState(FunctionAttributeKey.FanSpeed, "level_1");
                                    break;
                                case 2:
                                    airFresh.SetAttrState(FunctionAttributeKey.FanSpeed, "level_2");
                                    break;
                                case 3:
                                    airFresh.SetAttrState(FunctionAttributeKey.FanSpeed, "level_3");
                                    break;
                            }
                            airFresh.SetAttrState(FunctionAttributeKey.Humidity, receiveBytes[6].ToString());
                            airFresh.SetAttrState(FunctionAttributeKey.IndoorTemp, receiveBytes[7].ToString());
                            airFresh.SetAttrState(FunctionAttributeKey.IndoorHumidity, receiveBytes[8].ToString());
                            airFresh.SetAttrState(FunctionAttributeKey.FilterRemain, receiveBytes[9].ToString());
                            airFresh.SetAttrState(FunctionAttributeKey.FilterTimeout, receiveBytes[10] == 1 ? "true" : "false");
                        }
                        break;
                }
@@ -672,6 +711,10 @@
                switch (command)
                {
                    case Command.SetSingleLightACK:
                    case Command.FreshAirReadACK:
                    case Command.FreshAirControlACK:
                    case Command.FreshAirReadACK_JinMao:
                    case Command.FreshAirControlACK_JinMao:
                        receiveFlag += string.Format("{0}", usefulBytes[0]);
                        break;
                    case Command.SetLogicLoopColorACK:
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -480,6 +480,7 @@
                            IsOthreShare = mHome.IsOtherShare,
                            accountType = mHome.accountType,
                            isRemoteControl = mHome.isRemoteControl,
                            isBindGateway = mHome.isBindGateway,
                            longitude = mHome.longitude,
                            latitude = mHome.latitude,
                            deliverstatus = mHome.deliverstatus,
@@ -491,7 +492,10 @@
                            Address = mHome.homeAddress,
                            isAllowCreateScene = mHome.isAllowCreateScene,
                        };
                        UserInfo.Current.regionList.Add(home);
                        if (home.isBindGateway)
                        {
                            UserInfo.Current.regionList.Add(home);
                        }
                    }
                    //-------如果账号是首次登录
                    if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID))
@@ -1816,7 +1820,19 @@
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyBrandDevcieList, requestJson);
        }
        /// <summary>
        /// 获取设备详情
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew GetDeviceInfo(string functionId)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
            d.Add("deviceIds", new List<string>() { functionId });
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieInfoList, requestJson);
        }
        /// <summary>
        /// 获取设备详情列表
HDL_ON/DAL/Server/HttpUtil.cs
@@ -17,8 +17,8 @@
        /// 固定域名,正式环境
        /// 公共域名就近解析
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
        /// <summary>
        /// RegionMark
        /// </summary>
HDL_ON/Entity/Enumerative/Command.cs
@@ -14,6 +14,75 @@
        ReadAnalog = 0xE50A,
        ReadAnalogACK = 0xE50B,
        #region 新风协议
        //新风协议控制
        //附加数据:  新风通道号(1 - 200) + 开关(0,1) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时)
        FreshAirControl = 0x144A,
        //返回:新风通道号(1 - 200) + 开关(0,1) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时)+模拟量(2byte==16bit)+
        //室内温度(4byte) + 室外温度(4byte) + 室内湿度(4byte)+ PM2.5(4byte) + TVOC(4byte) + CO2(4byte)
        FreshAirControlACK = 0x144B,
        //2.新风协议读状态
        //附加数据:  新风通道号(1 - 200)
        FreshAirRead = 0x144C,
        //返回:新风通道号(1 - 200) + 开关(0,1) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时) +模拟量(2byte==16bit)+
        //室内温度(4byte) + 室外温度(4byte) + 室内湿度(4byte)+ PM2.5(4byte) + TVOC(4byte) + CO2(4byte)
        FreshAirReadACK = 0x144D,
        #endregion
        #region 金茂府 昆明 温州 新风协议
        /// <summary>
        /// 附加数据长度:1
        /// 新风编号    1~200
        /// </summary>
        FreshAirRead_JinMao = 0x1446,
        /// <summary>
        /// 附加数据长度:30
        /// 1    新风编号    1~200
        /// 2    类型  第三方类型  0:金茂新风
        /// 3    开关    0-关机,1-开机
        /// 4    运行模式    1-通风,2-加湿
        /// 5    节能舒适选择    1-舒适,2-节能
        /// 6    风速档位    0-自动,1-1档,2-2档,3-3档
        /// 7    湿度设定    %
        /// 8    室内温度值    ℃
        /// 9    室内湿度值    ℃
        /// 10    过滤网剩余    %
        /// 11    过滤网使用超时    1 超时 0 无
        /// </summary>
        FreshAirReadACK_JinMao = 0x1447,
        /// <summary>
        /// 附加数据长度:4
        /// 1    新风编号    1~200
        /// 2    类型  第三方类型  0:金茂新风
        /// 3    开关    0-关机,1-开机
        /// 4    运行模式    1-通风,2-加湿
        /// 5    节能舒适选择    1-舒适,2-节能
        /// 6    风速档位    0-自动,1-1档,2-2档,3-3档
        /// 7    湿度设定    %
        /// 8    室内温度值    ℃
        /// 9    室内湿度值    ℃
        /// 10    过滤网剩余    %
        /// 11    过滤网使用超时    1 超时 0 无
        /// </summary>
        FreshAirControl_JinMao = 0x1448,
        /// <summary>
        /// 附加数据长度:30
        /// 1    新风编号    1~200
        /// 2    类型  第三方类型  0:金茂新风
        /// 3    开关    0-关机,1-开机
        /// 4    运行模式    1-通风,2-加湿
        /// 5    节能舒适选择    1-舒适,2-节能
        /// 6    风速档位    0-自动,1-1档,2-2档,3-3档
        /// 7    湿度设定    %
        /// 8    室内温度值    ℃
        /// 9    室内湿度值    ℃
        /// 10    过滤网剩余    %
        /// 11    过滤网使用超时
        /// </summary>
        FreshAirControlACK_JinMao = 0x1449,
        #endregion
        #region 绿建温控器协议
        /// <summary>
        /// 读取温控器主机指令
@@ -1222,24 +1291,6 @@
        LogicstateControl = 0xE014,
        LogicstateControlACK = 0xE015,
        #region 新风协议
        //新风协议控制
        //附加数据:  新风通道号(1 - 200) + 开关(0,1) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时)
        FreshAirControl = 0x144A,
        //返回:新风通道号(1 - 200) + 开关(0,1) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时)+模拟量(2byte==16bit)+
        //室内温度(4byte) + 室外温度(4byte) + 室内湿度(4byte)+ PM2.5(4byte) + TVOC(4byte) + CO2(4byte)
        FreshAirControlACK = 0x144B,
        //2.新风协议读状态
        //附加数据:  新风通道号(1 - 200)
        FreshAirRead = 0x144C,
        //返回:新风通道号(1 - 200) + 开关(0,1) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时) +模拟量(2byte==16bit)+
        //室内温度(4byte) + 室外温度(4byte) + 室内湿度(4byte)+ PM2.5(4byte) + TVOC(4byte) + CO2(4byte)
        FreshAirReadACK = 0x144D,
        #endregion
        /// <summary>
        /// 布防设置       
HDL_ON/Entity/Function/Function.cs
@@ -768,7 +768,7 @@
        /// <summary>
        /// 室内温度
        /// </summary>
        public const string IndoorTemp = "room_temp";
        public const string RoomTemp = "room_temp";
        /// <summary>
        /// value
        /// </summary>
@@ -838,7 +838,7 @@
        /// </summary>
        public const string AnionTimeLeft = "anion_time_surplus";
        /// <summary>
        /// 打开登记(风扇)
        /// 打开等级(风扇)
        /// </summary>
        public const string OpenLevel = "openLevel";
        /// <summary>
@@ -846,6 +846,30 @@
        /// </summary>
        public const string Key = "key";
        /// <summary>
        /// 节能
        /// </summary>
        public const string Energy = "energy";
        /// <summary>
        /// 湿度
        /// </summary>
        public const string Humidity = "humidity";
        /// <summary>
        /// 室内温度
        /// </summary>
        public const string IndoorTemp = "indoor_temp";
        /// <summary>
        /// 室内湿度
        /// </summary>
        public const string IndoorHumidity = "indoor_humidity";
        /// <summary>
        /// 过滤网剩余量
        /// </summary>
        public const string FilterRemain = "filter_remain";
        /// <summary>
        /// 过滤网是否超时警告
        /// </summary>
        public const string FilterTimeout = "filter_timeout";
        #region tuya
        /// <summary>
@@ -895,7 +919,13 @@
        {
            get
            {
                return Convert.ToByte(loopId, 16);
                try
                {
                    return Convert.ToByte(loopId, 16);
                }catch
                {
                    return 0;
                }
            }
        }
@@ -1022,6 +1052,10 @@
        /// (新风)
        /// </summary>
        public const string AirFreshStandard = "airFresh.standard";
        /// <summary>
        /// 新风 ——金茂定制
        /// </summary>
        public const string AirFreshJinmao = "airFresh.jinmao";
        /// <summary>
        /// 新风spk列表
@@ -1031,6 +1065,7 @@
        {
            var spkList = new List<string>();
            spkList.Add(AirFreshStandard);
            spkList.Add(AirFreshJinmao);
            return spkList;
        }
        #endregion
@@ -1181,6 +1216,7 @@
        /// 红外遥控器
        /// </summary>
        public const string IrLearn = "ir.learn";
        #region 涂鸦
        /// <summary>
        /// 家电、涂鸦空气净化器
HDL_ON/Entity/Function/Scene.cs
@@ -446,7 +446,7 @@
                case FunctionAttributeKey.SetTemp:
                    text = Language.StringByID(StringId.Temp);
                    break;
                case FunctionAttributeKey.IndoorTemp:
                case FunctionAttributeKey.RoomTemp:
                    text = Language.StringByID(StringId.IndoorTemp);
                    break;
                case FunctionAttributeKey.Delay:
@@ -475,7 +475,7 @@
            switch (key)
            {
                case FunctionAttributeKey.SetTemp:
                case FunctionAttributeKey.IndoorTemp:
                case FunctionAttributeKey.RoomTemp:
                    us = "°C";
                    break;
                case FunctionAttributeKey.Percent:
@@ -500,7 +500,7 @@
                    text = value == "on" ? Language.StringByID(StringId.On) : Language.StringByID(StringId.OFF);
                    break;
                case FunctionAttributeKey.SetTemp:
                case FunctionAttributeKey.IndoorTemp:
                case FunctionAttributeKey.RoomTemp:
                case FunctionAttributeKey.Brightness:
                case FunctionAttributeKey.Percent:
                    if (value == "")
HDL_ON/Entity/FunctionList.cs
@@ -70,6 +70,16 @@
            var spkList = SPK.FhSpkList();
            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
        }
        /// <summary>
        /// 新风列表
        /// </summary>
        /// <returns></returns>
        public List<Function> GetAirFreshList()
        {
            var spkList = SPK.AirFreshSpkList();
            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
        }
        #region 家电列表 electricals
        /// <summary>
        /// 家电列表
@@ -127,6 +137,8 @@
                var tempFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(functionDataString);
                if (tempFunction == null)
                {
                    MainPage.Log("null");
                    FileUtlis.Files.DeleteFile(filePath);
                    return;
                }
@@ -144,6 +156,7 @@
                        }
                    }
                }
                    MainPage.Log("add");
                Functions.Add(tempFunction);
            }
            if (filePath.StartsWith("SceneData_"))
HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
@@ -122,10 +122,10 @@
        /// 是否允许创建场景
        /// </summary>
        public bool isAllowCreateScene;
        ///// <summary>
        ///// 是否绑定网关
        ///// </summary>
        //public bool isBindGateway;
        /// <summary>
        /// 是否绑定网关
        /// </summary>
        public bool isBindGateway;
    }
    /// <summary>
HDL_ON/Entity/Room.cs
@@ -462,10 +462,10 @@
            }
        }
        /// <summary>
        /// 房间功能列表
        /// </summary>
        List<Function> functions = new List<Function>();
        ///// <summary>
        ///// 房间功能列表
        ///// </summary>
        //List<Function> functions = new List<Function>();
        /// <summary>
        /// 获取房间功能列表
        /// </summary>
@@ -473,8 +473,8 @@
        {
            if (needRefresh)
            {
                functions = new List<Function>();
            }
            var functions = new List<Function>();
            if (functions.Count == 0)
            {
                foreach (var f in FunctionList.List.GetDeviceFunctionList())
@@ -487,22 +487,22 @@
            }
            return functions;
        }
        /// <summary>
        /// 增加房间功能
        /// 操作的是缓存数据,不用保存
        /// </summary>
        public void AddRoomFunction(Function function)
        {
            functions.Add(function);
        }
        /// <summary>
        /// 删除房间功能
        /// 操作的是缓存数据,不用保存
        /// </summary>
        public void RemoveRoomFunction(Function function)
        {
            functions.Remove(functions.Find((obj) => obj.sid == function.sid));
        }
        ///// <summary>
        ///// 增加房间功能
        ///// 操作的是缓存数据,不用保存
        ///// </summary>
        //public void AddRoomFunction(Function function)
        //{
        //    functions.Add(function);
        //}
        ///// <summary>
        ///// 删除房间功能
        ///// 操作的是缓存数据,不用保存
        ///// </summary>
        //public void RemoveRoomFunction(Function function)
        //{
        //    functions.Remove(functions.Find((obj) => obj.sid == function.sid));
        //}
        /// <summary>
        /// 房间场景列表
        /// </summary>
HDL_ON/HDL_ON.projitems
@@ -387,7 +387,7 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\EnvironmentalScience\EnvironmentalPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\EnvironmentalScience\EchartsOption_Pie.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\SetPir.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AirFreshControlPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AcControlPage_AddIrButton.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)DAL\" />
HDL_ON/UI/MainPage.cs
@@ -18,15 +18,9 @@
        /// </summary>
        public static PageLayout BasePageView { get; set; }
        /// <summary>
        /// DisplayCompleted
        /// </summary>
        public static bool DisplayCompleted = false;
        //public static UserInfo LoginUser;
        /// <summary>
        /// 版本号
        /// </summary>
        public static string VersionString = "1.1.0319";
        public static string VersionString = "1.1.0324";
        ///// <summary>
        ///// 客户端类型
        ///// </summary>
@@ -40,6 +34,10 @@
        /// 天气刷新action
        /// </summary>
        public static Action RefreshAir;
        /// <summary>
        /// 回退页面action 没有需要可以不用
        /// </summary>
        public static Action ReturnRefreshAction;
        /// <summary>
        /// 无登录模式
        /// </summary>
@@ -198,13 +196,21 @@
                        {
                            if (e < BasePageView.ChildrenCount - 1)
                            {
                                MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
                            }
                            while (e < BasePageView.ChildrenCount - 1)
                            {
                                BasePageView.GetChildren(BasePageView.ChildrenCount - 1).RemoveFromParent();
                            }
                            try
                            {
                                ReturnRefreshAction?.Invoke();
                                ReturnRefreshAction = null;
                            }
                            catch (Exception ex)
                            {
                                Log($"后退事件异常:{ex.Message}");
                            }
                            //while (e < BasePageView.ChildrenCount - 1)
                            //{
                            //    BasePageView.GetChildren(BasePageView.ChildrenCount - 1).RemoveFromParent();
                            //}
                        };
                        BasePageView.MouseDownEventHandler += (sender, e) =>
                        {
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -185,20 +185,20 @@
            };
            bodyView.AddChidren(btnIcon_bg);
#if DEBUG
            #if DEBUG
            bool b = false;
            btnIcon.MouseUpEventHandler += (sender, e) =>
            {
                //return;
                if (b)
                {
                    etAccount.Text = "18316672920";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654";
                    etAccount.Text = "15622703419";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654";
                    // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 
                }
                else
                {
                    etAccount.Text = "15971583093";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374
                    //15971583093 gs//tzy 274116637@qq.com
                    etAccount.Text = "18316672920";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374
                    //15971583093 gs//tzy 274116637@qq.com//Sumant.Bhatia@havells.com 国外服务器测试
                }
                b = !b;
                etPassword.Text = "123456";
HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -637,9 +637,12 @@
                        }
                        else
                        {
                            BindingResidencePage page = new BindingResidencePage();
                            MainPage.BaseView.AddChidren(page);
                            page.LoadView();
                            //Application.RunOnMainThread(() =>
                            //{
                            //    BindingResidencePage page = new BindingResidencePage();
                            //    MainPage.BaseView.AddChidren(page);
                            //    page.LoadView();
                            //});
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -132,7 +132,6 @@
                switch (function.Spk_Prefix)
                {
                    case FunctionCategory.Curtain:
                        CurtainFragment();
                        break;
                    case FunctionCategory.Sensor:
@@ -332,7 +331,7 @@
                        ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                        ProgressTextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                        MaxValue = 100,
                        Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.BatteryState)),
                        Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
                        Tag = function.sid + "_DimmerBar",
                        SeekBarPadding = Application.GetRealWidth(20),
                    };
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -76,13 +76,25 @@
        /// </summary>
        void LoadEvent_SwitchFunction(Button btnSwitch,FunctionAttributes fadeTime = null)
        {
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                if(function.spk == SPK.IrLearn || function.spk == SPK.TvIr)
                {
                    new System.Threading.Thread(() => {
                        System.Threading.Thread.Sleep(2000);
                        Application.RunOnMainThread(() => {
                            btnSwitch.IsSelected = !btnSwitch.IsSelected;
                        });
                    }) { IsBackground = true }.Start();
                }
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    if(fadeTime!= null)
                    {
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
@@ -892,9 +892,9 @@
        /// 信息提示窗口,自动关闭
        /// </summary>
        /// <param name="msg">提示错误文本</param>
        public void FlashingBox(string msg,int time=2000)
        public void FlashingBox(string msg,int time=2)
        {
            new PublicAssmebly().TipMsgAutoClose(msg, false, time);
            new PublicAssmebly().TipMsgAutoClose(msg, false, time*1000);
        }
        /// <summary>
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/AddMiniRemoteControlDirection4Page.cs
@@ -220,22 +220,22 @@
                    return;
                }
                var form = HdlFormLogic.Current.GetFormByName("AddMiniRemoteControlDirection1Page") as AddMiniRemoteControlDirection1Page;
                if (form.AddDeviceEvent != null)
                //if (form.AddDeviceEvent != null)
                {
                    //代表这个是由温总那边调用的,直接回调函数
                    form.AddDeviceEvent.Invoke(newDevice);
                    form.AddDeviceEvent?.Invoke(newDevice);
                    //关闭掉这个界面
                    this.CloseForm();
                    //再把AddMiniRemoteControlDirection1Page界面关了
                    HdlFormLogic.Current.CloseFormByFormName("AddMiniRemoteControlDirection1Page");
                }
                else
                {
                    //代表这并不是由温总的界面调用的,则关闭掉全部的界面
                    HdlFormLogic.Current.CloseAllOpenForm();
                    //然后再把温总的界面new起来
                    new UI2.PersonalCenter.PirDevice.Method().MainView(this, newDevice,()=> { });
                }
                //else
                //{
                //    //代表这并不是由温总的界面调用的,则关闭掉全部的界面
                //    HdlFormLogic.Current.CloseAllOpenForm();
                //    //然后再把温总的界面new起来
                //    new UI2.PersonalCenter.PirDevice.Method().MainView(this, newDevice,()=> { });
                //}
            };
        }
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
@@ -18,7 +18,7 @@
            brand = integratedBrand;
        }
        public void LoadPage()
        public void LoadPage(VerticalRefreshLayout refreshView)
        {
            new TopViewDiv(bodyView, Language.StringByID(StringId.AddDevice)).LoadTopView();
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
@@ -33,16 +33,16 @@
            Load3tyBrandDeviceList();
            Load3tyBrandDeviceList(refreshView);
            contentView.BeginHeaderRefreshingAction = () =>
            {
                contentView.EndHeaderRefreshing();
                Load3tyBrandDeviceList();
                Load3tyBrandDeviceList(refreshView);
            };
        }
        void Load3tyBrandDeviceList()
        void Load3tyBrandDeviceList(VerticalRefreshLayout refreshView)
        {
            var waitPage = new Loading();
            waitPage.Start();
@@ -57,7 +57,7 @@
                        var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString());
                        Application.RunOnMainThread(() =>
                        {
                            LoadRow(revData);
                            LoadRow(revData, refreshView);
                        });
                    }
                    else
@@ -77,7 +77,7 @@
            { IsBackground = true }.Start();
        }
        void LoadRow(List<IntegratedBrandDevice> deviceList)
        void LoadRow(List<IntegratedBrandDevice> deviceList, VerticalRefreshLayout refreshView)
        {
            contentView.RemoveAll();
            bool isFrist = true;
@@ -143,6 +143,9 @@
                        case SPK.IrModule:
                            var form = new AddMiniRemoteControlDirection1Page();
                            form.AddForm();
                            form.AddDeviceEvent = (functionObj) => {
                                refreshView.BeginHeaderRefreshing();
                            };
                            break;
                    }
                };
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
@@ -25,7 +25,7 @@
            {
                var page = new AddDevciePage(brand);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
                page.LoadPage(contentView);
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            new TopViewDiv(bodyView, Language.StringByID(StringId.Devices)).LoadTopView_AddIcon("3ty", action);
@@ -46,6 +46,8 @@
                contentView.EndHeaderRefreshing();
                Load3tyBrandDeviceList();
            };
            //contentView.BeginHeaderRefreshing();
        }
        void Load3tyBrandDeviceList()
@@ -150,7 +152,7 @@
                    switch (device.spk)
                    {
                        case SPK.IrModule:
                            new UI2.PersonalCenter.PirDevice.Method().MainView(this, device,()=> { });
                            new UI2.PersonalCenter.PirDevice.Method().MainView(this, device,()=> {});
                            break;
                    }
                };
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs
@@ -12,12 +12,17 @@
        }
        public void Show(Control control)
        {
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            PirDevice.View.TopView topView = new View.TopView();
            topView.topNameBtn.TextID = StringId.tianjiayaokongqi;
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); };
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                RemoveFromParent();
            };
            FrameLayout editfLayout = new FrameLayout
            {
@@ -122,74 +127,57 @@
                }
                //new引导界面
                View.ReplicationView replication = new View.ReplicationView();
               // MainPage.BasePageView.AddChidren(replication);
                replication.Show(this);
               // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                //添加数据对象
                Entity.AttributesStatus buttonObj = new Entity.AttributesStatus();
                buttonObj.key = "key" + control.status.Count.ToString();
                buttonObj.value = texts;
                PirSend.CodeStudy(control, buttonObj, (responsePackNew) =>
                PirSend.CodeStudy(control, buttonObj, (mqttdate) =>
                {
                    if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                    if (mqttdate != null)
                    {
                        Method method = new Method();
                        Method.buttondata = "";
                        var mqttdate = method.MqttDate("按键", control.sid, 25);
                        if (mqttdate != null)
                        //休眠是为显示引导界面
                        // System.Threading.Thread.Sleep(3000);
                        //移除添加按钮引导界面
                        replication.RemView();
                        var buttonName = control.status.Find((c) => c.value == buttonObj.value);
                        if (buttonName == null)
                        {
                            //休眠是为显示引导界面
                            // System.Threading.Thread.Sleep(3000);
                            //移除添加按钮引导界面
                            replication.RemView();
                            var buttonName = control.status.Find((c) => c.value == buttonObj.value);
                            if (buttonName == null)
                            {
                                //添加数据
                                control.status.Add(buttonObj);
                            }
                            //移除添加按钮界面
                            this.RemoveFromParent();
                            for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
                            {
                                var view = MainPage.BasePageView.GetChildren(i);
                                if (view.GetType() == typeof(AddControl))
                                {
                                    new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                                    view.RemoveFromParent();
                                }
                            }
                            //加载数据界面
                            AddControl addControl = new AddControl();
                            MainPage.BasePageView.AddChidren(addControl);
                            addControl.Show(control);
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                            //添加数据
                            control.status.Add(buttonObj);
                        }
                        else
                        {
                            replication.RemView();
                            new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                        }
                        //移除添加按钮界面
                        this.RemoveFromParent();
                        //移除之前可能存在的界面
                        Method.RemoveView("AddControl");
                        //加载数据界面
                        AddControl addControl = new AddControl();
                        MainPage.BasePageView.AddChidren(addControl);
                        addControl.Show(control);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    }
                    else
                    {
                        replication.RemView();
                        Method method = new Method();
                        method.ErrorShow(responsePackNew, "");
                        method.ErrorShow(null,"添加失败");
                    }
                });
            };
        }
        /// <summary>
        /// 移除界面
        /// </summary>
        public override void RemoveFromParent()
        {
            //刷新指定界面
            Method.RefreshView("PirMain");
            base.RemoveFromParent();
        }
    }
}
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
@@ -24,7 +24,7 @@
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                this.RemoveFromParent();
            };
@@ -71,7 +71,7 @@
            };
            this.AddChidren(saveLayout);
            saveLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            //暂时隐藏排序功能
            Button paixuBtn = new Button
            {
                Width = Application.GetRealWidth(375 - 16 * 2),
@@ -82,7 +82,7 @@
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.textTipColor,
            };
            saveLayout.AddChidren(paixuBtn);
            //saveLayout.AddChidren(paixuBtn);
            Button saveBtn = new Button
            {
@@ -140,20 +140,13 @@
            //保存点击事件
            saveBtn.MouseUpEventHandler += (sender, e) =>
            {
               //移除当前界面
                //移除当前界面
                this.RemoveFromParent();
                //可能之前已经存在该界面
                for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
                {
                    var view = MainPage.BasePageView.GetChildren(i);
                    if (view.GetType() == typeof(AddControlComplete))
                    {
                        view.RemoveFromParent();
                    }
                }
                Method.RemoveView("AddControlComplete");
                AddControlComplete addControlComplete = new AddControlComplete();
                MainPage.BasePageView.AddChidren(addControlComplete);
                addControlComplete.Show(control,false);
                addControlComplete.Show(control, false);
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            #endregion
@@ -166,112 +159,19 @@
        void RefreshView(VerticalScrolViewLayout vv, bool if_bool, Control control)
        {
            vv.RemoveAll();
            //定义一个变量记录行数
            int sum = 0;
            if (control.status.Count % 3 == 0)
            View.Buttons buttons = new View.Buttons();
            buttons.AddButton2(vv, control.status, (obj) =>
            {
                sum = control.status.Count / 3;
            }
            else
            {
                sum = control.status.Count / 3 + 1;
            }
            //计算加载出来的数据需要的高度
            int h = 16 + sum * (16 + 44) + 104 + 76;
            int line = 0;
            //按钮的父控件
            var FLayout = new FrameLayout
            {
                Height = Application.GetRealWidth(h),
            };
            vv.AddChidren(FLayout);
            for (int i = 1, j = 0; i <= control.status.Count; i++, j++)
            {
                var nameObj = control.status[i - 1];
                //按钮
                var buttonNameBtn = new Button
                Method.ThreadSend(control, (responsePackNew) =>
                {
                    Y = Application.GetRealHeight(16 + line * (16 + 44)),
                    X = Application.GetRealWidth(16 + (16 + 104) * j),
                    Width = Application.GetRealWidth(104),
                    Height = Application.GetRealHeight(44),
                    Text = nameObj.value,
                    TextSize = TextSize.text16,
                    TextColor = CSS.CSS_Color.textColor,
                    TextAlignment = TextAlignment.Center,
                    Radius = (uint)Application.GetRealHeight(18),
                    BorderWidth = 1,
                    BorderColor = CSS.CSS_Color.textCancelColor,
                };
                FLayout.AddChidren(buttonNameBtn);
                //删除图标
                var delIconBtn = new Button
                {
                    UnSelectedImagePath = "PirIcon/delbuton.png",
                    Y = Application.GetRealHeight(12 + line * (16 + 44)),
                    X = Application.GetRealWidth((16 + 92) + (104 + 16) * j),
                    Width = Application.GetRealWidth(16),
                    Height = Application.GetRealWidth(16),
                    Tag = nameObj,
                };
                if (if_bool)
                {
                    FLayout.AddChidren(delIconBtn);
                }
                //删除图标的点击事件
                delIconBtn.MouseUpEventHandler += (sender, e) =>
                {
                    var obj = delIconBtn.Tag as Entity.AttributesStatus;
                    //加载log
                    Loading loading = new Loading();
                    this.AddChidren(loading);
                    HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
                    loading.Start();
                    new System.Threading.Thread(() =>
                    var buttonObj = control.status.Find((c) => c.value == obj.value);
                    if (buttonObj != null)
                    {
                        try
                        {
                            //发送按键删除;
                            responsePackNew = PirSend.CodeRemove(obj, control.deviceId);
                        }
                        catch { }
                        finally
                        {
                            Application.RunOnMainThread(() =>
                            {
                                loading.Hide();
                                if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                                {
                                    var buttonObj = control.status.Find((c) => c.value == obj.value);
                                    if (buttonObj != null)
                                    {
                                        control.status.Remove(buttonObj);
                                    }
                                    RefreshView(vv, true, control);
                                }
                                else {
                                    Method method = new Method();
                                    method.ErrorShow(responsePackNew,"");
                                }
                            });
                        }
                    })
                    { IsBackground = true }.Start();
                };
                if (i % 3 == 0)
                {
                    //满一行重置j=0值;
                    j = -1;
                    line += 1;
                }
            }
                        control.status.Remove(buttonObj);
                    }
                    RefreshView(vv, true, control);
                }, "删除按键", "fram", this, null, obj);
            }, if_bool);
        }
    }
}
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs
@@ -12,26 +12,12 @@
        }
        public void Show(Control control, bool bool_library)
        {
            //数据转换
            Entity.Function function = new Entity.Function();
            {
                function.sid = control.sid;
                function.deviceId = control.deviceId;
                function.name = control.name;
                function.spk = control.spk;
                //function.attributes.AddRange(control.status);
                //遥控器添加到列表;
                if (null == Pir.currPir.FunctioList.Find((c) => c.sid == function.sid))
                {
                    Pir.currPir.FunctioList.Add(function);
                }
            }
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            PirDevice.View.TopView topView = new View.TopView();
            topView.topNameBtn.TextID = StringId.tianjiayaokongqi;
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); };
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { RemoveFromParent(); };
            FrameLayout fLayout = new FrameLayout
            {
@@ -41,7 +27,7 @@
                Width = Application.GetRealWidth(375),
            };
            this.AddChidren(fLayout);
            //
            //成功图标
            Button iconBtn = new Button
            {
                Y = Application.GetRealHeight(28),
@@ -90,13 +76,13 @@
            this.AddChidren(namePatchView.FLayoutView());
            namePatchView.btnText1.TextID = StringId.yaokongqimingcheng;
            namePatchView.btnText2.Text = control.name;
            //所属区域
            View.PatchView quyuPatchView = new View.PatchView();
            quyuPatchView.frameLayout.Y = namePatchView.frameLayout.Bottom;
            this.AddChidren(quyuPatchView.FLayoutView());
            quyuPatchView.btnText1.TextID = StringId.suoshuquyu;
            quyuPatchView.btnText2.Text=Intelligence.Automation.LogicMethod.GetGetRoomName(function);
            quyuPatchView.btnText2.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(GetFunction(control.deviceId));
            //继续添加
            Button addBtn = new Button
@@ -124,17 +110,23 @@
                List<string> list = new List<string>();
                for (int i = 0; i < Pir.currPir.FunctioList.Count; i++)
                {
                    //添加所有遥控名称列表
                    list.Add(Pir.currPir.FunctioList[i].name);
                }
                Method method = new Method();
                method.EditControlName(StringId.editName, list, control.name, (name, dialog) =>
                {
                    //发送更新名称命令
                    Method.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) =>
                    {
                        //关闭窗口
                        dialog.Close();
                        //更新备注
                        namePatchView.btnText2.Text = name;
                        function.name = name;
                        //更新临时设备名称
                        control.name = name;
                        //更换内存设备名称
                        GetFunction(control.deviceId).name = name;
                    }, "修改名称", "dialog", null, dialog);
                }, () => { });
            };
@@ -142,23 +134,25 @@
            quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) =>
            {
                Method method = new Method();
                method.ManagementPosition(function, () =>
                method.ManagementPosition(GetFunction(control.deviceId), () =>
                {
                    //更新区域
                    quyuPatchView.btnText2.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(function);
                    quyuPatchView.btnText2.Text = Intelligence.Automation.LogicMethod.GetGetRoomName(GetFunction(control.deviceId));
                });
            };
            //继续添加点击事件
            addBtn.MouseUpEventHandler += (sender, e) =>
            {
                if (bool_library)
                {
                {//继续添加库的遥控器
                    Method.RefreshView("PirMain");//刷新指点界面
                    this.RemoveFromParent();
                }
                else
                {
                {//继续添加自定义的遥控器
                    Method method = new Method();
                    method.AddControl(this, (controlDevice) => {
                    method.AddControl(this, (controlDevice) =>
                    {
                        AddButton addButton = new AddButton();
                        MainPage.BasePageView.AddChidren(addButton);
                        addButton.Show(controlDevice);
@@ -169,18 +163,36 @@
            //完成点击事件
            saveView.btnClick.MouseUpEventHandler += (sender, e) =>
            {
                //刷新指点界面
                Method.RefreshView("PirMain");
                //移除所有界面
                MainPage.BasePageView.RemoveViewByTag("PirView");
                //移除红外宝根界面
                MainPage.BasePageView.RemoveViewByTag("PirMain");
                //重新加载界面
                var page = new PirMain();
                MainPage.BasePageView.AddChidren(page);
                page.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            #endregion
        }
        /// <summary>
        /// 查找设备对象
        /// </summary>
        /// <param name="deviceId">设备ID</param>
        /// <returns></returns>
        public Entity.Function GetFunction(string deviceId)
        {
            var fun = Pir.currPir.FunctioList.Find((c) => c.deviceId == deviceId);
            if (fun != null)
            {
                return fun;
            }
            return new Entity.Function();
        }
        /// <summary>
        /// 移除界面
        /// </summary>
        public override void RemoveFromParent()
        {
            //刷新指定界面
            Method.RefreshView("PirMain");
            base.RemoveFromParent();
        }
    }
}
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs
@@ -58,7 +58,7 @@
                        var library = Newtonsoft.Json.JsonConvert.DeserializeObject<Library>(str);
                        if (library != null)
                        {
                            if (libraryList.Count < 20)
                            if (libraryList.Count < 40)
                            {
                                libraryList.Add(library);
                            }
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs
@@ -9,6 +9,7 @@
    {
        public EditControl()
        {
            Tag = "PirView";
        }
        public void Show(Entity.Function control,Action<Entity.Function> action)
        {
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -12,10 +12,10 @@
            Tag = "PirView";
        }
      
        public void Show(List<Brand> brandList,List<Library> libraryList,string spk)
        public void Show(List<Brand> brandList, List<Library> libraryList,string spk)
        {
           
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            PirDevice.View.TopView topView = new View.TopView();
@@ -108,7 +108,7 @@
                X = Application.GetRealWidth(136),
                Width = Application.GetRealWidth(104),
                Height = Application.GetRealHeight(17),
                Text = "(1/20)",
                Text = $"(1/{libraryList.Count})",
                TextSize = TextSize.text12,
                TextColor = CSS.CSS_Color.textCancelColor,
            };
@@ -160,7 +160,7 @@
            {
                if (index>1) {
                    index--;
                    sumBtn.Text = "(" + index.ToString() + "/20)";
                    sumBtn.Text = $"({index.ToString()}/{libraryList.Count})";
                }
                code = 1;
                GetBtnText(testBtn, code, spk);
@@ -168,10 +168,10 @@
            //右
            rightIconBtn.MouseUpEventHandler += (sender, e) =>
            {
                if (index < 20)
                if (index < libraryList.Count)
                {
                    index++;
                    sumBtn.Text = "(" + index.ToString() + "/20)";
                    sumBtn.Text = $"({index.ToString()}/{libraryList.Count})";
                }
                code = 1;
                GetBtnText(testBtn, code, spk);
@@ -180,10 +180,10 @@
            //测试Text
            testBtn.MouseUpEventHandler += (sender, e) =>
            {
                var library = libraryList[index-1];
                var library = libraryList[index - 1];
                var control = GetControl(spk, testBtn.TextID, library);
                //发送测试码命令
                CodeTest(control);
                Method.ThreadSend(control, (responsePackNew) => { }, "库码测试", "frame", this, null);
                if (code == 3) {
                    //标记最后那个码
                    if_bool = true;
@@ -192,12 +192,12 @@
            //控制失败
            failedBtn.MouseUpEventHandler += (sender, e) =>
            {
                if (index < 20)
                if (index < libraryList.Count)
                {
                    //先加
                    index++;
                    //更新文本
                    sumBtn.Text = "(" + index.ToString() + "/20)";
                    sumBtn.Text = $"({index.ToString()}/{libraryList.Count})";
                }
                code = 1;
                //更新状态
@@ -214,16 +214,16 @@
                GetBtnText(testBtn, code, spk);
                if (if_bool)
                {
                    var library = libraryList[index];
                    var library = libraryList[index-1];
                    var control = GetControl(spk, testBtn.TextID, library);
                    Method method = new Method();
                    //发送库添加遥控器命令
                    method.ThreadAddControl(control, this, (cont) =>
                    method.ThreadAddControl(control, this, (device) =>
                    {
                        MainPage.BasePageView.RemoveViewByTag("PirView");
                        AddControlComplete addControlComplete = new AddControlComplete();
                        MainPage.BasePageView.AddChidren(addControlComplete);
                        addControlComplete.Show(cont, true);
                        addControlComplete.Show(device, true);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    });
@@ -316,47 +316,6 @@
            }
            return control;
        }
        /// <summary>
        /// 发送库码测试命令
        /// </summary>
        /// <param name="control"></param>
        private void CodeTest(Control control)
        {
            //加载log
            Loading loading = new Loading();
            this.AddChidren(loading);
            HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
            loading.Start();
            new System.Threading.Thread(() =>
            {
                try
                {
                    responsePackNew = PirSend.CodeTest(control);
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                        {
                        }
                        else
                        {
                            //Method method = new Method();
                            //method.ErrorShow(responsePackNew);
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs
@@ -8,12 +8,13 @@
{
    public class Method
    {
        /// <summary>
        /// 程序主入口
        /// 红外宝程序主入口
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="function"></param>
        public void MainView(FrameLayout frame, Entity.Function function,Action action)
        public void MainView(FrameLayout frame, Entity.Function function, Action action)
        {
            Pir pirDevice = new Pir();
            if (function != null)
@@ -22,6 +23,7 @@
                pirDevice.deviceId = function.deviceId;
                pirDevice.sid = function.sid;
                pirDevice.online = function.online;
                pirDevice.versions = function.versions;
            }
            Pir.currPir = pirDevice;
            GetControlList(frame, () =>
@@ -32,8 +34,10 @@
                    MainPage.BasePageView.AddChidren(page);
                    page.Show();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    page.BackAction += () => {
                    PirMain.BackAction += () =>
                    {
                        action?.Invoke();
                        PirMain.BackAction = null;
                    };
                });
            }, Pir.currPir);
@@ -139,7 +143,13 @@
                            {
                                if (device != null)
                                {
                                    control.deviceId = device.deviceId;
                                    //遥控器添加到列表;
                                    if (null == Pir.currPir.FunctioList.Find((c) => c.deviceId == device.deviceId))
                                    {
                                        Pir.currPir.FunctioList.Add(device);
                                    }
                                    frame.RemoveFromParent();//添加成功关闭弹窗
                                    action(control);
                                }
@@ -211,25 +221,10 @@
                                var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Pir>(str);
                                if (pirJosn != null)
                                {
/* 项目“HDL-ON_iOS”的未合并的更改
在此之前:
                                    if (null == Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId))
在此之后:
                                    if (null == list.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId))
*/
                                    if (null == PirDevice.Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId))
                                    {
/* 项目“HDL-ON_iOS”的未合并的更改
在此之前:
                                        Pir.pirDeviceList.Add(pirJosn);
在此之后:
                                        list.pirDeviceList.Add(pirJosn);
*/
                                    {
                                        PirDevice.Pir.pirDeviceList.Add(pirJosn);
                                    }
                                }
                            }
@@ -258,7 +253,7 @@
                            {
                                loading.Hide();
                                Method method = new Method();
                                method.ErrorShow(null,"读取红外宝列表失败");
                                method.ErrorShow(null, "读取红外宝列表失败");
                            }
                        }
                        catch { }
@@ -286,7 +281,7 @@
                        var pirDevice = Pir.pirDeviceList[i];
                        try
                        {
                            var responsePackNew = PirSend.ControlList(pirDevice);
                            var responsePackNew = PirSend.ControlList(pirDevice.deviceId);
                            if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                            {
                                var jArray = JArray.Parse(responsePackNew.Data.ToString());
@@ -331,57 +326,27 @@
        /// 获取单个红外宝遥控器列表
        /// </summary>
        /// <param name="action">回调函数</param>
        public static void GetControlList(FrameLayout frame ,Action action, Pir pirDevice)
        public static void GetControlList(FrameLayout frame, Action action, Pir pirDevice)
        {
            Loading loading = new Loading();
            frame.AddChidren(loading);
            loading.Start();
            new System.Threading.Thread(() =>
            {
                try
                {
                    try
                    {
                        var responsePackNew = PirSend.ControlList(pirDevice);
                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                        {
                            var jArray = JArray.Parse(responsePackNew.Data.ToString());
                            for (int a = 0; a < jArray.Count; a++)
                            {
                                var jay = jArray[a];
                                //数据返序列化为Logic对象
                                var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
                                var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str);
                                if (pirJosn != null)
                                {
                                    if (null == pirDevice.FunctioList.Find((c) => c.sid == pirJosn.sid))
                                    {
                                        pirDevice.FunctioList.Add(pirJosn);
                                    }
                                }
                            }
                        }
                    }
                    catch { }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        action();
                    });
                }
            })
            { IsBackground = true }.Start();
            ThreadSend(new Control { deviceId = pirDevice.deviceId }, (responsePackNew) =>
             {
                 var jArray = JArray.Parse(responsePackNew.Data.ToString());
                 for (int a = 0; a < jArray.Count; a++)
                 {
                     var jay = jArray[a];
                     //数据返序列化为Logic对象
                     var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay);
                     var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str);
                     if (pirJosn != null)
                     {
                         if (null == pirDevice.FunctioList.Find((c) => c.deviceId == pirJosn.deviceId))
                         {
                             pirDevice.FunctioList.Add(pirJosn);
                         }
                     }
                 }
                 action();
             }, "获取遥控器列表", "frame", frame, null);
        }
        /// <summary>
@@ -392,37 +357,12 @@
        /// <param name="action">回调函数</param>
        public void GetControl(FrameLayout frame, Control control, Action<Entity.Function> action)
        {
            Entity.Function function = null;
            //加载log
            Loading loading = new Loading();
            frame.AddChidren(loading);
            loading.Start();
            new System.Threading.Thread(() =>
            ThreadSend(control, (responsePackNew) =>
            {
                try
                {
                    // 获取设备详情通过(spk,sid)
                    var responsePackNew = PirSend.GetinfoBySid(control);
                    if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                    {
                        //var str = Newtonsoft.Json.JsonConvert.SerializeObject(responsePackNew.Data.ToString());
                        function = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(responsePackNew.Data.ToString());
                    }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        action(function);
                    });
                }
            })
            { IsBackground = true }.Start();
                var function = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(responsePackNew.Data.ToString());
                action(function);
            }, "获取设备详情", "frame", frame, null);
        }
        /// <summary>
        /// 发送命令线程
        /// </summary>
@@ -432,9 +372,10 @@
        /// <param name="view">判断log父控件</param>
        /// <param name="frame">log父控件</param>
        /// <param name="dialog">log父控件</param>
        public static void ThreadSend(Control control, Action<ResponsePackNew> action, string str,string view, FrameLayout frame, Dialog dialog)
        /// <param name="attributesStatus">学习按键</param>
        public static void ThreadSend(Control control, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, Entity.AttributesStatus attributesStatus=null)
        {
            //加载log
            Loading loading = new Loading();
            if (view == "dialog")
@@ -460,8 +401,25 @@
                        responsePackNew = PirSend.DeviceRename(control.deviceId, control.name);
                    }
                    else if (str == "删除按键") {
                       // responsePackNew = PirSend.CodeRemove(control.deviceId, control.name);
                    else if (str == "删除按键")
                    {
                        if (attributesStatus != null)
                        {
                            responsePackNew = PirSend.CodeRemove(attributesStatus, control.deviceId);
                        }
                    }
                    else if (str == "获取设备详情")
                    {
                        // 获取设备详情通过(spk,sid)
                        responsePackNew = PirSend.GetinfoBySid(control);
                    }
                    else if (str == "获取遥控器列表")
                    {
                        responsePackNew = PirSend.ControlList(control.deviceId);
                    }
                    else if (str == "库码测试")
                    {
                        responsePackNew = PirSend.CodeTest(control);
                    }
                }
                catch { }
@@ -477,7 +435,28 @@
                        else
                        {
                            Method method = new Method();
                            method.ErrorShow(responsePackNew, "");
                            //自定义错误提示文本
                            string eorroText = "";
                            if (str == "删除")
                            {
                            }
                            else if (str == "修改名称")
                            {
                            }
                            else if (str == "删除按键")
                            {
                            }
                            else if (str == "获取设备详情")
                            {
                            }
                            else if (str == "获取遥控器列表")
                            {
                            }
                            else if (str == "库码测试")
                            {
                            }
                            method.ErrorShow(responsePackNew, eorroText);
                        }
                    });
@@ -519,7 +498,7 @@
                    str = buttondata;
                }
                if (!string.IsNullOrEmpty(controldata))
                if (!string.IsNullOrEmpty(str))
                {
                    try
                    {
@@ -559,7 +538,11 @@
            }
            else if (text == "读取红外宝列表失败")
            {
                str = "读取红外宝列表失败"; //Language.StringByID(StringId.delFail);
                str = Language.StringByID(StringId.huoqushujushibao);
            }
            else if (text == "添加失败")
            {
                str = Language.StringByID(StringId.tianjiashibai);
            }
            else
            {
@@ -577,19 +560,19 @@
                            break;
                        case "10807":
                            {
                                str = "红外宝下遥控器超过最大(10个)数量限制";// Language.StringByID(StringId.gatewayNotOnline);
                                str = Language.StringByID(StringId.bunengchaoguo10);
                            }
                            break;
                        case "2":
                            {
                                str = "系统维护中~请稍后再试~";
                                str = Language.StringByID(StringId.xitongweihuzhong);
                            }
                            break;
                        default:
                            {
                                str ="获取数据失败" ;// Language.StringByID(StringId.saveFail);
                                str = Language.StringByID(StringId.huoqushujushibao);
                            }
                            break;
@@ -607,6 +590,79 @@
                case 3: { } break;
            }
        }
        /// <summary>
        ///指定刷新界面
        /// </summary>
        /// <param name="strView">判断字符</param>
        public static void RefreshView(string strView)
        {
            //标记是不是已经刷新完成
            bool if_bool = false;
            for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
            {
                var view = MainPage.BasePageView.GetChildren(i);
                if (strView == "PirMain")
                {
                    if (view.GetType() == typeof(PirMain))
                    {
                        //强制转换对象
                        var f = (PirMain)view;
                        //移除所有子控件
                        f.RemoveAll();
                        //重新加载UI
                        f.Show();
                        //退出for循环
                        //break;
                        if_bool = true;
                    }
                }
                if (if_bool)
                {
                    //退出for循环
                    break;
                }
            }
        }
        /// <summary>
        /// 指定删除界面
        /// </summary>
        /// <param name="strView">判断字符</param>
        public static void RemoveView(string strView)
        {
            for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
            {
                var view = MainPage.BasePageView.GetChildren(i);
                if (strView == "PirMain")
                {
                    if (view.GetType() == typeof(PirMain))
                    {
                        //移除界面
                        view.RemoveFromParent();
                    }
                }
                else if (strView == "AddControl")
                {
                    if (view.GetType() == typeof(AddControl))
                    {
                        //找到移除
                        view.RemoveFromParent();
                    }
                }
                else if (strView == "AddControlComplete")
                {
                    if (view.GetType() == typeof(AddControlComplete))
                    {
                        //找到移除
                        view.RemoveFromParent();
                    }
                }
            }
        }
    }
    [Serializable]
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Pir.cs
@@ -54,7 +54,7 @@
        /// </summary>
        public List<string> library = new List<string>();
        /// <summary>
        ///
        /// 学习按键列表
        /// </summary>
        public List<AttributesStatus> status = new List<AttributesStatus>();
    }
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -7,28 +7,39 @@
{
    public class PirMain : FrameLayout
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public PirMain()
        {
            /// 标记界面
            Tag = "PirMain";
        }
        /// <summary>
        /// 回调
        /// </summary>
        public Action BackAction;
        public static Action BackAction;
        /// <summary>
        /// 添加图标Btn
        /// </summary>
        Button addDevice;
        /// <summary>
        /// 临时储存设备类型列表
        /// </summary>
        List<DeviceType> DeviceTypeList = new List<DeviceType>();
        public void Show()
        {
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            PirDevice.View.TopView topView = new View.TopView();
            topView.topNameBtn.TextID = StringId.hongwaiyaokong;
            topView.topIconBtn.Visible = true;
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => {
                BackAction();
                this.RemoveFromParent(); };
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                RemoveFromParent();
            };
            FrameLayout middFLayout = new FrameLayout();
            middFLayout.Y = Application.GetRealHeight(64);
@@ -38,21 +49,27 @@
            VerticalRefreshLayout vv = new VerticalRefreshLayout();
            middFLayout.AddChidren(vv);
            //加号图标
            Button addDevice = new Button
            addDevice = new Button
            {
                Y = Application.GetRealHeight(480),
                X = Application.GetRealWidth(293),
                Width = Application.GetRealWidth(82),
                Height = Application.GetRealWidth(84),
                UnSelectedImagePath = "PirIcon/add.png",
            };
                Visible=false,
            };
            middFLayout.AddChidren(addDevice);
            if (Pir.currPir.FunctioList.Count < 10)
            {
                //10个遥控器就会隐藏添加图标
                middFLayout.AddChidren(addDevice);
                // middFLayout.AddChidren(addDevice);
                addDevice.Visible = true;
            }
            #endregion
            #region 界面点击事件
            ///下拉刷新界面事件
            vv.BeginHeaderRefreshingAction += () =>
                {
                    ////关闭刷新View;
@@ -68,134 +85,68 @@
                    }, Pir.currPir);
                };
            UIView(vv);
            ///设置图标点击事件
            topView.clickSetBtn.MouseUpEventHandler += (sender, e) =>
            {
                SetPir setPir = new SetPir();
                MainPage.BasePageView.AddChidren(setPir);
                setPir.Show(() =>
                {
                    BackAction();
                    ////刷新界面
                    UIView(vv);
                });
                setPir.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            ///添加遥控器图标点击事件
            addDevice.MouseUpEventHandler += (sender, e) =>
            {
                FrameLayout frame = new FrameLayout
                //进来不允许左滑
                MainPage.BasePageView.ScrollEnabled = false;
                View.Buttons buttons = new View.Buttons();
                buttons.AddFrameLayout(this, (if_value, view) =>
                {
                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
                };
                this.AddChidren(frame);
                FrameLayout controlFl = new FrameLayout();
                controlFl.Y = Application.GetRealHeight(319);
                controlFl.X = Application.GetRealWidth(16);
                controlFl.Width = Application.GetRealWidth(343);
                controlFl.Height = Application.GetRealHeight(328);
                controlFl.BackgroundColor = CSS.CSS_Color.view;
                controlFl.Radius = (uint)Application.GetRealHeight(12);
                frame.AddChidren(controlFl);
                ///添加遥控器
                Button text3Btn = new Button
                {
                    Y = Application.GetRealHeight(12),
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(343 - 16 * 2),
                    Height = Application.GetRealHeight(20),
                    TextSize = TextSize.text14,
                    TextColor = CSS.CSS_Color.textConfirmColor,
                    TextAlignment = TextAlignment.Center,
                    TextID = StringId.tianjiayaokongqi,
                    IsBold = true,
                };
                controlFl.AddChidren(text3Btn);
                frame.MouseUpEventHandler += (sender1, e1) =>
                {
                    frame.RemoveFromParent();
                };
                int line = 0;
                for (int i = 1, j = 0; i <= 7; i++, j++)
                {
                    var currpirdeviceFLayout = new FrameLayout
                    //关闭允许左滑
                    MainPage.BasePageView.ScrollEnabled = true;
                    //1=空调;2=电视;3=风扇;4=机顶盒;5=DVD/EVD/VCD;6=投影仪;7=自定义;
                    if (if_value == 7)
                    {
                        Width = Application.GetRealWidth(80),
                        Height = Application.GetRealWidth(80),
                        X = Application.GetRealWidth(26 + (80 + 25) * j),
                        Y = Application.GetRealHeight(52 + (80 + 12) * line),
                    };
                    controlFl.AddChidren(currpirdeviceFLayout);
                    var deviceIconBtn = new Button
                    {
                        Y = Application.GetRealHeight(8),
                        X = Application.GetRealWidth(20),
                        Width = Application.GetRealWidth(40),
                        Height = Application.GetRealWidth(40),
                        UnSelectedImagePath = "PirIcon/Infraredtreasure.png",
                    };
                    currpirdeviceFLayout.AddChidren(deviceIconBtn);
                    var iconNameBtn = new Button
                    {
                        Y = deviceIconBtn.Bottom + Application.GetRealHeight(8),
                        Width = Application.GetRealWidth(80),
                        Height = Application.GetRealHeight(17),
                        TextSize = TextSize.text12,
                        TextColor = CSS.CSS_Color.TextualColor,
                        TextAlignment = TextAlignment.Center,
                    };
                    currpirdeviceFLayout.AddChidren(iconNameBtn);
                    var clickBtn = new Button { Tag = i };
                    currpirdeviceFLayout.AddChidren(clickBtn);
                    if (i % 3 == 0)
                    {
                        //满一行重置j=0值;
                        j = -1;
                        line += 1;
                    }
                    GetIconAndText(i, deviceIconBtn, iconNameBtn);
                    clickBtn.MouseUpEventHandler += (sender2, e2) =>
                    {
                        //1=空调;2=电视;3=风扇;4=机顶盒;5=DVD/EVD/VCD;6=投影仪;7=自定义;
                        int if_value = int.Parse(clickBtn.Tag.ToString());
                        if (if_value == 7)
                        Method method = new Method();
                        method.AddControl(this, (control) =>
                        {
                            Method method = new Method();
                            method.AddControl(this, (control) =>
                           //成功后移除;
                           view.RemoveFromParent();
                            AddButton addButton = new AddButton();
                            MainPage.BasePageView.AddChidren(addButton);
                            addButton.Show(control);
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        });
                    }
                    else
                    {
                        if (if_value == 3 || if_value == 4 || if_value == 5 || if_value == 6)
                        {
                            new TipPopView().FlashingBox(Language.StringByID(StringId.zanshibuzhichigaigongneng));
                            return;
                        }
                        if (DeviceTypeList.Count == 0)
                        {
                            GetDeviceTypeList(true, () =>
                            {
                                //成功后移除;
                                frame.RemoveFromParent();
                                AddButton addButton = new AddButton();
                                MainPage.BasePageView.AddChidren(addButton);
                                addButton.Show(control);
                                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                                DeviceTypeViewClick(if_value);
                               //获取成功之后移除
                               view.RemoveFromParent();
                            });
                        }
                        else
                        {
                            //进来都要移除;
                            frame.RemoveFromParent();
                            if (DeviceTypeList.Count == 0)
                            {
                                GetDeviceTypeList(true, () =>
                                 {
                                     DeviceTypeViewClick(if_value);
                                 });
                            }
                            else
                            {
                                DeviceTypeViewClick(if_value);
                            }
                            DeviceTypeViewClick(if_value);
                            view.RemoveFromParent();
                        }
                    };
                }
                    }
                }, 7);
            };
            #endregion
            ///初始化界面
            UIView(vv);
        }
        /// <summary>
@@ -241,7 +192,6 @@
            for (int j = 0; j < Pir.currPir.FunctioList.Count; j++)
            {
                var control = Pir.currPir.FunctioList[j];
                View.ControlView controlView = new View.ControlView();
                controlView.Show(pirView.devfLayout, j);
                //遥控器名称
@@ -267,7 +217,12 @@
                                Pir.currPir.FunctioList.Remove(Function);
                            }
                            UIView(vv);
                            if (Pir.currPir.FunctioList.Count < 10)
                            {
                                //10个遥控器就会隐藏添加图标
                                // middFLayout.AddChidren(addDevice);
                                addDevice.Visible = true;
                            }
                        }, "删除", "dialog", null, dialog);
                    }, () => { }, false);
@@ -299,10 +254,11 @@
        /// <summary>
        /// 设备进入下一级方法
        /// </summary>
        /// <param name="if_value"></param>
        /// <param name="if_value">控件索引值</param>
        private void DeviceTypeViewClick(int if_value)
        {
            var strings = GetTypeString(if_value).Split('-');
            var strings = View.Buttons.GetTypeString(if_value).Split('-');
            var jobDeviceType = DeviceTypeList.Find((c) => c.deviceType == strings[0]);
            if (jobDeviceType == null)
            {
@@ -320,118 +276,9 @@
        }
        /// <summary>
        /// 获取设备类型str
        /// </summary>
        /// <param name="index">索引值</param>
        private string GetTypeString(int index)
        {
            string type = "";
            switch (index)
            {
                case 1:
                    {
                        //空调
                        type = "ac-" + SPK.AcIr;
                    }
                    break;
                case 2:
                    {
                        //电视
                        type = "tv-" + SPK.TvIr;
                    }
                    break;
                case 3:
                    {
                        //风扇
                        // type = "fan-" + SPK.ElectricFan;
                    }
                    break;
                case 4:
                    {
                        //机顶盒
                        //  type = "set_top_box-" + SPK.ElectricTV;
                    }
                    break;
                case 5:
                    {
                        //影碟机
                        // type = "dvd-" + SPK.ElectricTV;
                    }
                    break;
                case 6:
                    {
                        //投影仪
                        //  type = "projector-" + SPK.ElectricTV;
                    }
                    break;
            }
            return type;
        }
        /// <summary>
        /// 设置图片和备注
        /// </summary>
        /// <param name="index">索引值</param>
        /// <param name="deviceIconBtn">图标Btn</param>
        /// <param name="deviceNameBtn">设备备注Btn</param>
        private void GetIconAndText(int index, Button deviceIconBtn, Button deviceNameBtn)
        {
            string iconPath = "";
            int deviceNameIndex = 0;
            switch (index)
            {
                case 1:
                    {
                        iconPath = "PirIcon/air.png";
                        deviceNameIndex = StringId.kongtiao;
                    }
                    break;
                case 2:
                    {
                        iconPath = "PirIcon/tv.png";
                        deviceNameIndex = StringId.dianshi;
                    }
                    break;
                case 3:
                    {
                        iconPath = "PirIcon/fan.png";
                        deviceNameIndex = StringId.fengshan;
                    }
                    break;
                case 4:
                    {
                        iconPath = "PirIcon/stb.png";
                        deviceNameIndex = StringId.jidinghe;
                    }
                    break;
                case 5:
                    {
                        iconPath = "PirIcon/dvd.png";
                        deviceNameIndex = StringId.dvd;
                    }
                    break;
                case 6:
                    {
                        iconPath = "PirIcon/projector.png";
                        deviceNameIndex = StringId.touyingyi;
                    }
                    break;
                case 7:
                    {
                        iconPath = "PirIcon/custom.png";
                        deviceNameIndex = StringId.zidingyi;
                    }
                    break;
            }
            deviceIconBtn.UnSelectedImagePath = iconPath;
            deviceNameBtn.TextID = deviceNameIndex;
        }
        /// <summary>
        /// 读取红外设备类型列表
        /// </summary>
        /// <param name="tag">标识要不要提示(true=提示)</param>
        /// <param name="tag">表示要不要提示错误信息(true=提示)</param>
        /// <param name="action">回调函数</param>
        public void GetDeviceTypeList(bool tag, Action action)
        {
@@ -504,7 +351,14 @@
                }
            }, id, "品牌列表");
        }
        /// <summary>
        /// 移除界面
        /// </summary>
        public override void RemoveFromParent()
        {
            BackAction();
            base.RemoveFromParent();
        }
    }
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
@@ -79,9 +79,9 @@
        /// <summary>
        /// 获取遥控器列表
        /// </summary>
        public static ResponsePackNew ControlList(Pir pir)
        public static ResponsePackNew ControlList(string deviceId)
        {
            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", pir.deviceId } };
            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", deviceId} };
            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_List);
            return responsePackNew;
        }
@@ -150,7 +150,7 @@
        /// 红外码学习
        /// </summary>
        /// <returns></returns>
        public static void CodeStudy(Control control,AttributesStatus buttonObj,Action<ResponsePackNew> action)
        public static void CodeStudy(Control control, AttributesStatus buttonObj, Action<Cloud> action)
        {
            var job = new JObject { };
            job.Add("key", buttonObj.key);
@@ -161,21 +161,32 @@
            var jArray = new JArray { };
            jArray.Add(job);
            var jObject = new JObject { { "homeId", HomeId }, { "deviceId", control.deviceId }, { "attributes", jArray } };
            ResponsePackNew responsePackNew = null;
            Cloud cloud = null;
            new System.Threading.Thread(() =>
            {
                try
                {
                    //发送红外码学习命令
                    responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy);
                    var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy);
                    if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                    {
                        Method method = new Method();
                        Method.buttondata = "";
                        cloud = method.MqttDate("按键", control.sid, 25);
                    }
                    else
                    {
                        Method method = new Method();
                        method.ErrorShow(responsePackNew, "");
                    }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        action(responsePackNew);
                        action(cloud);
                    });
                }
@@ -267,7 +278,6 @@
            { IsBackground = true }.Start();
        }
        /// <summary>
        ///请求服务器(与住宅有关:例如;homeId) 
        /// </summary>
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs
@@ -10,10 +10,9 @@
    {
        public SetPir()
        {
            Tag = "PirMain";
            Tag = "PirView";
        }
        public void Show(Action action)
        public void Show()
        {
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
@@ -21,7 +20,6 @@
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
            {
                action();
                RemoveFromParent();
            };
            topView.topNameBtn.TextID = StringId.setlogic;
@@ -41,16 +39,22 @@
            editNameFLayout.btnNextIcon.Width = Application.GetRealWidth(28);
            editNameFLayout.btnNextIcon.UnSelectedImagePath = "LogicIcon/editname.png";
            viewLayout.AddChidren(editNameFLayout.FLayoutView());
            ///版本升级
            FrameLayout50 banbenshengjiFL = new FrameLayout50();
            banbenshengjiFL.btnText.Text = Language.StringByID(StringId.banbenshengji);
            banbenshengjiFL.frameLayout.Y = editNameFLayout.frameLayout.Bottom;
            viewLayout.AddChidren(banbenshengjiFL.FLayoutView());
            /////版本升级
            //FrameLayout50 banbenshengjiFL = new FrameLayout50();
            //banbenshengjiFL.btnText.Text = Language.StringByID(StringId.banbenshengji);
            //banbenshengjiFL.frameLayout.Y = editNameFLayout.frameLayout.Bottom;
            //viewLayout.AddChidren(banbenshengjiFL.FLayoutView());
            var versions = Pir.currPir.versions.Find((c)=>c.module== "fw_version");
            if (versions == null)
            {
                versions = new Entity.VersionInfo();
            }
            ///版本号:v1.3.5
            FrameLayout50 banbenhaoFLayout = new FrameLayout50();
            banbenhaoFLayout.btnNextIcon.Visible = false;
            banbenhaoFLayout.btnText.Text = Language.StringByID(StringId.banbenhao) + ":v1.3.5";
            banbenhaoFLayout.frameLayout.Y = banbenshengjiFL.frameLayout.Bottom;
            banbenhaoFLayout.btnText.Text = Language.StringByID(StringId.banbenhao) + ":"+ versions.version;
            banbenhaoFLayout.frameLayout.Y = editNameFLayout.frameLayout.Bottom;// banbenshengjiFL.frameLayout.Bottom;
            viewLayout.AddChidren(banbenhaoFLayout.FLayoutView());
            //删除
            FrameLayout frameLayout = new FrameLayout
@@ -106,16 +110,8 @@
                            Pir.pirDeviceList.Remove(Pir.currPir);
                        }
                        dialog.Close();
                        action();
                        this.RemoveFromParent();
                        for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
                        {
                            var view = MainPage.BasePageView.GetChildren(i);
                            if (view.GetType() == typeof(PirMain))
                            {
                                view.RemoveFromParent();
                            }
                        }
                        Method.RemoveView("PirMain");
                    }, "删除", "dialog", null, dialog);
                }, () =>
@@ -129,6 +125,15 @@
            #endregion
        }
        /// <summary>
        /// 移除界面
        /// </summary>
        public override void RemoveFromParent()
        {
            //刷新PirMain界面
            Method.RefreshView("PirMain");
            base.RemoveFromParent();
        }
    }
}
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using Shared;
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View
@@ -13,7 +14,7 @@
        /// <param name="buttonList">数据列表</param>
        /// <param name="action">回调</param>
        /// <param name="line">表示多少行</param>
        /// <param name="line">表示一行加载多少个按钮</param>
        /// <param name="sum">表示一行加载多少个按钮</param>
        public void AddButton(FrameLayout buttonFLayout, List<string> buttonList, Action<string> action, int line = 7, int sum = 3)
        {
            VerticalScrolViewLayout vv = new VerticalScrolViewLayout();
@@ -59,6 +60,283 @@
        }
        /// <summary>
        /// 动态加载按钮列表
        /// </summary>
        /// <param name="vv">父控件</param>
        /// <param name="list">数据列表</param>
        /// <param name="action">回调</param>
        /// <param name="if_bool">表示是否显示删除图标</param>
        public void AddButton2(VerticalScrolViewLayout vv, List<Entity.AttributesStatus> list, Action<Entity.AttributesStatus> action, bool if_bool)
        {
            //定义一个变量记录行数
            int sum = 0;
            if (list.Count % 3 == 0)
            {
                sum = list.Count / 3;
            }
            else
            {
                sum = list.Count / 3 + 1;
            }
            //计算加载出来的数据需要的高度
            int h = 16 + sum * (16 + 44) + 104 + 76;
            int line = 0;
            //按钮的父控件
            var FLayout = new FrameLayout
            {
                Height = Application.GetRealWidth(h),
            };
            vv.AddChidren(FLayout);
            for (int i = 1, j = 0; i <= list.Count; i++, j++)
            {
                var nameObj = list[i - 1];
                //按钮
                var buttonNameBtn = new Button
                {
                    Y = Application.GetRealHeight(16 + line * (16 + 44)),
                    X = Application.GetRealWidth(16 + (16 + 104) * j),
                    Width = Application.GetRealWidth(104),
                    Height = Application.GetRealHeight(44),
                    Text = nameObj.value,
                    TextSize = TextSize.text16,
                    TextColor = CSS.CSS_Color.textColor,
                    TextAlignment = TextAlignment.Center,
                    Radius = (uint)Application.GetRealHeight(18),
                    BorderWidth = 1,
                    BorderColor = CSS.CSS_Color.textCancelColor,
                };
                FLayout.AddChidren(buttonNameBtn);
                //删除图标
                var delIconBtn = new Button
                {
                    UnSelectedImagePath = "PirIcon/delbuton.png",
                    Y = Application.GetRealHeight(12 + line * (16 + 44)),
                    X = Application.GetRealWidth((16 + 92) + (104 + 16) * j),
                    Width = Application.GetRealWidth(16),
                    Height = Application.GetRealWidth(16),
                    Tag = nameObj,
                };
                if (if_bool)
                {
                    FLayout.AddChidren(delIconBtn);
                }
                //删除图标的点击事件
                delIconBtn.MouseUpEventHandler += (sender, e) =>
                {
                    var obj = delIconBtn.Tag as Entity.AttributesStatus;
                    action(obj);
                };
                if (i % 3 == 0)
                {
                    //满一行重置j=0值;
                    j = -1;
                    line += 1;
                }
            }
        }
        /// <summary>
        /// 动态加载按钮列表
        /// </summary>
        /// <param name="FLayout">父控件</param>
        /// <param name="action">回调</param>
        /// <param name="sum">多少个FrameLayout控件</param>
        public void AddFrameLayout(FrameLayout FLayout, Action<int,FrameLayout> action, int sum)
        {
            FrameLayout viewFLayout = new FrameLayout
            {
                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
            };
            FLayout.AddChidren(viewFLayout);
            FrameLayout controlFl = new FrameLayout();
            controlFl.Y = Application.GetRealHeight(319);
            controlFl.X = Application.GetRealWidth(16);
            controlFl.Width = Application.GetRealWidth(343);
            controlFl.Height = Application.GetRealHeight(328);
            controlFl.BackgroundColor = CSS.CSS_Color.view;
            controlFl.Radius = (uint)Application.GetRealHeight(12);
            viewFLayout.AddChidren(controlFl);
            ///添加遥控器
            Button text3Btn = new Button
            {
                Y = Application.GetRealHeight(12),
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(343 - 16 * 2),
                Height = Application.GetRealHeight(20),
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.textConfirmColor,
                TextAlignment = TextAlignment.Center,
                TextID = StringId.tianjiayaokongqi,
                IsBold = true,
            };
            controlFl.AddChidren(text3Btn);
            viewFLayout.MouseUpEventHandler += (sender1, e1) =>
            {
                //关闭允许左滑
                MainPage.BasePageView.ScrollEnabled = true;
                viewFLayout.RemoveFromParent();
            };
            int line = 0;
            for (int i = 1, j = 0; i <= sum; i++, j++)
            {
                var currpirdeviceFLayout = new FrameLayout
                {
                    Width = Application.GetRealWidth(80),
                    Height = Application.GetRealWidth(80),
                    X = Application.GetRealWidth(26 + (80 + 25) * j),
                    Y = Application.GetRealHeight(52 + (80 + 12) * line),
                };
                controlFl.AddChidren(currpirdeviceFLayout);
                var deviceIconBtn = new Button
                {
                    Y = Application.GetRealHeight(8),
                    X = Application.GetRealWidth(20),
                    Width = Application.GetRealWidth(40),
                    Height = Application.GetRealWidth(40),
                    UnSelectedImagePath = "PirIcon/Infraredtreasure.png",
                };
                currpirdeviceFLayout.AddChidren(deviceIconBtn);
                var iconNameBtn = new Button
                {
                    Y = deviceIconBtn.Bottom + Application.GetRealHeight(8),
                    Width = Application.GetRealWidth(80),
                    Height = Application.GetRealHeight(17),
                    TextSize = TextSize.text12,
                    TextColor = CSS.CSS_Color.TextualColor,
                    TextAlignment = TextAlignment.Center,
                };
                currpirdeviceFLayout.AddChidren(iconNameBtn);
                var clickBtn = new Button { Tag = i };
                currpirdeviceFLayout.AddChidren(clickBtn);
                if (i % 3 == 0)
                {
                    //满一行重置j=0值;
                    j = -1;
                    line += 1;
                }
                GetIconAndText(i, deviceIconBtn, iconNameBtn);
                clickBtn.MouseUpEventHandler += (sender2, e2) =>
                {
                    //1=空调;2=电视;3=风扇;4=机顶盒;5=DVD/EVD/VCD;6=投影仪;7=自定义;
                    int if_value = int.Parse(clickBtn.Tag.ToString());
                    action(if_value, viewFLayout);
                };
            }
        }
        /// <summary>
        /// 设置图片和备注
        /// </summary>
        /// <param name="index">索引值</param>
        /// <param name="deviceIconBtn">图标Btn</param>
        /// <param name="deviceNameBtn">设备备注Btn</param>
        private void GetIconAndText(int index, Button deviceIconBtn, Button deviceNameBtn)
        {
            string iconPath = "";
            int deviceNameIndex = 0;
            switch (index)
            {
                case 1:
                    {
                        iconPath = "PirIcon/air.png";
                        deviceNameIndex = StringId.kongtiao;
                    }
                    break;
                case 2:
                    {
                        iconPath = "PirIcon/tv.png";
                        deviceNameIndex = StringId.dianshi;
                    }
                    break;
                case 3:
                    {
                        iconPath = "PirIcon/fan.png";
                        deviceNameIndex = StringId.fengshan;
                    }
                    break;
                case 4:
                    {
                        iconPath = "PirIcon/stb.png";
                        deviceNameIndex = StringId.jidinghe;
                    }
                    break;
                case 5:
                    {
                        iconPath = "PirIcon/dvd.png";
                        deviceNameIndex = StringId.dvd;
                    }
                    break;
                case 6:
                    {
                        iconPath = "PirIcon/projector.png";
                        deviceNameIndex = StringId.touyingyi;
                    }
                    break;
                case 7:
                    {
                        iconPath = "PirIcon/custom.png";
                        deviceNameIndex = StringId.zidingyi;
                    }
                    break;
            }
            deviceIconBtn.UnSelectedImagePath = iconPath;
            deviceNameBtn.TextID = deviceNameIndex;
        }
        /// <summary>
        /// 获取设备类型str
        /// </summary>
        /// <param name="index">索引值</param>
        public static string GetTypeString(int index)
        {
            string type = "";
            switch (index)
            {
                case 1:
                    {
                        //空调
                        type = "ac-" + SPK.AcIr;
                    }
                    break;
                case 2:
                    {
                        //电视
                        type = "tv-" + SPK.TvIr;
                    }
                    break;
                case 3:
                    {
                        //风扇
                        // type = "fan-" + SPK.ElectricFan;
                    }
                    break;
                case 4:
                    {
                        //机顶盒
                        //  type = "set_top_box-" + SPK.ElectricTV;
                    }
                    break;
                case 5:
                    {
                        //影碟机
                        // type = "dvd-" + SPK.ElectricTV;
                    }
                    break;
                case 6:
                    {
                        //投影仪
                        //  type = "projector-" + SPK.ElectricTV;
                    }
                    break;
            }
            return type;
        }
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="tag">标记值</param>
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PirView.cs
@@ -47,28 +47,12 @@
            IsBold = true,
        };
        /// <summary>
        /// 版本号
        /// </summary>
        public Button versionBtn = new Button
        {
            Y = Application.GetRealHeight(40),
            X = Application.GetRealWidth(72),
            Width = Application.GetRealWidth(120),
            Height = Application.GetRealHeight(17),
            Text = "版本号v1.3.5",
            TextAlignment = TextAlignment.CenterLeft,
            TextSize = TextSize.text12,
            TextColor = CSS.CSS_Color.textCancelColor,
        };
        /// <summary>
        /// 当前个数
        /// </summary>
        public Button geBtn = new Button
        {
            Y = Application.GetRealHeight(59),
            Y = Application.GetRealHeight(40),
            X = Application.GetRealWidth(72),
            Width = Application.GetRealWidth(120),
            Height = Application.GetRealHeight(17),
@@ -83,7 +67,7 @@
        /// </summary>
        public Button sumBtn = new Button
        {
            Y = Application.GetRealHeight(59),
            Y = Application.GetRealHeight(40),
            Width = Application.GetRealWidth(50),
            Height = Application.GetRealHeight(17),
            Text = "/10",
@@ -159,7 +143,6 @@
            devfLayout.Height = Application.GetRealHeight(92 + (50 * i));
            devfLayout.AddChidren(priequipmentBtn);
            devfLayout.AddChidren(deviceNameBtn);
            devfLayout.AddChidren(versionBtn);
            devfLayout.AddChidren(geBtn);
            geBtn.Width = geBtn.GetTextWidth();
            devfLayout.AddChidren(sumBtn);
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.Stan;
@@ -408,9 +409,9 @@
                    TextSize = CSS_FontSize.TextFontSize,
                };
                modeChangeView.AddChidren(btnFanText);
                btnFanIcon.UnSelectedImagePath = acFunction.GetModeIconPath(m,false);
                btnFanIcon.SelectedImagePath = acFunction.GetModeIconPath(m);
                btnFanText.Text = acFunction.GetModeAttrText(m);
                btnFanIcon.UnSelectedImagePath = acFunction.GetFanIconPath(m,false);
                btnFanIcon.SelectedImagePath = acFunction.GetFanIconPath(m);
                btnFanText.Text = acFunction.GetFanAttrText(m);
                if (modeList.IndexOf(m) < modeList.Count - 1)
                {
@@ -490,13 +491,14 @@
            };
            div.AddChidren(bodyView);
            var contentView = new FrameLayout()
            var contentView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(16),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(296),
            };
            bodyView.AddChidren(contentView);
                var row = new FrameLayout()
                {
@@ -505,7 +507,14 @@
                contentView.AddChidren(row);
                int index = 0;
            foreach (var attr in device.attributes)
            List<FunctionAttributes> attrList = new List<FunctionAttributes>();
            attrList.AddRange(device.attributes);
            attrList.Add(new FunctionAttributes() {
                key = "+",
            });
            foreach (var attr in attrList)
            {
                if (attr.key == FunctionAttributeKey.Mode
                    || attr.key == FunctionAttributeKey.OnOff
@@ -522,13 +531,57 @@
                {
                    row = new FrameLayout()
                    {
                        Width = Application.GetRealWidth(200),
                        Height = Application.GetRealHeight(56),
                    };
                    contentView.AddChidren(row);
                }
                if (attr.key == "+")
                {
                    var addView = new FrameLayout()
                    {
                        Gravity = Gravity.CenterVertical,
                        Width = Application.GetRealWidth(88),
                        Height = Application.GetRealHeight(40),
                        Radius = (uint)Application.GetRealHeight(18),
                        BorderColor = CSS_Color.PromptingColor1,
                        BorderWidth = (uint)Application.GetRealWidth(2),
                    };
                var btn = new Button()
                    if (index % 3 == 1)
                    {
                        addView.Gravity = Gravity.Center;
                    }
                    else if (index % 3 == 2)
                    {
                        addView.X = Application.GetRealWidth(208);
                    }
                    row.AddChidren(addView);
                    var btnAdd = new Button()
                    {
                        Gravity = Gravity.Center,
                        UnSelectedImagePath = "Public/PlusSignIcon.png",
                        Width = Application.GetRealWidth(32),
                        Height = Application.GetRealWidth(32),
                    };
                    addView.AddChidren(btnAdd);
                    btnAdd.MouseUpEventHandler = (sender, e) =>
                    {
                        dialog.Close();
                        var addButton = new AcControlPage_AddIrButton();
                        MainPage.BasePageView.AddChidren(addButton);
                        addButton.Show(device);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    };
                }
                else
                {
                    var btn = new Button()
                {
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetRealWidth(88),
@@ -573,7 +626,7 @@
                    { IsBackground = true }.Start();
                };
                }
                index++;
            }
@@ -666,6 +719,14 @@
                device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
                btnTemp.Text = e.ToString();
            };
            arcBar.MouseDownEventHandler = (sender, e) => {
                Console.WriteLine("ddd");
                MainPage.BasePageView.ScrollEnabled =false;
            };
            arcBar.MouseUpEventHandler = (sender, e) => {
                Console.WriteLine("ddd2");
                MainPage.BasePageView.ScrollEnabled = true;
            };
        }
        /// <summary>
        /// 控制模式事件
@@ -723,7 +784,7 @@
            Application.RunOnMainThread(() =>
            {
                btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp);
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.IndoorTemp))) + "°C";
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C";
                btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
                btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed));
                arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage_AddIrButton.cs
New file
@@ -0,0 +1,167 @@
using System;
using HDL_ON.Entity;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using HDL_ON.UI.UI2.PersonalCenter.PirDevice;
using HDL_ON.UI.UI2.PersonalCenter.PirDevice.View;
using Shared;
namespace HDL_ON.UI
{
    public class AcControlPage_AddIrButton : FrameLayout
    {
        public AcControlPage_AddIrButton()
        {
        }
        public void Show(Function control)
        {
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            UI2.PersonalCenter.PirDevice.View.TopView topView = new UI2.PersonalCenter.PirDevice.View.TopView();
            topView.topNameBtn.TextID = StringId.tianjiayaokongqi;
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); };
            FrameLayout editfLayout = new FrameLayout
            {
                Y = topView.frameLayout.Bottom,
                BackgroundColor = CSS.CSS_Color.textWhiteColor,
                Height = Application.GetRealHeight(152),
                Width = Application.GetRealWidth(375),
            };
            this.AddChidren(editfLayout);
            //线
            Button lineBtn = new Button
            {
                Y = Application.GetRealHeight(43),
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(375 - 16 * 2),
                Height = 1,
                BackgroundColor = CSS.CSS_Color.viewLine,
            };
            editfLayout.AddChidren(lineBtn);
            //请输入按键名称
            EditText editText = new EditText()
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(375 - 16 * 2),
                Height = Application.GetRealHeight(44),
                PlaceholderText = Language.StringByID(StringId.anjianmingcheng),
                PlaceholderTextColor = CSS.CSS_Color.textCancelColor,
                TextColor = CSS.CSS_Color.textColor,
                TextSize = TextSize.text14,
                TextAlignment = TextAlignment.CenterLeft,
            };
            editfLayout.AddChidren(editText);
            //下一步
            Button saveBtn = new Button
            {
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealHeight(44),
                Y = Application.GetRealHeight(92),
                X = Application.GetRealWidth(78),
                TextID = StringId.xiayibu,
                TextSize = TextSize.text16,
                TextColor = CSS.CSS_Color.textWhiteColor,
                TextAlignment = TextAlignment.Center,
                BackgroundColor = CSS.CSS_Color.btnSaveBackgroundColor,
                Radius = (uint)Application.GetRealHeight(22),
            };
            editfLayout.AddChidren(saveBtn);
            FrameLayout fLayout = new FrameLayout
            {
                Y = editfLayout.Bottom + Application.GetRealHeight(8),
                Height = Application.GetRealHeight(667 - 64 - 152 - 8),
                Width = Application.GetRealWidth(375),
                BackgroundColor = CSS.CSS_Color.textWhiteColor,
            };
            this.AddChidren(fLayout);
            //推荐按键
            Button titleBtn = new Button
            {
                Y = Application.GetRealHeight(12),
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealHeight(20),
                TextID = StringId.tuijiananjian,
                TextSize = TextSize.text14,
                TextColor = CSS.CSS_Color.text1Color,
                TextAlignment = TextAlignment.CenterLeft,
            };
            fLayout.AddChidren(titleBtn);
            //动态加载Button按钮父控件
            FrameLayout buttonFLayout = new FrameLayout
            {
                Y = Application.GetRealHeight(32),
                Height = Application.GetRealHeight(667 - 64 - 152 - 8 - 12 - 20),
                Width = Application.GetRealWidth(375),
            };
            fLayout.AddChidren(buttonFLayout);
            #endregion
            Buttons buttons = new Buttons();
            var buttonNameList = buttons.GetList("默认按钮");
            buttons.AddButton(buttonFLayout, buttonNameList, (s) =>
            {
                editText.Text = s;
#if __Android__
                editText.SetSelectionEnd();
#endif
            });
            ///下一步的点击事件
            saveBtn.MouseUpEventHandler += (sender, e) =>
            {
                var texts = editText.Text.Trim();
                if (string.IsNullOrEmpty(editText.Text))
                {
                    //名称不能为空
                    return;
                }
                var butName = control.attributes.Find((c) => c.key == texts);
                if (butName != null)
                {
                    //名称已经存在
                    return;
                }
                //new引导界面
                ReplicationView replication = new ReplicationView();
                replication.Show(this);
                //添加数据对象
                AttributesStatus buttonObj = new AttributesStatus();
                buttonObj.key = "key" + control.attributes.Count.ToString();
                buttonObj.value = texts;
                PirSend.CodeStudy(new Control() { deviceId = control.deviceId,sid = control.sid }, buttonObj, (mqttData) =>
                {
                    if (mqttData != null)// && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                    {
                        Method method = new Method();
                        Method.buttondata = "";
                        var mqttdate = method.MqttDate("按键", control.sid, 25);
                        if (mqttdate != null)
                        {
                            this.RemoveFromParent();
                            control.attributes.Add(new FunctionAttributes() { key = buttonObj.key, value = new System.Collections.Generic.List<string>() { buttonObj.value } });
                        }
                        else
                        {
                            replication.RemView();
                            new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                        }
                    }
                    else
                    {
                        Method method = new Method();
                        new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                    }
                });
            };
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -458,7 +458,7 @@
            Application.RunOnMainThread(() =>
            {
                btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp);
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.IndoorTemp))) + "°C";
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C";
                btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
                arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
                if (device.trait_on_off.curValue.ToString() == "on")
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
@@ -26,7 +26,7 @@
                    AC temp = new AC();
                    updataTime = DateTime.Now;
                    bodyView.btnTemp.Text = updateTemp.GetAttrState(FunctionAttributeKey.SetTemp);
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState((string)FunctionAttributeKey.IndoorTemp))) + "°C";
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState((string)FunctionAttributeKey.RoomTemp))) + "°C";
                    bodyView.btnMode.UnSelectedImagePath = temp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode));
                    bodyView.btnWindSpeed.UnSelectedImagePath = temp.GetFanIconPath(updateTemp.GetAttrState(FunctionAttributeKey.FanSpeed));
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
@@ -72,12 +72,12 @@
            if (isAdd)
            {
                function.roomIds.Add(room.roomId);
                room.AddRoomFunction(function);
                //room.AddRoomFunction(function);
            }
            else
            {
                function.roomIds.Remove(room.roomId);
                room.RemoveRoomFunction(function);
                //room.RemoveRoomFunction(function);
            }
            function.UpdataRoomIds();
            if (function.roomIds.Count == Entity.SpatialInfo.CurrentSpatial.RoomList.Count)
HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs
@@ -45,7 +45,6 @@
            var row = new FrameLayout()
            {
                //Width = Application.GetRealWidth(200),
                Height = Application.GetRealHeight(56),
            };
            contentView.AddChidren(row);
@@ -53,11 +52,10 @@
            int index = 0;
            foreach(var attr in device.attributes)
            {
                if(index != 0 && index%3==0)
                if (index != 0 && index % 3 == 0)
                {
                    row = new FrameLayout()
                    {
                        Width = Application.GetRealWidth(200),
                        Height = Application.GetRealHeight(56),
                    };
                    contentView.AddChidren(row);
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -20,7 +20,7 @@
                        return;
                    }
                    bodyView.btnTemp.Text = updateTemp.GetAttrState(FunctionAttributeKey.SetTemp);
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.IndoorTemp))) + "°C";
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C";
                    bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode));
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
                    if (updateTemp.trait_on_off.curValue.ToString() == "on")
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
@@ -91,10 +91,10 @@
            dimmerBar.OnStopTrackingTouchEvent = (sender, e) => {
                onDimmerBar = false;
                function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
                function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString());
                Control.Ins.SendWriteCommand(function, d);
                function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress);
                btnBrightnessText.Text = dimmerBar.Progress + "%";
            };
            //20201223 删除滑动发送命令,防止控件跳动