HDL Home App 第二版本 旧平台金堂用 正在使用
WJC
2020-03-24 b304a3c78df10b6e9b867e677d3e4719f1d4a7aa
ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -17,7 +17,6 @@
    /// </summary>
    public class Category : FrameLayout, ZigBee.Common.IStatus
    {
        #region ◆ 变量____________________________
        /// <summary>
        /// The instance.
@@ -127,30 +126,7 @@
        #endregion
        #region ◆ 接口____________________________
        /// <summary>
        /// 该接口将弃用 改用DeviceInfoChange()
        /// </summary>
        /// <param name="common">Common.</param>
        public void Changed(CommonDevice common)
        {
        }
        /// <summary>
        /// Changeds the IL ogic status.
        /// </summary>
        /// <param name="logic">Logic.</param>
        public void ChangedILogicStatus(ZigBee.Device.Logic logic)
        {
        }
        /// <summary>
        /// Changeds the IS cene status.
        /// </summary>
        /// <param name="scene">Scene.</param>
        public void ChangedISceneStatus(Scene scene)
        {
        }
        /// <summary>
        /// 设备状态更新接口
        /// <para>type:如果为 DeviceInComingRespon:设备新上报</para>
@@ -1959,11 +1935,11 @@
                functionSceneBodyView.AddChidren(sceneScrolView);
                foreach (var scene in sceneList)
                {
                    var sceneView = new SceneCategoryView(0, 0);
                    var sceneView = new SceneCategoryView();
                    sceneScrolView.AddChidren(sceneView);
                    sceneView.Init(scene, room);
                    GetDelayScene(sceneScrolView);
                }
                    sceneView.InitControl(scene, room);
                }
                GetDelayScene(sceneScrolView);
            }
        }
