Auto: twincat-4.1 — nested UDT browse via online type walker
Closes #315
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.0">
|
||||
<DUT Name="ST_AlarmRecord" Id="{00000000-0000-0000-0000-000000000403}">
|
||||
<Declaration><![CDATA[// PR 4.1 / #315 — element type for the GVL_Plant.aAlarmRecords ARRAY[1..2000] cutoff
|
||||
// fixture. Two atomic members per element so an over-cap browse short-circuits to a
|
||||
// single IsArrayRoot leaf rather than 2000 × 2 = 4000 individual leaves.
|
||||
TYPE ST_AlarmRecord :
|
||||
STRUCT
|
||||
nCode : DINT;
|
||||
bActive : BOOL;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.0">
|
||||
<DUT Name="ST_NestedFlags" Id="{00000000-0000-0000-0000-000000000401}">
|
||||
<Declaration><![CDATA[// PR 4.1 / #315 — exercises TwinCATTypeWalker.Walk against a mixed-atomic struct.
|
||||
// Members chosen to span integer / boolean / real so the per-leaf flatten emits one
|
||||
// row per type the OPC UA layer renders. Bit-packed BOOL members reuse the existing
|
||||
// PR 1.5 bit-extract path on read.
|
||||
TYPE ST_NestedFlags :
|
||||
STRUCT
|
||||
bRunning : BOOL;
|
||||
bFault : BOOL;
|
||||
bWarning : BOOL;
|
||||
nState : INT;
|
||||
rTemperature : REAL;
|
||||
sTagName : STRING(40);
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.0">
|
||||
<DUT Name="ST_RecursiveCap" Id="{00000000-0000-0000-0000-000000000402}">
|
||||
<Declaration><![CDATA[// PR 4.1 / #315 — exercises the depth-cap / cycle-guard path in TwinCATTypeWalker.
|
||||
// A POINTER TO ST_RecursiveCap surfaces in the IDataType graph as IsPointer=true
|
||||
// (DataTypeCategory.Pointer); the walker should skip the pointer member rather than
|
||||
// recurse, leaving nValue as the only atomic leaf. If the cycle guard ever regresses
|
||||
// the walker would either stack-overflow or emit a flood of self-referential paths,
|
||||
// both of which the integration test asserts against.
|
||||
TYPE ST_RecursiveCap :
|
||||
STRUCT
|
||||
nValue : DINT;
|
||||
pNext : POINTER TO ST_RecursiveCap;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
</DUT>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user