| | |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #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 rgb in list) |
| | | 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), |
| | |
| | | }; |
| | | titleView.AddChidren(btnViewTitle); |
| | | |
| | | var autoColorfulView = new FrameLayout() |
| | | if (rgb.GetAttribute(FunctionAttributeKey.Colorful) != null) |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(autoColorfulView); |
| | | autoColorfulView.AddChidren(new Button() { Width = Application.GetRealWidth(343), Gravity = Gravity.BottomCenter, Height = 1, BackgroundColor = CSS.CSS_Color.DividingLineColor, Y = Application.GetRealHeight(44) - 1 }); |
| | | var autoColorfulView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(autoColorfulView); |
| | | autoColorfulView.AddChidren(new Button() { Width = Application.GetRealWidth(343), Gravity = Gravity.BottomCenter, Height = 1, BackgroundColor = CSS.CSS_Color.DividingLineColor, Y = Application.GetRealHeight(44) - 1 }); |
| | | |
| | | Button btnAutoColorfulRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | autoColorfulView.AddChidren(btnAutoColorfulRight); |
| | | Button btnAutoColorfulRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | autoColorfulView.AddChidren(btnAutoColorfulRight); |
| | | |
| | | var btnAutoColorfulTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS.CSS_FontSize.TextFontSize, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Auto, |
| | | }; |
| | | autoColorfulView.AddChidren(btnAutoColorfulTitle); |
| | | btnAutoColorfulTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEditDialog_OnOff(rgb.sid,true); |
| | | }; |
| | | var btnAutoColorfulTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS.CSS_FontSize.TextFontSize, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Auto, |
| | | }; |
| | | autoColorfulView.AddChidren(btnAutoColorfulTitle); |
| | | btnAutoColorfulTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | 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) |
| | |
| | | |
| | | |
| | | 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>(); |
| | |
| | | |
| | | outputDevice.status = dicSateteList; |
| | | |
| | | var oldTemp = Logic.currlogic.output.Find((obj) => obj.sid.Substring(0, 16) == sid.Substring(0, 16)); |
| | | if (oldTemp != null) |
| | | try |
| | | { |
| | | Logic.currlogic.output.Remove(oldTemp); |
| | | 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); |
| | | |