|
| 1 | +using System.Linq; |
| 2 | +using TiaCodegen.Commands.Functions.Base; |
| 3 | +using TiaCodegen.Enums; |
| 4 | +using TiaCodegen.Interfaces; |
| 5 | + |
| 6 | +namespace TiaCodegen.Commands.Functions |
| 7 | +{ |
| 8 | + public class CTUDCall : SystemFunctionBlockCall |
| 9 | + { |
| 10 | + public CTUDCall(string instanceName, |
| 11 | + IOperationOrSignal cd = null, |
| 12 | + IOperationOrSignal r = null, |
| 13 | + IOperationOrSignal ld = null, |
| 14 | + IOperationOrSignal pv = null, |
| 15 | + IOperationOrSignal qu = null, |
| 16 | + IOperationOrSignal qd = null, |
| 17 | + IOperationOrSignal cv = null) : base("CTUD", instanceName, null) |
| 18 | + { |
| 19 | + Interface["CD"] = new IOperationOrSignalDirectionWrapper(cd, Direction.Input); |
| 20 | + Interface["R"] = new IOperationOrSignalDirectionWrapper(r, Direction.Input); |
| 21 | + Interface["LD"] = new IOperationOrSignalDirectionWrapper(ld, Direction.Input); |
| 22 | + Interface["PV"] = new IOperationOrSignalDirectionWrapper(pv, Direction.Input); |
| 23 | + Interface["QU"] = new IOperationOrSignalDirectionWrapper(qu, Direction.Output); |
| 24 | + Interface["QD"] = new IOperationOrSignalDirectionWrapper(qd, Direction.Output); |
| 25 | + Interface["CV"] = new IOperationOrSignalDirectionWrapper(cv, Direction.Output); |
| 26 | + |
| 27 | + TemplateValueName = "value_type"; |
| 28 | + TemplateValueType = "Type"; |
| 29 | + TemplateValue = "Int"; |
| 30 | + HasNoEn = true; |
| 31 | + |
| 32 | + Children.AddRange(Interface.Values.Where(x => x.OperationOrSignal != null).Select(x => x.OperationOrSignal)); |
| 33 | + } |
| 34 | + } |
| 35 | +} |
0 commit comments