36个文件已添加
62个文件已修改
3838 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/Collection/DefenseAlarmIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmCenter/InAlarmBigIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmCenter/NoDefenseBigIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/AirSwitch/AirSwitchBgIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/AirSwitch/AirSwitchBgOnIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/AirSwitch/EnergyIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/EnvirSensor/HchoBg.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/EnvirSensor/HchoIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/electricalbreaker_blue.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/electricalbreaker_white.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/electricalbreaker.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/sensorhcho.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/LogicIcon/security.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/PersonalCenter/FacePassage/FailIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/PersonalCenter/FacePassage/TrueIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/PersonalCenter/ResidenceInAlarmIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Collection/DefenseAlarmIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/InAlarmBigIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/NoDefenseBigIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/AirSwitch/AirSwitchBgIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/AirSwitch/AirSwitchBgOnIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/AirSwitch/EnergyIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvirSensor/HchoBg.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvirSensor/HchoIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/electricalbreaker_blue.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/electricalbreaker_white.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/electricalbreaker.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorhcho.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/LogicIcon/security.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/PersonalCenter/FacePassage/FailIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/PersonalCenter/FacePassage/TrueIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/PersonalCenter/ResidenceInAlarmIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/DB_ResidenceData.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/AirSwitch.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/SecurityAlarm.cs 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Sensor.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/PublicAssmebly.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/TopViewDiv.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/Security.cs 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorMegahealth/AddSenesorMegahealthDirection1Page.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/CustomerObj.cs 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs 448 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FaceSettingPage.cs 197 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FaceSettingResultPage.cs 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPage.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs 148 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs 188 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmDeploymentSettingPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs 249 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs 423 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,28 +1,13 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs">
    <Files>
      <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" />
      <File FileName="HDL_ON/DAL/DriverLayer/UdpSocket.cs" />
      <File FileName="HDL_ON/Entity/FunctionList.cs" Line="435" Column="32" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" Line="459" Column="40" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="295" Column="67" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="234" Column="1" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmDeploymentSettingPage.cs" Line="29" Column="16" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="390" Column="52" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" Line="154" Column="15" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" Line="705" Column="5" />
    </Files>
  <MonoDevelop.Ide.Workbench>
    <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="Utlis" expanded="True" />
              </Node>
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="DriverLayer" expanded="True" />
                <Node name="Mqtt" expanded="True" />
                <Node name="Server" expanded="True" />
              </Node>
@@ -30,36 +15,24 @@
                <Node name="Function" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI0-Public" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="2-Classification" expanded="True">
                    <Node name="ClassificationPage.cs" selected="True" />
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="FaceManagement" expanded="True" />
                  </Node>
                  <Node name="4-PersonalCenter" expanded="True" />
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="ArmCenter" expanded="True" />
                    <Node name="1ContorlPage" 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="PersonalCenter" 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="ArmCenter" expanded="True" />
                  </Node>
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_Android" selected="True" />
            <Node name="HDL-ON_iOS" expanded="True" />
          </Node>
        </State>
      </Pad>
      <Pad Id="MonoDevelop.Debugger.WatchPad">
        <State>
          <Value>cus.customerFaceUrl</Value>
        </State>
      </Pad>
    </Pads>
@@ -70,7 +43,7 @@
    <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
@@ -78,9 +51,13 @@
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="431" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="747" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" line="106" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="348" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" line="54" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" line="168" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs" line="71" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" line="468" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="224" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="466" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="523" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="279" column="1" />
    </BreakpointStore>
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
HDL-ON_Android/Assets/Language.ini
@@ -400,7 +400,7 @@
414=Controller on
415=Someone
416=Log
417=Water Leakage
417=Water leakage
418=In Alarm
419=Normal
420=Hot dry
@@ -473,6 +473,21 @@
485=Check/Modify
486=Defense function / Alarm status
487=Alarm target after triggering
488=Face passage
489=Apply face ID to:
490=Community access control
491=About face ID and privacy
492=Erase data
493=Reset face ID
494=Set face ID
495=Face passage settings
496=There is no associated task deployment status
497=Custom
498=Trigger delay
499=Add defense function
500=Add alarm target
501=Security alarm: {0} is triggered.
502=Clear the security alarm?
 
1000=Room Humidity
@@ -810,43 +825,7 @@
6095=More than 30 add buttons
 
 
7108=Leak/No Leak
7109=Leak
7110=No leak
7111=Water leaking/no water leaking
7112=Water leaking
7113=No water leaking
7114=Someone/Nobody
7115=Someone
7116=Nobody
7117=Open/Close
7118=On
7119=Close
7120=Anti-dismantling function
7121=Online
7122=Not online
7123=Air quality
7124=Excellent
7125=Good
7126=Poor
7127=Send notification
7128=Notification content
7129=(within 100 characters)
7130=Account selection
7131=App push
7132=Automation
7133=Executed
7134=Target State
7135=Tumble
7136=Temperature
7137=Humidity
7138=PM2.5
7139=CO2
7140=TVOC
7141=Exceeding
7142=Serious
7143=High
7144=excellence
 
 
6000=Rename
@@ -975,6 +954,49 @@
7105=Light pollution: 75 ~ 115ug/m3
7106=Moderate pollution: 115 ~ 150ug/m3
7107=Heavy pollution: > 150ug/m3
7108=Leak/No Leak
7109=Leak
7110=No leak
7111=Water leaking/no water leaking
7112=Water leaking
7113=No water leaking
7114=Someone/Nobody
7115=Someone
7116=Nobody
7117=Open/Close
7118=On
7119=Close
7120=Anti-dismantling function
7121=Online
7122=Not online
7123=Air quality
7124=Excellent
7125=Good
7126=Poor
7127=Send notification
7128=Notification content
7129=(within 100 characters)
7130=Account selection
7131=App push
7132=Automation
7133=Executed
7134=Target State
7135=Tumble
7136=Temperature
7137=Humidity
7138=PM2.5
7139=CO2
7140=TVOC
7141=Exceeding
7142=Serious
7143=High
7144=excellence
7145=Security
7146=Add security
7147=Arm
7148=Disarm
    
9000=Please sign in with new cell phone number.
9001=Please sign in with new email address.
@@ -1555,7 +1577,21 @@
485=查看/修改
486=布防功能/报警状态
487=触发后告警目标
488=人脸通行
489=将面容ID应用于:
490=社区门禁通行
491=关于面容ID与隐私
492=抹掉数据
493=重置面容
494=设置面容
495=人脸通行设置
496=还没有关联任何布防状态
497=自定义
498=触发延时
499=添加布防功能
500=添加告警目标
501=安防报警:{0}被触发。
502=是否解除安防警报?
 
1000=室内湿度
1001=童锁
@@ -2041,6 +2077,11 @@
7142=严重
7143=偏高
7144=优秀
7145=安防
7146=添加安防
7147=布防
7148=撤防
 
9000=请使用新的手机账号登录APP
9001=请使用新的邮箱账号登录APP
HDL-ON_Android/Assets/Phone/Collection/DefenseAlarmIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmCenter/InAlarmBigIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/ArmCenter/NoDefenseBigIcon.png

HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/AirSwitch/AirSwitchBgIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/AirSwitch/AirSwitchBgOnIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/AirSwitch/EnergyIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/EnvirSensor/HchoBg.png
HDL-ON_Android/Assets/Phone/FunctionIcon/EnvirSensor/HchoIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/electricalbreaker_blue.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/electricalbreaker_white.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/electricalbreaker.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/sensorhcho.png
HDL-ON_Android/Assets/Phone/LogicIcon/security.png
HDL-ON_Android/Assets/Phone/PersonalCenter/FacePassage/FailIcon.png
HDL-ON_Android/Assets/Phone/PersonalCenter/FacePassage/TrueIcon.png
HDL-ON_Android/Assets/Phone/PersonalCenter/ResidenceInAlarmIcon.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -443,6 +443,20 @@
    <AndroidAsset Include="Assets\Phone\Collection\DefenseStatusIcon.png" />
    <AndroidAsset Include="Assets\Phone\Collection\DisarmStatusIcon.png" />
    <AndroidAsset Include="Assets\Phone\PersonalCenter\ResidenceDefenseIcon.png" />
    <AndroidAsset Include="Assets\Phone\Collection\DefenseAlarmIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmCenter\InAlarmBigIcon.png" />
    <AndroidAsset Include="Assets\Phone\PersonalCenter\ResidenceInAlarmIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\electricalbreaker.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\AirSwitchBgIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\AirSwitchBgOnIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\EnergyIcon.png" />
    <AndroidAsset Include="Assets\Phone\PersonalCenter\FacePassage\FailIcon.png" />
    <AndroidAsset Include="Assets\Phone\PersonalCenter\FacePassage\TrueIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\sensorhcho.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\HchoBg.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\HchoIcon.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" />
  </ItemGroup>
  <ItemGroup>
    <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\BindScene.png" />
@@ -1343,6 +1357,7 @@
    <Folder Include="Assets\Phone\FunctionIcon\IrFan\" />
    <Folder Include="Assets\Phone\PersonalCenter\FacePassage\" />
    <Folder Include="Assets\Phone\FunctionIcon\Light\LightScene\" />
    <Folder Include="Assets\Phone\FunctionIcon\Electrical\AirSwitch\" />
  </ItemGroup>
  <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" />
  <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
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="202108201" android:versionName="1.2.202108201" package="com.hdl.onpro">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108271" android:versionName="1.2.202108271" package="com.hdl.onpro">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <!-- 乐橙可视对讲需要的权限 -->
    <!--<uses-permission android:name="android.permission.INTERNET" />-->
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -459,6 +459,7 @@
        <Folder Include="Assets.xcassets\device_bg.imageset\" />
        <Folder Include="Resources\Phone\FunctionIcon\Light\LightScene\" />
        <Folder Include="Resources\Phone\PersonalCenter\FacePassage\" />
        <Folder Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\" />
    </ItemGroup>
    <ItemGroup>
        <InterfaceDefinition Include="LaunchScreen.storyboard" />
@@ -1331,6 +1332,20 @@
      <BundleResource Include="Resources\Phone\Collection\DefenseStatusIcon.png" />
      <BundleResource Include="Resources\Phone\Collection\DisarmStatusIcon.png" />
      <BundleResource Include="Resources\Phone\PersonalCenter\ResidenceDefenseIcon.png" />
      <BundleResource Include="Resources\Phone\Collection\DefenseAlarmIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\InAlarmBigIcon.png" />
      <BundleResource Include="Resources\Phone\PersonalCenter\ResidenceInAlarmIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\AirSwitchBgIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\AirSwitchBgOnIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\AirSwitch\EnergyIcon.png" />
      <BundleResource Include="Resources\Phone\PersonalCenter\FacePassage\FailIcon.png" />
      <BundleResource Include="Resources\Phone\PersonalCenter\FacePassage\TrueIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\HchoBg.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\HchoIcon.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\sensorhcho.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\electricalbreaker.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" />
    </ItemGroup>
    <ItemGroup>
      <ITunesArtwork Include="iTunesArtwork" />
HDL-ON_iOS/Info.plist
@@ -100,9 +100,9 @@
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>CFBundleShortVersionString</key>
    <string>1.2.202108171</string>
    <string>1.2.202108271</string>
    <key>CFBundleVersion</key>
    <string>1.2.08171</string>
    <string>1.2.08271</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Use geographic location to provide services such as weather</string>
    <key>NSAppleMusicUsageDescription</key>
HDL-ON_iOS/Resources/Language.ini
@@ -487,6 +487,7 @@
499=Add defense function
500=Add alarm target
501=Security alarm: {0} is triggered.
502=Clear the security alarm?
 
1000=Room Humidity
@@ -824,43 +825,7 @@
6095=More than 30 add buttons
 
 
7108=Leak/No Leak
7109=Leak
7110=No leak
7111=Water leaking/no water leaking
7112=Water leaking
7113=No water leaking
7114=Someone/Nobody
7115=Someone
7116=Nobody
7117=Open/Close
7118=On
7119=Close
7120=Anti-dismantling function
7121=Online
7122=Not online
7123=Air quality
7124=Excellent
7125=Good
7126=Poor
7127=Send notification
7128=Notification content
7129=(within 100 characters)
7130=Account selection
7131=App push
7132=Automation
7133=Executed
7134=Target State
7135=Tumble
7136=Temperature
7137=Humidity
7138=PM2.5
7139=CO2
7140=TVOC
7141=Exceeding
7142=Serious
7143=High
7144=excellence
 
 
6000=Rename
@@ -989,6 +954,49 @@
7105=Light pollution: 75 ~ 115ug/m3
7106=Moderate pollution: 115 ~ 150ug/m3
7107=Heavy pollution: > 150ug/m3
7108=Leak/No Leak
7109=Leak
7110=No leak
7111=Water leaking/no water leaking
7112=Water leaking
7113=No water leaking
7114=Someone/Nobody
7115=Someone
7116=Nobody
7117=Open/Close
7118=On
7119=Close
7120=Anti-dismantling function
7121=Online
7122=Not online
7123=Air quality
7124=Excellent
7125=Good
7126=Poor
7127=Send notification
7128=Notification content
7129=(within 100 characters)
7130=Account selection
7131=App push
7132=Automation
7133=Executed
7134=Target State
7135=Tumble
7136=Temperature
7137=Humidity
7138=PM2.5
7139=CO2
7140=TVOC
7141=Exceeding
7142=Serious
7143=High
7144=excellence
7145=Security
7146=Add security
7147=Arm
7148=Disarm
    
9000=Please sign in with new cell phone number.
9001=Please sign in with new email address.
@@ -1583,6 +1591,7 @@
499=添加布防功能
500=添加告警目标
501=安防报警:{0}被触发。
502=是否解除安防警报?
 
1000=室内湿度
1001=童锁
@@ -2068,6 +2077,11 @@
7142=严重
7143=偏高
7144=优秀
7145=安防
7146=添加安防
7147=布防
7148=撤防
 
9000=请使用新的手机账号登录APP
9001=请使用新的邮箱账号登录APP
HDL-ON_iOS/Resources/Phone/Collection/DefenseAlarmIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/InAlarmBigIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/ArmCenter/NoDefenseBigIcon.png

HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/AirSwitch/AirSwitchBgIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/AirSwitch/AirSwitchBgOnIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/AirSwitch/EnergyIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvirSensor/HchoBg.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/EnvirSensor/HchoIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/electricalbreaker_blue.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/electricalbreaker_white.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/electricalbreaker.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/sensorhcho.png
HDL-ON_iOS/Resources/Phone/LogicIcon/security.png
HDL-ON_iOS/Resources/Phone/PersonalCenter/FacePassage/FailIcon.png
HDL-ON_iOS/Resources/Phone/PersonalCenter/FacePassage/TrueIcon.png
HDL-ON_iOS/Resources/Phone/PersonalCenter/ResidenceInAlarmIcon.png
HDL_ON/Common/ApiUtlis.cs
@@ -204,7 +204,7 @@
                    {
                        endTime = DateTime.Now.AddSeconds(100);
                        MainPage.Log($"读取场景数据成功");
                        var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
                        var sceneList = JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
                        if (sceneList == null)
                        {
                            sceneList = new List<Scene>();
@@ -275,12 +275,18 @@
                            {
                                UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken;
                            }
                            else if(video.interphoneType == InterphoneType.HDL.ToString())
                            {
                                DB_ResidenceData.Instance.SupportFacePass = true;
                                DB_ResidenceData.Instance.SaveResidenceData();
                            }
                        }
                    }
                    //======================安防====================
                    GetSecurityList();
                    //======================SIP账号====================
                }
                catch (Exception ex)
@@ -294,8 +300,11 @@
                        MainPage.Log($"结束读取云端数据线程");
                        endTime = DateTime.MinValue;
                        DownloadDataComplete = true;
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                    //不考虑网关情况,直接订阅
                    DAL.Mqtt.MqttClient.InitState();
@@ -327,8 +336,11 @@
                    DownloadDataComplete = true;
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                    //初始化数据
                    //SpatialInfo.CurrentSpatial.Clear();
@@ -388,17 +400,38 @@
                }
                var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>());
                var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString());
                foreach (var function in infoList)
                if (infoList != null)
                {
                    function.SaveFile();
                    FunctionList.List.IniFunctionList(function.savePath, true);
                    var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_"));
                    if (filePathList != null)
                    {
                        foreach (var file in filePathList)
                        {
                            FileUtlis.Files.DeleteFile(file);
                        }
                    }
                    foreach (var function in infoList)
                    {
                        function.SaveFile();
                        FunctionList.List.IniFunctionList(function.savePath, true);
                    }
                }
            }
            }
            else
            {
                MainPage.Log($"读取安防列表失败:Code:{pack.Code}; Msg:{pack.message}");
            }
        }
        /// <summary>
        /// 获取SIP账号信息
        /// </summary>
        public void GetSipInfo()
        {
            var pack = Ins.HttpRequest.GetSecurityList();
        }
    }
}
HDL_ON/Common/R.cs
@@ -6,6 +6,22 @@
    {
        /// <summary>
        /// 一级建筑标准
        /// </summary>
        public const int Class_I_BuildingStandard = 505;
        /// <summary>
        /// 二级建筑标准
        /// </summary>
        public const int SecondaryBuildingStandard = 506;
        /// <summary>
        /// 超标
        /// </summary>
        public const int ExceedingTheStandard = 503;
        /// <summary>
        /// 是否解除安防警报?
        /// </summary>
        public const int ClearTheSecurityAlarmTip = 502;
        /// <summary>
        /// 安防报警
        /// </summary>
        public const int SecurityAlarmTipString = 501;
@@ -2539,6 +2555,22 @@
        /// 优秀
        /// </summary>
        public const int youxiu = 7144;
        /// <summary>
        /// 安防
        /// </summary>
        public const int anfang = 7145;
        /// <summary>
        /// 添加安防
        /// </summary>
        public const int addSecurityLogic = 7146;
        /// <summary>
        /// 布防
        /// </summary>
        public const int bufang = 7147;
        /// <summary>
        /// 撤防
        /// </summary>
        public const int chefang = 7148;
        #region LE新增
HDL_ON/DAL/DriverLayer/Control.cs
@@ -467,6 +467,7 @@
                    var actionObjs = new List<ApiAlinkControlActionObj>();
                    actionObjs.Add(apiControlData);
                    var pack = httpServer.ControlDevice(actionObjs);
                    MainPage.Log($"远程控制反馈:{pack.message}");
                }
            }
