using System; using System.Collections.Generic; using System.Text; using DotNetSiemensPLCToolBoxLibrary.DataTypes.Blocks.Step7V5; namespace S7Explorer.Models { public class S7Function { public S7Block Block { get; set; } public string Name { get; set; } public string Description { get; set; } public List Parameters { get; set; } = new List(); public string Code { get; set; } public S7Function() { } public S7Function(S7Block block) { Block = block; Name = block?.Name ?? string.Empty; Description = block?.Title ?? string.Empty; // Code would need to be extracted from the block // This is just a placeholder Code = "// Function code would be extracted here"; } public override string ToString() { return Name; } } public class S7FunctionParameter { public string Name { get; set; } public string DataType { get; set; } public string Comment { get; set; } public string Direction { get; set; } // IN, OUT, IN_OUT public override string ToString() { return $"{Direction} {Name} : {DataType}"; } } }