From 8725e1ea0924ef7f32a6b835f868f4dddad091a8 Mon Sep 17 00:00:00 2001 From: SUP-HMI Date: Thu, 15 Jun 2023 07:43:58 +0000 Subject: [PATCH] Sync from CSC at Thu Jun 15 07:43:58 UTC 2023 --- TestAddin/Program.cs | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/TestAddin/Program.cs b/TestAddin/Program.cs index d2e972d..a803e17 100644 --- a/TestAddin/Program.cs +++ b/TestAddin/Program.cs @@ -173,8 +173,8 @@ static void Main(string[] args) tiaPortalProject = tiaPortal.Projects.First(); } - var screens = GetScreens(tiaPortalProject.Devices); - + var screens = GetScreens(tiaPortalProject); + List screenDynEvenList = new List(); string fileDirectory; if (pathArg != "") @@ -231,6 +231,31 @@ static void Main(string[] args) //Console.ReadKey(); } + private static IEnumerable GetScreens(Project tiaProject) + { + var screens = GetScreens(tiaProject.Devices); + if (screens == null) { + screens = GetScreens(tiaProject.DeviceGroups); + } + return screens; + } + private static IEnumerable GetScreens(DeviceUserGroupComposition groups) + { + foreach (var group in groups) + { + var screens = GetScreens(group.Devices); + if (screens != null) + { + return screens; + } + screens = GetScreens(group.Groups); + if (screens != null) + { + return screens; + } + } + return null; + } private static IEnumerable GetScreens(DeviceComposition engObj) {