2 # Tree construction attributes
4 # Testing attribute: TDataStd_TreeNode
6 # Testing command: AppendNode
8 # Testing command: SetNode
9 # Testing command: ChildNodeIterate
15 # Add an attribute to a data framework
17 set aName_Root Label_1
18 Label D ${aLabel_Root}
19 SetName D ${aLabel_Root} ${aName_Root}
22 ###set aChild1 [NewChild D ${aLabel_Root}]
25 SetName D ${aChild1} ${aName1}
28 ###set aChild2 [NewChild D ${aLabel_Root}]
31 SetName D ${aChild2} ${aName2}
33 set aName3 Label_1_1_1
34 ###set aChild3 [NewChild D ${aLabel_Root}]
37 SetName D ${aChild3} ${aName3}
39 SetNode D ${aLabel_Root}
40 AppendNode D ${aLabel_Root} ${aChild1}
41 AppendNode D ${aLabel_Root} ${aChild2}
42 AppendNode D ${aLabel_Root} ${aChild3}
44 # Close/Open the transaction
47 # Forget the attribute
48 ForgetAll D ${aLabel_Root}
50 # Close/Open the transaction
58 # Get a value of the attribute
59 set IsDone [catch {set aListChildNodes [ChildNodeIterate D ${aLabel_Root} 1]} aResult]
60 if { ${IsDone} != 0 } {
62 puts "Append TDataStd_TreeNode attribute: Error"
65 set aListChildNodesLength [llength ${aListChildNodes}]
66 if { ${aListChildNodesLength}!=[expr 3 + 0]} {
67 puts "aListChildNodes=${aListChildNodes}"
68 puts "aListChildNodesLength=${aListChildNodesLength}"
69 puts "Append TDataStd_TreeNode attribute: Error"
72 set aFirstChildNode [lindex ${aListChildNodes} 0]
73 set aSecondChildNode [lindex ${aListChildNodes} 1]
74 set aThirdChildNode [lindex ${aListChildNodes} 2]
75 if { ${aFirstChildNode}!=${aChild1} ||
76 ${aSecondChildNode}!=${aChild2} ||
77 ${aThirdChildNode}!=${aChild3}} {
78 puts "aFirstChildNode=${aFirstChildNode} aChild1=${aChild1}"
79 puts "aSecondChildNode=${aSecondChildNode} aChild2=${aChild2}"
80 puts "aThirdChildNode=${aThirdChildNode} aChild3=${aChild3}"
81 puts "Append TDataStd_TreeNode attribute: Error"
85 puts "Append TDataStd_TreeNode attribute: OK"