@@ -633,12 +634,14 @@
                 gatewayId = DB_ResidenceData.Instance.HomeGateway.gatewayId,
                  sid = securityAlarm.sid, status = state, userSecurityId = securityAlarm.userSecurityId
                } });
                MainPage.Log($"安防控制结果:{result.Code}");
            }
            else
            {
                Dictionary<string, string> keys = new Dictionary<string, string>();
                keys.Add("sid", securityAlarm.sid);
                keys.Add("status", state);
                keys.Add("alarm", securityAlarm.alarm.ToString());
                var aLinkData = new AlinkReadFunctionStatusObj()
                {
                    id = Ins.msg_id.ToString(),
@@ -783,20 +786,31 @@
                    || receiveObj.Topic == CommunicationTopic.ct.ReadSecurityStatus + "_reply"
                    || receiveObj.Topic == CommunicationTopic.ct.SecurityStatusUp)
                {
                    var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(receiveObj.BodyDataString);
                    if (temp != null)
                    try
                    {
                        Control_Udp.ReceiveRepeatManager(temp.id, null);
                        foreach (var updataSecurity in temp.objects)
                        {
                            var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid);
                            if (updataLocalSecurity != null)
                        MainPage.Log($"局域网安防信息: {receiveObj.Topic}  : 内容: {res[1]}");
                        var tt = "";
                        lock (tt) {
                            var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(receiveObj.BodyDataString);
                            if (temp != null)
                            {
                                updataLocalSecurity.status = updataSecurity.status;
                                Control_Udp.ReceiveRepeatManager(temp.id, null);
                                foreach (var updataSecurity in temp.objects)
                                {
                                    var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid);
                                    if (updataLocalSecurity != null)
                                    {
                                        updataLocalSecurity.status = updataSecurity.status;
                                        updataLocalSecurity.alarm = updataSecurity.alarm;
                                        ArmCenterPage.LoadEvent_RefreshSecurityStatus(updataLocalSecurity);
                                    }
                                }
                                HomePage.LoadEvent_RefreshSecurityStatus();
                            }
                        }
                        HomePage.LoadEvent_RefreshSecurityStatus();
                        ArmCenterPage.LoadEvent_RefreshSecurityStatus();
                    }
                    catch (Exception ex){
                        MainPage.Log($"安防局域网异常:{ex.Message}");
                    }
                }
                else
@@ -853,7 +867,7 @@
                                return;
                            }
                        }
                        MainPage.Log($"A协议更新状态:{revString}");
                        //MainPage.Log($"A协议更新状态:{revString}");
                        foreach (var attr in updateTemp.status)
                        {
                            localFunction.time_stamp = temp.time_stamp;
@@ -864,6 +878,9 @@
                        Function localObj = null;
                        switch (localFunction.spk)
                        {
                            case SPK.AirSwitch:
                                AirSwitchPage.UpdataState(localFunction);
                                break;
                            case SPK.ElectricEnergy:
                                EnergyMainPage.UpdataStatus(localFunction);
                                break;
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -446,26 +446,33 @@
                                //安防状态变化
                                else if (topic == $"/user/{MqttInfoConfig.Current.HomeGatewayInfo.gatewayId}/custom/security/status/up")
                                {
                                    MainPage.Log($"安防状态变化");
                                    if (!string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.aesKey))
                                    {
                                        var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey);
                                        var securityString = Encoding.UTF8.GetString(securityBytes);
                                        var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(securityString);
                                        if (temp != null)
                                        try
                                        {
                                            Control_Udp.ReceiveRepeatManager(temp.id, null);
                                            foreach (var updataSecurity in temp.objects)
                                            var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey);
                                            var securityString = Encoding.UTF8.GetString(securityBytes);
                                            var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(securityString);
                                            MainPage.Log($"安防状态变化:{securityString}");
                                            if (temp != null)
                                            {
                                                var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid);
                                                if (updataLocalSecurity != null)
                                                Control_Udp.ReceiveRepeatManager(temp.id, null);
                                                foreach (var updataSecurity in temp.objects)
                                                {
                                                    updataLocalSecurity.status = updataSecurity.status;
                                                    var updataLocalSecurity = FunctionList.List.securities.Find((obj) => obj.sid == updataSecurity.sid);
                                                    if (updataLocalSecurity != null)
                                                    {
                                                        updataLocalSecurity.status = updataSecurity.status;
                                                        updataLocalSecurity.alarm = updataSecurity.alarm;
                                                        ArmCenterPage.LoadEvent_RefreshSecurityStatus(updataLocalSecurity);
                                                    }
                                                }
                                                HomePage.LoadEvent_RefreshSecurityStatus();
                                            }
                                            HomePage.LoadEvent_RefreshSecurityStatus();
                                            ArmCenterPage.LoadEvent_RefreshSecurityStatus();
                                        }catch(Exception ex)
                                        {
                                            MainPage.Log($"安防远程信息异常:{ex.Message}");
                                        }
                                    }
                                }
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -2375,6 +2375,7 @@
            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("securitys", securityStates);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            MainPage.Log($"api安防控制:{requestJson}");
            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson);
            return pack;
        }
@@ -2633,5 +2634,51 @@
        }
        #endregion
        /// <summary>
        /// 人脸录入
        /// </summary>
        /// <param name="imageBytes"></param>
        /// <returns></returns>
        public ResponsePackNew FaceSetting(string imageBytes)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("userFace", @"data:image/jpg;base64,"+imageBytes);
            //MainPage.Log(imageBytes);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_InputUserFace, requestJson);
        }
        /// <summary>
        /// 修改住户人脸关闭状态
        /// 1:开启状态 2:关闭状态
        /// 3:清除人脸数据
        /// </summary>
        public ResponsePackNew EditFaceFunction(int status)
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id);
            d.Add("faceClose", status);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SwitchFaceFunction, requestJson);
        }
        /// <summary>
        /// 获取住户详情
        /// </summary>
        /// <returns></returns>
        public ResponsePackNew GetCustomerInfo()
        {
            Dictionary<string, object> d = new Dictionary<string, object>();
            d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id);
            var requestJson = HttpUtil.GetSignRequestJson(d);
            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson);
        }
    }
}
HDL_ON/DAL/Server/HttpUtil.cs
@@ -16,10 +16,9 @@
        /// <summary>
        /// 固定域名,正式环境
        /// 公共域名就近解析
        ///
        /// </summary>
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        /// <summary>
        /// RegionMark
        /// </summary>
@@ -651,7 +650,7 @@
        /// <summary>
        /// 响应错误信息
        /// </summary>
        public string message;
        public string message = "";
        /// <summary>
        /// 这个是请求错误时的扩展数据,以后所有的附带扩展数据都会放在这里面动态维护
HDL_ON/DAL/Server/NewAPI.cs
@@ -661,6 +661,20 @@
        /// 获取通话记录
        /// </summary>
        public const string API_POST_FL_GetCallList = "/home-wisdom/platform/imou/listCallRecords";
        public const string Api_Post_GetSipInfo = "";
        /// <summary>
        /// 人脸录入
        /// </summary>
        public const string Api_Post_InputUserFace = "/community-wisdom/app/doorDevice/inputUserFace";
        /// <summary>
        /// 开关人脸功能
        /// </summary>
        public const string Api_Post_SwitchFaceFunction = "/community-wisdom/app/doorDevice/updateCustomerFaceClose";
        /// <summary>
        /// 获取住户详情
        /// </summary>
        public const string Api_Post_GetCustomerInfo = "/basis-footstone/app/customer/detail";
        #endregion
@@ -688,6 +702,11 @@
        public const string API_POST_DoorHistory = "/home-wisdom/app/device/door/logs";
        #endregion
        #region  ■  -- SIP相关接口_______________________________
        #endregion
    }
    ///// <summary>
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
@@ -784,6 +784,10 @@
        /// 萤石猫眼呼叫
        /// </summary>
        EZVIZ,
        /// <summary>
        ///
        /// </summary>
        HDL,
    }
HDL_ON/Entity/DB_ResidenceData.cs
@@ -155,6 +155,10 @@
            HDL_ON.UI.UI2.Intelligence.Automation.Logic.LogicList.Clear();
            DAL.Mqtt.MqttClient.DisConnectRemote("退出登录,或者切换住宅");
        }
        /// <summary>
        /// 是否支持人脸通行
        /// </summary>
        public bool SupportFacePass = false;
        /// <summary>
        /// 网关详细信息
HDL_ON/Entity/Function/AirSwitch.cs
New file
@@ -0,0 +1,10 @@
using System;
namespace HDL_ON.Entity
{
    public class AirSwitch
    {
        public AirSwitch()
        {
        }
    }
}
HDL_ON/Entity/Function/Function.cs
@@ -1274,6 +1274,10 @@
        /// 青萍环境传感器
        /// </summary>
        public const string SensorEnvironment3 = "sensor.environment3";
        /// <summary>
        /// 甲醛
        /// </summary>
        public const string SensorHcho = "sensor.hcho";
        /// <summary>
        /// 环境传感器spk列表
@@ -1290,6 +1294,7 @@
            spkList.Add(SensorEnvironment);
            spkList.Add(SensorEnvironment2);
            spkList.Add(SensorEnvironment3);
            spkList.Add(SensorHcho);
            return spkList;
        }
@@ -1362,6 +1367,10 @@
        /// 红外风扇
        /// </summary>
        public const string FanIr = "ir.fan";
        /// <summary>
        /// 智能空开
        /// </summary>
        public const string AirSwitch = "electrical.breaker";
        #region 涂鸦
        /// <summary>
@@ -1404,6 +1413,7 @@
            spkList.Add(ElectricTuyaFan);
            spkList.Add(ElectricTuyaWeepRobot);
            spkList.Add(ElectricTuyaWaterValve);
            spkList.Add(AirSwitch);
            return spkList;
        }
HDL_ON/Entity/Function/SecurityAlarm.cs
@@ -6,6 +6,78 @@
namespace HDL_ON.Entity
{
    public class SecurityCenter111111
    {
        static SecurityCenter111111 _securityCenter;
        public static SecurityCenter111111 Ins
        {
            get
            {
                if (_securityCenter == null)
                {
                    _securityCenter = new SecurityCenter111111();
                }
                return _securityCenter;
            }
        }
        /// <summary>
        /// 布防中
        /// </summary>
        public bool InDefense
        {
            get
            {
                lock (FunctionList.List.securities)
                {
                    var temp = FunctionList.List.securities.Find((obj) => obj.status == "enable");
                    return temp == null ? false : true;
                }
            }
        }
        /// <summary>
        /// 报警中
        /// </summary>
        public bool InAlarm
        {
            get
            {
                lock (FunctionList.List.securities)
                {
                    var temp = FunctionList.List.securities.Find((obj) => obj.alarm == true);
                    return temp == null ? false : true;
                }
            }
        }
        SecurityAlarm _inDefenseMode;
        /// <summary>
        /// 当前布防模式
        /// </summary>
        public SecurityAlarm InDefenseMode
        {
            get
            {
                if (_inDefenseMode == null)
                {
                    lock (FunctionList.List.securities)
                    {
                        var temp = FunctionList.List.securities.Find((obj) => obj.status == "enable");
                        return temp;
                    }
                }
                return _inDefenseMode;
            }
        }
    }
    public class SecurityAlarm
    {
        public SecurityAlarm()
@@ -39,6 +111,10 @@
        /// 撒防:disable
        /// </summary>
        public string status = "disable";
        /// <summary>
        /// 报警状态
        /// </summary>
        public bool alarm = false;
        /// <summary>
        /// 类型
        /// "all"--全宅布防,
@@ -572,6 +648,6 @@
    {
        public string sid;
        public string status ="disable" ;
        public string alarm ="false";
        public bool alarm = false;
    }
}
HDL_ON/Entity/Function/Sensor.cs
@@ -91,6 +91,12 @@
                    _intervalValue.Add("71 ~ 40");
                    _intervalValue.Add("0 ~ 39");
                    break;
                case SPK.SensorHcho:
                    _intervalValue.Add("~ 0.08");
                    _intervalValue.Add("0.08 ~ 0.1");
                    _intervalValue.Add("0.1 ~ ");
                    break;
            }
            return _intervalValue;
        }
@@ -136,6 +142,16 @@
                    _levelColorList.Add(0xFFADE764);
                    _levelColorList.Add(0xFFFF3D3D);
                    break;
                case SPK.SensorHcho:
                    _levelColorList.Add(0xFF2172FF);
                    _levelColorList.Add(0xFFADE764);
                    _levelColorList.Add(0xFFFF3D3D);
                    break;
                default:
                    _levelColorList.Add(0x00000000);
                    _levelColorList.Add(0x00000000);
                    _levelColorList.Add(0x00000000);
                    break;
            }
            return _levelColorList;
@@ -180,6 +196,16 @@
                    _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel1);
                    _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel2);
                    _levelTextList.Add(StringId.SensorReferenceHumidityTipLevel3);
                    break;
                case SPK.SensorHcho:
                    _levelTextList.Add(StringId.Class_I_BuildingStandard);
                    _levelTextList.Add(StringId.SecondaryBuildingStandard);
                    _levelTextList.Add(StringId.ExceedingTheStandard);
                    break;
                default:
                    _levelTextList.Add(99999999);
                    _levelTextList.Add(99999999);
                    _levelTextList.Add(99999999);
                    break;
            }
            return _levelTextList;
@@ -248,6 +274,14 @@
                    else if (values < 40)
                        level = 3;
                    break;
                case SPK.SensorHcho:
                    if (values <= 0.08)
                        level = 1;
                    else if (values <= 0.1)
                        level = 2;
                    else
                        level = 3;
                    break;
            }
            return level;
        }
HDL_ON/HDL_ON.projitems
@@ -476,6 +476,12 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddInputPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddOutputPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddOutputSettingPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\FaceSettingPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Security.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\AirSwitchPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\AirSwitch.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\FaceSettingResultPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\CustomerObj.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
HDL_ON/UI/MainPage.cs
@@ -25,7 +25,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string VersionString = "1.2.0820";
        public static string VersionString = "1.2.0827";
        ///// <summary>
        ///// 客户端类型
        ///// </summary>
@@ -116,6 +116,8 @@
        {
            SPK.EnergyStandard,
            SPK.MusicStandard,
            SPK.AirSwitch,
            SPK.ElectricEnergy,
        };
@@ -328,8 +330,11 @@
                    ///等待获取住宅信息
                    Application.RunOnMainThread( () =>
                    {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                        //跳转页面----
                        UserBasePage = new UserPage();
HDL_ON/UI/UI0-Public/PublicAssmebly.cs
@@ -513,7 +513,11 @@
                if (showedTime.AddSeconds(30) > DateTime.Now)
                {
                    thread.Abort();
                    waitPage.RemoveFromParent();
                    if (waitPage != null)
                    {
                        waitPage.RemoveFromParent();
                        waitPage = null;
                    }
                }
            };
            thread.Start();
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -20,6 +20,12 @@
                //跳转到功能信息设置页面
                switch (function.spk)
                {
                    case SPK.AirSwitch:
                        var airSwitchPage = new AirSwitchPage(function);
                        MainPage.BasePageView.AddChidren(airSwitchPage);
                        airSwitchPage.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.LightSwitch:
                        var relayView = new RelayPage(function);
                        MainPage.BasePageView.AddChidren(relayView);
HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -162,7 +162,7 @@
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="tilte"></param>
        public void LoadTopView_FunctionTop(Function function, Action action)
        public void LoadTopView_FunctionTop(Function function, Action action,bool locationSet = true)
        {
            backAction = action;
@@ -186,7 +186,7 @@
            {
                var infoView = new FunctionBaseInfoSetPage(function, action);
                MainPage.BasePageView.AddChidren(infoView);
                infoView.LoadPage();
                infoView.LoadPage(locationSet);
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
        }
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -209,11 +209,10 @@
                    //etAccount.Text = "1033326940@qq.com";
                    //etAccount.Text = "18022428438";//wjc
                    //etAccount.Text = "13602944661";//kx
                    //etAccount.Text = "13226233133";//豆豆
                    //etAccount.Text = "18316672920";//lcg "18316672920";//hzx;// ""//cf;;
                    etAccount.Text = "13226233133";//豆豆
                    etAccount.Text = "18316672920";
                    //etAccount.Text = "18316120654";//tujie
                    // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568
                    etAccount.Text = "15626203746";
                    //etAccount.Text = "15626203746";
                    //etAccount.Text = "13450425807";//黄竹溪 knx项目
                }
                else
@@ -227,17 +226,19 @@
                    //etAccount.Text = "13415629083";
                    //etAccount.Text = "13676202754";//巴林服务器
                    //etAccount.Text = "13602944661";//kx
                    //etAccount.Text = "551775569@qq.com";//wcf
                    etAccount.Text = "551775569@qq.com";//wcf
                    //etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374
                    //etAccount.Text = "15971583093";//高胜
                    etAccount.Text = "15217626103";//昆明金茂项目
                    //etAccount.Text = "15217626103";//昆明金茂项目
                    //etAccount.Text = "18598273624";
                    etAccount.Text = "fslcjm5@163.com";
                    etAccount.Text = "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568
                }
                b = !b;
                etPassword.Text = "123456";
                if(etAccount.Text == "15626203746")
                if(etAccount.Text == "fslcjm5@163.com")
                {
                    etPassword.Text = "123456";
                    etPassword.Text = "a123456";
                }
                //etPassword.Text = "Hdl85521566";
                btnLogin.IsSelected = true;
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -537,27 +537,39 @@
#if DEBUG
            //FunctionList.List.Functions.Add(new Function()
            //{
            //    spk = SPK.AirFreshStandard,
            //    name = "测试新风",
            //    spk = SPK.AirSwitch,
            //    name = "智能空开",
            //    attributes = new List<FunctionAttributes>()
            //    {
            //        new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" },
            //        new FunctionAttributes(){ key = "fan",curValue= "on",state = "on" ,value = new List<string>(){ "high","low" } },
            //    },
            //});
            FunctionList.List.Functions.Add(new Function()
            {
                spk = SPK.SensorGas,
                name = "燃气传感器",
                spk = SPK.AirFreshStandard,
                name = "测试新风",
                attributes = new List<FunctionAttributes>()
                {
                    new FunctionAttributes(){ key = "enable",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } },
                    new FunctionAttributes(){ key = "status",curValue= "normal",state = "normal" ,value = new List<string>(){ "alarm", "normal" } },
                    new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" },
                    new FunctionAttributes(){ key = "fan",curValue= "low",state = "low" ,value = new List<string>(){ "high", "medium", "low" } },
                },
            });
            //FunctionList.List.Functions.Add(new Function()
            //{
            //    spk = SPK.SensorGas,
            //    name = "燃气传感器",
            //    attributes = new List<FunctionAttributes>()
            //    {
            //        new FunctionAttributes(){ key = "enable",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } },
            //        new FunctionAttributes(){ key = "status",curValue= "normal",state = "normal" ,value = new List<string>(){ "alarm", "normal" } },
            //    },
            //});
            //FunctionList.List.Functions.Add(new Function() { spk = SPK.PjtIr, name = "测试投影仪",
            //                            attributes = new List<FunctionAttributes>() {
