2 # Tree construction attributes
4 # Testing attribute: TDataStd_TreeNode
6 # Testing command: InsertNodeAfter
8 # Testing command: SetNode
9 # Testing command: AppendNode
10 # Testing command: ChildNodeIterate
16 # Add an attribute to a data framework
18 set aName_Root Label_1
19 Label D ${aLabel_Root}
20 SetName D ${aLabel_Root} ${aName_Root}
23 ###set aChild1 [NewChild D ${aLabel_Root}]
26 SetName D ${aChild1} ${aName1}
29 ###set aChild2 [NewChild D ${aLabel_Root}]
32 SetName D ${aChild2} ${aName2}
34 set aName3 Label_1_1_1
35 ###set aChild3 [NewChild D ${aLabel_Root}]
38 SetName D ${aChild3} ${aName3}
40 SetNode D ${aLabel_Root}
42 AppendNode D ${aLabel_Root} ${aChild1}
43 AppendNode D ${aLabel_Root} ${aChild2}
44 InsertNodeAfter D ${aChild1} ${aChild3}
46 # Close/Open the transaction
49 # Forget the attribute
50 ForgetAll D ${aLabel_Root}
52 # Close/Open the transaction
60 # Get a value of the attribute
61 set IsDone [catch {set aListChildNodes [ChildNodeIterate D ${aLabel_Root} 1]} aResult]
62 if { ${IsDone} != 0 } {
64 puts "InsertAfter TDataStd_TreeNode attribute: Error"
67 set aListChildNodesLength [llength ${aListChildNodes}]
68 if { ${aListChildNodesLength}!=[expr 3 + 0]} {
69 puts "aListChildNodes=${aListChildNodes}"
70 puts "aListChildNodesLength=${aListChildNodesLength}"
71 puts "InsertAfter TDataStd_TreeNode attribute: Error"
74 set aFirstChildNode [lindex ${aListChildNodes} 0]
75 set aSecondChildNode [lindex ${aListChildNodes} 1]
76 set aThirdChildNode [lindex ${aListChildNodes} 2]
77 if { ${aFirstChildNode}!=${aChild1} ||
78 ${aSecondChildNode}!=${aChild3} ||
79 ${aThirdChildNode}!=${aChild2}} {
80 puts "aFirstChildNode=${aFirstChildNode} aChild1=${aChild1}"
81 puts "aSecondChildNode=${aSecondChildNode} aChild2=${aChild2}"
82 puts "aThirdChildNode=${aThirdChildNode} aChild3=${aChild3}"
83 puts "InsertAfter TDataStd_TreeNode attribute: Error"
87 puts "InsertAfter TDataStd_TreeNode attribute: OK"