Skip to content

Commit

Permalink
suport SystemFunction CTU
Browse files Browse the repository at this point in the history
  • Loading branch information
sripp committed Apr 15, 2024
1 parent b326022 commit 3fbd8f3
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions TiaCodegen/Commands/Functions/CTUCall.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.Linq;
using TiaCodegen.Commands.Functions.Base;
using TiaCodegen.Enums;
using TiaCodegen.Interfaces;

namespace TiaCodegen.Commands.Functions
{
public class CTUCall : SystemFunctionBlockCall
{
public CTUCall(string instanceName,
IOperationOrSignal cu = null,
IOperationOrSignal r = null,
IOperationOrSignal pv = null,
IOperationOrSignal q = null,
IOperationOrSignal cv = null) : base("CTU", instanceName, null)
{
Interface["CU"] = new IOperationOrSignalDirectionWrapper(cu, Direction.Input);
Interface["R"] = new IOperationOrSignalDirectionWrapper(r, Direction.Input);
Interface["PV"] = new IOperationOrSignalDirectionWrapper(pv, Direction.Input);
Interface["Q"] = new IOperationOrSignalDirectionWrapper(q, Direction.Output);
Interface["CV"] = new IOperationOrSignalDirectionWrapper(cv, Direction.Output);

TemplateValueName = "value_type";
TemplateValueType = "Type";
TemplateValue = "Int";
HasNoEn = true;

Children.AddRange(Interface.Values.Where(x => x.OperationOrSignal != null).Select(x => x.OperationOrSignal));
}
}
}

0 comments on commit 3fbd8f3

Please sign in to comment.