wei
2021-09-07 6b6a3fd9c292a75196c4cc15c6d9bf52537efbd4
1.窗帘问题。2.智能空开。3.组合调光部分。
2个文件已添加
23个文件已修改
1220 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/Public/HookIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Public/HookIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Light.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/TopViewDiv.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPage.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPage.cs 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs 620 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,25 +1,67 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL-ON_iOS/Info.plist">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs">
    <Files>
      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="21" Column="89" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/A_EnvironmentalDataCenter.cs" Line="304" Column="119" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs" Line="976" Column="47" />
      <File FileName="HDL_ON/DAL/DriverLayer/Packet.cs" Line="605" Column="54" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" Line="288" Column="103" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption.cs" Line="8" Column="31" />
      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="208" Column="54" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" Line="895" Column="68" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs" Line="62" Column="49" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs" Line="142" Column="2" />
      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="27" Column="19" />
      <File FileName="HDL-ON_iOS/Info.plist" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs" Line="383" Column="53" />
      <File FileName="HDL_ON/Common/R.cs" Line="9" Column="34" />
      <File FileName="HDL-ON_iOS/Resources/Language.ini" Line="1616" Column="9" />
      <File FileName="HDL-ON_Android/Assets/Language.ini" Line="2217" Column="1" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs" Line="640" Column="26" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs" Line="170" Column="14" />
      <File FileName="HDL_ON/Entity/Function/Light.cs" Line="14" Column="49" />
      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="225" Column="23" />
      <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionPage.cs" Line="36" Column="10" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs" Line="1" Column="1" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPage.cs" Line="152" Column="1" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs" Line="234" Column="66" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPage.cs" Line="148" Column="74" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs" Line="261" Column="28" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs" Line="70" Column="30" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="Server" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI0-Public" expanded="True" />
                <Node name="UI1-Login" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="2-Classification" expanded="True" />
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="Curtain" expanded="True" />
                    <Node name="Electrical" expanded="True" />
                    <Node name="Light" expanded="True">
                      <Node name="LightScene" expanded="True" />
                    </Node>
                    <Node name="FunctionBaseInfoSetPageBLL.cs" selected="True" />
                  </Node>
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_Android" expanded="True">
              <Node name="Assets" expanded="True">
                <Node name="Phone" expanded="True" />
              </Node>
            </Node>
            <Node name="HDL-ON_iOS" expanded="True">
              <Node name="Info.plist" selected="True" />
              <Node name="Resources" expanded="True">
                <Node name="Phone" expanded="True">
                  <Node name="FunctionIcon" expanded="True">
                    <Node name="Light" expanded="True">
                      <Node name="LightScene" expanded="True" />
                    </Node>
                  </Node>
                  <Node name="Public" expanded="True" />
                </Node>
              </Node>
            </Node>
          </Node>
        </State>
@@ -32,7 +74,7 @@
    <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
@@ -49,6 +91,7 @@
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" line="153" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="338" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2144" column="1" />
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs" line="244" column="1" />
    </BreakpointStore>
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
HDL-ON_Android/Assets/Language.ini
@@ -496,6 +496,7 @@
508=Formaldehyde
509=Please enter security name.
510=Please select the deployment target.
511=Combined dimming
 
1000=Room Humidity
@@ -1612,7 +1613,7 @@
508=甲醛
509=请输入安防名称。
510=请选择布防目标。
511=组合调光
 
1000=室内湿度
HDL-ON_Android/Assets/Phone/Public/HookIcon.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -462,6 +462,7 @@
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" />
    <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" />
    <AndroidAsset Include="Assets\Phone\LogicIcon\security.png" />
    <AndroidAsset Include="Assets\Phone\Public\HookIcon.png" />
  </ItemGroup>
  <ItemGroup>
    <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\BindScene.png" />
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -130,9 +130,6 @@
      <PackageReference Include="Xamarin.Essentials">
        <Version>1.7.0</Version>
      </PackageReference>
      <PackageReference Include="Xamarin.Swift">
        <Version>1.0.8</Version>
      </PackageReference>
    </ItemGroup>
    <ItemGroup>
        <ImageAsset Include="Assets.xcassets\add_server1.imageset\add_server1.png" />
@@ -1353,6 +1350,7 @@
      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_blue.png" />
      <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\electricalbreaker_white.png" />
      <BundleResource Include="Resources\Phone\LogicIcon\security.png" />
      <BundleResource Include="Resources\Phone\Public\HookIcon.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.202109022</string>
    <string>1.2.202109024</string>
    <key>CFBundleVersion</key>
    <string>1.2.09022</string>
    <string>1.2.09024</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Use geographic location to provide services such as weather</string>
    <key>NSAppleMusicUsageDescription</key>
HDL-ON_iOS/Resources/Language.ini
@@ -496,6 +496,7 @@
508=Formaldehyde
509=Please enter security name.
510=Please select the deployment target.
511=Combined dimming
 
1000=Room Humidity
@@ -1612,7 +1613,7 @@
508=甲醛
509=请输入安防名称。
510=请选择布防目标。
511=组合调光
 
