mac
2023-08-29 2d5cd35af7437ad4015d38594d8c721dc6166b11
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicSeriesSettingPage.cs
@@ -26,10 +26,58 @@
            };
            bodyView.AddChidren(contentView);
            var seriesList = FunctionList.List.GetSeries();
            #region 找出所有序列的oid
            List<string> oidList = new List<string>();
            foreach(var rgb in list)
            {
                var oid = rgb.sid.Substring(0, 16);
                if (!oidList.Contains(oid))
                {
                    oidList.Add(oid);
                }
            }
            var seriesList = FunctionList.List.GetSeries();
            foreach(var temp in seriesList)
            {
                var oid = temp.sid.Substring(0, 16);
                if (!oidList.Contains(oid))
                {
                    oidList.Add(oid);
                }
            }
            #endregion
            //Dictionary<string, List<string>> deviceList = new Dictionary<string, List<string>>();
            //foreach(var oid in oidList)
            //{
            //    var sidList = FunctionList.List.
            //    if (!deviceList.ContainsKey(oid))
            //    {
            //        deviceList.Add(oid)
            //    }
            //}
            foreach(var oid in oidList)
            {
                Function rgb = null;
                rgb = list.Find((obj) => obj.sid.Substring(0, 16) == oid);
                if(rgb == null)
                {
                    rgb = FunctionList.List.GetLightList().Find((obj) => obj.spk == SPK.LightRGB && obj.sid.Substring(0, 16) == oid);
                    if (rgb == null)
                    {
                        rgb = FunctionList.List.GetLightList().Find((obj) => obj.spk == SPK.LightCCT && obj.sid.Substring(0, 16) == oid);
                        if (rgb == null)
                        {
                            rgb = FunctionList.List.GetLightList().Find((obj) => obj.spk == SPK.LightDimming && obj.sid.Substring(0, 16) == oid);
                        }
                    }
                }
                var titleView = new FrameLayout()
                {
                    Height = Application.GetRealHeight(44),
@@ -49,6 +97,8 @@
                };
                titleView.AddChidren(btnViewTitle);
                if (rgb.GetAttribute(FunctionAttributeKey.Colorful) != null)
                {
                var autoColorfulView = new FrameLayout()
                {
                    Height = Application.GetRealHeight(44),
@@ -80,6 +130,7 @@
                {
                    LoadEditDialog_OnOff(rgb.sid,true);
                };
                }
                var rgbSeriesList = seriesList.FindAll((obj) => obj.sid.Substring(0, 16) == rgb.sid.Substring(0, 16));
                foreach(var rgbSeries in rgbSeriesList)
@@ -252,6 +303,10 @@
                Output outputDevice = new Output();
                outputDevice.target_type = "1";
                outputDevice.sid = sid;
                outputDevice.delay = "0";
                List<Dictionary<string, string>> dicSateteList = new List<Dictionary<string, string>>();
                Dictionary<string, string> diction = new Dictionary<string, string>();
@@ -268,11 +323,17 @@
                outputDevice.status = dicSateteList;
                var oldTemp = Logic.currlogic.output.Find((obj) => obj.sid.Substring(0, 16) == sid.Substring(0, 16));
                try
                {
                    var oldTemp = Logic.currlogic.output.Find((obj) => obj.sid != null && obj.sid.Length > 16 && obj.sid.Substring(0, 16) == sid.Substring(0, 16));
                if (oldTemp != null)
                {
                    Logic.currlogic.output.Remove(oldTemp);
                }
                }catch(Exception ex)
                {
                    MainPage.Log($"自动化保存跑马灯数据异常:{ex.Message}");
                }
                Logic.currlogic.output.Add(outputDevice);