@@ -683,7 +695,11 @@
                            GetUnreadPushMessages();
                            RegisterGetPushMessageAction();
                            waitPage.Hide();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                    catch (Exception ex) {
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -30,21 +30,38 @@
        /// </summary>
        public static void LoadEvent_RefreshSecurityStatus()
        {
            Application.RunOnMainThread(() =>
            try
            {
                if (bodyView != null)
                Application.RunOnMainThread(() =>
                {
                    foreach(var temp in FunctionList.List.securities)
                    if (bodyView != null)
                    {
                        if(temp.status == "enable")
                        lock (FunctionList.List.securities)
                        {
                            bodyView.btnSecurityStatus.IsSelected = true;
                            return;
                            foreach (var temp in FunctionList.List.securities)
                            {
                                if (temp.status == "enable")
                                {
                                    if (temp.alarm)
                                    {
                                        bodyView.btnSecurityStatus.SelectedImagePath = "Collection/DefenseAlarmIcon.png";
                                    }
                                    else
                                    {
                                        bodyView.btnSecurityStatus.SelectedImagePath = "Collection/DefenseStatusIcon.png";
                                    }
                                    bodyView.btnSecurityStatus.IsSelected = true;
                                    return;
                                }
                            }
                        }
                    }
                    bodyView.btnSecurityStatus.IsSelected = false;
                }
            });
                });
            }
            catch (Exception ex)
            {
                MainPage.Log($"安防主页更新异常:{ex.Message}");
            }
        }
        /// <summary>
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -442,8 +442,11 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                            waitPage.Hide();
                            waitPage.RemoveFromParent();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })
@@ -488,8 +491,11 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                            waitPage.Hide();
                            waitPage.RemoveFromParent();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })
HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
@@ -49,9 +49,16 @@
                functionView.frameLayout.Y = Application.GetRealHeight(0);
            }
            //场景
            LogicView.SelectTypeView sceneView = new LogicView.SelectTypeView();
            sceneView.frameLayout.Y = functionView.frameLayout.Bottom;
            sceneView.btnText.TextID = StringId.Scenes;
            sceneView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png";
            viewLayout.AddChidren(sceneView.FLayoutView());
            //室外变化
            LogicView.SelectTypeView shiwaiView = new LogicView.SelectTypeView();
            shiwaiView.frameLayout.Y = functionView.frameLayout.Bottom;
            shiwaiView.frameLayout.Y = sceneView.frameLayout.Bottom;
            shiwaiView.btnText.TextID = StringId.shiwaibainhua;
            shiwaiView.btnIcon.UnSelectedImagePath = "LogicIcon/changesinoutdoor.png";
            
@@ -78,6 +85,11 @@
                funTpye.Show(LogicMethod.condition_if);
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            //场景点击事件
            sceneView.btnClick.MouseUpEventHandler += (sen, e) =>
            {
                SceneMethod();
            };
            //室外变化
            shiwaiView.btnClick.MouseUpEventHandler += (sen, e) => {
                Weather weather = new Weather();
@@ -88,5 +100,70 @@
            #endregion
        }
        /// <summary>
        /// 添加场景
        /// </summary>
        public void SceneMethod()
        {
            var sceneList = LogicMethod.CurrLogicMethod.GetSceneList();
            List<string> nameList = new List<string>();
            for (int i = 0; i < sceneList.Count; i++)
            {
                var scene = sceneList[i];
                nameList.Add(scene.name);
            }
            PublicInterface publicInterface = new PublicInterface();
            publicInterface.FrameOrVv(this, nameList, new List<string> { }, StringId.addSceneLogic, (index) =>
            {
                var sceneSelecetd = sceneList[index];
                Input input = new Input();
                input.sid = sceneSelecetd.sid;
                input.condition_type = "10";
                Dictionary<string, string> dic = new Dictionary<string, string>();
                LogicMethod.CurrLogicMethod.dictionary(dic, "key", "scene");
                LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "=");
                LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string");
                LogicMethod.CurrLogicMethod.dictionary(dic, "value", "on");
                input.condition.Add(dic);
                AddCondition(input);
                LogicMethod.CurrLogicMethod.RemoveAllView();
                AddLogic addLogic = new AddLogic();
                MainPage.BasePageView.AddChidren(addLogic);
                addLogic.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            });
        }
        /// <summary>
        /// 添加条件
        /// </summary>
        /// <param name="input"></param>
        private void AddCondition(Input input)
        {
            ///记录索引值
            int index = -1;
            for (var i = 0; i < Logic.currlogic.input.Count; i++)
            {
                var condition_type = Logic.currlogic.input[i].condition_type;
                if (condition_type == "10")
                {
                    ///找到标记索引,退出循环体
                    index = i;
                    break;
                }
            }
            if (index != -1)
            {
                //移除旧数据
                Logic.currlogic.input.RemoveAt(index);
                //新数据插入旧数据的位置
                Logic.currlogic.input.Insert(index, input);
            }
            else
            {
                Logic.currlogic.input.Add(input);
            }
        }
    }
}
HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -36,11 +36,18 @@
            viewLayout.AddChidren(functionView.FLayoutView());
            //场景
            LogicView.SelectTypeView sceneView = new LogicView.SelectTypeView();
            LogicView.SelectTypeView sceneView= new LogicView.SelectTypeView();
            sceneView.frameLayout.Y = functionView.frameLayout.Bottom;
            sceneView.btnText.TextID = StringId.Scenes;
            sceneView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png";
            viewLayout.AddChidren(sceneView.FLayoutView());
            //安防
            LogicView.SelectTypeView securityView = new LogicView.SelectTypeView();
            securityView.frameLayout.Y = sceneView.frameLayout.Bottom;
            securityView.btnText.TextID = StringId.anfang;
            securityView.btnIcon.UnSelectedImagePath = "LogicIcon/security.png";
            viewLayout.AddChidren(securityView.FLayoutView());
            //延时
            LogicView.SelectTypeView delayView = new LogicView.SelectTypeView();
@@ -64,6 +71,16 @@
            sceneView.btnClick.MouseUpEventHandler += (sen, e) =>
            {
                SceneMethod();
            };
            //安防点击事件
            securityView.btnClick.MouseUpEventHandler += (sen, e) =>
            {
                Security security = new Security();
                MainPage.BasePageView.AddChidren(security);
                security.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                //SecurityMethod(this);
            };
            //延时点击事件
            delayView.btnClick.MouseUpEventHandler += (sen, e) =>
@@ -92,7 +109,7 @@
                nameList.Add(scene.name);
            }
            PublicInterface publicInterface = new PublicInterface();
            publicInterface.FrameOrVv(this, nameList, StringId.addSceneLogic, (index) =>
            publicInterface.FrameOrVv(this, nameList,new List<string> { }, StringId.addSceneLogic, (index) =>
            {
                var sceneSelecetd = sceneList[index];
                Output outputDevice = new Output();
@@ -108,7 +125,41 @@
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            });
        }
        /// <summary>
        /// 添加安防
        /// </summary>
        public void SecurityMethod(FrameLayout frameLayout, bool edit=false, int index1=-1)
        {
            List<string> stateList = new List<string>();
            if (edit&& index1 != -1) {
                Output output = Logic.currlogic.output[index1];
                var security = LogicMethod.CurrLogicMethod.GetSecurity(output.sid);
                stateList.Add(security.name);
            }
            var securityList = LogicMethod.CurrLogicMethod.GetSecurityList();
            List<string> nameList = new List<string>();
            for (int i = 0; i < securityList.Count; i++)
            {
                var security = securityList[i];
                nameList.Add(security.name);
            }
            PublicInterface publicInterface = new PublicInterface();
            publicInterface.FrameOrVv(frameLayout, nameList, stateList, StringId.addSecurityLogic,(index) =>
            {
                var securitySelecetd = securityList[index];
                Output outputDevice = new Output();
                outputDevice.target_type = "3";
                outputDevice.sid = securitySelecetd.sid;
                //没啥作用,为了发送数据格式统一;
                outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "security" }, { "value", "0" } } };
                AddOutput(outputDevice,true);
                LogicMethod.CurrLogicMethod.RemoveAllView();
                AddLogic addLogic = new AddLogic();
                MainPage.BasePageView.AddChidren(addLogic);
                addLogic.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            });
        }
        /// <summary>
        /// 延时时间方法
        /// </summary>
@@ -137,7 +188,7 @@
            if (edit)
            {
                Output output = Logic.currlogic.output[index];
                if (output.target_type == "3")
                if (output.target_type == "4")
                {
                    List<Dictionary<string, string>> dicList = output.status as List<Dictionary<string, string>>;
                    foreach (var dic in dicList)
@@ -169,7 +220,7 @@
                }
                Output outputTime= new Output();
                outputTime.sid = LogicMethod.CurrLogicMethod.NewSid();
                outputTime.target_type = "3";
                outputTime.target_type = "4";
                Dictionary<string, string> dic = new Dictionary<string, string>();
                LogicMethod.CurrLogicMethod.dictionary(dic, "key", "delay");
                LogicMethod.CurrLogicMethod.dictionary(dic, "value", timepoint);
@@ -195,23 +246,34 @@
            };
        }
        /// <summary>
        /// 添加目标
        /// </summary>
        /// <param name="target"></param>
        private void AddOutput(Output target)
        /// <param name="bool_if">表示启用不同条件</param>
        private void AddOutput(Output target,bool bool_if=false)
        {
            int indexValue = -1;
            for (int i = 0; i < Logic.currlogic.output.Count; i++)
            {
                if (Logic.currlogic.output[i].sid == target.sid)
                if (bool_if)
                {
                    indexValue = i;
                    break;
                    ///安防允许一种
                    if (Logic.currlogic.output[i].target_type == target.target_type)
                    {
                        indexValue = i;
                        break;
                    }
                }
                else
                {
                    if (Logic.currlogic.output[i].sid == target.sid)
                    {
                        indexValue = i;
                        break;
                    }
                }
            }
            if (indexValue != -1)
            {
                Logic.currlogic.output.RemoveAt(indexValue);
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -504,6 +504,17 @@
                            }
                        }
                        break;
                    case "10":
                        {
                            //用sid找到场景;
                            var scene = LogicMethod.CurrLogicMethod.GetSecne(inputCondition.sid);
                            inputView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png";
                            inputView.btnNextIcon.Visible = false;
                            inputView.btnClick.Visible = false;
                            //显示场景名称
                            inputView.btnText.Text = scene.name;
                        }
                        break;
                }
                //再次编辑条件状态点击事件
@@ -755,6 +766,7 @@
                                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                            }
                            break;
                    }
                };
                ///删除控件
@@ -1088,6 +1100,27 @@
                        break;
                    case "3":
                        {
                            //用sid找到安防;
                            var security = LogicMethod.CurrLogicMethod.GetSecurity(outputTarget.sid);
                            targetView.btnIcon.UnSelectedImagePath = "LogicIcon/security.png";
                            targetView.btnDelay.Visible = false;
                            //显示安防名称
                            targetView.btnText.Text = security.name;
                            string value = GetKeyValue("security", dicList);
                            if (value == "enable")
                            {
                                stateStr = Language.StringByID(StringId.bufang);
                            }
                            else
                            {
                                stateStr = Language.StringByID(StringId.chefang);
                            }
                        }
                        break;
                    case "4":
                        {
                            targetView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png";
                            foreach (var dic in dicList)
                            {
@@ -1098,9 +1131,9 @@
                        break;
                }
                if (outputTarget.target_type == "1")
                if (outputTarget.target_type == "1" || outputTarget.target_type == "3")
                {
                    targetView.btnState.Text =new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr;
                    targetView.btnState.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr;
                }
                else
                {
@@ -1139,7 +1172,12 @@
                            break;
                        case "3":
                            {
                                Security security = new Security();
                                security.SecurityMethod(thisView, "", edit, indexVulae);
                            }
                            break;
                        case "4":
                            {
                                FrameLayout fLayout = new FrameLayout
                                {
                                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs
@@ -93,6 +93,8 @@
        /// 云端天气条件=6;
        /// 某个逻辑/场景的输出条件=7;
        /// 地理围栏=8;
        /// 空气质量=9;
        /// 场景=10;
        /// </summary>
        public string condition_type = "";
        public List<Dictionary<string, string>> condition = new List<Dictionary<string, string>>();
@@ -119,7 +121,8 @@
        /// 逻辑输出目标类型
        /// 设备=1;
        /// 场景=2;
        /// 延时=3;
        /// 安防=3;
        /// 延时=4;
        /// </summary>
        public string target_type = "";
        public List<Dictionary<string, string>> status = new List<Dictionary<string, string>>();
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -179,12 +179,21 @@
            return Entity.FunctionList.List.GetDeviceFunctionList();
        }
        /// <summary>
        /// 获取网关场景列表
        /// 获取场景列表
        /// </summary>
        /// <returns></returns>
        public List<HDL_ON.Entity.Scene> GetSceneList()
        {
            return HDL_ON.Entity.FunctionList.List.scenes;
        }
        /// <summary>
        /// 获取安防列表
        /// </summary>
        /// <returns></returns>
        public List<HDL_ON.Entity.SecurityAlarm> GetSecurityList()
        {
            return FunctionList.List.securities;
        }
        /// <summary>
        /// 获取房间的设备列表
@@ -217,7 +226,7 @@
            return deviceLists;
        }
        /// <summary>
        /// 获取当个设备
        /// 获取设备(功能)对象
        /// </summary>
        /// <param name="sid">设备唯一标识</param>
        /// <returns></returns>
@@ -238,7 +247,7 @@
        }
        /// <summary>
        /// 获取当个场景
        /// 获取场景对象
        /// </summary>
        /// <param name="sid">场景唯一标识</param>
        /// <returns></returns>
@@ -258,6 +267,26 @@
            return scene;
        }
        /// <summary>
        /// 获取安防对象
        /// </summary>
        /// <param name="sid">安防唯一标识</param>
        /// <returns></returns>
        public HDL_ON.Entity.SecurityAlarm GetSecurity(string sid)
        {
            HDL_ON.Entity.SecurityAlarm security = new Entity.SecurityAlarm() { name = "Unknown" };
            List<HDL_ON.Entity.SecurityAlarm> SecurityLists = GetSecurityList();
            for (int i = 0; i < SecurityLists.Count; i++)
            {
                var sce = SecurityLists[i];
                if (sce.sid == sid)
                {
                    security = sce;
                    break;
                }
            }
            return security;
        }
        /// <summary>
        /// 获取房间名(即是=区域名称)
        /// </summary>
        /// <param name="device">设备</param>
HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs
@@ -357,6 +357,8 @@
            //1-10(表示条件图标)自己局部定义为了显示选中条件类型图标
            //1-时间图标
            //2-功能图标
            //3-云端图标
            //4-场景图标
            for (int i = 0; i < logic.input.Count; i++)
            {
                if (logic.input[i] == null)
@@ -386,6 +388,12 @@
                        }
                        break;
                    case 10:
                        {
                            iconInt = 4;
                        }
                        break;
                }
                if (!iconIntValue.Contains(iconInt))
@@ -401,6 +409,7 @@
            //12-20(表示目标图标)自己局部定义为了显示选中目标类型图标
            //12-功能图标
            //13-场景图标
            //14-安防图标
            //14-延时图标
            for (int i = 0; i < logic.output.Count; i++)
            {
@@ -423,6 +432,12 @@
                    case 3:
                        {
                            iconInt = 14;
                        }
                        break;
                    case 4:
                        {
                            iconInt = 15;
                        }
                        break;
@@ -483,6 +498,12 @@
                            strIcon = "LogicIcon/shiwaitianqi.png";
                        }
                        break;
                    case 4:
                        {
                            strIcon = "LogicIcon/selectTheScene.png";
                        }
                        break;
                    case 11:
                        {
                            //分割条件和目标的图标
@@ -502,7 +523,14 @@
                        break;
                    case 14:
                        {
                            strIcon = "LogicIcon/security.png";
                        }
                        break;
                    case 15:
                        {
                            //strIcon = "LogicIcon/timeicon.png";
                        }
                        break;
HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs
@@ -263,7 +263,7 @@
        /// <param name="list">显示数据源</param>
        /// <param name="titleText">标题</param>
        /// <param name="action">返回值索引值</param>
        public void FrameOrVv(FrameLayout frame, List<string> list, int titleText, Action<int> action)
        public void FrameOrVv(FrameLayout frame, List<string> list, List<string> stateList, int titleText, Action<int> action)
        {
            int line = 0;
@@ -366,6 +366,11 @@
                {
                    verticalRefresh.AddChidren(checkView.FLayoutView());
                }
                if (stateList.Contains(strName))
                {
                    checkView.btnCheckIcon.IsSelected = true;
                }
                checkView.btnText.Text = strName;
                checkView.btnClick.Tag = i;//标记
                //点击事件
@@ -391,8 +396,7 @@
                frameLayout.RemoveFromParent();
            };
        }
        }
        /// <summary>
        /// 超出5个元素该用滑动控件
        /// </summary>
@@ -400,7 +404,7 @@
        /// <param name="list">显示数据源</param>
        /// <param name="stateList">之前状态数据源</param>
        /// <param name="titleText">标题</param>
        /// <param name="action">返回值索引值</param>
        /// <param name="action">返回值列表</param>
        public void FrameOrVvList(FrameLayout frame, List<string> list, List<string> stateList, int titleText, Action<List<string>> action)
        {
@@ -705,6 +709,14 @@
                      };
                    }
                    break;
                case "security":
                    {
                        list = new List<string> {
             Language.StringByID(StringId.bufang ),
             Language.StringByID(StringId.chefang),
                      };
                    }
                    break;
            }
            return list;