1000=室内湿度
HDL-ON_iOS/Resources/Phone/Public/HookIcon.png
HDL_ON/Common/R.cs
@@ -5,6 +5,12 @@
    public static class StringId
    {
        //public const int SaveAs
        /// <summary>
        /// 组合调光
        /// </summary>
        public const int CombinedDimming = 511;
        /// <summary>
        /// 
        /// </summary>
HDL_ON/DAL/Server/HttpUtil.cs
@@ -17,8 +17,8 @@
        /// 固定域名,正式环境
        /// 公共域名就近解析
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
        /// <summary>
        /// RegionMark
        /// </summary>
HDL_ON/Entity/Function/Function.cs
@@ -695,7 +695,7 @@
    /// 功能属性
    /// 属性字段解析:attri :属性内容,value 属性的值,max 最大值 min 最小值
    /// </summary>
    [System.Serializable]
    [Serializable]
    public class FunctionAttributes
    {
        /// <summary>
HDL_ON/Entity/Function/Light.cs
@@ -11,10 +11,13 @@
        /// 获取rgb颜色
        /// </summary>
        /// <returns></returns>
        public int GetRGBcolor(Function function )
        public int GetRGBcolor(Function function ,string rgbString ="")
        {
            var color = function.GetAttrState(FunctionAttributeKey.RGB).Split(",");
            if(!string.IsNullOrEmpty(rgbString))
            {
                color = rgbString.Split(",");
            }
            if(color.Length!= 3)
            {
                color = new string[] {"100", "100", "100" };
HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -158,6 +158,34 @@
        }
        /// <summary>
        /// 灯光功能列表界面
        /// 带组合调光编辑
        /// </summary>
        /// <param name="backAction"></param>
        /// <param name="editAction"></param>
        public void LoadTopView_LightFunction( Action editAction)
        {
            LoadTopView();
            var btnSetting = new Button()
            {
                X = Application.GetRealWidth(337),
                Y = Application.GetRealHeight(29),
                Width = Application.GetMinRealAverage(28),
                Height = Application.GetMinRealAverage(28),
                UnSelectedImagePath = "FunctionIcon/Light/LightScene/SetLightSceneIcon.png",
            };
            contentView.AddChidren(btnSetting);
            btnSetting.MouseUpEventHandler = (sender, e) =>
            {
                editAction();
            };
        }
        /// <summary>
        /// 向framelayout添加顶部区域,拥有配置图标按钮
        /// </summary>
        /// <param name="frame"></param>
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -211,8 +211,8 @@
                    etAccount.Text = "13226233133";//豆豆
                    //etAccount.Text = "18316672920";
                    //etAccount.Text = "18316120654";//tujie
                    //etAccount.Text = "15626203746";
                    etAccount.Text = "13450425807";//黄竹溪 knx项目
                    etAccount.Text = "15626203746";
                    //etAccount.Text = "13450425807";//黄竹溪 knx项目
                }
                else
                {
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -38,8 +38,20 @@
        public void LoadPage(int titleId)
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //if (titleId == StringId.Lights)
            //{
            //    Action action = () => {
            //        var skipView = new AddLightScene(new List<Function>(),new Scene() { sceneType = SceneType.LightScene});
            //        MainPage.BasePageView.AddChidren(skipView);
            //        skipView.LoadPage();
            //        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            //    };
            //    new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView_LightFunction(action);
            //}
            //else
            {
            new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView();
            }
            /// <summary>
            /// 房间内容显示区域
            /// </summary>
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -183,12 +183,14 @@
                    UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode))
                };
                FrameWhiteCentet1.AddChidren(btnMode);
                if (device.GetAttribute(FunctionAttributeKey.Mode).value.Count > 1)
                {
                btnMode.MouseUpEventHandler = (sender, e) =>
                {
                    LoadDiv_ChangeModeView();
                };
            }
            }
            btnSwitch = new Button()
            {
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPage.cs
@@ -25,6 +25,12 @@
        /// 窗帘动态控件
        /// </summary>
        CurtainSeekBarOn curtainSeekBar;
        /// <summary>
        /// 进度值
        /// </summary>
        Button btnProgress;
        ///// <summary>
        ///// 窗帘进度减少按钮
        ///// </summary>
@@ -134,6 +140,17 @@
            //    controlView.AddChidren(btnCollection);
            //}
            btnProgress = new Button() {
                Y = Application.GetRealHeight(80),
                Height = Application.GetRealHeight(50),
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.PromptingColor1,
                Text = curtainTemp.GetPercent(function).ToString() + "%",
            };
            controlView.AddChidren(btnProgress);
            curtainSeekBar = new CurtainSeekBarOn()
            {
                Gravity = Gravity.CenterHorizontal,
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -53,6 +53,7 @@
            //运行方向 打开(加进度):关闭(减进度)
            bool runningDirection = progress > curtainSeekBar.Progress;
            int curBarProgress = curtainSeekBar.Progress;
            btnProgress.Text = progress + "%";
            new System.Threading.Thread(() =>
            {
                try
@@ -228,8 +229,9 @@
            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //};
            //curtainSeekBar.OnProgressChangedEvent = (sender, e) =>
            //{
            curtainSeekBar.OnProgressChangedEvent = (sender, e) =>
            {
                btnProgress.Text = curtainSeekBar.Progress + "%";
            //    controlBar.Progress = curtainSeekBar.Progress;
            //    new System.Threading.Thread(() =>
            //    {
@@ -243,9 +245,10 @@
            //        }
            //    })
            //    { IsBackground = true }.Start();
            //};
            };
            curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
            btnProgress.Text = curtainSeekBar.Progress + "%";
                //controlBar.Progress = curtainSeekBar.Progress;
                new System.Threading.Thread(() =>
                {
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPage.cs
@@ -26,18 +26,18 @@
        /// 窗帘动态控件
        /// </summary>
        CurtainRollSeekBarOn curtainSeekBar;
        /// <summary>
        /// 窗帘进度减少按钮
        /// </summary>
        Button btnMinusSignIcon;
        /// <summary>
        /// 窗帘进度增加按钮
        /// </summary>
        Button btnPlusSgnIcon;
        /// <summary>
        /// 窗帘滑动控制
        /// </summary>
        DiyImageSeekBar controlBar;
        ///// <summary>
        ///// 窗帘进度减少按钮
        ///// </summary>
        //Button btnMinusSignIcon;
        ///// <summary>
        ///// 窗帘进度增加按钮
        ///// </summary>
        //Button btnPlusSgnIcon;
        ///// <summary>
        ///// 窗帘滑动控制
        ///// </summary>
        //DiyImageSeekBar controlBar;
        /// <summary>
        /// 窗帘关闭按钮
        /// </summary>
@@ -50,6 +50,10 @@
        /// 窗帘打开按钮
        /// </summary>
        Button btnCurtainOpen;
        /// <summary>
        /// 进度值
        /// </summary>
        Button btnProgress;
        #endregion
        #region 区域变量
@@ -134,6 +138,17 @@
            //    controlView.AddChidren(btnCollection);
            //}
            btnProgress = new Button()
            {
                Y = Application.GetRealHeight(80),
                Height = Application.GetRealHeight(50),
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.PromptingColor1,
                Text = curtainTemp.GetPercent(function).ToString() + "%",
            };
            controlView.AddChidren(btnProgress);
            curtainSeekBar = new CurtainRollSeekBarOn()
            {
                Gravity = Gravity.CenterHorizontal,
@@ -146,54 +161,54 @@
            };
            controlView.AddChidren(curtainSeekBar);
            btnMinusSignIcon = new Button()
            {
                Y = Application.GetRealHeight(406),
                Width = Application.GetRealWidth(52),
                Height = Application.GetMinRealAverage(24),
                TextAlignment = TextAlignment.CenterRight,
                TextID = StringId.PullOpen,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextColor = CSS_Color.PromptingColor1,
                Visible = false,
                Enable = false,
            };
            controlView.AddChidren(btnMinusSignIcon);
            //btnMinusSignIcon = new Button()
            //{
            //    Y = Application.GetRealHeight(406),
            //    Width = Application.GetRealWidth(52),
            //    Height = Application.GetMinRealAverage(24),
            //    TextAlignment = TextAlignment.CenterRight,
            //    TextID = StringId.PullOpen,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //    TextColor = CSS_Color.PromptingColor1,
            //    Visible = false,
            //    Enable = false,
            //};
            //controlView.AddChidren(btnMinusSignIcon);
            controlBar = new DiyImageSeekBar()
            {
                X = btnMinusSignIcon.Right,
                Y = Application.GetRealHeight(391),//414,设计数据
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealHeight(54),
                SeekBarViewHeight = Application.GetRealHeight(8),
                ThumbImagePath = "Public/ThumbImage.png",
                ThumbImageHeight = Application.GetRealHeight(54),
                ProgressBarColor = CSS_Color.MainColor,
                ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                ProgressTextSize = 0x00000000,
                MaxValue = 100,
                SeekBarPadding = Application.GetRealWidth(20),
                Progress = curtainTemp.GetPercent(function),
                Visible = false,
                Enable = false,
            };
            controlView.AddChidren(controlBar);
            //controlBar = new DiyImageSeekBar()
            //{
            //    X = btnMinusSignIcon.Right,
            //    Y = Application.GetRealHeight(391),//414,设计数据
            //    Width = Application.GetRealWidth(220),
            //    Height = Application.GetRealHeight(54),
            //    SeekBarViewHeight = Application.GetRealHeight(8),
            //    ThumbImagePath = "Public/ThumbImage.png",
            //    ThumbImageHeight = Application.GetRealHeight(54),
            //    ProgressBarColor = CSS_Color.MainColor,
            //    ProgressTextColor = CSS_Color.FirstLevelTitleColor,
            //    ProgressTextSize = 0x00000000,
            //    MaxValue = 100,
            //    SeekBarPadding = Application.GetRealWidth(20),
            //    Progress = curtainTemp.GetPercent(function),
            //    Visible = false,
            //    Enable = false,
            //};
            //controlView.AddChidren(controlBar);
            btnPlusSgnIcon = new Button()
            {
                X = Application.GetRealWidth(286),
                Y = Application.GetRealHeight(406),
                Width = Application.GetRealWidth(62),
                Height = Application.GetRealWidth(24),
                TextID = StringId.Shut,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextColor = CSS_Color.PromptingColor1,
                Visible = false,
                Enable = false,
            };
            controlView.AddChidren(btnPlusSgnIcon);
            //btnPlusSgnIcon = new Button()
            //{
            //    X = Application.GetRealWidth(286),
            //    Y = Application.GetRealHeight(406),
            //    Width = Application.GetRealWidth(62),
            //    Height = Application.GetRealWidth(24),
            //    TextID = StringId.Shut,
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //    TextColor = CSS_Color.PromptingColor1,
            //    Visible = false,
            //    Enable = false,
            //};
            //controlView.AddChidren(btnPlusSgnIcon);
            btnCurtainClose = new Button()
            {
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -50,6 +50,7 @@
            //运行方向 打开(加进度):关闭(减进度)
            bool runningDirection = progress > curtainSeekBar.Progress;
            int curBarProgress = curtainSeekBar.Progress;
            btnProgress.Text = progress + "%";
            new System.Threading.Thread(() =>
            {
                try
@@ -185,23 +186,23 @@
                CurtainAnimation(100);
            };
            btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
            {
                controlBar.Progress -= 1;
                function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
            };
            //btnMinusSignIcon.MouseUpEventHandler = (sender, e) =>
            //{
            //    controlBar.Progress -= 1;
            //    function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress);
            //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //    d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString());
            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //};
            btnPlusSgnIcon.MouseUpEventHandler = (sender, e) =>
            {
                controlBar.Progress += 1;
                function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
            };
            //btnPlusSgnIcon.MouseUpEventHandler = (sender, e) =>
            //{
            //    controlBar.Progress += 1;
            //    function.SetAttrState(FunctionAttributeKey.Percent, controlBar.Progress);
            //    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //    d.Add(FunctionAttributeKey.Percent, controlBar.Progress.ToString());
            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //};
            btnCurtainStop.MouseDownEventHandler = (sender, e) =>
@@ -242,7 +243,8 @@
            //};
            curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                controlBar.Progress = curtainSeekBar.Progress;
                //controlBar.Progress = curtainSeekBar.Progress;
                btnProgress.Text = curtainSeekBar.Progress + "%";
                new System.Threading.Thread(() =>
                {
                    function.SetAttrState(FunctionAttributeKey.Percent, e);
@@ -254,9 +256,9 @@
                { IsBackground = true }.Start();
            };
            //controlBar.OnProgressChangedEvent = (sender, e) =>
            //{
            //    curtainSeekBar.Progress = controlBar.Progress;
            curtainSeekBar.OnProgressChangedEvent = (sender, e) =>
            {
                btnProgress.Text = curtainSeekBar.Progress + "%";
            //    new System.Threading.Thread(() =>
            //    {
            //        if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - function.refreshTime).TotalMilliseconds > 300)
@@ -269,22 +271,23 @@
            //        }
            //    })
            //    { IsBackground = true }.Start();
            //};
            controlBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                curtainSeekBar.Progress = controlBar.Progress;
                new System.Threading.Thread(() =>
                {
                    function.SetAttrState(FunctionAttributeKey.Percent, e);
                    function.refreshTime = DateTime.Now;
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("percent", e.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
            };
            //controlBar.OnStopTrackingTouchEvent = (sender, e) =>
            //{
            //    curtainSeekBar.Progress = controlBar.Progress;
            //    btnProgress.Text = curtainSeekBar.Progress + "%";
            //    new System.Threading.Thread(() =>
            //    {
            //        function.SetAttrState(FunctionAttributeKey.Percent, e);
            //        function.refreshTime = DateTime.Now;
            //        System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
            //        d.Add("percent", e.ToString());
            //        DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //    })
            //    { IsBackground = true }.Start();
            //};
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
@@ -34,6 +34,13 @@
        /// 开关按钮
        /// </summary>
        Button btnSwitch;
        /// <summary>
        /// 运行状态-动态加载
        /// </summary>
        Button btnRunStatus;
        #endregion
        #region 区域变量
@@ -74,7 +81,6 @@
                btnFromFloor_Out = btnFromFloorOut;
            }
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function);
            controlView = new FrameLayout()
            {
@@ -136,6 +142,62 @@
            };
            controlView.AddChidren(btnSwitchIcon);
            //运行状态
            if(function.GetAttribute("run_status")!= null)
            {
                btnRunStatus = new Button()
                {
                    Y = Application.GetRealHeight(300),
                    Height = Application.GetRealHeight(58),
                    TextAlignment = TextAlignment.Center,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                controlView.AddChidren(btnRunStatus);
                UpdataRunStatus();
            }
            if (function.GetAttribute("power")!= null)
            {
                Button btnEnergyIcon = new Button()
                {
                    Y = Application.GetRealHeight(377),
                    Gravity = Gravity.CenterHorizontal,
                    Width = Application.GetRealWidth(32),
                    Height = Application.GetRealWidth(32),
                    UnSelectedImagePath = "FunctionIcon/Electrical/AirSwitch/EnergyIcon.png"
                };
                controlView.AddChidren(btnEnergyIcon);
                Button btnEnergyText = new Button()
                {
                    Y = Application.GetRealHeight(400),
                    Gravity = Gravity.CenterHorizontal,
                    Height = Application.GetRealWidth(47),
                    TextAlignment = TextAlignment.Center,
                    TextID = StringId.EnergyMonitoring,
                    TextColor = CSS_Color.TextualColor,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                controlView.AddChidren(btnEnergyText);
                EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                    var skipView = new EnergyMainPage();
                    MainPage.BasePageView.AddChidren(skipView);
                    skipView.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                };
                btnEnergyIcon.MouseUpEventHandler = eventHandler;
                btnEnergyText.MouseUpEventHandler = eventHandler;
            }
            btnSwitch = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
@@ -148,7 +210,7 @@
            };
            controlView.AddChidren(btnSwitch);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh,false);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(function);
@@ -177,6 +239,10 @@
                    {
                        bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
                    }
                    if(updataTemp.GetAttribute("run_status")!=null)
                    {
                        bodyView.UpdataRunStatus();
                    }
                }
                catch (Exception ex)
                {
@@ -185,6 +251,138 @@
            });
        }
        /// <summary>
        /// 更新运行状态
        /// </summary>
        void UpdataRunStatus()
        {
            if (btnRunStatus == null)
                return;
            var runStatus = function.GetAttrState("run_status");
            if (Language.CurrentLanguage == "Chinese")
            {
                switch (runStatus)
                {
                    //* RUN:正常工作中
                    case "RUN":
                        btnRunStatus.Text = "工作中";
                        btnRunStatus.TextColor = CSS_Color.MainColor;
                        break;
                    //* HV:过压预警
                    case "HV":
                        btnRunStatus.Text = "过压预警";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* LV:欠压预警
                    case "LV":
                        btnRunStatus.Text = "欠压预警";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* HC:过流预警
                    case "HC":
                        btnRunStatus.Text = "过流预警";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* HT:过温预警
                    case "HT":
                        btnRunStatus.Text = "过温预警";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* LEAK:漏电预警
                    case "LEAK":
                        btnRunStatus.Text = "漏电预警";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* ERR_HV:过压报警
                    case "ERR_HV":
                        btnRunStatus.Text = "过压报警";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                    //* ERR_LV:欠压报警
                    case "ERR_LV":
                        btnRunStatus.Text = "欠压报警";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                    //* ERR_HC:过流报警
                    case "ERR_HC":
                        btnRunStatus.Text = "过流报警";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                    //* ERR_HT:过温报警
                    case "ERR_HT":
                        btnRunStatus.Text = "过温报警";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                    //* ERR_LEAK:漏电报警
                    case "ERR_LEAK":
                        btnRunStatus.Text = "漏电报警";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                }
            }
            else
            {
                switch (runStatus)
                {
                    //* RUN:正常工作中
                    case "RUN":
                        btnRunStatus.Text = "At work";
                        btnRunStatus.TextColor = CSS_Color.MainColor;
                        break;
                    //* HV:过压预警
                    case "HV":
                        btnRunStatus.Text = "Overvoltage warning";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* LV:欠压预警
                    case "LV":
                        btnRunStatus.Text = "Undervoltage warning";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* HC:过流预警
                    case "HC":
                        btnRunStatus.Text = "Overcurrent warning";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* HT:过温预警
                    case "HT":
                        btnRunStatus.Text = "Overtemperature warning";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* LEAK:漏电预警
                    case "LEAK":
                        btnRunStatus.Text = "Leakage warning";
                        btnRunStatus.TextColor = 0xFFFC9C04;
                        break;
                    //* ERR_HV:过压报警
                    case "ERR_HV":
                        btnRunStatus.Text = "Overvoltage alarm";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                    //* ERR_LV:欠压报警
                    case "ERR_LV":
                        btnRunStatus.Text = "Undervoltage alarm";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                    //* ERR_HC:过流报警
                    case "ERR_HC":
                        btnRunStatus.Text = "Overcurrent alarm";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                    //* ERR_HT:过温报警
                    case "ERR_HT":
                        btnRunStatus.Text = "Overtemperature alarm";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                    //* ERR_LEAK:漏电报警
                    case "ERR_LEAK":
                        btnRunStatus.Text = "Leakage alarm";
                        btnRunStatus.TextColor = 0xFFFF8080;
                        break;
                }
            }
        }
        /// <summary>
        /// 加载事件列表
        /// </summary>
        void LoadEventList()
HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
@@ -84,6 +84,9 @@
        {
            bodyView = this;
            energyList = FunctionList.List.GetEnergyList(); 
            var breaker = FunctionList.List.Functions.FindAll((obj) => obj.spk == SPK.AirSwitch);
            var energyBreker = breaker.FindAll((obj) => obj.GetAttribute("power") != null);
            energyList.AddRange(energyBreker);
        }
        /// <summary>
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
@@ -67,7 +67,11 @@
            {
                btnLocationInfoRight.MouseUpEventHandler = eventHandler;
            }
            if (btnLocationValues != null)
            {
            btnLocationValues.MouseUpEventHandler = eventHandler;
        }
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -41,7 +41,7 @@
        /// <summary>
        /// 色温的滑动控件
        /// </summary>
        SeekBarControl barColorTemplatrue;
        CCTSeekBarControl barColorTemplatrue;
        /// <summary>
        /// 开关按钮
        /// </summary>
@@ -205,7 +205,7 @@
            btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png";
            controlView.AddChidren(btnColorTemplatrueBack);
            //滑动条控件
            barColorTemplatrue = new SeekBarControl();
            barColorTemplatrue = new CCTSeekBarControl();
            barColorTemplatrue.X = btnTempClolorMin.Right;
            barColorTemplatrue.Y = Application.GetRealHeight(340);
            barColorTemplatrue.MinValue = 27;
@@ -537,11 +537,12 @@
                btnReadIcon.IsSelected = true;
            }
        }
    }
        /// <summary>
        /// 左右滑动的进度条控件
        /// </summary>
        private class SeekBarControl : DiyImageSeekBar
    public class CCTSeekBarControl : DiyImageSeekBar
        {
            #region ■ 变量声明___________________________
@@ -649,7 +650,7 @@
            /// 左右滑动的进度条控件
            /// </summary>
            /// <param name="i_width">宽度,非真实值</param>
            public SeekBarControl(int i_width = 210)
            public CCTSeekBarControl(int i_width = 210)
            {
                this.Width = Application.GetRealWidth(i_width);
                this.Height = Application.GetRealHeight(54);
@@ -772,6 +773,5 @@
            }
            #endregion
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs
@@ -27,18 +27,19 @@
        static VerticalScrolViewLayout functionListView;
        #endregion
        List<Function> functionList;
        public AddLightScene()
        List<Function> sceneLishtList;
        Scene lightScene;
        public AddLightScene(List<Function> functions,Scene scene)
        {
            bodyView = this;
            functionList = new List<Function>();
            sceneLishtList = functions;
            lightScene = scene;
        }
        public void LoadPage(int titleId)
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView();
            new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView();
            /// <summary>
            /// 房间内容显示区域
@@ -81,10 +82,615 @@
            };
            bodyView.AddChidren(functionListView);
                functionList.AddRange(FunctionList.List.GetLightList());
            var lightList = FunctionList.List.GetLightList();
            foreach (var function in lightList)
            {
                var functionDiv = new LightRow(function)
                {
                    Gravity = Gravity.CenterHorizontal,
                    Width = Application.GetRealWidth(343),
                    Height = Application.GetRealHeight(62),
                    Radius = (uint)Application.GetMinRealAverage(12),
                    BorderColor = 0x00FFFFFF,
                    BorderWidth = 1,
                    BackgroundColor = CSS_Color.MainBackgroundColor,
                    Tag = function.spk + function.sid
                };
                functionDiv.LoadDiv(sceneLishtList);
                functionListView.AddChidren(functionDiv);
                functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
            }
            #region 底部view
            var bottomView = new FrameLayout()
            {
                Y = Application.GetRealHeight(591),
                Height = Application.GetRealHeight(100),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
            };
            this.AddChidren(bottomView);
            var btnConfrim = new Button()
            {
                Y = Application.GetRealHeight(12),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealHeight(44),
                Radius = (uint)Application.GetRealHeight(22),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainBackgroundColor,
                BackgroundColor = CSS_Color.MainColor,
                TextID = StringId.Confirm,
            };
            bottomView.AddChidren(btnConfrim);
            btnConfrim.MouseUpEventHandler = (sender, e) => {
                var lightSceneDialog = new LightSceneEditDialog(sceneLishtList,lightScene);
                lightSceneDialog.ShowDialog();
            };
            #endregion
        }
    }
    public class LightRow : FrameLayout
    {
        #region 区域控件
        static FrameLayout bodyDiv;
        /// <summary>
        /// 功能/场景icon
        /// </summary>
        Button btnIcon;
        /// <summary>
        /// 功能名称/场景名称
        /// </summary>
        Button btnName;
        /// <summary>
        /// 楼层信息显示按钮
        /// </summary>
        Button btnFromFloor;
        /// <summary>
        /// 选中按钮
        /// </summary>
        Button btnSelect;
        #endregion
        #region 区域变量
        Function function;
        #endregion
        public LightRow(Function func)
        {
            bodyDiv = this;
            bodyDiv.Tag = func.sid;
            function = func;
        }
        /// <summary>
        /// 加载控制卡片区域
        /// </summary>
        public void LoadDiv(List<Function> functions)
        {
            btnIcon = new Button()
            {
                X = Application.GetRealWidth(10),
                Y = Application.GetRealHeight(15),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"
            };
            bodyDiv.AddChidren(btnIcon);
            btnName = new Button()
            {
                X = Application.GetRealWidth(8 + 10 + 32),
                Y = Application.GetRealHeight(10),
                Width = Application.GetRealWidth(200),
                Height = Application.GetRealHeight(24),
                Text = function.name,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
            };
            bodyDiv.AddChidren(btnName);
            btnFromFloor = new Button()
            {
                X = Application.GetRealWidth(8 + 10 + 32),
                Y = Application.GetRealHeight(10 + 24),
                Width = Application.GetRealWidth(200),
                Height = Application.GetRealHeight(18),
                Text = function.GetRoomListName(),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
            bodyDiv.AddChidren(btnFromFloor);
            btnSelect = new Button()
            {
                X = Application.GetRealWidth(303),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "FunctionIcon/Light/LightScene/CheckIcon.png",
                SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png",
                IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null
            };
            bodyDiv.AddChidren(btnSelect);
            btnSelect.MouseUpEventHandler = (sender, e) => {
                btnSelect.IsSelected = !btnSelect.IsSelected;
                if(btnSelect.IsSelected)
                {
                    var addTemp = functions.Find((obj) => obj.deviceId == function.deviceId);
                    if (addTemp == null)
                    {
                        functions.Add(function);
                    }
                }
                else
                {
                    var removeTemp = functions.Find((obj) => obj.deviceId == function.deviceId);
                    if (removeTemp != null)
                    {
                        functions.Remove(removeTemp);
                    }
                }
            };
        }
        }
    /// <summary>
    /// 灯光场景编辑弹窗
    /// </summary>
    public class LightSceneEditDialog :Dialog
    {
        List<Function> lights;
        Scene editScene;
        public LightSceneEditDialog(List<Function> functions,Scene scene)
        {
            lights = functions;
            editScene = scene;
    }
        public void ShowDialog()
        {
            var hadDimming = lights.Find((obj) => obj.spk == SPK.LightDimming) != null;
            var hadCCT = lights.Find((obj) => obj.spk == SPK.LightCCT) != null;
            var hadRGB = lights.Find((obj) => obj.spk == SPK.LightRGB) != null;
            var bodyView = new FrameLayout();
            this.AddChidren(bodyView);
            bodyView.MouseUpEventHandler = (sender, e) => {
                this.Close();
            };
            var contentView = new FrameLayout() {
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Width = Application.GetRealWidth(343),
                Radius = (uint)Application.GetRealWidth(12),
            };
            bodyView.AddChidren(contentView);
            #region 标题区
            bool inEdit = false;//是否在编辑标题
            var titleView = new FrameLayout()
            {
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(52),
            };
            contentView.AddChidren(titleView);
            var btnTitle = new Button()
            {
                Height = Application.GetRealHeight(52),
                Gravity = Gravity.Center,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextColor = CSS_Color.MainColor,
                TextID = StringId.CombinedDimming,
                TextAlignment = TextAlignment.Center,
            };
            if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247
            {
                btnTitle.Width = Application.GetRealWidth(197);
                btnTitle.IsMoreLines = true;
            }
            else
            {
                btnTitle.Width = btnTitle.GetTextWidth()+ Application.GetRealWidth(10);
                btnTitle.IsMoreLines = false;
            }
            titleView.AddChidren(btnTitle);
            var btnEditIcon = new Button()
            {
                Width = Application.GetRealWidth(24),
                Height = Application.GetRealWidth(24),
                X = Application.GetRealWidth(12) + btnTitle.Right,
                Gravity = Gravity.CenterVertical,
                UnSelectedImagePath = "Public/Edit.png",
                SelectedImagePath = "Public/HookIcon.png"
            };
            titleView.AddChidren(btnEditIcon);
            EventHandler<MouseEventArgs> dd = (sender, e) =>
            {
                inEdit = !inEdit;
                btnEditIcon.IsSelected = inEdit;
                if (inEdit)
                {
                    btnTitle.Width = btnTitle.GetTextWidth();
                }
                else
                {
                    if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247
                    {
                        btnTitle.Width = Application.GetRealWidth(197);
                    }
                    else
                    {
                        btnTitle.Width = btnTitle.GetTextWidth();
                    }
                    editScene.name = btnTitle.Text.Trim();
                }
            };
            btnTitle.MouseUpEventHandler = dd;
            btnEditIcon.MouseUpEventHandler = dd;
            titleView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(51) });
            #endregion
            var dimmingLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightDimming);
            var cctLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightCCT);
            var rgbLight = editScene.functions.Find((obj) => obj.localFunction.spk == SPK.LightRGB);
            var brightnessValue = 0;
            var cctValue = 27;
            if (cctLight != null)
            {
                int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue);
                int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cctValue);
            }
            //属性设置区域
            var attrView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(52),
                Width = Application.GetRealWidth(343),
            };
            //属性设置区域高度
            int attrViewHight = Application.GetRealHeight(27 + 22);
            attrView.AddChidren(new Button() { Height = Application.GetRealHeight(27) });
            if (hadDimming)
            {
                attrViewHight += Application.GetRealHeight(54 + 11);
                var dimmingView = new FrameLayout();
                attrView.AddChidren(dimmingView);
                #region 亮度调节
                var btnBrightnessText = new Button()
                {
                    X = Application.GetRealWidth(35),
                    Y = Application.GetRealHeight(1),
                    Width = Application.GetRealWidth(224),
                    Height = Application.GetRealHeight(21),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    TextID = StringId.Brightness,
                    BackgroundColor = 0xFFFF0000
                };
                dimmingView.AddChidren(btnBrightnessText);
                var btnMinValuesText = new Button()
                {
                    X = Application.GetRealWidth(35),
                    Y = btnBrightnessText.Bottom,
                    Width = Application.GetRealWidth(30),
                    Height = Application.GetRealHeight(21),
                    Text = "0%",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                dimmingView.AddChidren(btnMinValuesText);
                var dimmerBar = new DiyImageSeekBar()
                {
                    X = Application.GetRealWidth(35 + 22),
                    Y = Application.GetRealHeight(11),
                    Width = Application.GetRealWidth(210),
                    Height = Application.GetRealHeight(54),
                    SeekBarViewHeight = Application.GetRealHeight(8),
                    ThumbImagePath = "Public/ThumbImage.png",
                    ThumbImageHeight = Application.GetRealHeight(54),
                    ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                    ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    ProgressBarColor = CSS_Color.AuxiliaryColor1,
                    MaxValue = 100,
                    Progress = brightnessValue,
                    SeekBarPadding = Application.GetRealWidth(20),
                };
                //dimmingView.AddChidren(dimmerBar);
                var btnMaxValuesText = new Button()
                {
                    X = dimmerBar.Right,
                    Y = btnBrightnessText.Bottom,
                    Width = Application.GetRealWidth(45),
                    Height = Application.GetRealHeight(21),
                    Text = "100%",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                dimmingView.AddChidren(btnMaxValuesText);
                #endregion
            }
            attrView.Height = attrViewHight;
            contentView.AddChidren(attrView);
            contentView.Height = Application.GetRealHeight(52 + 44) + attrViewHight;
            contentView.Gravity = Gravity.Center;
            #region bottom View
            var bottomView = new FrameLayout()
            {
                Y = Application.GetRealHeight(52) + attrViewHight,
                Height = Application.GetRealHeight(44),
            };
            contentView.AddChidren(bottomView);
            var btnSave = new Button()
            {
                Width = Application.GetRealWidth(172),
                Height = Application.GetRealHeight(44),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextColor = CSS_Color.TextualColor,
                TextID = StringId.Save,
            };
            bottomView.AddChidren(btnSave);
            var btnComplete = new Button()
            {
                X = Application.GetRealWidth(172),
                Width = Application.GetRealWidth(172),
                Height = Application.GetRealHeight(44),
                BackgroundColor = CSS_Color.MainColor,
                TextColor = CSS_Color.MainBackgroundColor,
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.Complete
            };
            bottomView.AddChidren(btnComplete);
            bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
            btnSave.MouseUpEventHandler = (sender, e) => {
                this.Close();
            };
            btnComplete.MouseUpEventHandler = (sender, e) => {
                this.Close();
            };
            #endregion
            this.Show();
            return;
            //只有调光器
            if (!hadDimming&&!hadCCT&&!hadRGB)
            {
                contentView.Height = Application.GetRealHeight(520);
                contentView.Width = Application.GetRealWidth(343);
                contentView.Gravity = Gravity.Center;
                contentView.Radius = (uint)Application.GetRealWidth(12);
                contentView.AddChidren(titleView);
            }
            else if (hadCCT && hadRGB)//
            {
                contentView.Height = Application.GetRealHeight(520);
                contentView.Width = Application.GetRealWidth(343);
                contentView.Gravity = Gravity.Center;
                contentView.Radius = (uint)Application.GetRealWidth(12);
                contentView.AddChidren(titleView);
                #region 亮度调节
                var btnBrightnessText = new Button()
                {
                    X = Application.GetRealWidth(35),
                    Y = Application.GetRealHeight(82),
                    Width = Application.GetRealWidth(224),
                    Height = Application.GetRealHeight(21),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    TextID = StringId.Brightness,
                };
                contentView.AddChidren(btnBrightnessText);
                var btnMinValuesText = new Button()
                {
                    X = Application.GetRealWidth(35),
                    Y = btnBrightnessText.Bottom,
                    Width = Application.GetRealWidth(30),
                    Height = Application.GetRealHeight(21),
                    Text = "0%",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                contentView.AddChidren(btnMinValuesText);
                var dimmerBar = new DiyImageSeekBar()
                {
                    X = Application.GetRealWidth(35 + 22),
                    Y = Application.GetRealHeight(312),
                    Width = Application.GetRealWidth(210),
                    Height = Application.GetRealHeight(54),
                    SeekBarViewHeight = Application.GetRealHeight(8),
                    ThumbImagePath = "Public/ThumbImage.png",
                    ThumbImageHeight = Application.GetRealHeight(54),
                    ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                    ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    ProgressBarColor = CSS_Color.AuxiliaryColor1 ,
                    MaxValue = 100,
                    Progress = brightnessValue,
                    SeekBarPadding = Application.GetRealWidth(20),
                };
                contentView.AddChidren(dimmerBar);
                var btnMaxValuesText = new Button()
                {
                    X = dimmerBar.Right,
                    Y = btnBrightnessText.Bottom,
                    Width = Application.GetRealWidth(45),
                    Height = Application.GetRealHeight(21),
                    Text = "100%",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                contentView.AddChidren(btnMaxValuesText);
                #endregion
                #region 色温
                //色温
                var btnTempClolor = new Button();
                btnTempClolor.X = Application.GetRealWidth(35);
                btnTempClolor.Y = Application.GetRealHeight(159);
                btnTempClolor.Width = Application.GetRealWidth(224);
                btnTempClolor.Height = Application.GetRealHeight(21);
                btnTempClolor.TextAlignment = TextAlignment.CenterLeft;
                btnTempClolor.TextColor = CSS_Color.FirstLevelTitleColor;
                btnTempClolor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
                btnTempClolor.TextID = StringId.ColorTemperature;
                contentView.AddChidren(btnTempClolor);
                //2700K
                var btnTempClolorMin = new Button();
                btnTempClolorMin.Y = btnTempClolor.Bottom + Application.GetRealHeight(9);
                btnTempClolorMin.Width = Application.GetRealWidth(54);
                btnTempClolorMin.Height = Application.GetRealHeight(21);
                btnTempClolorMin.Text = "2700K";
                btnTempClolorMin.TextAlignment = TextAlignment.CenterRight;
                btnTempClolorMin.TextColor = CSS_Color.PromptingColor1;
                btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
                contentView.AddChidren(btnTempClolorMin);
                //滑动条的背景图片
                var btnColorTemplatrueBack = new Button();
                //需要减掉滑动条的左右间距
                btnColorTemplatrueBack.Width = Application.GetRealWidth(210 - 20 * 2);
                btnColorTemplatrueBack.Height = Application.GetRealHeight(8);
                btnColorTemplatrueBack.Gravity = Gravity.CenterHorizontal;
                btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png";
                contentView.AddChidren(btnColorTemplatrueBack);
                //滑动条控件
                var barColorTemplatrue = new CCTSeekBarControl();
                barColorTemplatrue.X = btnTempClolorMin.Right;
                barColorTemplatrue.Y = Application.GetRealHeight(340);
                barColorTemplatrue.MinValue = 27;
                barColorTemplatrue.MaxValue = 65;
                barColorTemplatrue.ProgressBarColor = 0x00000000;//全部透明
                barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000;
                barColorTemplatrue.SeekBarBackgroundColor = 0x00000000;
                contentView.AddChidren(barColorTemplatrue);
                barColorTemplatrue.Y = btnTempClolorMin.Y - (barColorTemplatrue.Height - btnTempClolorMin.Height) / 2;
                //显示上方的Txt
                barColorTemplatrue.ShowCustomTextView(Application.GetRealWidth(50), CSS_FontSize.PromptFontSize_FirstLevel, CSS_Color.FirstLevelTitleColor);
                var cct = 27;
                int.TryParse(cctLight.status.Find((obj)=>obj.key == FunctionAttributeKey.CCT).value, out cct);
                barColorTemplatrue.Progress = cct;
                //设置初始值
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                //变更背景图的Y轴坐标
                btnColorTemplatrueBack.Y = barColorTemplatrue.Y + (barColorTemplatrue.Height - btnColorTemplatrueBack.Height) / 2;
                //6500K
                var btnTempClolorMax = new Button();
                btnTempClolorMax.Y = btnTempClolorMin.Y;
                btnTempClolorMax.X = barColorTemplatrue.Right;
                btnTempClolorMax.Width = Application.GetRealWidth(54);
                btnTempClolorMax.Height = Application.GetRealHeight(21);
                btnTempClolorMax.Text = "6500K";
                btnTempClolorMax.TextAlignment = TextAlignment.CenterLeft;
                btnTempClolorMax.TextColor = CSS_Color.PromptingColor1;
                btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
                contentView.AddChidren(btnTempClolorMax);
                #endregion
                #region RGB
                var btnCurColor = new Button()
                {
                    X = Application.GetRealWidth(24),
                    Y = Application.GetRealHeight(241),
                    Width = Application.GetMinRealAverage(24),
                    Height = Application.GetMinRealAverage(24),
                    Radius = (uint)Application.GetMinRealAverage(8),
                    BorderColor = CSS_Color.PromptingColor2,
                    BorderWidth = 1,
                    BackgroundColor = (uint)(0xFF000000 + new Light().GetRGBcolor(new Function(),rgbLight.status.Find((obj) => obj.key == FunctionAttributeKey.RGB).value))
                };
                contentView.AddChidren(btnCurColor);
                //色盘的桌布控件(限制那个白色滑动球使用)
                var framePickerBack = new FrameLayout();
                framePickerBack.Gravity = Gravity.CenterHorizontal;
                framePickerBack.Y = Application.GetRealHeight(249);
                framePickerBack.Width = Application.GetMinRealAverage(198);
                framePickerBack.Height = Application.GetMinRealAverage(198);
                contentView.AddChidren(framePickerBack);
                var colorPicker = new ColorPicker()
                {
                    ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
                };
                framePickerBack.AddChidren(colorPicker);
                #endregion
            }
            else if (hadDimming && !hadCCT && !hadRGB)
            {
                contentView.Height = Application.GetRealHeight(211);
                contentView.Width = Application.GetRealWidth(343);
                contentView.Gravity = Gravity.Center;
                contentView.Radius = (uint)Application.GetRealWidth(12);
                contentView.AddChidren(titleView);
            }
        }
    }
}