@@ -2018,6 +1994,10 @@
            for (int i = 0; scrolViewLayout != null && i < scrolViewLayout.ChildrenCount; i++)
            {
                var sceneView = scrolViewLayout.GetChildren(i) as SceneCategoryView;
                if (sceneView == null)
                {
                    continue;
                }
                foreach (var delayScenesListResponseInfo in delayList)
                {
                    if (delayScenesListResponseInfo.ScenesId == sceneView.scene.Id)
@@ -2025,21 +2005,26 @@
                        sceneView.scene.RemainTime = delayScenesListResponseInfo.RemainTime;
                        var remainTime = delayScenesListResponseInfo.RemainTime;
                        if (remainTime > 0)
                        {
                        {
                            //开启内部延时时间线程(旨在全部地方的同一场景时间同步)
                            HdlSceneLogic.Current.StartDelayTimeThread(sceneView.scene);
                            new System.Threading.Thread(() =>
                            {
                                while (remainTime-- > 0)
                                while (remainTime > 0 && this.Parent != null)
                                {
                                    System.Threading.Thread.Sleep(1000);
                                    Application.RunOnMainThread(() =>
                                    {
                                        sceneView.SetTimeText(CommonFormResouce.GetTimeString(remainTime));
                                    });
                                    remainTime--;
                                }
                                Application.RunOnMainThread(() =>
                                {
                                    sceneView.scene.RemainTime = 0;
                                    sceneView.SetTimeImage();
                                    if (this.Parent != null)
                                    {
                                        sceneView.SetTimeImage();
                                    }
                                });
                            })
                            { IsBackground = true }.Start();
@@ -2048,32 +2033,19 @@
                    }
                }
            }
        }
        /// <summary>
        /// GetExecScene
        /// </summary>
        /// <param name="scrolViewLayout"></param>
        private void GetExecScene(VerticalScrolViewLayout scrolViewLayout)
        {
            new System.Threading.Thread(() =>
            {
            })
            { IsBackground = true }.Start();
        }
        }
        #endregion
        #region ◆ 自动化__________________________
        /// <summary>
        /// 自动化功能代码入口
        /// </summary>
        private void ShowAutotion()
        {
            // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
            #region   ---推荐模板的组件
            //推荐模板背景控件
        {
            // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
            var bjFrameLayout = new FrameLayout
            {
                Width = Application.GetRealWidth(1080 - 58),
@@ -2113,8 +2085,8 @@
            //推荐模板开关控件
            var recommendswitchBtn = new Button
            {
                Width = Application.GetMinRealAverage(104),
                Height = Application.GetMinRealAverage(63),
                Width = Application.GetRealWidth(104),
                Height = Application.GetRealHeight(63),
                UnSelectedImagePath = "ZigeeLogic/logicclose.png",
                SelectedImagePath = "ZigeeLogic/logicopen.png",
                X = bjFrameLayout.Width - Application.GetRealWidth(104 + 58),
@@ -2245,6 +2217,16 @@
                //关闭刷新View;
                logicScrolView.EndHeaderRefreshing();
            };
            logicScrolView.BeginHeaderRefreshingAction += () =>
            {
                //重新刷新logic列表
                Common.Logic.LogicList.Clear();
                Read(logicScrolView, no);
                //关闭刷新View;
                logicScrolView.EndHeaderRefreshing();
            };
            Read(logicScrolView, no);
            Read(logicScrolView, no);
@@ -2335,9 +2317,16 @@
                    refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                }
            }
            foreach (var logic in Common.Logic.LogicList)
            {
                var fLayout = new FrameLayout
                {
                    Height = Application.GetRealHeight(190 + 30),
                    Width = Application.GetRealWidth(1080 - 58),
                    BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                };
                refresview.AddChidren(fLayout);
                var logicRowlayout = new RowLayout
                {
@@ -2345,11 +2334,10 @@
                    Width = Application.GetRealWidth(1080 - 58),
                    LineColor = ZigbeeColor.Current.LogicBackgroundColor,
                    BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                    SubViewWidth = Application.GetRealWidth(184),//改变编辑控件宽度多少;
                };
                refresview.AddChidren(logicRowlayout);
                fLayout.AddChidren(logicRowlayout);
                var logicnameBtn = new Button
                {
@@ -2364,7 +2352,6 @@
                };
                logicRowlayout.AddChidren(logicnameBtn);
                var logicswitchBtn = new Button
                {
                    Width = Application.GetMinRealAverage(104),
@@ -2373,10 +2360,9 @@
                    SelectedImagePath = "ZigeeLogic/logicopen.png",
                    X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
                    Y = Application.GetRealHeight(58 + 30 + 9 + 30),
                };
                logicRowlayout.AddChidren(logicswitchBtn);
                logicswitchBtn.MouseUpEventHandler += (sender1, e1) =>
                {
@@ -2424,7 +2410,6 @@
                };
                ///删除
                var del = new Button
                {
@@ -2446,18 +2431,17 @@
                            Logic.Send.DelLogic(logic.LogicId);
                        }
                    };
                    alert.Show();
                };
                var line = new Button
                {
                    Y = Application.GetRealHeight(215),
                    Height = Application.GetRealHeight(5),
                    Y = fLayout.Height-1,
                    Height =1,
                    X = Application.GetRealWidth(58),
                    Width = Application.GetRealWidth(1080 - 58),
                    BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
                    X = Application.GetRealWidth(58),
                };
                logicRowlayout.AddChidren(line);
                fLayout.AddChidren(line);
            }
        }
@@ -2517,19 +2501,19 @@
                var iconindex = iconIndexlist[i];
                var typebjBtn = new FrameLayout
                {
                    Width = Application.GetRealWidth(82),
                    Height = Application.GetRealHeight(82),
                    Width = Application.GetMinRealAverage(82),
                    Height = Application.GetMinRealAverage(82),
                    X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i),
                    Y = Application.GetRealHeight(58 + 30 + 30),
                    Radius = (uint)Application.GetRealHeight(41),
                    Radius = (uint)Application.GetMinRealAverage(41),
                    BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                };
                logicRowlayout.AddChidren(typebjBtn);
                var typeIconBtn = new Button
                {
                    Width = Application.GetRealWidth(58),
                    Height = Application.GetRealHeight(58),
                    Width = Application.GetMinRealAverage(58),
                    Height = Application.GetMinRealAverage(58),
                    Gravity = Gravity.Center,
                };
@@ -2686,10 +2670,10 @@
            {
                commonDeviceList.Add(common);
            }
        }
        }
        #endregion
    }
}