HDL_ON/UI/UI2/3-Intelligence/Automation/Security.cs
New file
@@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using Shared;
namespace HDL_ON.UI.UI2.Intelligence.Automation
{
    public class Security : FrameLayout
    {
        public Security()
        {
            Tag = "Logic";
        }
        public void Show()
        {
            LogicView.TopView topView = new LogicView.TopView();
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
            {
                RemoveFromParent();
            };
            topView.topNameBtn.TextID = StringId.addSecurityLogic;
            VerticalScrolViewLayout viewLayout = new VerticalScrolViewLayout
            {
                Y = Application.GetRealHeight(64),
                Width = Application.GetRealWidth(LogicView.TextSize.view375),
                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64),
                BackgroundColor = CSS.CSS_Color.viewMiddle,
            };
            this.AddChidren(viewLayout);
            var securityList = LogicMethod.CurrLogicMethod.GetSecurityList();
            for (int i = 0; i < securityList.Count; i++)
            {
                var security = securityList[i];
                LogicView.SelectTypeView securityView = new LogicView.SelectTypeView();
                securityView.btnText.Text = security.name;
                securityView.btnIcon.UnSelectedImagePath = "LogicIcon/security.png";
                viewLayout.AddChidren(securityView.FLayoutView());
                securityView.btnClick.MouseUpEventHandler += (sen, e) =>
                {
                    SecurityMethod(this, security.sid);
                };
            }
        }
        /// <summary>
        /// 添加安防
        /// </summary>
        public void SecurityMethod(FrameLayout frameLayout,string sid, bool edit = false, int index1 = -1)
        {
            string stateStr = "";
            if (edit && index1 != -1)
            {
                Output output = Logic.currlogic.output[index1];
                sid = output.sid;
                for (int i = 0; i < output.status.Count; i++)
                {
                    var dic = output.status[i];
                    if (dic.ContainsKey("value"))
                    {
                        if (dic["value"] == "enable")
                        {
                            stateStr = Language.StringByID(StringId.bufang);
                        }
                        else
                        {
                            stateStr = Language.StringByID(StringId.chefang);
                        }
                    }
                }
            }
            PublicInterface conditionView = new PublicInterface();
            var strList = conditionView.GetViewList("security");
            conditionView.SingleSelectionShow(frameLayout, strList, Language.StringByID(StringId.addSecurityLogic), stateStr
         , (stateValue) =>
         {
             string selecttionMode = "";
             if (stateValue == Language.StringByID(StringId.bufang))
             {
                 selecttionMode = "enable";
             }
             else
             {
                 selecttionMode = "disable";
             }
             //封装数据
             Output outputDevice = new Output();
             outputDevice.target_type = "3";
             outputDevice.sid = sid;
             outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "security" }, { "value", selecttionMode } } };
             AddOutput(outputDevice);
             LogicMethod.CurrLogicMethod.RemoveAllView();
             AddLogic addLogic = new AddLogic();
             MainPage.BasePageView.AddChidren(addLogic);
             addLogic.Show();
             MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
         });
        }
        /// <summary>
        /// 添加目标
        /// </summary>
        /// <param name="target"></param>
        /// <param name="bool_if">表示启用不同条件</param>
        private void AddOutput(Output target, bool bool_if = false)
        {
            int indexValue = -1;
            for (int i = 0; i < Logic.currlogic.output.Count; i++)
            {
                if (bool_if)
                {
                    ///安防允许一种
                    if (Logic.currlogic.output[i].target_type == target.target_type)
                    {
                        indexValue = i;
                        break;
                    }
                }
                else
                {
                    if (Logic.currlogic.output[i].sid == target.sid)
                    {
                        indexValue = i;
                        break;
                    }
                }
            }
            if (indexValue != -1)
            {
                Logic.currlogic.output.RemoveAt(indexValue);
                Logic.currlogic.output.Insert(indexValue, target);
            }
            else
            {
                Logic.currlogic.output.Add(target);
            }
        }
    }
}
HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -130,20 +130,14 @@
                Height = Application.GetMinRealAverage(28),
                UnSelectedImagePath = "Public/AddIcon.png",
            };
            //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
            {
                topView.AddChidren(btnAddIconBg);
            }
            topView.AddChidren(btnAddIconBg);
            btnAddIcon = new Button()
            {
                X = Application.GetRealWidth(337 - 20),
                Width = Application.GetMinRealAverage(28 + 30),
                Height = Application.GetMinRealAverage(28 + 29),
            };
            //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
            {
                topView.AddChidren(btnAddIcon);
            }
            topView.AddChidren(btnAddIcon);
            #endregion
            contentPageView = new PageLayout()
