Skip to content

Commit

Permalink
Sync from CSC at Thu Jun 15 07:43:58 UTC 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
SUP-HMI committed Jun 15, 2023
1 parent e6c4458 commit 8725e1e
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions TestAddin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ static void Main(string[] args)
tiaPortalProject = tiaPortal.Projects.First();
}

var screens = GetScreens(tiaPortalProject.Devices);
var screens = GetScreens(tiaPortalProject);

List<ScreenDynEvents> screenDynEvenList = new List<ScreenDynEvents>();
string fileDirectory;
if (pathArg != "")
Expand Down Expand Up @@ -231,6 +231,31 @@ static void Main(string[] args)
//Console.ReadKey();
}

private static IEnumerable<HmiScreen> GetScreens(Project tiaProject)
{
var screens = GetScreens(tiaProject.Devices);
if (screens == null) {
screens = GetScreens(tiaProject.DeviceGroups);
}
return screens;
}
private static IEnumerable<HmiScreen> 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<HmiScreen> GetScreens(DeviceComposition engObj)
{
Expand Down

0 comments on commit 8725e1e

Please sign in to comment.