Skip to content

Commit 87ef873

Browse files
committed
add tp call
1 parent 9eef157 commit 87ef873

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 TPCall : SystemFunctionBlockCall
9+
{
10+
public TPCall(string instanceName,
11+
IOperationOrSignal pt = null,
12+
IOperationOrSignal q = null,
13+
IOperationOrSignal et = null) : base("TP", instanceName, null)
14+
{
15+
Interface["PT"] = new IOperationOrSignalDirectionWrapper(pt, Direction.Input);
16+
Interface["Q"] = new IOperationOrSignalDirectionWrapper(q, Direction.Output);
17+
Interface["ET"] = new IOperationOrSignalDirectionWrapper(et, Direction.Output);
18+
19+
TemplateValueName = "time_type";
20+
TemplateValueType = "Type";
21+
TemplateValue = "Time";
22+
HasNoEn = true;
23+
24+
SafetyTemplateString = @" <TemplateValue Name=""f_user_card"" Type=""Cardinality"">1</TemplateValue>
25+
<TemplateValue Name=""f_image_card"" Type=""Cardinality"">0</TemplateValue>
26+
<TemplateValue Name=""f_imageclassic_card"" Type=""Cardinality"">0</TemplateValue>
27+
<TemplateValue Name=""f_imageplus_card"" Type=""Cardinality"">0</TemplateValue>
28+
<TemplateValue Name=""codedbool_type"" Type=""Type"">DInt</TemplateValue>";
29+
30+
Children.AddRange(Interface.Values.Where(x => x.OperationOrSignal != null).Select(x => x.OperationOrSignal));
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)