@@ -242,10 +236,7 @@
        /// </summary>
        void LoadSceneFunctionControlZone(List<Scene> listScene)
        {
            //topView.AddChidren(btnAddIcon);
            sceneFunctionView.RemoveAll();
            var rowView = new FrameLayout();
            try
            {
                int index = 0;
@@ -260,44 +251,7 @@
                    }
                    listScene = this.floorRoomSelectView.GetCanShowListScene();
                }
                foreach (var scene in listScene)
                {
                    //if (scene.roomIds.Count == 0)//如何在房间已经移除了这个功能,则收藏界面也不会再显示
                    //{
                    //    scene.collect = false;
                    //    continue;
                    //}
                    if (index % 2 == 0)
                    {
                        rowView = new FrameLayout()
                        {
                            Height = Application.GetRealWidth(122),
                        };
                        sceneFunctionView.AddChidren(rowView);
                        sceneFunctionView.AddChidren(new Button()
                        {
                            Height = Application.GetRealHeight(7 + 7),
                        });
                    }
                    var functionView_X = Application.GetRealWidth((16 + 164) * (index % 2) + 16);
                    var functionView = new FrameLayout()
                    {
                        X = functionView_X,
                        Width = Application.GetRealWidth(164),
                        Height = Application.GetRealWidth(122),
                        Tag = scene.sid,
                        //BackgroundImagePath = (scene as Scene).ImagePath,
                    };
                    rowView.AddChidren(functionView);
                    //2020-12-03 修改图片加载方法
                    ImageUtlis.Current.LoadLocalOrNetworkImages((scene as Scene).ImagePath, functionView);
                    LoadSceneFunctionDiv(functionView, scene);
                    index++;
                }
                if (index == 0)
                if (listScene.Count == 0)
                {
                    var view = new FrameLayout();
                    sceneFunctionView.AddChidren(view);
@@ -323,6 +277,38 @@
                    };
                    view.AddChidren(btnNoCollectionTip);
                }
                else
                {
                    var rowView = new FrameLayout();
                    new System.Threading.Thread(() =>
                    {
                        foreach (var scene in listScene)
                        {
                            System.Threading.Thread.Sleep(10);
                            Application.RunOnMainThread(() =>
                            {
                                if (index % 2 == 0)
                                {
                                    rowView = new FrameLayout()
                                    {
                                        Height = Application.GetRealWidth(122),
                                    };
                                    sceneFunctionView.AddChidren(rowView);
                                    sceneFunctionView.AddChidren(new Button()
                                    {
                                        Height = Application.GetRealHeight(7 + 7),
                                    });
                                }
                                var functionView_X = Application.GetRealWidth((16 + 164) * (index % 2) + 16);
                                var functionView = LoadSceneFunctionDiv(functionView_X, scene);
                                rowView.AddChidren(functionView);
                                index++;
                            });
                        }
                    })
                    { IsBackground = true }.Start();
                }
            }
            catch (Exception ex)
            {
@@ -335,8 +321,19 @@
        /// <summary>
        /// 加载场景控制卡片
        /// </summary>
        void LoadSceneFunctionDiv(FrameLayout view, Scene scene)
        //FrameLayout LoadSceneFunctionDiv(FrameLayout view, Scene scene)
        FrameLayout LoadSceneFunctionDiv(int functionView_X, Scene scene)
        {
            var view = new FrameLayout()
            {
                X = functionView_X,
                Width = Application.GetRealWidth(164),
                Height = Application.GetRealWidth(122),
                Tag = scene.sid,
            };
            //2020-12-03 修改图片加载方法
            ImageUtlis.Current.LoadLocalOrNetworkImages(scene.ImagePath, view);
            try
            {
                Button btnCoverd = new Button()
@@ -376,7 +373,7 @@
                btnZone = new Button()
                {
                    X = Application.GetRealWidth(12),
                    Y = btnName.Bottom,
                    Y = Application.GetRealWidth(68+24),
                    Height = Application.GetRealWidth(18),
                    Width = Application.GetRealWidth(113),
                    TextColor = CSS_Color.MainBackgroundColor,
@@ -413,16 +410,20 @@
                    IsSelected = scene.collect,
                };
                view.AddChidren(btnCollection);
                btnCollection.MouseUpEventHandler = (sender, e) => {
                btnCollection.MouseUpEventHandler = (sender, e) =>
                {
                    scene.collect = btnCollection.IsSelected = !btnCollection.IsSelected;
                    scene.CollectScene();
                };
                LoadEvent_ControlScene(btnCoverd, btnName, btnZone, btnShowDelay, scene);
                btnSettingIcon.MouseUpEventHandler = (sender, e) => {
                    Action backAction = () => {
                btnSettingIcon.MouseUpEventHandler = (sender, e) =>
                {
                    Action backAction = () =>
                    {
                        LoadSceneFunctionControlZone(null);
                    };
                    Action refreshAction = () => {
                    Action refreshAction = () =>
                    {
                        btnName.Text = scene.name;
                        btnZone.Text = scene.GetRoomListName();
                        //2020-12-03 修改图片加载方法
@@ -436,54 +437,15 @@
                //场景正在倒计时执行中
                scene.SceneCountDown(btnShowDelay);
                //if (scene.LastExecutionTime == "" || Convert.ToDouble(scene.LastExecutionTime) + Convert.ToDouble(scene.delay) < Convert.ToDouble(Utlis.GetTimestamp(false)))
                //{
                //    int time = 0;
                //    int.TryParse(Convert.ToInt32(
                //        Convert.ToDouble(scene.LastExecutionTime) + Convert.ToDouble(scene.delay) - Convert.ToDouble(Utlis.GetTimestamp(false))
                //        ).ToString(),out time);
                //    if (time > 0)
                //    {
                //        new System.Threading.Thread(() =>
                //        {
                //            //int time = Convert.ToInt32(scene.delay);
                //            if (time > 0)
                //            {
                //                while (time > 0)
                //                {
                //                    Application.RunOnMainThread(() =>
                //                    {
                //                        if (time / 60 > 1)
                //                        {
                //                            btnShowDelay.Text = (time / 60).ToString() + "min";
                //                        }
                //                        else
                //                        {
                //                            btnShowDelay.Text = (time--).ToString() + "s";
                //                        }
                //                    });
                //                    if (time / 60 > 1)
                //                    {
                //                        System.Threading.Thread.Sleep(time / 60 * 60000);
                //                    }
                //                    else
                //                    {
                //                        System.Threading.Thread.Sleep(1000);
                //                    }
                //                }
                //                Application.RunOnMainThread(() =>
                //                {
                //                    btnShowDelay.Text = "";
                //                });
                //            }
                //        })
                //        { IsBackground = true, Priority = System.Threading.ThreadPriority.BelowNormal }.Start();
                //    }
                //}
                return view;
            }
            catch (Exception ex)
            {
                MainPage.Log("homepage LoadControlView error : " + ex.Message);
                return view;
            }
            finally
            {
            }
        }
        #endregion
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs
@@ -177,7 +177,14 @@
                        }
                        finally
                        {
                            Application.RunOnMainThread(() => { waitPage.Hide(); });
                            Application.RunOnMainThread(() =>
                            {
                                if (waitPage != null)
                                {
                                    waitPage.RemoveFromParent();
                                    waitPage = null;
                                }
                            });
                        }
                    })
                    { IsBackground = true }.Start();
HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorMegahealth/AddSenesorMegahealthDirection1Page.cs
@@ -159,7 +159,13 @@
                        }
                        finally
                        {
                            Application.RunOnMainThread(() => { waitPage.Hide(); });
                            Application.RunOnMainThread(() => {
                                if (waitPage != null)
                                {
                                    waitPage.RemoveFromParent();
                                    waitPage = null;
                                }
                            });
                        }
                    })
                    { IsBackground = true }.Start();
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
@@ -70,7 +70,14 @@
                }
                finally
                {
                    Application.RunOnMainThread(() => { waitPage.Hide(); });
                    Application.RunOnMainThread(() =>
                    {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
@@ -91,7 +91,13 @@
                }
                finally
                {
                    Application.RunOnMainThread(() => { waitPage.Hide(); });
                    Application.RunOnMainThread(() => {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/CustomerObj.cs
New file
@@ -0,0 +1,97 @@
using System;
namespace HDL_ON.Entity
{
    public class CustomerObj
    {
        public CustomerObj()
        {
        }
        /// <summary>
        /// 住户id
        /// </summary>
        public string customerId;
        /// <summary>
        /// 住户名称
        /// </summary>
        public string customerName;
        /// <summary>
        /// 住户类型
        /// </summary>
        public int customerType;
        /// <summary>
        /// 住户类型中文
        /// </summary>
        public string customerTypeText;
        /// <summary>
        /// 苑期区编号
        /// </summary>
        public string groupCode;
        /// <summary>
        /// 楼幢编号
        /// </summary>
        public string buildingCode;
        /// <summary>
        /// 单元编号
        /// </summary>
        public string unitCode;
        /// <summary>
        /// 楼层号
        /// </summary>
        public string floorNum;
        /// <summary>
        /// 房屋编号
        /// </summary>
        public string houseCode;
        /// <summary>
        /// 房屋名称
        /// </summary>
        public string houseName;
        /// <summary>
        /// 住户手机号
        /// </summary>
        public string customerPhone;
        /// <summary>
        /// 住户分机号
        /// </summary>
        public string customerPhoneProfix;
        /// <summary>
        /// 住户性别
        /// </summary>
        public string customerSex;
        /// <summary>
        /// 住户性别中文
        /// </summary>
        public string customerSexText;
        /// <summary>
        /// 住户证件号
        /// </summary>
        public string certificateNo;
        /// <summary>
        /// 住户人脸url
        /// </summary>
        public string customerFaceUrl;
        /// <summary>
        /// 住户地址
        /// </summary>
        public string address;
        /// <summary>
        /// 人脸状态
        /// 1:录入状态
        /// 2:下发成功
        /// 3:下发失败
        /// </summary>
        public int faceStatus = 0;
        /// <summary>
        /// 人脸状态
        /// 1:开启状态
        /// 2:关闭状态
        /// 3:清除人脸数据
        /// </summary>
        public int faceClose = 0;
    }
}
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs
@@ -1,4 +1,7 @@
using System;
using System.Threading;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -7,10 +10,44 @@
    public class FacePassagePage : FrameLayout
    {
        FrameLayout bodyView;
        FrameLayout contentView;
        Button btnCommunityAccessControlIcon;
        Button btnSetFaceId;
        Button btnEraseData;
        #region 图标选择部分图标
        /// <summary>
        /// 面容id
        /// 背景图选项区域
        /// </summary>
        string faceid = "";
        FrameLayout pictureOptionView;
        /// <summary>
        /// 背景图选项选择区域
        /// </summary>
        VerticalScrolViewLayout optionView;
        /// <summary>
        /// 拍照按钮
        /// </summary>
        Button btnTakePicture;
        /// <summary>
        /// 相册按钮
        /// </summary>
        Button btnAlbum;
        /// <summary>
        /// 取消按钮
        /// </summary>
        Button btnCancel;
        #endregion
        /// <summary>
        /// 住户详情
        /// </summary>
        CustomerObj customerObj = new CustomerObj();
        public FacePassagePage()
        {
@@ -23,7 +60,7 @@
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            var contentView = new FrameLayout()
            contentView = new FrameLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(667-64),
@@ -82,7 +119,7 @@
            communityRow.AddChidren(btnCommunityTitle);
            var btnCommunityAccessControlIcon = new Button()
            btnCommunityAccessControlIcon = new Button()
            {
                X = Application.GetRealWidth(314),
                Gravity = Gravity.CenterVertical,
@@ -93,7 +130,20 @@
            };
            communityRow.AddChidren(btnCommunityAccessControlIcon);
            btnCommunityAccessControlIcon.MouseUpEventHandler = (sender, e) => {
                if(customerObj.faceClose == 3)//没有人脸数据不能开启人脸通行功能
                {
                    return;
                }
                btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected;
                int switchStatus = btnCommunityAccessControlIcon.IsSelected == true ? 1 :2;
                //失败回调
                Action action = () => {
                    btnCommunityAccessControlIcon.IsSelected = !btnCommunityAccessControlIcon.IsSelected;
                };
                editFaceInfo(switchStatus,action);
            };
            #endregion
@@ -110,7 +160,7 @@
            contentView.AddChidren(btnTip);
            var btnSetFaceId = new Button()
            btnSetFaceId = new Button()
            {
                Y = Application.GetRealHeight(539),
                Gravity = Gravity.CenterHorizontal,
@@ -125,32 +175,378 @@
                IsBold = true,
            };
            contentView.AddChidren(btnSetFaceId);
            btnSetFaceId.MouseUpEventHandler = (sender, e) => {
                LoadPictureOptionView();
            };
            if (string.IsNullOrEmpty(faceid))
            btnEraseData = new Button()
            {
            }
            else
            {
                btnSetFaceId.TextID = StringId.ResetFace;
                var btnEraseData = new Button()
                {
                    Y = Application.GetRealHeight(481),
                    Gravity = Gravity.CenterHorizontal,
                    Width = Application.GetRealWidth(220),
                    Height = Application.GetRealWidth(44),
                    Radius = (uint)Application.GetRealWidth(22),
                    BackgroundColor = CSS_Color.WarningColor,
                    TextID = StringId.EraseData,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextColor = CSS_Color.MainBackgroundColor,
                    TextAlignment = TextAlignment.Center,
                    IsBold = true,
                Y = Application.GetRealHeight(481),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealWidth(44),
                Radius = (uint)Application.GetRealWidth(22),
                BackgroundColor = CSS_Color.WarningColor,
                TextID = StringId.EraseData,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextColor = CSS_Color.MainBackgroundColor,
                TextAlignment = TextAlignment.Center,
                IsBold = true,
            };
            btnEraseData.MouseUpEventHandler = (sender,e) => {
                Action action = () => {
                    initButtonStatus();
                };
                contentView.AddChidren(btnEraseData);
            }
                editFaceInfo(3,action);
            };
            ReadFaceInfo();
        }
        /// <summary>
        /// 获取人脸信息
        /// </summary>
        void ReadFaceInfo()
        {
            var waitPage = new Loading();
            waitPage.Start();
            new Thread(() =>
            {
                try
                {
                    var hsr = new HttpServerRequest();
                    var pack = hsr.GetCustomerInfo();
                    if (pack != null)
                    {
                        if (pack.Code == StateCode.SUCCESS)
                        {
                            var cus = Newtonsoft.Json.JsonConvert.DeserializeObject<CustomerObj>(pack.Data.ToString());
                            if (cus != null)
                            {
                                customerObj = cus;
                                Application.RunOnMainThread(() =>
                                {
                                    initButtonStatus();
                                });
                            }
                        }
                    }
                }catch(Exception ex)
                {
                    MainPage.Log($"读取人脸信息异常:{ex.Message}");
                }
                finally
                {
                    Application.RunOnMainThread(() => {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 清除人脸数据
        /// </summary>
        void editFaceInfo(int status,Action action)
        {
            var waitPage = new Loading();
            waitPage.Start();
            new Thread(() =>
            {
                try
                {
                    var hsr = new HttpServerRequest();
                    var pack = hsr.EditFaceFunction(status);
                    if (pack != null)
                    {
                        if (pack.Code == StateCode.SUCCESS)
                        {
                            customerObj.faceClose = status;
                        }
                        else
                        {
                            Application.RunOnMainThread(() =>
                            {
                                IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
                            });
                        }
                    }
                }
                catch (Exception ex)
                {
                    MainPage.Log($"清除人脸信息异常:{ex.Message}");
                }
                finally
                {
                    Application.RunOnMainThread(() => {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                        action?.Invoke();
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 初始化底部按钮
        /// </summary>
        void initButtonStatus()
        {
            if (customerObj.faceClose == 1 || customerObj.faceClose == 2)//人脸数据已经存在1:人脸通行开启;2:关闭
            {
                if (customerObj.faceStatus == 2)//人脸数据下发门口机成功
                {
                    btnCommunityAccessControlIcon.IsSelected = customerObj.faceClose == 1;//人脸通行功能是否开启
                    contentView.AddChidren(btnEraseData);
                    btnSetFaceId.TextID = StringId.ResetFace;
                    return;
                }
            }
                btnCommunityAccessControlIcon.IsSelected = false;
                btnEraseData.RemoveFromParent();
                btnSetFaceId.TextID = StringId.SetFace;
        }
        /// <summary>
        /// 加载图标选择选项
        /// </summary>
        void LoadPictureOptionView()
        {
            var pView = new FrameLayout()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            bodyView.AddChidren(pView);
            pictureOptionView = new FrameLayout()
            {
                Y = Application.GetRealHeight(445+50),
                Height = Application.GetRealHeight(250),
                AnimateSpeed = 0.3f,
                Animate = Animate.DownToUp,
            };
            pView.AddChidren(pictureOptionView);
            optionView = new VerticalScrolViewLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(100),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
            };
            pictureOptionView.AddChidren(optionView);
            btnTakePicture = new Button()
            {
                Height = Application.GetRealHeight(50),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.TextualColor,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.TakePicture,
            };
            optionView.AddChidren(btnTakePicture);
            optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            btnAlbum = new Button()
            {
                Height = Application.GetRealHeight(50),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.TextualColor,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.Album,
            };
            optionView.AddChidren(btnAlbum);
            optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            btnCancel = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(8) + optionView.Bottom,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(50),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
                TextID = StringId.Cancel,
                TextColor = CSS_Color.WarningColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
            };
            pictureOptionView.AddChidren(btnCancel);
            LoadEvent_PictureOptionViewEventList(pView);
        }
        /// <summary>
        /// 加载背景图选择区域事件列表
        /// </summary>
        void LoadEvent_PictureOptionViewEventList(FrameLayout pView)
        {
            pictureOptionView.MouseUpEventHandler = (sender, e) =>
            {
                pictureOptionView.Parent.RemoveFromParent();
            };
            pView.MouseUpEventHandler = (sender, e) =>
            {
                pictureOptionView.Parent.RemoveFromParent();
            };
            btnCancel.MouseUpEventHandler = (sender, e) =>
            {
                pictureOptionView.Parent.RemoveFromParent();
            };
            btnTakePicture.MouseDownEventHandler = (sender, e) => {
                btnTakePicture.IsSelected = true;
            };
            btnTakePicture.MouseUpEventHandler = (sender, e) =>
            {
                btnTakePicture.IsSelected = false;
                var imageName = Guid.NewGuid().ToString();
                CropImage.TakePicture((imagePath) =>
                {
                    CropImageCallBack(imagePath,1,imageName);
                }, imageName, 4, 6, 1000);
                pictureOptionView.Parent.RemoveFromParent();
            };
            btnAlbum.MouseDownEventHandler = (sender, e) => {
                btnAlbum.IsSelected = true;
            };
            btnAlbum.MouseUpEventHandler = (sender, e) =>
            {
                btnAlbum.IsSelected = false;
                //从相册选择图片裁剪
                var imageName = Guid.NewGuid().ToString();
                //var imageName = scene.sid;
                CropImage.SelectPicture((imagePath) =>
                {
                    CropImageCallBack(imagePath,2,imageName);
                }, imageName, 4, 6,1000);
                pictureOptionView.Parent.RemoveFromParent();
            };
        }
        /// <summary>
        /// 裁剪完照片回调,统一处理
        /// </summary>
        /// <param name="imagePath">裁剪后的真实路径</param>
        /// <param name="imageSource">照片来源;1:拍照;2:图库</param>
        void CropImageCallBack(string selectImagePath,int imageSource,string imageName)
        {
            if (string.IsNullOrEmpty(selectImagePath) == true)
            {
                return;
            }
            //上传成功到回调
            Action<bool> uploadSuccessAction = (isSuccess) =>
            {
                Action action = () => {
                    if (!isSuccess)
                    {
                        if (imageSource == 1)
                        {
                            CropImage.SelectPicture((imagePath) =>
                            {
                                CropImageCallBack(imagePath, 2, imageName);
                            }, imageName, 4, 6);
                        }
                        else
                        {
                            CropImage.TakePicture((imagePath) =>
                            {
                                CropImageCallBack(imagePath, 1,imageName);
                            }, imageName, 4, 6);
                        }
                    }else
                    {
                        ReadFaceInfo();
                    }
                };
                Application.RunOnMainThread(() =>
                {
                    var page = new FaceSettingResultPage(action);
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage(isSuccess);
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                });
            };
            //上传图片到云端
            UploadImage(selectImagePath, uploadSuccessAction);
        }
        /// <summary>
        /// 上传图片方法
        /// </summary>
        /// <param name="selectImagePath">裁剪后的图片路径</param>
        /// <param name="imageView"></param>
        /// <param name="uploadResultAction"></param>
        void UploadImage(string selectImagePath, Action<bool> uploadResultAction)
        {
            try
            {
                //1.读取裁剪后的图片,然后删除
                var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath);
                System.IO.File.Delete(selectImagePath);
                var waitPage = new Loading();
                bodyView.AddChidren(waitPage);
                waitPage.Start(Language.StringByID(StringId.PleaseWait));
                //开始上传
                new Thread(() =>
                {
                    try
                    {
                        string base64string = Convert.ToBase64String(imageBytes);
                        var pack = new HttpServerRequest().FaceSetting(base64string);
                        if (pack != null)
                        {
                            uploadResultAction?.Invoke(pack.Code == StateCode.SUCCESS);
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                    finally
                    {
                        Application.RunOnMainThread(() =>
                        {
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })
                { IsBackground = true }.Start();
            }
            catch { }
        }
    }
}
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FaceSettingPage.cs
New file
@@ -0,0 +1,197 @@
//using System;
//using HDL_ON.UI.CSS;
//using Shared;
//namespace HDL_ON.UI
//{
//    public class FaceSettingPage : FrameLayout
//    {
//        FrameLayout bodyView;
//        #region 图标选择部分图标
//        /// <summary>
//        /// 背景图选项区域
//        /// </summary>
//        FrameLayout pictureOptionView;
//        /// <summary>
//        /// 背景图选项选择区域
//        /// </summary>
//        VerticalScrolViewLayout optionView;
//        /// <summary>
//        /// 拍照按钮
//        /// </summary>
//        Button btnTakePicture;
//        /// <summary>
//        /// 相册按钮
//        /// </summary>
//        Button btnAlbum;
//        /// <summary>
//        /// 取消按钮
//        /// </summary>
//        Button btnCancel;
//        #endregion
//        public FaceSettingPage()
//        {
//            bodyView = this;
//        }
//        public void LoadPage()
//        {
//            new TopViewDiv(bodyView, Language.StringByID(StringId.FacePassage)).LoadTopView();
//            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
//            var contentView = new FrameLayout()
//            {
//                Y = Application.GetRealHeight(64),
//                Height = Application.GetRealHeight(667 - 64),
//                BackgroundColor = 0xFFFFFFFF,
//            };
//            bodyView.AddChidren(contentView);
//            var imageName = Guid.NewGuid().ToString();
//            CropImage.TakePicture((imagePath) =>
//            {
//            }, imageName, 4, 3);
//        }
//        /// <summary>
//        /// 加载图标选择选项
//        /// </summary>
//        void LoadPictureOptionView()
//        {
//            var pView = new FrameLayout()
//            {
//                BackgroundColor = CSS_Color.DialogTransparentColor1,
//            };
//            bodyView.AddChidren(pView);
//            pictureOptionView = new FrameLayout()
//            {
//                Y = Application.GetRealHeight(445),
//                Height = Application.GetRealHeight(250),
//                AnimateSpeed = 0.3f,
//                Animate = Animate.DownToUp,
//            };
//            pView.AddChidren(pictureOptionView);
//            optionView = new VerticalScrolViewLayout()
//            {
//                Gravity = Gravity.CenterHorizontal,
//                Width = Application.GetRealWidth(343),
//                Height = Application.GetRealHeight(150),
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//                Radius = (uint)Application.GetRealWidth(12),
//            };
//            pictureOptionView.AddChidren(optionView);
//            btnTakePicture = new Button()
//            {
//                Height = Application.GetRealHeight(50),
//                TextAlignment = TextAlignment.Center,
//                TextColor = CSS_Color.TextualColor,
//                SelectedTextColor = CSS_Color.MainColor,
//                TextSize = CSS_FontSize.SubheadingFontSize,
//                TextID = StringId.TakePicture,
//            };
//            optionView.AddChidren(btnTakePicture);
//            optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
//            btnAlbum = new Button()
//            {
//                Height = Application.GetRealHeight(50),
//                TextAlignment = TextAlignment.Center,
//                TextColor = CSS_Color.TextualColor,
//                SelectedTextColor = CSS_Color.MainColor,
//                TextSize = CSS_FontSize.SubheadingFontSize,
//                TextID = StringId.Album,
//            };
//            optionView.AddChidren(btnAlbum);
//            optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
//            btnCancel = new Button()
//            {
//                Gravity = Gravity.CenterHorizontal,
//                Y = Application.GetRealHeight(8) + optionView.Bottom,
//                Width = Application.GetRealWidth(343),
//                Height = Application.GetRealHeight(50),
//                BackgroundColor = CSS_Color.MainBackgroundColor,
//                Radius = (uint)Application.GetRealWidth(12),
//                TextID = StringId.Cancel,
//                TextColor = CSS_Color.WarningColor,
//                TextSize = CSS_FontSize.SubheadingFontSize,
//            };
//            pictureOptionView.AddChidren(btnCancel);
//            LoadEvent_PictureOptionViewEventList(pView);
//        }
//        /// <summary>
//        /// 加载背景图选择区域事件列表
//        /// </summary>
//        void LoadEvent_PictureOptionViewEventList(FrameLayout pView)
//        {
//            pictureOptionView.MouseUpEventHandler = (sender, e) =>
//            {
//                pictureOptionView.Parent.RemoveFromParent();
//            };
//            pView.MouseUpEventHandler = (sender, e) =>
//            {
//                pictureOptionView.Parent.RemoveFromParent();
//            };
//            btnCancel.MouseUpEventHandler = (sender, e) =>
//            {
//                pictureOptionView.Parent.RemoveFromParent();
//            };
//            btnTakePicture.MouseDownEventHandler = (sender, e) => {
//                btnTakePicture.IsSelected = true;
//            };
//            btnTakePicture.MouseUpEventHandler = (sender, e) =>
//            {
//                btnTakePicture.IsSelected = false;
//                var imageName = Guid.NewGuid().ToString();
//                //var imageName = scene.sid;
//                CropImage.TakePicture((imagePath) =>
//                {
//                    CropImageCallBack(imagePath);
//                }, imageName, 4, 3);
//                //if (pageTitleId == StringId.EditScene)
//                //{
//                //    scene.SaveFunctionData();
//                //}
//                pictureOptionView.Parent.RemoveFromParent();
//            };
//            btnAlbum.MouseDownEventHandler = (sender, e) => {
//                btnAlbum.IsSelected = true;
//            };
//            btnAlbum.MouseUpEventHandler = (sender, e) =>
//            {
//                btnAlbum.IsSelected = false;
//                //从相册选择图片裁剪
//                var imageName = Guid.NewGuid().ToString();
//                //var imageName = scene.sid;
//                CropImage.SelectPicture((imagePath) =>
//                {
//                    //CropImageCallBack(imagePath);
//                }, imageName, 4, 3);
//                pictureOptionView.Parent.RemoveFromParent();
//            };
//        }
//    }
//}
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FaceSettingResultPage.cs
New file
@@ -0,0 +1,97 @@
using System;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    public class FaceSettingResultPage : FrameLayout
    {
        FrameLayout bodyView;
        Action backAction;
        public FaceSettingResultPage(Action action)
        {
            bodyView = this;
            backAction = action;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="isSuccess">是否成功</param>
        public void LoadPage(bool isSuccess)
        {
            new TopViewDiv(bodyView, Language.StringByID(StringId.FacePassage)).LoadTopView();
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            var contentView = new FrameLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(667 - 64),
            };
            bodyView.AddChidren(contentView);
            var btnResultIcon = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(99),
                Width = Application.GetRealWidth(100),
                Height = Application.GetRealWidth(100),
                UnSelectedImagePath = "PersonalCenter/FacePassage/FailIcon.png",
                SelectedImagePath = "PersonalCenter/FacePassage/TrueIcon.png",
                IsSelected = isSuccess,
            };
            contentView.AddChidren(btnResultIcon);
            Button btnResultText = new Button()
            {
                Y = Application.GetRealHeight(240),
                Height = Application.GetRealHeight(40),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
            };
            contentView.AddChidren(btnResultText);
            var btnSetFaceId = new Button()
            {
                Y = Application.GetRealHeight(539),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealWidth(44),
                Radius = (uint)Application.GetRealWidth(22),
                BackgroundColor = CSS_Color.MainColor,
                TextID = isSuccess ? StringId.Complete :StringId.Retry,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextColor = CSS_Color.MainBackgroundColor,
                TextAlignment = TextAlignment.Center,
                IsBold = true,
            };
            contentView.AddChidren(btnSetFaceId);
            btnSetFaceId.MouseUpEventHandler = (sender, e) => {
                if (isSuccess)
                {
                    this.RemoveFromParent();
                }
                else
                {
                    backAction?.Invoke();
                    this.RemoveFromParent();
                }
            };
        }
    }
}
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -84,7 +84,6 @@
        /// 区域成员小区域文本
        /// </summary>
        Button btnResidenceMemberText;
        #region F3阶段
        /// <summary>
        /// 区域安放小区域
        /// </summary>
@@ -121,9 +120,7 @@
        /// 区域添加功能小区域文本
        /// </summary>
        Button btnResidenceAddFunctionText;
        #endregion
        #region F3阶段
        ///// <summary>
        ///// 软件设置区域
        ///// </summary>
@@ -155,7 +152,6 @@
        /// </summary>
        Button btnSmartSpeakerText;
        #endregion
        public PersonalCenterPage()
        {
@@ -478,7 +474,6 @@
                    residenceArmView.AddChidren(btnResidenceArmText);
                    #endregion
                }
                #region F3阶段
                #region ---数据备份区域
                //residenceDataBackupView = new FrameLayout()
@@ -541,37 +536,39 @@
                //residenceAuxiliaryFunctionView.AddChidren(btnResidenceAuxiliaryFunctionText);
                #endregion
                #region ---添加功能区域
                residenceAddFunctionView = new FrameLayout()
                if (DB_ResidenceData.Instance.GatewayType == 1)
                {
                    //X = residenceMemberView.Right,
                    X = Application.GetRealWidth(28 - 24),
                    Y = residenceManageView.Bottom,
                    Width = Application.GetRealWidth(64 + 48),
                    Height = Application.GetRealWidth(64),
                };
                residenceInfoView.AddChidren(residenceAddFunctionView);
                btnResidenceAddFunctionIcon = new Button
                {
                    Gravity = Gravity.CenterHorizontal,
                    Y = Application.GetRealHeight(5),
                    Width = Application.GetMinRealAverage(30),
                    Height = Application.GetMinRealAverage(30),
                    UnSelectedImagePath = "PersonalCenter/AddFunctionIcon.png",
                };
                residenceAddFunctionView.AddChidren(btnResidenceAddFunctionIcon);
                btnResidenceAddFunctionText = new Button()
                {
                    Y = btnResidenceManageIcon.Bottom,
                    Height = Application.GetRealHeight(29),
                    TextID = StringId.AddFunction,
                    TextAlignment = TextAlignment.Center,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel
                };
                residenceAddFunctionView.AddChidren(btnResidenceAddFunctionText);
                #endregion
                #endregion
                    #region ---添加功能区域
                    residenceAddFunctionView = new FrameLayout()
                    {
                        //X = residenceMemberView.Right,
                        X = Application.GetRealWidth(28 - 24),
                        Y = residenceManageView.Bottom,
                        Width = Application.GetRealWidth(64 + 48),
                        Height = Application.GetRealWidth(64),
                    };
                    residenceInfoView.AddChidren(residenceAddFunctionView);
                    btnResidenceAddFunctionIcon = new Button
                    {
                        Gravity = Gravity.CenterHorizontal,
                        Y = Application.GetRealHeight(5),
                        Width = Application.GetMinRealAverage(30),
                        Height = Application.GetMinRealAverage(30),
                        UnSelectedImagePath = "PersonalCenter/AddFunctionIcon.png",
                    };
                    residenceAddFunctionView.AddChidren(btnResidenceAddFunctionIcon);
                    btnResidenceAddFunctionText = new Button()
                    {
                        Y = btnResidenceManageIcon.Bottom,
                        Height = Application.GetRealHeight(29),
                        TextID = StringId.AddFunction,
                        TextAlignment = TextAlignment.Center,
                        TextColor = CSS_Color.FirstLevelTitleColor,
                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel
                    };
                    residenceAddFunctionView.AddChidren(btnResidenceAddFunctionText);
                    #endregion
                }
            }
            else
            {
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
@@ -40,12 +40,23 @@
            if (btnResidenceArmIcon != null)
            {
                btnResidenceArmIcon.IsSelected = false;
                foreach (var temp in FunctionList.List.securities)
                lock (FunctionList.List.securities)
                {
                    if (temp.status == "enable")
                    foreach (var temp in FunctionList.List.securities)
                    {
                        btnResidenceArmIcon.IsSelected = true;
                        break;
                        if (temp.status == "enable")
                        {
                            if (temp.alarm)
                            {
                                btnResidenceArmIcon.SelectedImagePath = "PersonalCenter/ResidenceInAlarmIcon.png";
                            }
                            else
                            {
                                btnResidenceArmIcon.SelectedImagePath = "PersonalCenter/ResidenceDefenseIcon.png";
                            }
                            btnResidenceArmIcon.IsSelected = true;
                            break;
                        }
                    }
                }
                btnResidenceArmIcon.MouseUpEventHandler = (sender, e) =>
@@ -308,15 +319,22 @@
        #region 添加设备
        void LoadEvent_SkipbtnAddFunctionPage()
        {
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            if (DB_ResidenceData.Instance.GatewayType == 1)
            {
                var page = new BrandListPage();
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            btnResidenceAddFunctionIcon.MouseUpEventHandler = eventHandler;
            btnResidenceAddFunctionText.MouseUpEventHandler = eventHandler;
                try
                {
                    EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
                    {
                        var page = new BrandListPage();
                        MainPage.BasePageView.AddChidren(page);
                        page.LoadPage();
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    };
                    btnResidenceAddFunctionIcon.MouseUpEventHandler = eventHandler;
                    btnResidenceAddFunctionText.MouseUpEventHandler = eventHandler;
                }
                catch { }
            }
        }
        #endregion
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
@@ -259,11 +259,17 @@
            /// </summary>
            optionListView = new VerticalScrolViewLayout()
            {
                Height = Application.GetRealHeight(51 * (6+1)),
                Height = Application.GetRealHeight(51 * 6),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                ScrollEnabled = false,
            };
            bodyScrolView.AddChidren(optionListView);
            if(Entity.DB_ResidenceData.Instance.SupportFacePass)
            {
                optionListView.Height = Application.GetRealHeight(51 * (6 + 1));
            }
            #region 个人选项-名字区域
            /// <summary>
            /// 个人选项-名字区域
@@ -563,46 +569,46 @@
            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            #endregion
            #region 个人选项-人脸通行管理
            faceManagementView = new FrameLayout()
            if (Entity.DB_ResidenceData.Instance.SupportFacePass)
            {
                Height = Application.GetRealHeight(50),
            };
            optionListView.AddChidren(faceManagementView);
                #region 个人选项-人脸通行管理
                faceManagementView = new FrameLayout()
                {
                    Height = Application.GetRealHeight(50),
                };
                optionListView.AddChidren(faceManagementView);
            var btnFaceManagementRight = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
            faceManagementView.AddChidren(btnFaceManagementRight);
                var btnFaceManagementRight = new Button()
                {
                    X = Application.GetRealWidth(339),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(16),
                    Height = Application.GetMinRealAverage(16),
                    UnSelectedImagePath = "Public/Right.png",
                };
                faceManagementView.AddChidren(btnFaceManagementRight);
            btnFaceManagementText = new Button()
            {
                X = Application.GetRealWidth(16),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.FacePassageSetting,
            };
            faceManagementView.AddChidren(btnFaceManagementText);
                btnFaceManagementText = new Button()
                {
                    X = Application.GetRealWidth(16),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextID = StringId.FacePassageSetting,
                };
                faceManagementView.AddChidren(btnFaceManagementText);
            btnFaceManagementText.MouseUpEventHandler = (sender, e) =>
            {
                var page = new FacePassagePage();
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
                btnFaceManagementText.MouseUpEventHandler = (sender, e) =>
                {
                    var page = new FacePassagePage();
                    MainPage.BasePageView.AddChidren(page);
                    page.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
            #endregion
                #endregion
            }
            #endregion
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs
@@ -486,7 +486,11 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                            waitPage.Hide();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs
@@ -110,8 +110,11 @@
                finally
                {
                    Application.RunOnMainThread(() => {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                        int count = SpatialInfo.CurrentSpatial.FloorList.Count > 10 ? 10 : SpatialInfo.CurrentSpatial.FloorList.Count;
                        floorsListView.Height = Application.GetRealHeight(50 * count);
                        contentView.Height = Application.GetRealHeight(50 * (count + 1));
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPage.cs
@@ -151,8 +151,11 @@
                    finally
                    {
                        Application.RunOnMainThread(() => {
                            waitPage.Hide();
                            waitPage.RemoveFromParent();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs
@@ -59,8 +59,11 @@
                            finally
                            {
                                Application.RunOnMainThread(() => {
                                    waitPage.Hide();
                                    waitPage.RemoveFromParent();
                                    if (waitPage != null)
                                    {
                                        waitPage.RemoveFromParent();
                                        waitPage = null;
                                    }
                                });
                            }
                        })
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs
@@ -63,8 +63,11 @@
                        {
                            Application.RunOnMainThread(() =>
                            {
                                waitPage.Hide();
                                waitPage.RemoveFromParent();
                                if (waitPage != null)
                                {
                                    waitPage.RemoveFromParent();
                                    waitPage = null;
                                }
                            });
                        }
                    })
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshRelayControlPage.cs
@@ -66,19 +66,21 @@
            fanSpeedList = device.GetAttribute(FunctionAttributeKey.FanSpeed).value;
            btnFan.MouseUpEventHandler += (sender, e) =>
            {
                if( !btnSwitch.IsSelected){return;}
                var curFanSpeedIndex = fanSpeedList.IndexOf(device.GetAttrState(FunctionAttributeKey.FanSpeed));
                var sendFanSpeedIndex = curFanSpeedIndex == fanSpeedList.Count - 1 ? 0 : 1+curFanSpeedIndex;
                ShowFanSelectView();
                //return;
                //if ( !btnSwitch.IsSelected){return;}
                //var curFanSpeedIndex = fanSpeedList.IndexOf(device.GetAttrState(FunctionAttributeKey.FanSpeed));
                //var sendFanSpeedIndex = curFanSpeedIndex == fanSpeedList.Count - 1 ? 0 : 1+curFanSpeedIndex;
                device.SetAttrState(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]);
                new System.Threading.Thread(() =>
                {
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]);
                    Control.Ins.SendWriteCommand(device, d);
                })
                { IsBackground = true }.Start();
                RefreshFanSpeed();
                //device.SetAttrState(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]);
                //new System.Threading.Thread(() =>
                //{
                //    Dictionary<string, string> d = new Dictionary<string, string>();
                //    d.Add(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]);
                //    Control.Ins.SendWriteCommand(device, d);
                //})
                //{ IsBackground = true }.Start();
                //RefreshFanSpeed();
            };
            //风速文本
            this.btnFanView = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false);
@@ -140,40 +142,107 @@
            };
            frameBack.Show();
            var fanAttr = device.GetAttribute(FunctionAttributeKey.FanSpeed);
            if(fanAttr == null)
            {
                return;
            }
            var valueCount = fanAttr.value.Count;
            //菜单控件(风速)
            var menuContr = new DialogTitleMenuControl(3, Language.StringByID(StringId.FanSpeed));
            menuContr.X = Application.GetRealWidth(209);
            var menuContr = new DialogTitleMenuControl(valueCount, Language.StringByID(StringId.FanSpeed));
            //menuContr.X = Application.GetRealWidth(209);
            menuContr.Gravity = Gravity.CenterHorizontal;
            menuContr.Y = Application.GetRealHeight(231);
            menuContr.Width = Application.GetRealWidth(160);
            menuContr.Height = Application.GetRealHeight(199);
            if (valueCount > 2)
            {
                menuContr.Height = Application.GetRealHeight(199);
            }
            else
            {
                menuContr.Height = Application.GetRealHeight(154);
            }
            dialogBody.AddChidren(menuContr);
            //1档
            var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low" ? "FunctionIcon/AirFresh/Fan1Select.png" : "FunctionIcon/AirFresh/Fan1.png";
            menuContr.AddRowMenu(Language.StringByID(StringId.FanOneGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low", () =>
            foreach(var fanAttrValue in fanAttr.value)
            {
                frameBack.Close();
                //发送档位命令
                this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "low");
            });
                bool isSelecte = false;
                var iconPath = "FunctionIcon/AirFresh/Fan1.png";
                string text = Language.StringByID(StringId.FanOneGear);
                if (fanAttrValue == "low" || fanAttrValue == "level_1")
                {
                    text = Language.StringByID(StringId.LowWindSpeed);
                    if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low"|| this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "level_1")
                    {
                        iconPath = "FunctionIcon/AirFresh/Fan1Select.png";
                        isSelecte = true;
                    }
                }
                else if (fanAttrValue == "medium" || fanAttrValue == "level_2")
                {
                    text = Language.StringByID(StringId.MiddleWindSpeed);
                    iconPath = "FunctionIcon/AirFresh/Fan2.png";
                    if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium" || this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "level_2")
                    {
                        iconPath = "FunctionIcon/AirFresh/Fan2Select.png";
                        isSelecte = true;
                    }
                }
                else if (fanAttrValue == "high" || fanAttrValue == "level_3")
                {
                    text = Language.StringByID(StringId.HighWindSpeed);
                    iconPath = "FunctionIcon/AirFresh/Fan3.png";
                    if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high" || this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "level_3")
                    {
                        iconPath = "FunctionIcon/AirFresh/Fan3Select.png";
                        isSelecte = true;
                    }
                }
            //2档
            iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium" ? "FunctionIcon/AirFresh/Fan2Select.png" : "FunctionIcon/AirFresh/Fan2.png";
            menuContr.AddRowMenu(Language.StringByID(StringId.FanTwoGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium", () =>
            {
                frameBack.Close();
                //发送档位命令
                this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "medium");
            });
                menuContr.AddRowMenu(text, iconPath, isSelecte, () =>
                {
                    frameBack.Close();
                    //发送档位命令
                    this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, fanAttrValue);
                });
            }
            //3档
            iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high" ? "FunctionIcon/AirFresh/Fan3Select.png" : "FunctionIcon/AirFresh/Fan3.png";
            menuContr.AddRowMenu(Language.StringByID(StringId.FanThreeGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high", () =>
            {
                frameBack.Close();
                //发送档位命令
                this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "high");
            });
            //if (fanAttr.value.Contains("low"))
            //{
            //    //1档
            //    var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low" ? "FunctionIcon/AirFresh/Fan1Select.png" : "FunctionIcon/AirFresh/Fan1.png";
            //    menuContr.AddRowMenu(Language.StringByID(StringId.FanOneGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low", () =>
            //    {
            //        frameBack.Close();
            //        //发送档位命令
            //        this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "low");
            //    });
            //}
            //if (fanAttr.value.Contains("medium"))
            //{
            //    //2档
            //    var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium" ? "FunctionIcon/AirFresh/Fan2Select.png" : "FunctionIcon/AirFresh/Fan2.png";
            //    menuContr.AddRowMenu(Language.StringByID(StringId.FanTwoGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium", () =>
            //    {
            //        frameBack.Close();
            //        //发送档位命令
            //        this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "medium");
            //    });
            //}
            //if (fanAttr.value.Contains("high"))
            //{
            //    //3档
            //    var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high" ? "FunctionIcon/AirFresh/Fan3Select.png" : "FunctionIcon/AirFresh/Fan3.png";
            //    menuContr.AddRowMenu(Language.StringByID(StringId.FanThreeGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high", () =>
            //    {
            //        frameBack.Close();
            //        //发送档位命令
            //        this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "high");
            //    });
            //}
        }
        #endregion
@@ -300,5 +369,8 @@
        #endregion
    }
}
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs
@@ -249,7 +249,11 @@
                    finally
                    {
                        Application.RunOnMainThread(() => {
                            waitPage.Hide();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
@@ -15,9 +16,16 @@
        /// 自定义布防区域
        /// </summary>
        HorizontalScrolViewLayout customDeploymentView;
        /// <summary>
        ///
        /// </summary>
        FrameLayout alarmIconBgView;
        //安防状态背景图
        Button btnArmTipIcon;
        /// <summary>
        /// 安防警报图标
        /// </summary>
        Button btnInalarmIcon;
        /// <summary>
        /// 当前布防名称
        /// </summary>
@@ -27,6 +35,15 @@
        /// 撤防区域
        /// </summary>
        FrameLayout disarmView;
        /// <summary>
        /// 布防接口
        /// </summary>
        SecurityAlarm InDefenseMode = null;
        /// <summary>
        /// 自定义布防控件列表
        /// </summary>
        List<ArmDiyView> armDiyViewList = new List<ArmDiyView>();
        public ArmCenterPage()
        {
@@ -55,7 +72,7 @@
                Height =Application.GetRealWidth(32),
            });
            FrameLayout alarmIconBgView = new FrameLayout()
            alarmIconBgView = new FrameLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(198),
@@ -72,6 +89,25 @@
                SelectedImagePath = "FunctionIcon/ArmCenter/InDefenseBigIcon.png",
            };
            alarmIconBgView.AddChidren(btnArmTipIcon);
            btnInalarmIcon = new Button()
            {
                Width = Application.GetRealWidth(198),
                Height = Application.GetRealWidth(198),
                UnSelectedImagePath = "FunctionIcon/ArmCenter/InAlarmBigIcon.png",
            };
            btnInalarmIcon.MouseUpEventHandler = (sender, e) => {
                if(InDefenseMode!= null)
                {
                    Action action = () =>
                    {
                        InDefenseMode.alarm = false;
                        Control.Ins.ControlSecurity(InDefenseMode, "enable");
                    };
                    new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteSceneTip, action);
                }
            };
            btnDefenseName = new Button()
            {
@@ -111,21 +147,25 @@
            };
            disarmView.AddChidren(btnDisarm);
            btnDisarm.MouseUpEventHandler = (sender, e) => {
                foreach (var temp in FunctionList.List.securities)
                //foreach (var temp in FunctionList.List.securities)
                //{
                //    if (temp.status == "enable")
                //    {
                //        Control.Ins.ControlSecurity(temp, "disable");
                //        break;
                //    }
                //}
                if(InDefenseMode!= null)
                {
                    if (temp.status == "enable")
                    {
                        Control.Ins.ControlSecurity(temp, "disable");
                        break;
                    }
                    Control.Ins.ControlSecurity(InDefenseMode, "disable");
                }
            };
                #endregion
            #endregion
                #region 自定义布防
                //自定义布防标题
                Button btnCustomDeploymentTitle = new Button()
            #region 自定义布防
            //自定义布防标题
            Button btnCustomDeploymentTitle = new Button()
            {
                X = Application.GetRealWidth(24),
                Height = Application.GetRealWidth(54),
@@ -217,11 +257,34 @@
            #endregion
            iniCustomDeploymentView();
        }
            ///刷新界面
            LoadEvent_RefreshSecurityStatus();
        /// <summary>
        /// 初始化报警状态
        /// </summary>
        /// <param name="inAlarm"></param>
        public void InitAlarmStatus(bool inAlarm)
        {
            try
            {
                if (inAlarm)
                {
                    if (btnInalarmIcon.Parent == null)
                    {
                        alarmIconBgView.AddChidren(btnInalarmIcon);
                    }
                }
                else
                {
                    if (btnInalarmIcon.Parent != null)
                    {
                        btnInalarmIcon.RemoveFromParent();
                    }
                }
            }
            catch { }
        }
        /// <summary>
@@ -230,11 +293,11 @@
        private void iniCustomDeploymentView()
        {
            customDeploymentView.RemoveAll();
            armDiyViewList.Clear();
            foreach (var mode in FunctionList.List.securities)
            {
                var armDiyView = new ArmDiyView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png",
                mode.name);
                mode.name,mode.sid);
                customDeploymentView.AddChidren(armDiyView);
                EventHandler<MouseEventArgs> event2 = (sender, e) =>
                {
@@ -244,13 +307,18 @@
                if (mode.status == "enable")
                {
                    armDiyView.LightingView(true);
                    InDefenseMode = mode;
                    ///刷新界面
                    LoadEvent_RefreshSecurityStatus(InDefenseMode);
                }
                armDiyViewList.Add(armDiyView);
            }
            if (FunctionList.List.securities.Count < 4)
            {
                var view = new ArmDiyView("FunctionIcon/ArmCenter/AddDefenseIcon.png", "FunctionIcon/ArmCenter/AddDefenseIcon.png",
                  Language.StringByID(StringId.Custom));
                  Language.StringByID(StringId.Custom),"customSid");
                customDeploymentView.AddChidren(view);
                EventHandler<MouseEventArgs> event1 = (sender, e) =>
                {
@@ -339,13 +407,12 @@
            }
            btnOpen.MouseUpEventHandler = (sender, e) => {
                if (alarm.status == "disable")
                string controlStatus = alarm.status == "disable" ? "enable" : "disable";
                new System.Threading.Thread(() =>
                {
                    Control.Ins.ControlSecurity(alarm, "enable");
                }else
                {
                    Control.Ins.ControlSecurity(alarm, "disable");
                }
                    Control.Ins.ControlSecurity(alarm, controlStatus);
                })
                { IsBackground = true }.Start();
                dialog.Close();  
            };
@@ -369,26 +436,68 @@
        }
        public static void LoadEvent_RefreshSecurityStatus()
        public static void LoadEvent_RefreshSecurityStatus(SecurityAlarm updataTemp)
        {
            Application.RunOnMainThread(() =>
            {
                if (bodyView != null)
                try
                {
                    bodyView.iniCustomDeploymentView();
                    bodyView.disarmView.Height = 0;
                    bodyView.btnArmTipIcon.IsSelected = false;
                    bodyView.btnDefenseName.Text = "";
                    foreach (var temp in FunctionList.List.securities)
                    if (bodyView != null)
                    {
                        if (temp.status == "enable")
                        //布防
                        if (updataTemp.status == "enable")
                        {
                            bodyView.disarmView.Height = Application.GetRealHeight(68);
                            bodyView.btnArmTipIcon.IsSelected = true;
                            bodyView.btnDefenseName.Text = temp.name;
                            break;
                            bodyView.InDefenseMode = updataTemp;
                            foreach (var tempView in bodyView.armDiyViewList)
                            {
                                tempView.LightingView(false);
                                if (tempView.sid == updataTemp.sid)
                                {
                                    tempView.LightingView(updataTemp.status == "enable");
                                }
                            }
                        }
                        else
                        {
                            //撤防
                            if(bodyView.InDefenseMode.sid == updataTemp.sid)
                            {
                                foreach (var tempView in bodyView.armDiyViewList)
                                {
                                    tempView.LightingView(false);
                                }
                            }
                        }
                        //foreach(var tempView in bodyView.armDiyViewList)
                        //{
                        //    tempView.LightingView(false);
                        //    if(tempView.sid == updataTemp.sid)
                        //    {
                        //        tempView.LightingView(updataTemp.status == "enable");
                        //    }
                        //}
                        //没有布防的情况
                        if (bodyView.InDefenseMode ==null|| bodyView.InDefenseMode.status == "disable")
                        {
                            bodyView.disarmView.Height = 0;
                            bodyView.btnArmTipIcon.IsSelected = false;
                            bodyView.btnDefenseName.Text = "";
                        }
                        else
                        {
                            bodyView.disarmView.Height = Application.GetRealHeight(68);
                            bodyView.btnArmTipIcon.IsSelected = true;
                            bodyView.btnDefenseName.Text = bodyView.InDefenseMode.name;
                        }
                        bodyView.InitAlarmStatus(bodyView.InDefenseMode.alarm);
                    }
                }
                catch (Exception ex)
                {
                    MainPage.Log($"安防界面更新异常:{ex.Message}");
                }
            });
        }
@@ -402,14 +511,16 @@
    {
        Button btnIcon;
        Button btnText;
        public string sid;
        /// <summary>
        /// 自定义布防界面
        /// </summary>
        /// <param name="UnSelectedIconPath">图片路径</param>
        /// <param name="SelectedIconPath">图片路径</param>
        /// <param name="Text">显示文本</param>
        public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text)
        public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text,string inSid)
        {
            sid = inSid;
            this.Width = Application.GetRealWidth(82);
            this.Height = Application.GetRealWidth(80);
@@ -453,6 +564,9 @@
    }
    /// <summary>
    /// 固定布防控件
    /// </summary>
    public class FixedArmView : FrameLayout
    {
        /// <summary>
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmDeploymentSettingPage.cs
@@ -235,7 +235,11 @@
                    finally
                    {
                        Application.RunOnMainThread(() => {
                            waitPage.Hide();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
@@ -85,18 +85,26 @@
                Control.Ins.SendWriteCommand(function, d);
            };
            btnCurtainStop.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainStop.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainOpen.IsSelected = false;
            };
            btnCurtainOpen.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainStop.IsSelected = false;
            };
            btnCurtainClose.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = true;
                btnCurtainOpen.IsSelected = false;
                btnCurtainStop.IsSelected = false;
            };
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
                new System.Threading.Thread(() => {
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -19,14 +19,14 @@
                    return;
                if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid)
                {
                    var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent);
                    if (percentString != null)
                    {
                        int percent = 0;
                        int.TryParse(percentString, out percent);
                        bodyView.btnCurtainOpen.IsSelected = percent > 0;
                        bodyView.btnCurtainClose.IsSelected = percent == 0;
                    }
                    //var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent);
                    //if (percentString != null)
                    //{
                    //    int percent = 0;
                    //    int.TryParse(percentString, out percent);
                    //    bodyView.btnCurtainOpen.IsSelected = percent > 0;
                    //    bodyView.btnCurtainClose.IsSelected = percent == 0;
                    //}
                    try
                    {
                        if (!bodyView.onCurtainAnimation)
@@ -136,13 +136,15 @@
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) =>
            {
                //new System.Threading.Thread(() => {
                //    System.Threading.Thread.Sleep(2000);
                //    Application.RunOnMainThread(() => {
                //        btnCurtainClose.IsSelected = false;
                //    });
                //})
                //{ IsBackground = true }.Start();
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnCurtainClose.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "off";
                function.SetAttrState(FunctionAttributeKey.Percent, 0);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
@@ -171,13 +173,15 @@
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                //new System.Threading.Thread(() => {
                //    System.Threading.Thread.Sleep(2000);
                //    Application.RunOnMainThread(() => {
                //        btnCurtainOpen.IsSelected = false;
                //    });
                //})
                //{ IsBackground = true }.Start();
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnCurtainOpen.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "on";
                function.SetAttrState(FunctionAttributeKey.Percent, 100);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
@@ -190,16 +194,20 @@
            btnCurtainStop.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainStop.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainOpen.IsSelected = false;
            };
            btnCurtainOpen.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainStop.IsSelected = false;
            };
            btnCurtainClose.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = true;
                btnCurtainOpen.IsSelected = false;
                btnCurtainStop.IsSelected = false;
            };
            //btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -19,11 +19,11 @@
                    return;
                if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid)
                {
                    var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent);
                    int percent = 0;
                    int.TryParse(percentString, out percent);
                    bodyView.btnCurtainOpen.IsSelected = percent > 0;
                    bodyView.btnCurtainClose.IsSelected = percent == 0;
                    //var percentString = updateTemp.GetAttrState(FunctionAttributeKey.Percent);
                    //int percent = 0;
                    //int.TryParse(percentString, out percent);
                    //bodyView.btnCurtainOpen.IsSelected = percent > 0;
                    //bodyView.btnCurtainClose.IsSelected = percent == 0;
                    try
                    {
                        if (!bodyView.onCurtainAnimation)
@@ -133,13 +133,15 @@
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) =>
            {
                //new System.Threading.Thread(() => {
                //    System.Threading.Thread.Sleep(2000);
                //    Application.RunOnMainThread(() => {
                //        btnCurtainClose.IsSelected = false;
                //    });
                //})
                //{ IsBackground = true }.Start();
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnCurtainClose.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "off";
                function.SetAttrState(FunctionAttributeKey.Percent, 0);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
@@ -166,13 +168,15 @@
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                //new System.Threading.Thread(() => {
                //    System.Threading.Thread.Sleep(2000);
                //    Application.RunOnMainThread(() => {
                //        btnCurtainOpen.IsSelected = false;
                //    });
                //})
                //{ IsBackground = true }.Start();
                new System.Threading.Thread(() =>
                {
                    System.Threading.Thread.Sleep(2000);
                    Application.RunOnMainThread(() =>
                    {
                        btnCurtainOpen.IsSelected = false;
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "on";
                function.SetAttrState(FunctionAttributeKey.Percent, 100);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
@@ -203,16 +207,20 @@
            btnCurtainStop.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainStop.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainOpen.IsSelected = false;
            };
            btnCurtainOpen.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainOpen.IsSelected = true;
                btnCurtainClose.IsSelected = false;
                btnCurtainStop.IsSelected = false;
            };
            btnCurtainClose.MouseDownEventHandler = (sender, e) =>
            {
                btnCurtainClose.IsSelected = true;
                btnCurtainOpen.IsSelected = false;
                btnCurtainStop.IsSelected = false;
            };
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
New file
@@ -0,0 +1,249 @@
using System;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    public class AirSwitchPage : FrameLayout
    {
        #region 控件集合
        static AirSwitchPage bodyView;
        /// <summary>
        /// 控制界面加载区域
        /// </summary>
        FrameLayout controlView;
        /// <summary>
        /// 功能备注
        /// </summary>
        Button btnFunctionName;
        /// <summary>
        /// 功能所属楼层、房间
        /// </summary>
        Button btnFromFoorAndRoom;
        /// <summary>
        /// 收藏按钮
        /// </summary>
        Button btnCollection;
        /// <summary>
        /// 继电器状态图标
        /// </summary>
        Button btnSwitchIcon;
        /// <summary>
        /// 开关按钮
        /// </summary>
        Button btnSwitch;
        #endregion
        #region 区域变量
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
        /// <summary>
        /// 刷新显示信息
        /// </summary>
        Action actionRefresh;
        #endregion
        public AirSwitchPage(Function func)
        {
            bodyView = this;
            function = func;
        }
        /// <summary>
        /// 加载界面
        /// </summary>
        /// <param name="btnCollectionIcon">收藏按钮</param>
        /// <param name="btnFunctionName">功能名称信息按钮</param>
        /// <param name="btnFromFloor">功能楼层信息按钮</param>
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
        {
            if (btnCollectionIcon == null)
            {
                btnCollection_Out = new Button();
                btnFunctionName_Out = new Button();
                btnFromFloor_Out = new Button();
            }
            else
            {
                btnCollection_Out = btnCollectionIcon;
                btnFunctionName_Out = btnFunctionNameOut;
                btnFromFloor_Out = btnFromFloorOut;
            }
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function);
            controlView = new FrameLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(88),
                Width = Application.GetRealWidth(327),
                Height = Application.GetRealHeight(526),
                BackgroundImagePath = "Public/Fragmentbg.png",
            };
            bodyView.AddChidren(controlView);
            btnFunctionName = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(14),
                Width = Application.GetRealWidth(270),
                Height = Application.GetRealHeight(37),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
            btnFromFoorAndRoom = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = btnFunctionName.Bottom,
                Width = Application.GetRealWidth(270),
                Height = Application.GetRealHeight(21),
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
            btnCollection = new Button()
            {
                X = Application.GetRealWidth(273),
                Y = Application.GetRealHeight(14),
                Width = Application.GetMinRealAverage(40),
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = function.collect
            };
            controlView.AddChidren(btnCollection);
            btnSwitchIcon = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(102),
                Width = Application.GetRealWidth(148),
                Height = Application.GetRealWidth(198),
                UnSelectedImagePath = "FunctionIcon/Electrical/AirSwitch/AirSwitchBgIcon.png",
                SelectedImagePath = "FunctionIcon/Electrical/AirSwitch/AirSwitchBgOnIcon.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitchIcon);
            btnSwitch = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(466),// + btnSwitchIcon.Bottom,
                Width = Application.GetMinRealAverage(32),
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh,false);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
            LoadEventList();
        }
        /// <summary>
        /// 更新状态
        /// </summary>
        public static void UpdataState(Function updataTemp)
        {
            Application.RunOnMainThread(() =>
            {
                try
                {
                    if (bodyView == null)
                        return;
                    if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
                    {
                        bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
                    }
                }
                catch (Exception ex)
                {
                    MainPage.Log($"AirSwitch error {ex.Message}");
                }
            });
        }
        /// <summary>
        /// 加载事件列表
        /// </summary>
        void LoadEventList()
        {
            LoadSwitchEvent();
            LoadCollectionEvent();
            //回退刷新信息事件
            actionRefresh = () => {
                btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
        }
        /// <summary>
        /// 收藏功能按钮事件
        /// </summary>
        void LoadCollectionEvent()
        {
            btnCollection.MouseUpEventHandler += (sender, e) => {
                btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
                function.CollectFunction();
            };
        }
        /// <summary>
        /// 加载开关事件
        /// </summary>
        void LoadSwitchEvent()
        {
            btnSwitchIcon.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected;
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected;
                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>();
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs
@@ -47,7 +47,7 @@
        /// <summary>
        /// 加载界面
        /// </summary>
        public void LoadPage()
        public void LoadPage(bool locationSetting = true)
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(actionRefresh);
@@ -111,58 +111,59 @@
                });
            #endregion
            #region 位置管理
            var locationMagtView = new FrameLayout()
            if (locationSetting)
            {
                Height = Application.GetRealHeight(55),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            contentView.AddChidren(locationMagtView);
            var btnLocationMagtTitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(160),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.LocationManagement,
            };
            locationMagtView.AddChidren(btnLocationMagtTitle);
            btnLocationValues = new Button()
            {
                X = Application.GetRealWidth(86),
                Width = Application.GetRealWidth(237),
                TextAlignment = TextAlignment.CenterRight,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.TextFontSize,
                Text = function.GetRoomListName(),
            };
            locationMagtView.AddChidren(btnLocationValues);
            btnLocationInfoRight = new Button()
            {
                X = Application.GetRealWidth(339),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/RightIcon.png",
            };
            locationMagtView.AddChidren(btnLocationInfoRight);
            locationMagtView.AddChidren(
                new Button()
                #region 位置管理
                var locationMagtView = new FrameLayout()
                {
                    Gravity = Gravity.CenterHorizontal,
                    Y = Application.GetRealHeight(54),
                    BackgroundColor = CSS_Color.DividingLineColor,
                    Width = Application.GetRealWidth(343),
                    Height = Application.GetRealHeight(1)
                });
            #endregion
                    Height = Application.GetRealHeight(55),
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                };
                contentView.AddChidren(locationMagtView);
                var btnLocationMagtTitle = new Button()
                {
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(160),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextID = StringId.LocationManagement,
                };
                locationMagtView.AddChidren(btnLocationMagtTitle);
                btnLocationValues = new Button()
                {
                    X = Application.GetRealWidth(86),
                    Width = Application.GetRealWidth(237),
                    TextAlignment = TextAlignment.CenterRight,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.TextFontSize,
                    Text = function.GetRoomListName(),
                };
                locationMagtView.AddChidren(btnLocationValues);
                btnLocationInfoRight = new Button()
                {
                    X = Application.GetRealWidth(339),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetMinRealAverage(16),
                    Height = Application.GetMinRealAverage(16),
                    UnSelectedImagePath = "Public/RightIcon.png",
                };
                locationMagtView.AddChidren(btnLocationInfoRight);
                locationMagtView.AddChidren(
                    new Button()
                    {
                        Gravity = Gravity.CenterHorizontal,
                        Y = Application.GetRealHeight(54),
                        BackgroundColor = CSS_Color.DividingLineColor,
                        Width = Application.GetRealWidth(343),
                        Height = Application.GetRealHeight(1)
                    });
                #endregion
            }
            #region 共享
            //var sharedView = new FrameLayout()
            //{
HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
@@ -97,6 +97,8 @@
            ///切换播放模式点击事件;
            playView.playOrderBtn.MouseUpEventHandler += (sender, e) =>
             {
                 //single/single_cycle/order/list_cycle/random
                 string modeValueString = string.Empty;
                 string msg = Language.StringByID(StringId.switchTo);
                 switch (A31MusicModel.Current.A31PlayStatus.loop)
                 {
@@ -119,8 +121,9 @@
                         break;
                 }
                 new PublicAssmebly().TipMsgAutoClose(msg, false,1000);
                 string url = "http://" + A31MusicModel.Current.IPAddress + "/httpapi.asp?command=setPlayerCmd:" + "loopmode:" + A31MusicModel.Current.A31PlayStatus.loop;
                 SendMethod.SendCommand(url);
                 Dictionary<string, string> dic = new Dictionary<string, string>();
                 dic.Add("mode",modeValueString);
                 //SendMethod.sendMethod.SendControlCommand(,dic);
             };
            ///添加喜爱点击事件;
            playView.loveBtn.MouseUpEventHandler += (sender, e) =>
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
@@ -3,6 +3,8 @@
using Shared;
using Shared.IO;
using System.Net;
using HDL_ON.Entity;
namespace HDL_ON.UI.Music
{
    public class MusicMain : FrameLayout
@@ -56,19 +58,22 @@
        /// <summary>
        ///  显示加载界面
        /// </summary>
        public  static Loading loading = new Loading();
        public static Loading loading = new Loading();
        /// <summary>
        /// 定义全局对象
        /// </summary>
        VerticalRefreshLayout verticalRefresh;
        /// <summary>
        /// 为了音乐刷新状态定义全局对象
        /// </summary>
        MusicView musicView = new MusicView();
        public void Show()
        {
            #region 界面布局
            this.BackgroundColor = MusicColor.ViewColor;
            var topView = new TopView();
            this.AddChidren(topView.TopFLayoutView());
            topView.topNameBtn.TextID =StringId.a31Music;
            topView.topNameBtn.TextID = StringId.a31Music;
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                RemoveFromParent();
@@ -84,200 +89,71 @@
            verticalRefresh.BeginHeaderRefreshingAction += () =>
            {
                SeachMusic(false);
                SeachMusic();
            };
            this.AddChidren(loading);
            SeachMusic();
            if (A31MusicModel.A31MusicModelList.Count == 0)
            {
                SeachMusic(true);
            }
            else
            {
                clearA31Threads();
               //verticalRefresh.RemoveAll();
                for (int i = 0; i < A31MusicModel.A31MusicModelList.Count; i++)
                {
                    var a31player = A31MusicModel.A31MusicModelList[i];
                    ///这个状态是之前保存的,加载完成后要标记为不在线,后面再读取正确的状态
                    if (!a31player.IsCanShow)
                    {
                        continue;
                    }
                    if (A31MusicModel.A31MusicModelList.Count - 1 == i)
                    {
                        a31player.IsEnd = true;
                    }
                    else
                    {
                        a31player.IsEnd = false;
                    }
                    ///加载界面时默认不在线
                    ///这里标记是为了不读取不在线播放器状态
                    a31player.IsOnLine = false;
                    MusicListView(a31player);
                }
                ///读取正确的信息,包括IP和端口及名称
                SendMethod.Seach((obj) =>
                {
                    try
                    {
                        if (obj == null)
                        {
                            ///这里要读取主从关系
                            readServerOrClientMode();
                            A31MusicModel.Save();
                            return;
                        }
                        var a31MusicModel = A31MusicModel.A31MusicModelList.Find((music) => music.UniqueDeviceName == obj.UniqueDeviceName);
                        if (a31MusicModel != null)
                        {
                            a31MusicModel.IPAddress = obj.IPAddress;
                            a31MusicModel.Port = obj.Port;
                            a31MusicModel.Name = obj.Name;
                            a31MusicModel.IsCanShow = true;
                            a31MusicModel.IsOnLine = true;
                        }
                    }
                    catch (Exception e) { MainPage.Log(e.Message); }
                });
            }
        }
        /// <summary>
        /// 刷新播放器列表
        /// </summary>
        /// <param name="Yes">是否显示刷新图标</param>
        void SeachMusic(bool Yes = false)
        void SeachMusic()
        {
            for (int i = 0; i < A31MusicModel.A31MusicModelList.Count; i++)
            Application.RunOnMainThread(() =>
            {
                var a31player = A31MusicModel.A31MusicModelList[i];
                a31player.IsCanShow = false;
                a31player.IsOnLine = false;
            }
            if (Yes)
            {
                //为了第一次进来log一下;
                loading.Start();
            }
            SendMethod.Seach((obj) =>
            {
                if (obj == null)
                verticalRefresh.RemoveAll();
                for (int i = 0; i < SendMethod.sendMethod.GetMusicList.Count; i++)
                {
                    readServerOrClientMode();
                    A31MusicModel.Save();
                    if (!Yes)
                    var playerFunction = SendMethod.sendMethod.GetMusicList[i];
                    if (!playerFunction.online)
                    {
                        ///等待跑完在关闭
                        verticalRefresh.EndHeaderRefreshing();
                        //过滤掉不在线的音乐播放器
                        continue;
                    }
                    Application.RunOnMainThread(() =>
                    {
                        if (Yes)
                        {
                            //为了第一次进来log一下;
                            loading.Hide();
                        }
                        verticalRefresh.RemoveAll();
                        for (int i = 0; i < A31MusicModel.A31MusicModelList.Count; i++)
                        {
                            var a31player = A31MusicModel.A31MusicModelList[i];
                            //这个状态是之前保存的,加载完成后要标记为不在线,后面再读取正确的状态
                            if (!a31player.IsCanShow)
                            {
                                continue;
                            }
                            if (A31MusicModel.A31MusicModelList.Count - 1 == i)
                            {
                                a31player.IsEnd = true;
                            }
                            else
                            {
                                a31player.IsEnd = false;
                            }
                            MusicListView(a31player);
                        }
                       //A31MusicModel.ReadMusicStates();
                    MusicListView(playerFunction);
                }
                    });
                    return;
                }
                var a31MusicModel = A31MusicModel.A31MusicModelList.Find((music) => { return music.UniqueDeviceName == obj.UniqueDeviceName; });
                if (a31MusicModel == null)
                {
                    //不是我们支持的品牌不支持
                    if (obj.Name != null)
                    {
                        obj.sid = "030101123456780909020123AABB" + obj.UniqueDeviceName;
                        A31MusicModel.A31MusicModelList.Add(obj);
                    }
                }
                else
                {
                    a31MusicModel.IPAddress = obj.IPAddress;
                    a31MusicModel.Port = obj.Port;
                    a31MusicModel.Name = obj.Name;
                    a31MusicModel.IsCanShow = true;
                    a31MusicModel.IsOnLine = true;
                }
            });
        }
        /// <summary>
        /// 显示音乐列表的方法
        /// </summary>
        void MusicListView(A31MusicModel a31player)
        void MusicListView(Function player)
        {
            MusicView musicView = new MusicView();
            musicView.View(verticalRefresh);
            musicView.singerBtn.Text = a31player.A31PlayStatus.Artist;
            musicView.songNameBtn.Text = a31player.A31PlayStatus.Title;
            musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player);
            if (a31player.IsEnd)
            {
                musicView.muiscFl.Height = Application.GetRealHeight(12 + 139 + 12);
            }
            musicView.singerBtn.Text = player.GetAttrState("song_name");
            musicView.songNameBtn.Text = player.GetAttrState("song_name");
            musicView.musicNameBtn.Text = player.name;
            //if (player.IsEnd)
            //{
            //    musicView.muiscFl.Height = Application.GetRealHeight(12 + 139 + 12);
            //}
            musicView.collectIconBtn.MouseUpEventHandler += (sender, e) =>
            {
                musicView.collectIconBtn.IsSelected = !musicView.collectIconBtn.IsSelected;
                if (a31player.ServerClientType == 1)
                if (musicView.collectIconBtn.IsSelected)
                {
                    if (musicView.collectIconBtn.IsSelected)
                    {
                        a31player.MainPlayCollection = true;
                    }
                    else
                    {
                        a31player.MainPlayCollection = false;
                    }
                    player.collect = true;
                }
                else
                {
                    if (musicView.collectIconBtn.IsSelected)
                    {
                        a31player.collect = true;
                    }
                    else
                    {
                        a31player.collect = false;
                    }
                    player.collect = false;
                }
                A31MusicModel.Save();
            };
            EventHandler<MouseEventArgs> clickMergence = (sender, e) =>
            {
                if (a31player.ServerClientType == 0)
                {
                    new View.DialogView { }.PlayMergence(a31player);
                }
                else if (a31player.ServerClientType == 1)
                {
                    new View.DialogView { }.DetachPlayMergence(a31player);
                }
                //if (player.ServerClientType == 0)
                //{
                //    new View.DialogView { }.PlayMergence(player);
                //}
                //else if (player.ServerClientType == 1)
                //{
                //    new View.DialogView { }.DetachPlayMergence(player);
                //}
            };
            musicView.mergeBjBtn.MouseUpEventHandler += clickMergence;
            musicView.mergeBtn.MouseUpEventHandler += clickMergence;
@@ -285,7 +161,6 @@
            EventHandler<MouseEventArgs> clickPlayView = (sender, e) =>
            {
                A31MusicModel.Current = a31player;//当前播放器
                var a31PlayMusicPage = new A31PlayMusicPage();
                MainPage.BasePageView.AddChidren(a31PlayMusicPage);
                a31PlayMusicPage.Show();
@@ -302,7 +177,9 @@
            musicView.prevBtn.MouseDownEventHandler += (sender, e) =>
            {
                musicView.prevBtn.IsSelected = true;
                SendMethod.Previous(a31player);
                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("song_step", "up");
                SendMethod.sendMethod.SendControlCommand(player, dic);
            };
            musicView.prevBtn.MouseUpEventHandler += (sender, e) =>
            {
@@ -311,24 +188,28 @@
            ///暂停/播放点击事件
            musicView.playBtn.MouseDownEventHandler += (sender, e) =>
            {
                string status = "off";
                if (musicView.playBtn.IsSelected)
                {
                    musicView.playBtn.IsSelected = false;
                    SendMethod.Pause(a31player);
                    a31player.A31PlayStatus.status = "pause";
                    status = "off";
                }
                else
                {
                    musicView.playBtn.IsSelected = true;
                    SendMethod.Play(a31player);
                    a31player.A31PlayStatus.status = "play";
                    status = "on";
                }
                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("on_off", status);
                SendMethod.sendMethod.SendControlCommand(player, dic);
            };
            ///下一曲点击事件
            musicView.nextBtn.MouseDownEventHandler += (sender, e) =>
            {
                musicView.nextBtn.IsSelected = true;
                SendMethod.Next(a31player);
                Dictionary<string, string> dic = new Dictionary<string, string>();
                dic.Add("song_step", "down");
                SendMethod.sendMethod.SendControlCommand(player, dic);
            };
            musicView.nextBtn.MouseUpEventHandler += (sender, e) =>
            {
@@ -340,47 +221,49 @@
                while (true)
                {
                    System.Threading.Thread.Sleep(1000);
                    if (!a31player.IsOnLine)
                    if (!player.online)
                    {
                        continue;
                    }
                    SendMethod.ReadStatus(a31player);
                    //SendMethod.ReadStatus(player);
                     SendMethod.sendMethod.RefreshDeviceStatus(player,new List<string> { player.deviceId });
                    Application.RunOnMainThread(() =>
                    {
                        musicView.singerBtn.Text = a31player.A31PlayStatus.Artist;
                        musicView.songNameBtn.Text = a31player.A31PlayStatus.Title;
                        musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player);
                        if (a31player.A31PlayStatus.status == "play")
                        {
                            musicView.playBtn.IsSelected = true;
                        }
                        else
                        {
                            musicView.playBtn.IsSelected = false;
                        }
                        musicView.regionBtn.Text = a31player.GetRoomListName();
                        if (a31player.ServerClientType == 1)
                        {
                            if (a31player.MainPlayCollection)
                            {
                                musicView.collectIconBtn.IsSelected = true;
                            }
                            else
                            {
                                musicView.collectIconBtn.IsSelected = false;
                            }
                        }
                        else
                        {
                            if (a31player.collect)
                            {
                                musicView.collectIconBtn.IsSelected = true;
                            }
                            else
                            {
                                musicView.collectIconBtn.IsSelected = false;
                            }
                        }
                        //musicView.singerBtn.Text = player.A31PlayStatus.Artist;
                        //musicView.songNameBtn.Text = player.A31PlayStatus.Title;
                        //musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(player);
                        //if (player.A31PlayStatus.status == "play")
                        //{
                        //    musicView.playBtn.IsSelected = true;
                        //}
                        //else
                        //{
                        //    musicView.playBtn.IsSelected = false;
                        //}
                        //musicView.regionBtn.Text = player.GetRoomListName();
                        //if (player.ServerClientType == 1)
                        //{
                        //    if (player.MainPlayCollection)
                        //    {
                        //        musicView.collectIconBtn.IsSelected = true;
                        //    }
                        //    else
                        //    {
                        //        musicView.collectIconBtn.IsSelected = false;
                        //    }
                        //}
                        //else
                        //{
                        //    if (player.collect)
                        //    {
                        //        musicView.collectIconBtn.IsSelected = true;
                        //    }
                        //    else
                        //    {
                        //        musicView.collectIconBtn.IsSelected = false;
                        //    }
                        //}
                    });
                }
            })
@@ -388,99 +271,67 @@
            musicThread.Start();
            threadLists.Add(musicThread);
        }
        /// <summary>
        /// 读取主从关系
        ///指定刷新界面
        /// </summary>
        void readServerOrClientMode()
        /// <param name="strView">判断字符</param>
        public void RefreshView(string strView)
        {
            try
            Application.RunOnMainThread(() =>
            {
                for (int i = 0; i < A31MusicModel.A31MusicModelList.Count; i++)
                try
                {
                    var a31player = A31MusicModel.A31MusicModelList[i];
                    if (!a31player.IsOnLine)
                    for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
                    {
                        continue;
                    }
                    try
                    {
                        a31player.ServerClientType = 0;
                        var result = SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
                        if (result == null && result == "Failed")
                        var view = MainPage.BasePageView.GetChildren(i);
                        if (strView == view.Tag.ToString())
                        {
                            result = SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
                        }
                        if (result != null && result != "Failed")
                        {
                            a31player.Slave = Newtonsoft.Json.JsonConvert.DeserializeObject<Slaves>(result);
                        }
                    }
                    catch (Exception e)
                    {
                        var d = e.Message;
                    }
                }
                //分析主从关系
                for (int i = 0; i < A31MusicModel.A31MusicModelList.Count; i++)
                {
                    var a31player = A31MusicModel.A31MusicModelList[i];
                    if (!a31player.IsOnLine)
                    {
                        continue;
                    }
                    try
                    {
                        if (a31player.Slave != null && "0" != a31player.Slave.slaves)
                        {
                            a31player.ServerClientType = 1;//主的
                            string str = a31player.Name;
                            for (int j = 0; j < a31player.Slave.slave_list.Count; j++)
                            if (view.GetType() == typeof(MusicMain))
                            {
                                var slave = a31player.Slave.slave_list[j];
                                str = str + "+" + slave.name;
                                var tempA31Player = A31MusicModel.A31MusicModelList.Find((obj) => slave.uuid.Replace("uuid:", "") == obj.UniqueDeviceName);
                                if (tempA31Player == null)
                                {
                                    A31MusicModel.A31MusicModelList.Add(new A31MusicModel
                                    {
                                        sid = "030101123456780909020123AABB" + slave.uuid.Replace("uuid:", ""),
                                        ServerClientType = -1,//从的
                                        IPAddress = slave.ip,
                                        MainPlayIP = a31player.IPAddress,
                                        UniqueDeviceName = slave.uuid.Replace("uuid:", ""),
                                        Name = slave.name,
                                        IsCanShow = false,
                                        IsOnLine = false,//true作用为了读取从播放器的音量
                                    });
                                }
                                //如果找到就更新为从的
                                else
                                {
                                    tempA31Player.ServerClientType = -1;//从的
                                    tempA31Player.IPAddress = slave.ip;
                                    tempA31Player.MainPlayIP = a31player.IPAddress;
                                    tempA31Player.Name = slave.name;
                                    tempA31Player.UniqueDeviceName = slave.uuid.Replace("uuid:", "");
                                    tempA31Player.IsCanShow = false;
                                    tempA31Player.IsOnLine = false;//true作用为了读取从播放器的音量
                                }
                                //musicView.singerBtn.Text = player.A31PlayStatus.Artist;
                                //musicView.songNameBtn.Text = player.A31PlayStatus.Title;
                                //musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(player);
                                //if (player.A31PlayStatus.status == "play")
                                //{
                                //    musicView.playBtn.IsSelected = true;
                                //}
                                //else
                                //{
                                //    musicView.playBtn.IsSelected = false;
                                //}
                                //musicView.regionBtn.Text = player.GetRoomListName();
                                //if (player.ServerClientType == 1)
                                //{
                                //    if (player.MainPlayCollection)
                                //    {
                                //        musicView.collectIconBtn.IsSelected = true;
                                //    }
                                //    else
                                //    {
                                //        musicView.collectIconBtn.IsSelected = false;
                                //    }
                                //}
                                //else
                                //{
                                //    if (player.collect)
                                //    {
                                //        musicView.collectIconBtn.IsSelected = true;
                                //    }
                                //    else
                                //    {
                                //        musicView.collectIconBtn.IsSelected = false;
                                //    }
                                //}
                            }
                            a31player.MainPlayName = str;
                        }
                    }
                    catch (Exception e)
                    {
                        var ss = e.Message;
                    }
                }
            }
            catch { }
                catch { }
            });
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -4,12 +4,28 @@
using System.Net.Sockets;
using System.Security;
using System.Text;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using Shared;
namespace HDL_ON.UI.Music
{
    public class SendMethod
    {
        private static SendMethod m_sendMethod=null;
        public static SendMethod sendMethod
        {
            get
            {
                if (m_sendMethod == null)
                {
                    m_sendMethod = new SendMethod();
                }
                return m_sendMethod;
            }
        }
        /// <summary>
        ///搜索A31音乐播放器
        /// </summary>
@@ -209,7 +225,7 @@
                a31MusicModel.A31PlayStatus.loop = se.SearchForTextOfTag("LoopMode");
                a31MusicModel.A31PlayStatus.Source = se.SearchForTextOfTag("PlayMedium");
                a31MusicModel.A31PlayStatus.playSource = se.SearchForTextOfTag("TrackSource");
                a31MusicModel.A31PlayStatus.TrackURL = se.SearchForTextOfTag("TrackURI").Replace("&", "&amp;amp;");
                a31MusicModel.A31PlayStatus.TrackURL = se.SearchForTextOfTag("TrackURI").Replace("&", "&amp;amp;");
            }
            catch (Exception ex)
@@ -463,7 +479,8 @@
        /// <param name="volume">Volume.</param>
        public static void ControlVolume(int volume, A31MusicModel a31player)
        {
            System.Threading.Tasks.Task.Run(() => {
            System.Threading.Tasks.Task.Run(() =>
            {
                A31MusicModel.ProgressDateTime = DateTime.Now;
                try
                {
@@ -526,7 +543,7 @@
                musicInfo.URL = track.SearchForTextOfTag("URL").Replace("&", "&amp;amp;");
                var metadata = track.SearchForTextOfTag("Metadata").Replace("&", "&amp;");
                var item = SecurityElement.FromString(metadata).SearchForChildByTag("item");
                musicInfo.Title = item.SearchForTextOfTag("dc:title").Replace("&", "&amp;amp;");
                musicInfo.Title = item.SearchForTextOfTag("dc:title").Replace("&", "&amp;amp;");
                musicInfo.Artist = item.SearchForTextOfTag("upnp:artist").Replace("&", "&amp;amp;");
                musicInfo.Album = item.SearchForTextOfTag("upnp:album").Replace("&", "&amp;amp;");
                musicInfo.Duration = item.SearchForTextOfTag("res");
@@ -597,7 +614,7 @@
        /// <summary>
        /// 获取当前播放的列表
        /// </summary>
        public static  string GetCurrentPlayList(A31MusicModel a31player)
        public static string GetCurrentPlayList(A31MusicModel a31player)
        {
            System.Text.StringBuilder getPlayList = new System.Text.StringBuilder();
            getPlayList.AppendLine("<?xml version=\"1.0\"encoding=\"utf-8\"?>");
@@ -656,7 +673,7 @@
        /// <param name="musicInfo">播放音乐</param>
        /// <param name="listName">列表名称</param>
        /// <param name="musicList">推送列表(默认推50首)</param>
        public  static void PushList(MusicInfo musicInfo, string listName, List<MusicInfo> musicList, A31MusicModel a31player,string musicSource)
        public static void PushList(MusicInfo musicInfo, string listName, List<MusicInfo> musicList, A31MusicModel a31player, string musicSource)
        {
            //最大发送的条数
@@ -739,10 +756,12 @@
                sb.AppendLine("&amp;lt;dc:title&amp;gt;" + tempMusicInfo.Title + "&amp;lt;/dc:title&amp;gt;");
                sb.AppendLine("&amp;lt;dc:creator&amp;gt;DJ Sanny J&amp;lt;/dc:creator&amp;gt;");
                if (musicSource== "我的列表") {
                if (musicSource == "我的列表")
                {
                    sb.AppendLine("&amp;lt;upnp:artist&amp;gt;" + listName + "&amp;lt;/upnp:artist&amp;gt;");
                }
                else {
                else
                {
                    sb.AppendLine("&amp;lt;upnp:artist&amp;gt;" + tempMusicInfo.Artist + "&amp;lt;/upnp:artist&amp;gt;");
                }
                sb.AppendLine("&amp;lt;upnp:album&amp;gt;" + tempMusicInfo.Album + "&amp;lt;/upnp:album&amp;gt;");
@@ -778,7 +797,7 @@
            Play(a31player.IPAddress, a31player.Port, playString.ToString());
        }
       static void SendMusicLists(string ip, int port, string soapAction, string listInfo)
        static void SendMusicLists(string ip, int port, string soapAction, string listInfo)
        {
            System.Net.WebClient webClient = new System.Net.WebClient();
            webClient.Headers.Add("SOAPACTION", "\"urn:schemas-wiimu-com:service:PlayQueue:1#" + soapAction + "\"");
@@ -788,13 +807,13 @@
                byte[] recevieBytes = webClient.UploadData(new Uri("http://" + ip + ":" + port + "/upnp/control/PlayQueue1"), "POST", System.Text.Encoding.UTF8.GetBytes(listInfo));
                var s = System.Text.Encoding.UTF8.GetString(recevieBytes, 0, recevieBytes.Length);
            }
            catch(Exception e)
            catch (Exception e)
            {
                var d = e.Message;
            }
        }
       static void Play(string ip, int port, string info)
        static void Play(string ip, int port, string info)
        {
            System.Net.WebClient webClient = new System.Net.WebClient();
            webClient.Headers.Add("SOAPACTION", "\"urn:schemas-wiimu-com:service:PlayQueue:1#PlayQueueWithIndex\"");
@@ -882,5 +901,72 @@
            public string creator = string.Empty;
        }
        /// <summary>
        /// 获取音乐列表
        /// </summary>
        public List<Function> GetMusicList
        {
            get
            {
                return FunctionList.List.GetMusicList();
            }
        }
        /// <summary>
        /// 发送控制命令
        /// </summary>
        /// <param name="function">当前设备</param>
        /// <param name="dic">发送控制数据</param>
        public void SendControlCommand(Function function, Dictionary<string, string> dic)
        {
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendWriteCommand(function, dic);
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 刷新设备状态
        /// </summary>
        /// <returns></returns>
        public void RefreshDeviceStatus(Function music, List<string> functionIds)
        {
            try
            {
                Dictionary<string, object> d = new Dictionary<string, object>();
                d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
                d.Add("deviceIds", functionIds);
                var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_RefreshDeviceStatus);
                if (responsePackNew.Code != "0")
                {
                    return;
                }
                //数据返序列化为Function对象
                var str = Newtonsoft.Json.JsonConvert.SerializeObject(responsePackNew.Data.ToString());
                var function = Newtonsoft.Json.JsonConvert.DeserializeObject<Function>(str);
                if (function == null)
                {
                    return;
                }
                music.name = function.name;
                music.sid = function.sid;
                music.spk = function.spk;
                music.status = function.status;
                music.roomIds = function.roomIds;
                music.attributes = function.attributes;
            }
            catch { }
        }
        /// <summary>
        ///请求服务器(与住宅有关:例如;homeId)
        /// </summary>
        /// <returns></returns>
        public  ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5)
        {
            var requestJson = HttpUtil.GetSignRequestJson(o);
            return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout);
        }
    }
}