From a779a402e948f0a56511b90bd6d858567f343bcd Mon Sep 17 00:00:00 2001 From: TK <61820360+TomKovac@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:20:11 +0100 Subject: [PATCH] apps run test --- cake/ApaxCmd.cs | 210 +- cake/BuildContext.cs | 120 +- cake/BuildParameters.cs | 3 + cake/DotNetCmd.cs | 240 +++ cake/Program.cs | 522 ++++- cake/Properties/launchSettings.json | 8 + ...roth AG-011F-Indradrive_01V01-20110705.xml | 1777 +++++++++++++++++ .../SystemConstants/plc_line_HwIdentifiers.st | 19 + .../SystemConstants/plc_line_IoAddresses.st | 5 + .../app/ix-blazor/Pages/Component_1.razor | 5 +- .../app/ix-blazor/Pages/Component_2.razor | 1 + .../app/ix/app_apaxappname.csproj | 7 +- .../app/src/Documentation/Component_1.st | 118 +- .../app/src/Documentation/Component_2.st | 118 +- .../src/Documentation/DocumentationContext.st | 26 +- .../app/src/IO/HwIdentifiers.st | 23 + src/template.axolibrary/app/src/IO/Inputs.st | 9 + src/template.axolibrary/app/src/IO/Outputs.st | 9 + .../app/src/Sandbox/SandboxContext.st | 48 +- .../app/src/configuration.st | 9 +- src/template.axolibrary/app/src/program.st | 6 +- .../ctrl/src/TemplateComponent.st | 7 +- src/utils/this.sln | 15 + src/utils/utils.sln | 15 + 24 files changed, 3087 insertions(+), 233 deletions(-) create mode 100644 cake/DotNetCmd.cs create mode 100644 src/components.rexroth.drives/app/gsd/source/GSDML-V2.1-Bosch Rexroth AG-011F-Indradrive_01V01-20110705.xml create mode 100644 src/template.axolibrary/app/SystemConstants/plc_line_HwIdentifiers.st create mode 100644 src/template.axolibrary/app/SystemConstants/plc_line_IoAddresses.st create mode 100644 src/template.axolibrary/app/src/IO/HwIdentifiers.st create mode 100644 src/template.axolibrary/app/src/IO/Inputs.st create mode 100644 src/template.axolibrary/app/src/IO/Outputs.st diff --git a/cake/ApaxCmd.cs b/cake/ApaxCmd.cs index 18efd4775..ced887d65 100644 --- a/cake/ApaxCmd.cs +++ b/cake/ApaxCmd.cs @@ -11,6 +11,7 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Text; using Cake.Common.IO; using Cake.Common.Tools.ILMerge; using Cake.Core.Diagnostics; @@ -41,7 +42,144 @@ public static void ApaxInstall(this BuildContext context, IEnumerable fo } } - public static void ApaxClean(this BuildContext context, (string folder, string name, bool pack) lib) + public static void ApaxInstall(this BuildContext context, string folder) + { + var apaxArguments = "install"; + + context.Log.Information($"apax {apaxArguments} started in '{folder}'"); + context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings() + { + Arguments = apaxArguments, + WorkingDirectory = folder, + RedirectStandardOutput = false, + RedirectStandardError = false, + Silent = false + }).WaitForExit(); + context.Log.Information($"apax {apaxArguments} completed successfully in '{folder}'"); + } + public static void ApaxPlcSim(this BuildContext context, string folder) + { + var apaxArguments = "plcsim"; + + context.Log.Information($"apax {apaxArguments} started in '{folder}'"); + context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings() + { + Arguments = apaxArguments, + WorkingDirectory = folder, + RedirectStandardOutput = false, + RedirectStandardError = false, + Silent = false + }).WaitForExit(); + context.Log.Information($"apax {apaxArguments} completed successfully in '{folder}'"); + } + public static string ApaxHwu(this BuildContext context, string folder, ref bool summaryResult) + { + string retVal = ",NOK"; + var apaxArguments = "hwu"; + + context.Log.Information($"apax {apaxArguments} started in '{folder}'"); + + var processSettings = new ProcessSettings() + { + Arguments = apaxArguments, + WorkingDirectory = folder, + RedirectStandardOutput = true, + RedirectStandardError = true, + Silent = false + }; + + using (var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), processSettings)) + { + if (process == null) + { + summaryResult = false; + throw new Exception("Failed to start the process."); + } + + process.WaitForExit(); + + var standardOutput = process.GetStandardOutput(); + var standardError = process.GetStandardError(); + + + // Check the exit code and handle result + if (process.GetExitCode() == 0) + { + foreach (string line in standardOutput) + { + context.Log.Information(line); + } + context.Log.Information($"apax {apaxArguments} completed successfully in '{folder}'"); + retVal = ",OK"; + } + else + { + summaryResult = false; + foreach (string line in standardError) + { + context.Log.Error(line); + } + context.Log.Error($"apax {apaxArguments} failed with exit code: {process.GetExitCode()} in '{folder}'"); + context.Log.Error($"Error Output: {standardError}"); + } + return retVal; + } + } + public static string ApaxSwfd(this BuildContext context, string folder, ref bool summaryResult) + { + string retVal = ",NOK"; + var apaxArguments = "swfd"; + + context.Log.Information($"apax {apaxArguments} started in '{folder}'"); + + var processSettings = new ProcessSettings() + { + Arguments = apaxArguments, + WorkingDirectory = folder, + RedirectStandardOutput = true, + RedirectStandardError = true, + Silent = false + }; + + using (var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), processSettings)) + { + if (process == null) + { + summaryResult = false; + throw new Exception("Failed to start the process."); + } + + process.WaitForExit(); + + var standardOutput = process.GetStandardOutput(); + var standardError = process.GetStandardError(); + + + // Check the exit code and handle result + if (process.GetExitCode() == 0) + { + foreach (string line in standardOutput) + { + context.Log.Information(line); + } + context.Log.Information($"apax {apaxArguments} completed successfully in '{folder}'"); + retVal = ",OK"; + } + else + { + summaryResult = false; + foreach (string line in standardError) + { + context.Log.Error(line); + } + context.Log.Error($"apax {apaxArguments} failed with exit code: {process.GetExitCode()} in '{folder}'"); + context.Log.Error($"Error Output: {standardError}"); + } + return retVal; + } + } + + public static void ApaxClean(this BuildContext context, (string folder, string name, bool pack, bool app_run) lib) { foreach (var folder in context.GetAxFolders(lib)) { @@ -85,7 +223,7 @@ public static void ApaxBuild(this BuildContext context, IEnumerable fold } } - public static void ApaxUpdate(this BuildContext context, (string folder, string name, bool pack) lib) + public static void ApaxUpdate(this BuildContext context, (string folder, string name, bool pack, bool app_run) lib) { foreach (var folder in context.GetAxFolders(lib)) { @@ -110,7 +248,7 @@ public static void ApaxUpdate(this BuildContext context, (string folder, string } } - public static void ApaxPack(this BuildContext context, (string folder, string name, bool pack) lib) + public static void ApaxPack(this BuildContext context, (string folder, string name, bool pack, bool app_run) lib) { System.Console.WriteLine(context.ApaxSignKey); @@ -128,7 +266,7 @@ public static void ApaxPack(this BuildContext context, (string folder, string na } - public static void ApaxTest(this BuildContext context, (string folder, string name, bool pack) lib) + public static void ApaxTest(this BuildContext context, (string folder, string name, bool pack, bool app_run) lib) { foreach (var folder in context.GetAxFolders(lib)) { @@ -160,7 +298,7 @@ public static void ApaxTest(this BuildContext context, (string folder, string na } } - public static void ApaxTestLibrary(this BuildContext context, (string folder, string name, bool pack) lib) + public static void ApaxTestLibrary(this BuildContext context, (string folder, string name, bool pack, bool app_run) lib) { foreach (var folder in context.GetLibraryAxFolders(lib)) { @@ -202,22 +340,22 @@ public static void ApaxTestLibrary(this BuildContext context, (string folder, st } } - public static void ApaxIxc(this BuildContext context, IEnumerable folders) - { - foreach (var folder in folders) - { - context.ProcessRunner.Start(Helpers.GetDotNetCommand(), new ProcessSettings() - { - Arguments = "ixc", - WorkingDirectory = folder, - RedirectStandardOutput = false, - RedirectStandardError = false, - Silent = false - }).WaitForExit(); - } - } - - public static void ApaxCopyArtifacts(this BuildContext context, (string folder, string name, bool pack) lib) + //public static void ApaxIxc(this BuildContext context, IEnumerable folders) + //{ + // foreach (var folder in folders) + // { + // context.ProcessRunner.Start(Helpers.GetDotNetCommand(), new ProcessSettings() + // { + // Arguments = "ixc", + // WorkingDirectory = folder, + // RedirectStandardOutput = false, + // RedirectStandardError = false, + // Silent = false + // }).WaitForExit(); + // } + //} + + public static void ApaxCopyArtifacts(this BuildContext context, (string folder, string name, bool pack, bool app_run) lib) { if (lib.pack) { @@ -388,4 +526,34 @@ public static void ApaxCatalogInstall(this BuildContext context, string yamlFile } } } + + //public static void RunPowershellScript(this BuildContext context, string scriptPath, string arguments) + //{ + // string workDir = Path.GetFullPath(Path.Combine(scriptPath, "..")); + // context.Log.Information($"Powershell script {scriptPath} with arguments '{arguments}' started"); + // context.ProcessRunner.Start("powershell.exe", new ProcessSettings() + // { + // Arguments = $"-NoProfile -ExecutionPolicy Bypass -File \"{scriptPath}\" {arguments}", + // WorkingDirectory = workDir, + // RedirectStandardOutput = false, + // RedirectStandardError = false, + // Silent = false + // }).WaitForExit(); + // context.Log.Information($"Powershell script {scriptPath} with arguments '{arguments}' finished"); + //} + + //public static void DotnetClean(this BuildContext context, string slnFilePath, string arguments) + //{ + // string workDir = Path.GetFullPath(Path.Combine(slnFilePath, "..")); + // context.Log.Information($"Dotne clean command started with solution: {slnFilePath}"); + // context.ProcessRunner.Start(Helpers.GetDotNetCommand(), new ProcessSettings() + // { + // Arguments = arguments, + // WorkingDirectory = workDir, + // RedirectStandardOutput = false, + // RedirectStandardError = false, + // Silent = false + // }).WaitForExit(); + // context.Log.Information($"Dotne clean command finished with solution: {slnFilePath}"); + //} } \ No newline at end of file diff --git a/cake/BuildContext.cs b/cake/BuildContext.cs index b45f902c2..e01f62d95 100644 --- a/cake/BuildContext.cs +++ b/cake/BuildContext.cs @@ -24,6 +24,9 @@ using Polly; using static NuGet.Packaging.PackagingConstants; using Path = System.IO.Path; +using Cake.Core.IO; +using System; +using YamlDotNet.RepresentationModel; public class BuildContext : FrostingContext { @@ -103,9 +106,15 @@ public void UpdateApaxDependencies(string file, IEnumerable dependencies public IEnumerable TargetFrameworks { get; } = new List() { "net7.0" }; public string TestResults => Path.Combine(Environment.WorkingDirectory.FullPath, "..//TestResults//"); - + public string TestResultsCtrl => Path.Combine(Environment.WorkingDirectory.FullPath, "..//TestResultsCtrl//"); + public string AppTestResultsDir => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//..//app_test_results//")); + public string SourceDirPlcSim => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//..//source//plcsim//")); + public string PlcSimVirtualMemoryCardLocation => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//..//plcsim//")); + public string PlcName => "plc_line"; + public string PlcIpAddress => "10.10.10.120"; + public string SourceDirSecurityFiles => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//..//source//")); public BuildContext(ICakeContext context, BuildParameters buildParameters) : base(context) { @@ -145,39 +154,39 @@ public BuildContext(ICakeContext context, BuildParameters buildParameters) } #region Libraries - public IEnumerable<(string folder, string name, bool pack)> Libraries { get; } = new[] + public IEnumerable<(string folder, string name, bool pack, bool app_run)> Libraries { get; } = new[] { - ("ax.axopen.min", "ax.axopen.min", true), - ("ax.axopen.hwlibrary", "ax.axopen.hwlibrary", true), - ("ax.axopen.app", "ax.axopen.app", true), - ("sdk-ax", "ax-sdk", true), - ("abstractions", "axopen.abstractions", true), - ("timers", "axopen.timers", true), - ("simatic1500", "axopen.simatic1500", true), - ("utils", "axopen.utils", true), - ("core", "axopen.core", true), - ("data", "axopen.data", true), - ("probers", "axopen.probers", true), - ("inspectors", "axopen.inspectors", true), - ("components.abstractions", "axopen.components.abstractions", true), - ("components.elements", "axopen.components.elements", true), - ("io", "axopen.io", true), - ("components.cognex.vision", "axopen.components.cognex.vision", true), - ("components.pneumatics", "axopen.components.pneumatics", true), - ("components.drives", "axopen.components.drives", true), - ("components.rexroth.drives", "axopen.components.rexroth.drives", true), - ("components.rexroth.press", "axopen.components.rexroth.press", true), - ("components.festo.drives", "axopen.components.festo.drives", true), - ("components.desoutter.tightening", "axopen.components.desoutter.tightening", true), - ("components.robotics", "axopen.components.robotics", true), - ("components.abb.robotics", "axopen.components.abb.robotics", true), - ("components.mitsubishi.robotics", "axopen.components.mitsubishi.robotics", true), - ("components.ur.robotics", "axopen.components.ur.robotics", true), - ("components.kuka.robotics", "axopen.components.kuka.robotics", true), - ("components.siem.identification", "axopen.components.siem.identification", true), - ("components.balluff.identification", "axopen.components.balluff.identification", true), - ("integrations", "ix.integrations", false), - ("template.axolibrary", "template.axolibrary", false) + ("ax.axopen.min", "ax.axopen.min", true, false), + ("ax.axopen.hwlibrary", "ax.axopen.hwlibrary", true, false), + ("ax.axopen.app", "ax.axopen.app", true, false), + ("sdk-ax", "ax-sdk", true, false), + ("abstractions", "axopen.abstractions", true, true), + ("timers", "axopen.timers", true, false), + ("simatic1500", "axopen.simatic1500", true, false), + ("utils", "axopen.utils", true, false), + ("core", "axopen.core", true, true), + ("data", "axopen.data", true, true), + ("probers", "axopen.probers", true, true), + ("inspectors", "axopen.inspectors", true, true), + ("components.abstractions", "axopen.components.abstractions", true, true), + ("components.elements", "axopen.components.elements", true, true), + ("io", "axopen.io", true, true), + ("components.cognex.vision", "axopen.components.cognex.vision", true, true), + ("components.pneumatics", "axopen.components.pneumatics", true, true), + ("components.drives", "axopen.components.drives", true, true), + ("components.rexroth.drives", "axopen.components.rexroth.drives", true, true), + ("components.rexroth.press", "axopen.components.rexroth.press", true, true), + ("components.festo.drives", "axopen.components.festo.drives", true, true), + ("components.desoutter.tightening", "axopen.components.desoutter.tightening", true, true), + ("components.robotics", "axopen.components.robotics", true, true), + ("components.abb.robotics", "axopen.components.abb.robotics", true, true), + ("components.mitsubishi.robotics", "axopen.components.mitsubishi.robotics", true, true), + ("components.ur.robotics", "axopen.components.ur.robotics", true, true), + ("components.kuka.robotics", "axopen.components.kuka.robotics", true, true), + ("components.siem.identification", "axopen.components.siem.identification", true, true), + ("components.balluff.identification", "axopen.components.balluff.identification", true, true), + ("integrations", "ix.integrations", false,false), + ("template.axolibrary", "template.axolibrary", false, true) }; #endregion @@ -187,7 +196,7 @@ public BuildContext(ICakeContext context, BuildParameters buildParameters) public string ApaxSignKey { get; } = System.Environment.GetEnvironmentVariable("APAX_KEY"); - public IEnumerable GetAxFolders((string folder, string name, bool pack) library) + public IEnumerable GetAxFolders((string folder, string name, bool pack, bool app_run) library) { var paths = new string[] { @@ -210,7 +219,7 @@ public IEnumerable GetApplicationAxFolders((string folder, string name, return paths.Where(p => File.Exists(Path.Combine(p, "apax.yml"))); } - public IEnumerable GetLibraryAxFolders((string folder, string name, bool pack) library) + public IEnumerable GetLibraryAxFolders((string folder, string name, bool pack, bool app_run) library) { var paths = new string[] { @@ -220,7 +229,7 @@ public IEnumerable GetLibraryAxFolders((string folder, string name, bool return paths.Where(p => File.Exists(Path.Combine(p, "apax.yml"))); } - public IEnumerable GetLibraryWithTestAxFolders((string folder, string name, bool pack) library) + public IEnumerable GetLibraryWithTestAxFolders((string folder, string name, bool pack, bool app_run) library) { var paths = new string[] { @@ -230,7 +239,7 @@ public IEnumerable GetLibraryWithTestAxFolders((string folder, string na return paths.Where(p => File.Exists(Path.Combine(p, "apax.yml")) && Directory.Exists(Path.Combine(p, "tests"))).ToList(); } - public string GetLibFolder((string folder, string name, bool pack) library) + public string GetLibFolder((string folder, string name, bool pack, bool app_run) library) { return Path.Combine(Path.Combine(RootDir, library.folder), "ctrl"); } @@ -240,6 +249,11 @@ public string GetAppFolder((string folder, string name) library) return Path.Combine(Path.Combine(RootDir, library.folder), "app"); } + public string GetAppFolder((string folder, string name, bool pack, bool app_run) library) + { + return Path.Combine(Path.Combine(RootDir, library.folder), "app"); + } + public string GetAxTestResultsFolder(string axFolder) { return Path.Combine(axFolder, "testresult"); @@ -251,7 +265,7 @@ public string GetAppFolder((string folder, string name, string targetIp, string } - public IEnumerable GetApaxFiles((string folder, string name, bool pack) library) + public IEnumerable GetApaxFiles((string folder, string name, bool pack, bool app_run) library) { var paths = new string[] { @@ -263,7 +277,7 @@ public IEnumerable GetApaxFiles((string folder, string name, bool pack) return paths.Where(Path.Exists); } - public string GetApaxFile((string folder, string name, bool pack) library) + public string GetApaxFile((string folder, string name, bool pack, bool app_run) library) { return Path.Combine(Path.Combine(RootDir, library.folder), "ctrl", "apax.yml"); } @@ -272,7 +286,35 @@ public string GetApaxFile(string folder, string sub) { return Path.Combine(Path.Combine(RootDir, folder), sub, "apax.yml"); } + public string GetApaxFile(string folder) + { + return Path.Combine(Path.Combine(RootDir, folder), "apax.yml"); + } + public string GetApplicationName(string yamlFilePath) + { + string appName = ""; + // Load the YAML stream + var yaml = new YamlStream(); + using (var reader = new StreamReader(yamlFilePath)) + { + yaml.Load(reader); + } + + // Assuming there's only one document in the YAML stream + var root = (YamlMappingNode)yaml.Documents[0].RootNode; + + if (root.Children.TryGetValue(new YamlScalarNode("type"), out var typeNode) && typeNode is YamlScalarNode scalarNode && (scalarNode.Value == "app")) + { + if (root.Children.TryGetValue(new YamlScalarNode("name"), out var nameNode)) + { + appName = nameNode.ToString(); + } + + } + + return appName; + } public string EnsureFolder(string path) { diff --git a/cake/BuildParameters.cs b/cake/BuildParameters.cs index d4a9bcb4f..ec1154e79 100644 --- a/cake/BuildParameters.cs +++ b/cake/BuildParameters.cs @@ -48,4 +48,7 @@ public class BuildParameters [Option('b', "skip-build", Required = false, Default = false, HelpText = "Does not run build steps")] public bool NoBuild { get; set; } + + [Option('a', "apps-run", Required = false, Default = false, HelpText = "Download and run apps")] + public bool AppsRun{ get; set; } } \ No newline at end of file diff --git a/cake/DotNetCmd.cs b/cake/DotNetCmd.cs new file mode 100644 index 000000000..36fe9349b --- /dev/null +++ b/cake/DotNetCmd.cs @@ -0,0 +1,240 @@ +// Build +// Copyright (c) 2023 Peter Kurhajec (PTKu), MTS, and Contributors. All Rights Reserved. +// Contributors: https://github.com/ix-ax/ix/graphs/contributors +// See the LICENSE file in the repository root for more information. +// https://github.com/ix-ax/ix/blob/master/LICENSE +// Third party licenses: https://github.com/ix-ax/ix/blob/master/notices.md + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Configuration; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Threading.Tasks; +using Cake.Common.IO; +using Cake.Common.Tools.ILMerge; +using Cake.Core.Diagnostics; +using Cake.Core.IO; +using Microsoft.Extensions.Configuration; +using Microsoft.Win32; +using Octokit; +using YamlDotNet.RepresentationModel; +using static NuGet.Packaging.PackagingConstants; +using Path = System.IO.Path; + +public static class DotNetCmd +{ + + public static void DotnetIxc(this BuildContext context, IEnumerable folders) + { + foreach (var folder in folders) + { + context.ProcessRunner.Start(Helpers.GetDotNetCommand(), new ProcessSettings() + { + Arguments = "ixc", + WorkingDirectory = folder, + RedirectStandardOutput = false, + RedirectStandardError = false, + Silent = false + }).WaitForExit(); + } + } + + public static void RunPowershellScript(this BuildContext context, string scriptPath, string arguments) + { + string workDir = Path.GetFullPath(Path.Combine(scriptPath, "..")); + context.Log.Information($"Powershell script {scriptPath} with arguments '{arguments}' started"); + context.ProcessRunner.Start("powershell.exe", new ProcessSettings() + { + Arguments = $"-NoProfile -ExecutionPolicy Bypass -File \"{scriptPath}\" {arguments}", + WorkingDirectory = workDir, + RedirectStandardOutput = false, + RedirectStandardError = false, + Silent = false + }).WaitForExit(); + context.Log.Information($"Powershell script {scriptPath} with arguments '{arguments}' finished"); + } + + public static void DotNetClean(this BuildContext context, string slnFilePath, string arguments) + { + string workDir = Path.GetFullPath(Path.Combine(slnFilePath, "..")); + string args = string.Concat($"clean \"{slnFilePath}\" ", arguments); + context.Log.Information($"Dotnet clean command started with solution: {slnFilePath}"); + context.ProcessRunner.Start(Helpers.GetDotNetCommand(), new ProcessSettings() + { + Arguments = args, + WorkingDirectory = workDir, + RedirectStandardOutput = false, + RedirectStandardError = false, + Silent = false + }).WaitForExit(); + context.Log.Information($"Dotnet clean command finished with solution: {slnFilePath}"); + } + + public static string DotNetBuildWithResult(this BuildContext context, string slnFilePath, string arguments, ref bool summaryResult) + { + string workDir = Path.GetFullPath(Path.Combine(slnFilePath, "..")); + string args = $"build \"{slnFilePath}\" {arguments}"; + context.Log.Information($"Dotnet build command started with solution: {slnFilePath}"); + + string retVal = ",NOK"; + + var processSettings = new ProcessSettings + { + Arguments = args, + WorkingDirectory = workDir, + RedirectStandardOutput = true, + RedirectStandardError = true, + Silent = false + }; + + try + { + using (var process = context.ProcessRunner.Start(Helpers.GetDotNetCommand(), processSettings)) + { + if (process == null) + { + summaryResult = false; + throw new Exception("Failed to start the process."); + } + + // Initialize output storage + var standardOutput = new List(); + var standardError = new List(); + + // Read output and error streams asynchronously + Task outputTask = Task.Run(() => + { + foreach (var line in process.GetStandardOutput()) + { + standardOutput.Add(line); + context.Log.Information(line); // Log output immediately + } + }); + + Task errorTask = Task.Run(() => + { + foreach (var line in process.GetStandardError()) + { + standardError.Add(line); + context.Log.Error(line); // Log errors immediately + } + }); + + // Wait for the process to exit + process.WaitForExit(); + + // Ensure all output and error streams are read + Task.WaitAll(outputTask, errorTask); + + // Check the exit code and handle result + if (process.GetExitCode() == 0) + { + context.Log.Information($"Dotnet build command finished successfully with solution: {slnFilePath}"); + retVal = ",OK"; + } + else + { + summaryResult = false; + context.Log.Error($"Dotnet build command with solution: {slnFilePath} failed with exit code: {process.GetExitCode()}"); + context.Log.Error($"Standard Error Output: {string.Join(Environment.NewLine, standardError)}"); + context.Log.Error($"Standard Output: {string.Join(Environment.NewLine, standardOutput)}"); + } + } + } + catch (Exception ex) + { + context.Log.Error($"An exception occurred while running the dotnet build command: {ex.Message}"); + summaryResult = false; + } + return retVal; + } + + public static string DotNetRunWithResult(this BuildContext context, string projectPath, string arguments, int timeoutInSeconds, ref bool summaryResult) + { + string workDir = Path.GetFullPath(Path.Combine(projectPath, "..")); + string args = $"run --project \"{projectPath}\" {arguments}"; + context.Log.Information($"Dotnet run command started with project: {projectPath}"); + + string retVal = ",NOK"; + + // Configure the process + var processStartInfo = new ProcessStartInfo + { + FileName = "dotnet", + Arguments = args, + WorkingDirectory = workDir, + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true + }; + + using (var process = Process.Start(processStartInfo)) + { + if (process == null) + { + summaryResult = false; + throw new Exception("Failed to start the process."); + } + + // Asynchronously read the output and error streams + Task outputTask = Task.Run(() => + { + while (!process.StandardOutput.EndOfStream) + { + var line = process.StandardOutput.ReadLine(); + if (!string.IsNullOrEmpty(line)) + { + context.Log.Information($"[Output] {line}"); + } + } + }); + + Task errorTask = Task.Run(() => + { + while (!process.StandardError.EndOfStream) + { + var line = process.StandardError.ReadLine(); + if (!string.IsNullOrEmpty(line)) + { + context.Log.Error($"[Error] {line}"); + } + } + }); + + // Wait for 1 minute + context.Log.Information($"Waiting for {timeoutInSeconds} seconds..."); + Task.Delay(1000 * timeoutInSeconds).Wait(); + + // Check if the process is still running + if (!process.HasExited) + { + context.Log.Information($"The application '{projectPath}' is still running after {timeoutInSeconds} seconds."); + retVal = ",OK"; + } + else + { + context.Log.Error($"The application '{projectPath}' has exited."); + } + + // Ensure output and error tasks are complete + Task.WhenAll(outputTask, errorTask); + + // Kill the process if it is still running + if (!process.HasExited) + { + context.Log.Information($"Terminating the application '{projectPath}'..."); + process.Kill(true); + } + + // Log exit code + context.Log.Information($"Process exited with code: {process.ExitCode}"); + return retVal; + } + } +} \ No newline at end of file diff --git a/cake/Program.cs b/cake/Program.cs index b1174a4ec..897c864d5 100644 --- a/cake/Program.cs +++ b/cake/Program.cs @@ -8,6 +8,8 @@ using System; using System.Collections.Generic; +using System.Configuration; +using System.Diagnostics; using System.Diagnostics.Contracts; using System.IO; using System.IO.Compression; @@ -20,6 +22,7 @@ using Build; using Build.FilteredSolution; using Cake.Common; +using Cake.Common.Diagnostics; using Cake.Common.IO; using Cake.Common.Tools.DotNet; using Cake.Common.Tools.DotNet.Clean; @@ -36,10 +39,12 @@ using Newtonsoft.Json; using NuGet.Packaging; using NuGet.Protocol; +using NuGet.Protocol.Plugins; using Octokit; using Polly; using Spectre.Console; using static System.Net.WebRequestMethods; +using static NuGet.Packaging.PackagingConstants; using Credentials = Octokit.Credentials; using File = System.IO.File; using Path = System.IO.Path; @@ -142,7 +147,6 @@ public sealed class CatalogInstallTask : FrostingTask { public override void Run(BuildContext context) { - context.Libraries.ToList().ForEach(lib => { foreach (var apaxfile in context.GetApaxFiles(lib)) @@ -187,7 +191,7 @@ public override void Run(BuildContext context) var traversalProject = Path.Combine(traversalProjectFolder, "apax.yml"); context.CreateApaxTraversal(context.RootDir, traversalProject); context.ApaxInstall(new[] { traversalProjectFolder }); - context.ApaxIxc(new[] { traversalProjectFolder }); + context.DotnetIxc(new[] { traversalProjectFolder }); context.DotNetBuildSettings.Verbosity = DotNetVerbosity.Quiet; context.DotNetBuildSettings.MSBuildSettings.Properties.Add("NoWarn", new List() { "1234;2345;8602;10012;8618;0162;8605;1416;3270;1504;8600;8618;" + @@ -284,7 +288,9 @@ public override void Run(BuildContext context) } else { - throw new Exception($"No app or ax folder found for {package.folder}"); + //throw new Exception($"No app or ax folder found for {package.folder}"); + context.Log.Information($"No app or ax folder found for {package.folder}"); + break; } context.DotNetTest(Path.Combine(context.RootDir, package.folder, "tmp_L3_.proj"), context.DotNetTestSettings); @@ -295,8 +301,516 @@ public override void Run(BuildContext context) } } -[TaskName("CreateArtifacts")] +[TaskName("AppsRun")] [IsDependentOn(typeof(TestsTask))] +public sealed class AppsRunTask : FrostingTask +{ + // Tasks can be asynchronous + public override void Run(BuildContext context) + { + if (!context.BuildParameters.AppsRun) + { + context.Log.Warning($"Skipping apps run"); + return; + } + KillProcess(context,"Siemens.Simatic.PlcSim.Advanced.UserInterface"); + + bool summaryResult = true; + + var createResult = CreateLogFile(context, "app_test_result"); + + if (createResult.Success) + { + string logFilePath = createResult.FilePath; + WriteResult(context,"AppName,PlcHw,PlcSw,DotnetBuild,DotnetRun", logFilePath); + + foreach (var library in context.Libraries) + { + if (library.app_run) + { + string appFolder = context.GetAppFolder(library); + string appFile = context.GetApaxFile(appFolder); + string appName = context.GetApplicationName(appFile); + + if (!string.IsNullOrEmpty(appFolder) && context.DirectoryExists(appFolder) && !string.IsNullOrEmpty(appFile) && context.FileExists(appFile) && !string.IsNullOrEmpty(appName)) + { + // Display the file details + context.Log.Information($"###################################################"); + context.Log.Information($"Starting the application: {appName}"); + context.Log.Information($"File of the application: {appFile}"); + context.Log.Information($"###################################################"); + + WriteResult(context, " ", logFilePath); + WriteResult(context, appName, logFilePath, appendToSameLine: true); + + // Initialize PLC Sim instance + InitializePlcSimInstance(context, appName); + + // Overwrite security files + OverwriteSecurityFiles(context,appFile, context.PlcName); + + // Build and load PLC + BuildAndLoadPlc(context, appFile, appName, logFilePath, ref summaryResult); + + // Build and start HMI + BuildAndStartHmi(context, appFile, appName, logFilePath, ref summaryResult); + } + } + } + } + else + { + Console.Error.WriteLine("Failed to create the log file."); + } + KillProcess(context, "Siemens.Simatic.PlcSim.Advanced.UserInterface"); + context.Log.Information("Apps run done."); + } + + private static (bool Success, string FilePath) CreateLogFile(BuildContext context, string fileNamePrefix = "app_test_result") + { + string timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss"); // Generate the timestamp + string fileName = $"{fileNamePrefix}_{timestamp}.csv"; // Create the full file name + string appsRunResultFileName = Path.GetFullPath(Path.Combine(context.AppTestResultsDir, fileName)); + + // Create result directory + try + { + context.EnsureDirectoryExists(context.AppTestResultsDir); + } + catch (Exception ex) + { + context.Log.Error($"Failed to create the directory {context.AppTestResultsDir}: {ex.Message}"); + return (false, null); + } + context.Log.Information($"Directory: {context.AppTestResultsDir} has been created."); + + // Create result file + try + { + using (File.Create(appsRunResultFileName)) { } + context.Log.Information($"File '{appsRunResultFileName}' has been created."); + return (context.FileExists(appsRunResultFileName), appsRunResultFileName); + } + catch (Exception ex) + { + context.Log.Error($"Failed to create the file {appsRunResultFileName}: {ex.Message}"); + return (false, null); + } + } + + private static void WriteResult(BuildContext context,string textToWrite, string logFilePath, bool appendToSameLine = false) + { + // Check if the log file exists + if (!context.FileExists(logFilePath)) + { + context.Log.Error($"The specified log file does not exist: {logFilePath}"); + return; + } + + try + { + if (appendToSameLine) + { + // Append to the same line without a newline + File.AppendAllText(logFilePath, textToWrite); + } + else + { + // Append text with a newline + File.AppendAllText(logFilePath, textToWrite + Environment.NewLine); + } + + context.Log.Information($"Text successfully written to file '{logFilePath}'."); + context.Log.Information("File content:"); + + // Read and display the content of the log file + var fileContent = File.ReadAllText(logFilePath); + context.Log.Information(fileContent); + } + catch (Exception ex) + { + context.Log.Error($"An error occurred while writing to the file: {ex.Message}"); + } + } + + private static void KillProcess(BuildContext context,string processName) + { + try + { + // Get all processes by name + Process[] processes = Process.GetProcessesByName(processName); + + if (processes.Length > 0) + { + foreach (var process in processes) + { + try + { + // Attempt to kill the process + process.Kill(true); // Forcefully terminate the process + context.Log.Information($"Successfully terminated process: {process.ProcessName} (ID: {process.Id})"); + } + catch (Exception ex) + { + context.Log.Error($"Failed to terminate process: {process.ProcessName} (ID: {process.Id}) - {ex.Message}"); + } + } + } + else + { + context.Log.Information($"No processes named '{processName}' were found."); + } + } + catch (Exception ex) + { + context.Log.Error($"An error occurred while attempting to find or kill processes: {ex.Message}"); + } + } + + private static void InitializePlcSimInstance(BuildContext context, string instanceName) + { + string plcSimSourceDir = context.SourceDirPlcSim; + string memoryCardPath = context.PlcSimVirtualMemoryCardLocation; + + // Validate the memory card path + if (!context.DirectoryExists(memoryCardPath)) + { + context.Log.Error($"The provided path for the virtual memory card does not exist: {memoryCardPath}"); + return; + } + + // Validate the instance name + if (string.IsNullOrWhiteSpace(instanceName)) + { + context.Log.Error("The provided instance name is empty."); + return; + } + + // Determine the instance path + string instancePath = Path.GetFullPath(Path.Combine(memoryCardPath, instanceName)); + + if (context.DirectoryExists(instancePath)) + { + // Delete all files and subfolders + context.Log.Information($"The instance path {instancePath} already exists. It needs to be cleaned before."); + try + { + context.CleanDirectory(instancePath, new CleanDirectorySettings() { Force = true }); + } + catch (Exception ex) + { + context.Log.Error($"Failed to clean the directory {instancePath}: {ex.Message}"); + } + context.Log.Information($"Directory {instancePath} has been cleaned."); + } + + // Create the instance directory + try + { + context.EnsureDirectoryExists(instancePath); + } + catch (Exception ex) + { + context.Log.Error($"Failed to create directory {instancePath}: {ex.Message}"); + return; + } + context.Log.Information($"Directory: {instancePath} has been created."); + + // Source directory for PLC Sim files + if (!context.DirectoryExists(plcSimSourceDir)) + { + context.Log.Error($"Source directory for the plcsim {plcSimSourceDir} does not exist."); + return; + } + + // Copy plcsim virtual memory card content + try + { + context.CopyDirectory(plcSimSourceDir, instancePath); + } + catch (Exception ex) + { + context.Log.Error($"Failed to copy plcsim virtual memory card content from: {plcSimSourceDir} to: {instancePath}: {ex.Message}"); + return; + } + context.Log.Information($"Plcsim virtual memory card content has been copied succesfullt from: {plcSimSourceDir} to: {instancePath}"); + } + + private static void OverwriteSecurityFiles(BuildContext context, string appYamlFile, string plcName) + { + string sourceDirSecurityFiles = context.SourceDirSecurityFiles; + + // Check application YAML file + if (string.IsNullOrWhiteSpace(appYamlFile)) + { + context.Log.Error("The provided YAML of the application is empty."); + return; + } + + if (!context.FileExists(appYamlFile)) + { + context.Log.Error($"The provided application file does not exist: {appYamlFile}"); + return; + } + + string appFolder = Path.GetFullPath(Path.GetDirectoryName(appYamlFile)); + if (string.IsNullOrWhiteSpace(appFolder) || !context.DirectoryExists(appFolder)) + { + context.Log.Error($"The provided path for the application does not exist: {appFolder}"); + return; + } + + + if (string.IsNullOrWhiteSpace(plcName)) + { + context.Log.Error("The provided PLC name is empty."); + return; + } + + // Check source directory + if (string.IsNullOrWhiteSpace(sourceDirSecurityFiles)) + { + context.Log.Error("The provided directory name for the source directory of the security files is empty."); + return; + } + + if (!context.DirectoryExists(sourceDirSecurityFiles)) + { + context.Log.Error($"Source directory for the security file does not exist: {sourceDirSecurityFiles}"); + return; + } + + // Handle certification folder + string appCertFolder = Path.Combine(appFolder, "certs"); + if (context.DirectoryExists(appCertFolder)) + { + context.Log.Information($"The application certification folder {appCertFolder} already exists. It needs to be cleaned before."); + try + { + context.CleanDirectory(appCertFolder, new CleanDirectorySettings() { Force = true}); + context.Log.Information($"The application certification folder {appCertFolder} has been cleaned."); + } + catch (Exception ex) + { + context.Log.Error($"Failed to clean the application certification folder {appCertFolder}: {ex.Message}"); + } + } + else + { + try + { + context.EnsureDirectoryExists(appCertFolder); + context.Log.Information($"The application certification folder {appCertFolder} has been created."); + } + catch (Exception ex) + { + context.Log.Error($"Failed to create the application certification folder {appCertFolder}: {ex.Message}"); + } + } + + // Handle certification subfolder for the plc: 'plcName' + string appCertSubFolder = Path.GetFullPath(Path.Combine(appCertFolder, plcName)); + try + { + context.EnsureDirectoryExists (appCertSubFolder); + context.Log.Information($"The application certification subfolder {appCertSubFolder} has been created."); + } + catch (Exception ex) + { + context.Log.Error($"Failed to create the application certification folder {appCertSubFolder}: {ex.Message}"); + } + + // Handle certification file + string plcSourceCertificateFile = $"{plcName}.cer"; + string plcSourceCertificate = Path.GetFullPath(Path.Combine(sourceDirSecurityFiles, plcSourceCertificateFile)); + if (context.FileExists(plcSourceCertificate)) + { + try + { + context.CopyFileToDirectory(plcSourceCertificate, appCertSubFolder); + context.Log.Information($"Certification file '{plcSourceCertificateFile}' has been copied to: {appCertSubFolder}"); + } + catch (Exception ex) + { + context.Log.Error($"Failed to copy the certification file '{plcSourceCertificateFile}': {ex.Message}"); + } + } + else + { + context.Log.Error($"Certification file '{plcSourceCertificateFile}' does not exist in the directory: {sourceDirSecurityFiles}"); + } + + // Handle hwc folder + string appHwcFolder = Path.GetFullPath(Path.Combine(appFolder, "hwc")); + if (!context.DirectoryExists(appHwcFolder)) + { + context.Log.Error($"The application's hwc folder does not exist: {appHwcFolder}"); + return; + } + + // Handle hwc.gen subfolder + string appHwcGenFolder = Path.GetFullPath(Path.Combine(appHwcFolder, "hwc.gen")); + if (context.DirectoryExists(appHwcGenFolder)) + { + context.Log.Information($"The application's hwc.gen subfolder {appHwcGenFolder} already exists. It needs to be cleaned before."); + try + { + context.CleanDirectory(appHwcGenFolder, new CleanDirectorySettings() { Force = true }); + context.Log.Information($"The application's hwc.gen subfolder {appHwcGenFolder} has been cleaned."); + } + catch (Exception ex) + { + context.Log.Error($"Failed to clean the application's hwc.gen subfolder {appHwcGenFolder}: {ex.Message}"); + } + } + else + { + try + { + context.EnsureDirectoryExists(appHwcGenFolder); + context.Log.Information($"The application's hwc.gen subfolder {appHwcGenFolder} has been created."); + } + catch (Exception ex) + { + context.Log.Error($"Failed to create the application's hwc.gen subfolder {appHwcGenFolder}: {ex.Message}"); + } + } + + // Handle secutity configuration file + string securityConfigFileName = $"{plcName}.SecurityConfiguration.json"; + string securityConfigFile = Path.GetFullPath(Path.Combine(sourceDirSecurityFiles, securityConfigFileName)); + if (context.FileExists(securityConfigFile)) + { + try + { + context.CopyFileToDirectory(securityConfigFile, appHwcGenFolder); + context.Log.Information($"Security configuration file '{securityConfigFileName}' successfully copied to: {appHwcGenFolder}"); + } + catch (Exception ex) + { + context.Log.Error($"Failed to copy the file: {ex.Message}"); + } + } + else + { + context.Log.Information($"Security configuration file '{securityConfigFileName}' does not exist in the directory: {sourceDirSecurityFiles}"); + } + } + + private static void BuildAndLoadPlc(BuildContext context, string appYamlFile, string appName, string logFilePath, ref bool summaryResult) + { + string plcName = context.PlcName; + string plcIpAddress = context.PlcIpAddress; + + // Validate application YAML file + if (string.IsNullOrWhiteSpace(appYamlFile)) + { + context.Log.Error("The provided YAML of the application is empty."); + return; + } + + if (!File.Exists(appYamlFile)) + { + context.Log.Error($"The provided application file does not exist: {appYamlFile}"); + return; + } + + if (string.IsNullOrWhiteSpace(appName)) + { + context.Log.Error("The provided application name is empty."); + return; + } + + string appFolder = Path.GetDirectoryName(appYamlFile); + if (string.IsNullOrWhiteSpace(appFolder) || !Directory.Exists(appFolder)) + { + context.Log.Error($"The provided path for the application does not exist: {appFolder}"); + return; + } + + // Run "apax install" + ApaxCmd.ApaxInstall(context,appFolder); + + // Run "apax plcsim" + ApaxCmd.ApaxPlcSim(context, appFolder); + + // Run "apax hwu" + string hwuResult = ApaxCmd.ApaxHwu(context, appFolder, ref summaryResult); + WriteResult(context, hwuResult, logFilePath, appendToSameLine: true); + + // Run "apax swfd" + string swfdResult = ApaxCmd.ApaxSwfd(context, appFolder, ref summaryResult); + WriteResult(context, swfdResult, logFilePath, appendToSameLine: true); + } + + public static void BuildAndStartHmi(BuildContext context, string appYamlFile, string appName, string logFilePath, ref bool summaryResult) + { + // Validate application YAML file + if (string.IsNullOrWhiteSpace(appYamlFile)) + { + context.Log.Error("The provided YAML of the application is empty."); + return; + } + + if (!context.FileExists(appYamlFile)) + { + context.Log.Error($"The provided application file does not exist: {appYamlFile}"); + return; + } + + if (string.IsNullOrWhiteSpace(appName)) + { + context.Log.Error("The provided application name is empty."); + return; + } + + string appFolder = Path.GetFullPath(Path.GetDirectoryName(appYamlFile)); + if (string.IsNullOrWhiteSpace(appFolder) || !context.DirectoryExists(appFolder)) + { + context.Log.Error($"The provided path for the application does not exist: {appFolder}"); + return; + } + + // Recreate solution file by running the slngen script + string slnGenPath = Path.GetFullPath(Path.GetFullPath(Path.Combine (appFolder, "..", "./slngen.ps1"))); + DotNetCmd.RunPowershellScript(context,slnGenPath, ""); + + // Clean solution + string solutionFile = Path.GetFullPath(Path.Combine(appFolder, "../this.sln")); + DotNetCmd.DotNetClean(context, solutionFile, "-c Debug"); + + // Build solution + string buildResult = DotNetCmd.DotNetBuildWithResult(context, solutionFile, "-c Debug",ref summaryResult); + WriteResult(context, buildResult, logFilePath, appendToSameLine: true ); + + // Get blazor projects + var blazorFiles = Directory.GetFiles(appFolder, "*.csproj", SearchOption.AllDirectories).Where(file => file.Contains("blazor")).ToList(); + + if (blazorFiles.Any()) + { + foreach (var blazorFile in blazorFiles) + { + context.Log.Information($"Application 'blazor' file: {blazorFile}"); + + // Filter out libraries by checking for in the project file + string csprojContent = File.ReadAllText(blazorFile); + if (!csprojContent.Contains("")) + { + string runResult = DotNetCmd.DotNetRunWithResult(context, blazorFile, "-c Debug --framework net9.0",60 , ref summaryResult); + WriteResult(context, runResult, logFilePath, appendToSameLine: true); + } + } + } + else + { + context.Log.Information("No files containing 'blazor' in the filename and ending with '.csproj' were found."); + } + } + +} + +[TaskName("CreateArtifacts")] +[IsDependentOn(typeof(AppsRunTask))] public sealed class CreateArtifactsTask : FrostingTask { public override void Run(BuildContext context) diff --git a/cake/Properties/launchSettings.json b/cake/Properties/launchSettings.json index 966ec462a..b6d0c7c6d 100644 --- a/cake/Properties/launchSettings.json +++ b/cake/Properties/launchSettings.json @@ -31,6 +31,14 @@ "build": { "commandName": "Project", "commandLineArgs": "" + }, + "apps_run_only": { + "commandName": "Project", + "commandLineArgs": "--skip-build --apps-run" + }, + "test-L3-apps_run": { + "commandName": "Project", + "commandLineArgs": "--do-test --test-level 10 --apps-run" } } } \ No newline at end of file diff --git a/src/components.rexroth.drives/app/gsd/source/GSDML-V2.1-Bosch Rexroth AG-011F-Indradrive_01V01-20110705.xml b/src/components.rexroth.drives/app/gsd/source/GSDML-V2.1-Bosch Rexroth AG-011F-Indradrive_01V01-20110705.xml new file mode 100644 index 000000000..5d503b230 --- /dev/null +++ b/src/components.rexroth.drives/app/gsd/source/GSDML-V2.1-Bosch Rexroth AG-011F-Indradrive_01V01-20110705.xml @@ -0,0 +1,1777 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PROFINET Device Profile + 1.00 + Device Profile for PROFINET Devices + PROFIBUS Nutzerorganisation e. V. (PNO) + Device + + 4 + 1 + GSDML + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/template.axolibrary/app/SystemConstants/plc_line_HwIdentifiers.st b/src/template.axolibrary/app/SystemConstants/plc_line_HwIdentifiers.st new file mode 100644 index 000000000..5631dc14d --- /dev/null +++ b/src/template.axolibrary/app/SystemConstants/plc_line_HwIdentifiers.st @@ -0,0 +1,19 @@ +CONFIGURATION HardwareIDs + VAR_GLOBAL CONSTANT + plc_line_HwID : UINT := UINT#32; + plc_line_Rail_0_HwID : UINT := UINT#257; + plc_line_plc_line_HwID : UINT := UINT#48; + plc_line_plc_line_CPU_display_1_HwID : UINT := UINT#54; + plc_line_plc_line_Card_reader_writer_1_HwID : UINT := UINT#51; + plc_line_plc_line_DP_interface_1_HwID : UINT := UINT#60; + plc_line_plc_line_OPC_UA_1_HwID : UINT := UINT#117; + plc_line_plc_line_profinet_x1_HwID : UINT := UINT#64; + plc_line_plc_line_profinet_x1_Port_1_HwID : UINT := UINT#65; + plc_line_plc_line_profinet_x1_Port_2_HwID : UINT := UINT#66; + plc_line_plc_line_profinet_x2_HwID : UINT := UINT#72; + plc_line_plc_line_profinet_x2_Port_3_HwID : UINT := UINT#73; + plc_line_plc_line_virtual_communication_interface_HwID : UINT := UINT#135; + profinet_plc_line_HwID : UINT := UINT#256; + + END_VAR +END_CONFIGURATION diff --git a/src/template.axolibrary/app/SystemConstants/plc_line_IoAddresses.st b/src/template.axolibrary/app/SystemConstants/plc_line_IoAddresses.st new file mode 100644 index 000000000..1f46b8a7a --- /dev/null +++ b/src/template.axolibrary/app/SystemConstants/plc_line_IoAddresses.st @@ -0,0 +1,5 @@ +CONFIGURATION IoAddresses + VAR_GLOBAL + + END_VAR +END_CONFIGURATION diff --git a/src/template.axolibrary/app/ix-blazor/Pages/Component_1.razor b/src/template.axolibrary/app/ix-blazor/Pages/Component_1.razor index 802429c34..5c7004852 100644 --- a/src/template.axolibrary/app/ix-blazor/Pages/Component_1.razor +++ b/src/template.axolibrary/app/ix-blazor/Pages/Component_1.razor @@ -1,8 +1,7 @@ @page "/Component_1" @using AXOpen.Core; -@using Template.Axolibrary; - +@* @code { @@ -13,7 +12,7 @@ } #endregion -} +} *@ diff --git a/src/template.axolibrary/app/ix-blazor/Pages/Component_2.razor b/src/template.axolibrary/app/ix-blazor/Pages/Component_2.razor index 7b56b6788..d5b1a8807 100644 --- a/src/template.axolibrary/app/ix-blazor/Pages/Component_2.razor +++ b/src/template.axolibrary/app/ix-blazor/Pages/Component_2.razor @@ -1,5 +1,6 @@ @page "/Component_2" @using AXOpen.Core; +@using Template.Axolibrary; Documentation diff --git a/src/template.axolibrary/app/ix/app_apaxappname.csproj b/src/template.axolibrary/app/ix/app_apaxappname.csproj index 8b610fd51..15c6561fe 100644 --- a/src/template.axolibrary/app/ix/app_apaxappname.csproj +++ b/src/template.axolibrary/app/ix/app_apaxappname.csproj @@ -28,12 +28,11 @@ + - + - - - + diff --git a/src/template.axolibrary/app/src/Documentation/Component_1.st b/src/template.axolibrary/app/src/Documentation/Component_1.st index 553943e18..9c5ac50e2 100644 --- a/src/template.axolibrary/app/src/Documentation/Component_1.st +++ b/src/template.axolibrary/app/src/Documentation/Component_1.st @@ -1,71 +1,71 @@ USING AXOpen.Core; -USING Template.Axolibrary; +NAMESPACE Template.Axolibrary + {S7.extern=ReadWrite} + CLASS Component_1 EXTENDS AXOpen.Core.AxoObject + // + VAR PUBLIC + ExampleCylinder : Template.Axolibrary.TemplateComponent; + END_VAR + // -{S7.extern=ReadWrite} -CLASS Component_1 EXTENDS AXOpen.Core.AxoObject - // - VAR PUBLIC - ExampleCylinder : Template.Axolibrary.TemplateComponent; - END_VAR - // + // + VAR PUBLIC + {#ix-set:AttributeName = "<#Activate manual control#>"} + ActivateManualControl : BOOL; + _homeSensor : BOOL; + _workSensor : BOOL; + _moveHomeSignal : BOOL; + _moveWorkSignal : BOOL; + END_VAR + // - // - VAR PUBLIC - {#ix-set:AttributeName = "<#Activate manual control#>"} - ActivateManualControl : BOOL; - _homeSensor : BOOL; - _workSensor : BOOL; - _moveHomeSignal : BOOL; - _moveWorkSignal : BOOL; - END_VAR - // + METHOD PUBLIC Run + VAR_INPUT + parent : IAxoContext; + END_VAR - METHOD PUBLIC Run - VAR_INPUT - parent : IAxoContext; - END_VAR + THIS.Initialize(parent); - THIS.Initialize(parent); + IF ActivateManualControl THEN + ExampleCylinder.ActivateManualControl(); + END_IF; - IF ActivateManualControl THEN - ExampleCylinder.ActivateManualControl(); - END_IF; + // + ExampleCylinder.Run(THIS, + WORD#64, + REF(_homeSensor), + REF(_workSensor), + REF(_moveHomeSignal), + REF(_moveWorkSignal)); + // - // - ExampleCylinder.Run(THIS, - WORD#64, - REF(_homeSensor), - REF(_workSensor), - REF(_moveHomeSignal), - REF(_moveWorkSignal)); - // + THIS.UseInSequencer(); + END_METHOD - THIS.UseInSequencer(); - END_METHOD + // + VAR PUBLIC + Sequencer : AxoSequencer; + Steps : ARRAY[0..3] OF AXOpen.Core.AxoStep; + END_VAR - // - VAR PUBLIC - Sequencer : AxoSequencer; - Steps : ARRAY[0..3] OF AXOpen.Core.AxoStep; - END_VAR + METHOD PRIVATE UseInSequencer - METHOD PRIVATE UseInSequencer + Sequencer.Initialize(THIS); + Sequencer.Open(); - Sequencer.Initialize(THIS); - Sequencer.Open(); + IF(Steps[0].Execute(Sequencer, 'Move to home position')) THEN + IF(ExampleCylinder.MoveToHome().IsDone()) THEN + Sequencer.MoveNext(); + END_IF; + END_IF; - IF(Steps[0].Execute(Sequencer, 'Move to home position')) THEN - IF(ExampleCylinder.MoveToHome().IsDone()) THEN - Sequencer.MoveNext(); - END_IF; - END_IF; - - IF(Steps[1].Execute(Sequencer, 'Move to work position')) THEN - IF(ExampleCylinder.MoveToWork().IsDone()) THEN - Sequencer.MoveNext(); - END_IF; - END_IF; - END_METHOD - - // -END_CLASS + IF(Steps[1].Execute(Sequencer, 'Move to work position')) THEN + IF(ExampleCylinder.MoveToWork().IsDone()) THEN + Sequencer.MoveNext(); + END_IF; + END_IF; + END_METHOD + + // + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/template.axolibrary/app/src/Documentation/Component_2.st b/src/template.axolibrary/app/src/Documentation/Component_2.st index d07ed647a..0031a07db 100644 --- a/src/template.axolibrary/app/src/Documentation/Component_2.st +++ b/src/template.axolibrary/app/src/Documentation/Component_2.st @@ -1,71 +1,71 @@ USING AXOpen.Core; -USING Template.Axolibrary; +NAMESPACE Template.Axolibrary + {S7.extern=ReadWrite} + CLASS Component_2 EXTENDS AXOpen.Core.AxoObject + // + VAR PUBLIC + ExampleCylinder : Template.Axolibrary.TemplateComponent; + END_VAR + // -{S7.extern=ReadWrite} -CLASS Component_2 EXTENDS AXOpen.Core.AxoObject - // - VAR PUBLIC - ExampleCylinder : Template.Axolibrary.TemplateComponent; - END_VAR - // + // + VAR PUBLIC + {#ix-set:AttributeName = "<#Activate manual control#>"} + ActivateManualControl : BOOL; + _homeSensor : BOOL; + _workSensor : BOOL; + _moveHomeSignal : BOOL; + _moveWorkSignal : BOOL; + END_VAR + // - // - VAR PUBLIC - {#ix-set:AttributeName = "<#Activate manual control#>"} - ActivateManualControl : BOOL; - _homeSensor : BOOL; - _workSensor : BOOL; - _moveHomeSignal : BOOL; - _moveWorkSignal : BOOL; - END_VAR - // + METHOD PUBLIC Run + VAR_INPUT + parent : IAxoContext; + END_VAR - METHOD PUBLIC Run - VAR_INPUT - parent : IAxoContext; - END_VAR + THIS.Initialize(parent); - THIS.Initialize(parent); + IF ActivateManualControl THEN + ExampleCylinder.ActivateManualControl(); + END_IF; - IF ActivateManualControl THEN - ExampleCylinder.ActivateManualControl(); - END_IF; + // + ExampleCylinder.Run(THIS, + WORD#64, + REF(_homeSensor), + REF(_workSensor), + REF(_moveHomeSignal), + REF(_moveWorkSignal)); + // - // - ExampleCylinder.Run(THIS, - WORD#64, - REF(_homeSensor), - REF(_workSensor), - REF(_moveHomeSignal), - REF(_moveWorkSignal)); - // + THIS.UseInSequencer(); + END_METHOD - THIS.UseInSequencer(); - END_METHOD + // + VAR PUBLIC + Sequencer : AxoSequencer; + Steps : ARRAY[0..3] OF AXOpen.Core.AxoStep; + END_VAR - // - VAR PUBLIC - Sequencer : AxoSequencer; - Steps : ARRAY[0..3] OF AXOpen.Core.AxoStep; - END_VAR + METHOD PRIVATE UseInSequencer - METHOD PRIVATE UseInSequencer + Sequencer.Initialize(THIS); + Sequencer.Open(); - Sequencer.Initialize(THIS); - Sequencer.Open(); + IF(Steps[0].Execute(Sequencer, 'Move to home position')) THEN + IF(ExampleCylinder.MoveToHome().IsDone()) THEN + Sequencer.MoveNext(); + END_IF; + END_IF; - IF(Steps[0].Execute(Sequencer, 'Move to home position')) THEN - IF(ExampleCylinder.MoveToHome().IsDone()) THEN - Sequencer.MoveNext(); - END_IF; - END_IF; - - IF(Steps[1].Execute(Sequencer, 'Move to work position')) THEN - IF(ExampleCylinder.MoveToWork().IsDone()) THEN - Sequencer.MoveNext(); - END_IF; - END_IF; - END_METHOD - - // -END_CLASS + IF(Steps[1].Execute(Sequencer, 'Move to work position')) THEN + IF(ExampleCylinder.MoveToWork().IsDone()) THEN + Sequencer.MoveNext(); + END_IF; + END_IF; + END_METHOD + + // + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/template.axolibrary/app/src/Documentation/DocumentationContext.st b/src/template.axolibrary/app/src/Documentation/DocumentationContext.st index 6a93ce9da..5a258bf6b 100644 --- a/src/template.axolibrary/app/src/Documentation/DocumentationContext.st +++ b/src/template.axolibrary/app/src/Documentation/DocumentationContext.st @@ -1,12 +1,14 @@ -{S7.extern=ReadWrite} -CLASS DocumentationContext EXTENDS AXOpen.Core.AxoContext - VAR PUBLIC - componentOne : Component_1; - componentTwo : Component_2; - END_VAR - - METHOD PROTECTED OVERRIDE Main - componentOne.Run(THIS); - componentTwo.Run(THIS); - END_METHOD -END_CLASS +NAMESPACE Template.Axolibrary + {S7.extern=ReadWrite} + CLASS DocumentationContext EXTENDS AXOpen.Core.AxoContext + VAR PUBLIC + componentOne : Template.Axolibrary.Component_1; + componentTwo : Template.Axolibrary.Component_2; + END_VAR + + METHOD PROTECTED OVERRIDE Main + componentOne.Run(THIS); + componentTwo.Run(THIS); + END_METHOD + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/template.axolibrary/app/src/IO/HwIdentifiers.st b/src/template.axolibrary/app/src/IO/HwIdentifiers.st new file mode 100644 index 000000000..660d47d31 --- /dev/null +++ b/src/template.axolibrary/app/src/IO/HwIdentifiers.st @@ -0,0 +1,23 @@ +NAMESPACE app_apaxappname + TYPE + HwIdentifiers : WORD + ( + plc_line_HwID := WORD#32, + plc_line_Rail_0_HwID := WORD#257, + plc_line_plc_line_HwID := WORD#48, + plc_line_plc_line_CPU_display_1_HwID := WORD#54, + plc_line_plc_line_Card_reader_writer_1_HwID := WORD#51, + plc_line_plc_line_DP_interface_1_HwID := WORD#60, + plc_line_plc_line_OPC_UA_1_HwID := WORD#117, + plc_line_plc_line_profinet_x1_HwID := WORD#64, + plc_line_plc_line_profinet_x1_Port_1_HwID := WORD#65, + plc_line_plc_line_profinet_x1_Port_2_HwID := WORD#66, + plc_line_plc_line_profinet_x2_HwID := WORD#72, + plc_line_plc_line_profinet_x2_Port_3_HwID := WORD#73, + plc_line_plc_line_virtual_communication_interface_HwID := WORD#135, + profinet_plc_line_HwID := WORD#256, + + NONE := WORD#0 + ); + END_TYPE +END_NAMESPACE diff --git a/src/template.axolibrary/app/src/IO/Inputs.st b/src/template.axolibrary/app/src/IO/Inputs.st new file mode 100644 index 000000000..2949cd0d5 --- /dev/null +++ b/src/template.axolibrary/app/src/IO/Inputs.st @@ -0,0 +1,9 @@ +NAMESPACE app_apaxappname + TYPE + {S7.extern=ReadWrite} + {#ix-attr:[Container(Layout.Wrap)]} + Inputs : STRUCT + noInputsFoundInTheHwConfig AT %B0: BYTE; + END_STRUCT; + END_TYPE +END_NAMESPACE diff --git a/src/template.axolibrary/app/src/IO/Outputs.st b/src/template.axolibrary/app/src/IO/Outputs.st new file mode 100644 index 000000000..f1ea67b18 --- /dev/null +++ b/src/template.axolibrary/app/src/IO/Outputs.st @@ -0,0 +1,9 @@ +NAMESPACE app_apaxappname + TYPE + {S7.extern=ReadWrite} + {#ix-attr:[Container(Layout.Wrap)]} + Outputs : STRUCT + noOutputsFoundInTheHwConfig AT %B0: BYTE; + END_STRUCT; + END_TYPE +END_NAMESPACE diff --git a/src/template.axolibrary/app/src/Sandbox/SandboxContext.st b/src/template.axolibrary/app/src/Sandbox/SandboxContext.st index 2a6a3c1d9..90de9c1a9 100644 --- a/src/template.axolibrary/app/src/Sandbox/SandboxContext.st +++ b/src/template.axolibrary/app/src/Sandbox/SandboxContext.st @@ -1,26 +1,26 @@ -USING Template.Axolibrary; +NAMESPACE Template.Axolibrary + {S7.extern=ReadWrite} + CLASS SandboxContext EXTENDS AXOpen.Core.AxoContext + VAR PUBLIC + _manualControl : BOOL; + _testCyclinder : Template.Axolibrary.TemplateComponent; + _homeSensor : BOOL; + _workSensor : BOOL; + _moveHomeSignal : BOOL; + _moveWorkSignal : BOOL; + END_VAR -{S7.extern=ReadWrite} -CLASS SandboxContext EXTENDS AXOpen.Core.AxoContext - VAR PUBLIC - _manualControl : BOOL; - _testCyclinder : Template.Axolibrary.TemplateComponent; - _homeSensor : BOOL; - _workSensor : BOOL; - _moveHomeSignal : BOOL; - _moveWorkSignal : BOOL; - END_VAR + METHOD PROTECTED OVERRIDE Main + _testCyclinder.Run(THIS, + WORD#64, + REF(_homeSensor), + REF(_workSensor), + REF(_moveHomeSignal), + REF(_moveWorkSignal)); - METHOD PROTECTED OVERRIDE Main - _testCyclinder.Run(THIS, - WORD#64, - REF(_homeSensor), - REF(_workSensor), - REF(_moveHomeSignal), - REF(_moveWorkSignal)); - - IF(_manualControl) THEN - _testCyclinder.ActivateManualControl(); - END_IF; - END_METHOD -END_CLASS + IF(_manualControl) THEN + _testCyclinder.ActivateManualControl(); + END_IF; + END_METHOD + END_CLASS +END_NAMESPACE \ No newline at end of file diff --git a/src/template.axolibrary/app/src/configuration.st b/src/template.axolibrary/app/src/configuration.st index d76e508e2..83bbdd245 100644 --- a/src/template.axolibrary/app/src/configuration.st +++ b/src/template.axolibrary/app/src/configuration.st @@ -1,17 +1,20 @@ +USING Template.Axolibrary; + CONFIGURATION MyConfiguration TASK Main(Interval := T#10ms, Priority := 1); PROGRAM P1 WITH Main: MyProgram; VAR_GLOBAL {S7.extern=ReadWrite} - sandbox : SandboxContext; + sandbox : Template.Axolibrary.SandboxContext; {S7.extern=ReadWrite} - documentation : DocumentationContext; + documentation : Template.Axolibrary.DocumentationContext; {S7.extern=ReadWrite} _rtc : AXOpen.S71500.Rtc; {S7.extern=ReadWrite} _rtm : AXOpen.S71500.Rtm; - END_VAR + END_VAR + END_CONFIGURATION diff --git a/src/template.axolibrary/app/src/program.st b/src/template.axolibrary/app/src/program.st index fe03b0382..6dfff89df 100644 --- a/src/template.axolibrary/app/src/program.st +++ b/src/template.axolibrary/app/src/program.st @@ -1,7 +1,9 @@ +USING Template.Axolibrary; + PROGRAM MyProgram VAR_EXTERNAL - sandbox : SandboxContext; - documentation : DocumentationContext; + sandbox : Template.Axolibrary.SandboxContext; + documentation : Template.Axolibrary.DocumentationContext; _rtc : AXOpen.S71500.Rtc; _rtm : AXOpen.S71500.Rtm; END_VAR diff --git a/src/template.axolibrary/ctrl/src/TemplateComponent.st b/src/template.axolibrary/ctrl/src/TemplateComponent.st index 76d25d8c3..1299de268 100644 --- a/src/template.axolibrary/ctrl/src/TemplateComponent.st +++ b/src/template.axolibrary/ctrl/src/TemplateComponent.st @@ -132,6 +132,8 @@ NAMESPACE Template.Axolibrary moveWorkSignal : REF_TO BOOL; END_VAR + THIS.Initialize(parent); + THIS.Open(); Messenger.Serve(THIS); @@ -162,7 +164,6 @@ NAMESPACE Template.Axolibrary RETURN; END_IF; - THIS.Initialize(parent); Inputs.Status.HomeSensor := homeSensor^; Inputs.Status.WorkSensor := workSensor^; @@ -192,6 +193,8 @@ NAMESPACE Template.Axolibrary moveWorkSignal : REF_TO BOOL; END_VAR + THIS.Initialize(parent); + THIS.Open(); Messenger.Serve(THIS); @@ -222,8 +225,6 @@ NAMESPACE Template.Axolibrary RETURN; END_IF; - THIS.Initialize(parent); - Inputs.Status.HomeSensor := homeSensor^; Inputs.Status.WorkSensor := workSensor^; _hwId := hwID; diff --git a/src/utils/this.sln b/src/utils/this.sln index 937963bc4..7675a581d 100644 --- a/src/utils/this.sln +++ b/src/utils/this.sln @@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_core", "..\cor EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_ax_sdk", "..\sdk-ax\ctrl\ix\ix_ax_ax_sdk.csproj", "{653A5257-1488-4BF8-86A0-42DA495E4461}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_simatic1500", "..\simatic1500\ctrl\ix\ix_ax_axopen_simatic1500.csproj", "{1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_timers", "..\timers\src\AXOpen.Timers\ix_ax_axopen_timers.csproj", "{5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.ToolBox", "..\toolbox\src\AXOpen.ToolBox\AXOpen.ToolBox.csproj", "{6C21488E-3A34-4D7A-8DAA-7FE508F4D352}" @@ -43,6 +45,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ctrl", "..\sdk-ax\ctrl", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sdk-ax", "..\sdk-ax", "{6A1F3623-0F4F-4E25-B5FE-5D5A4259D634}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ix", "..\simatic1500\ctrl\ix", "{32D891C2-2081-4D5C-B487-30FCEE87CDC3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ctrl", "..\simatic1500\ctrl", "{F4A57554-42D1-4F2E-9DD3-A4B6BD3A7B09}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "simatic1500", "..\simatic1500", "{C417873F-0D6D-4AB8-B1EE-10CD18919173}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AXOpen.Timers", "..\timers\src\AXOpen.Timers", "{A35CEDC5-EA25-4FAC-A2CE-B0D5BD9D7AFC}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "..\timers\src", "{53D778CA-4BE5-4023-83BB-773F5789F809}" @@ -95,6 +103,10 @@ Global {653A5257-1488-4BF8-86A0-42DA495E4461}.Debug|Any CPU.Build.0 = Debug|Any CPU {653A5257-1488-4BF8-86A0-42DA495E4461}.Release|Any CPU.ActiveCfg = Release|Any CPU {653A5257-1488-4BF8-86A0-42DA495E4461}.Release|Any CPU.Build.0 = Release|Any CPU + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}.Release|Any CPU.Build.0 = Release|Any CPU {5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629}.Debug|Any CPU.Build.0 = Debug|Any CPU {5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -132,6 +144,9 @@ Global {653A5257-1488-4BF8-86A0-42DA495E4461} = {C2171157-A425-49BB-8015-F997A2B569B9} {C2171157-A425-49BB-8015-F997A2B569B9} = {C774E146-D81D-43E4-809F-2C3EB42DDD38} {C774E146-D81D-43E4-809F-2C3EB42DDD38} = {6A1F3623-0F4F-4E25-B5FE-5D5A4259D634} + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F} = {32D891C2-2081-4D5C-B487-30FCEE87CDC3} + {32D891C2-2081-4D5C-B487-30FCEE87CDC3} = {F4A57554-42D1-4F2E-9DD3-A4B6BD3A7B09} + {F4A57554-42D1-4F2E-9DD3-A4B6BD3A7B09} = {C417873F-0D6D-4AB8-B1EE-10CD18919173} {5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629} = {A35CEDC5-EA25-4FAC-A2CE-B0D5BD9D7AFC} {A35CEDC5-EA25-4FAC-A2CE-B0D5BD9D7AFC} = {53D778CA-4BE5-4023-83BB-773F5789F809} {53D778CA-4BE5-4023-83BB-773F5789F809} = {44D49DE9-5413-4E4D-AB61-E2DB0FE8C931} diff --git a/src/utils/utils.sln b/src/utils/utils.sln index 937963bc4..7675a581d 100644 --- a/src/utils/utils.sln +++ b/src/utils/utils.sln @@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_core", "..\cor EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_ax_sdk", "..\sdk-ax\ctrl\ix\ix_ax_ax_sdk.csproj", "{653A5257-1488-4BF8-86A0-42DA495E4461}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_simatic1500", "..\simatic1500\ctrl\ix\ix_ax_axopen_simatic1500.csproj", "{1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_ax_axopen_timers", "..\timers\src\AXOpen.Timers\ix_ax_axopen_timers.csproj", "{5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AXOpen.ToolBox", "..\toolbox\src\AXOpen.ToolBox\AXOpen.ToolBox.csproj", "{6C21488E-3A34-4D7A-8DAA-7FE508F4D352}" @@ -43,6 +45,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ctrl", "..\sdk-ax\ctrl", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sdk-ax", "..\sdk-ax", "{6A1F3623-0F4F-4E25-B5FE-5D5A4259D634}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ix", "..\simatic1500\ctrl\ix", "{32D891C2-2081-4D5C-B487-30FCEE87CDC3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ctrl", "..\simatic1500\ctrl", "{F4A57554-42D1-4F2E-9DD3-A4B6BD3A7B09}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "simatic1500", "..\simatic1500", "{C417873F-0D6D-4AB8-B1EE-10CD18919173}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AXOpen.Timers", "..\timers\src\AXOpen.Timers", "{A35CEDC5-EA25-4FAC-A2CE-B0D5BD9D7AFC}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "..\timers\src", "{53D778CA-4BE5-4023-83BB-773F5789F809}" @@ -95,6 +103,10 @@ Global {653A5257-1488-4BF8-86A0-42DA495E4461}.Debug|Any CPU.Build.0 = Debug|Any CPU {653A5257-1488-4BF8-86A0-42DA495E4461}.Release|Any CPU.ActiveCfg = Release|Any CPU {653A5257-1488-4BF8-86A0-42DA495E4461}.Release|Any CPU.Build.0 = Release|Any CPU + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F}.Release|Any CPU.Build.0 = Release|Any CPU {5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629}.Debug|Any CPU.Build.0 = Debug|Any CPU {5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -132,6 +144,9 @@ Global {653A5257-1488-4BF8-86A0-42DA495E4461} = {C2171157-A425-49BB-8015-F997A2B569B9} {C2171157-A425-49BB-8015-F997A2B569B9} = {C774E146-D81D-43E4-809F-2C3EB42DDD38} {C774E146-D81D-43E4-809F-2C3EB42DDD38} = {6A1F3623-0F4F-4E25-B5FE-5D5A4259D634} + {1DE31C78-DE35-4ABD-ADDA-9099A4918F3F} = {32D891C2-2081-4D5C-B487-30FCEE87CDC3} + {32D891C2-2081-4D5C-B487-30FCEE87CDC3} = {F4A57554-42D1-4F2E-9DD3-A4B6BD3A7B09} + {F4A57554-42D1-4F2E-9DD3-A4B6BD3A7B09} = {C417873F-0D6D-4AB8-B1EE-10CD18919173} {5FBD59DA-0C2C-40CF-AC3F-2E06DFF7C629} = {A35CEDC5-EA25-4FAC-A2CE-B0D5BD9D7AFC} {A35CEDC5-EA25-4FAC-A2CE-B0D5BD9D7AFC} = {53D778CA-4BE5-4023-83BB-773F5789F809} {53D778CA-4BE5-4023-83BB-773F5789F809} = {44D49DE9-5413-4E4D-AB61-E2DB0FE8C931}