1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
#INTERFACE CAF
# Tree construction attributes
#
# Testing attribute: TDataStd_TreeNode
#
# Testing command: ChildNodeNextBrother
#
# Testing command: NewChild
# Testing command: AppendNode
# Testing command: InitChildNodeIterator
# Testing command: ChildNodeMore
# Testing command: ChildNodeNext
# Testing command: ChildNodeValue
#
puts "caf005-M2"
# Add an attribute to a data framework
set aLabel_Root 0:2
set aName_Root Label_1
Label D ${aLabel_Root}
SetName D ${aLabel_Root} ${aName_Root}
set aName1 Label_1_1
###set aChild1 [NewChild D ${aLabel_Root}]
set aChild1 0:2:1
Label D ${aChild1}
SetName D ${aChild1} ${aName1}
set aName2 Label_1_2
###set aChild2 [NewChild D ${aLabel_Root}]
set aChild2 0:2:2
Label D ${aChild2}
SetName D ${aChild2} ${aName2}
set aName3 Label_1_1_1
###set aChild3 [NewChild D ${aLabel_Root}]
set aChild3 0:2:3
Label D ${aChild3}
SetName D ${aChild3} ${aName3}
set aName4 Label_1_1_2
###set aChild4 [NewChild D ${aLabel_Root}]
set aChild4 0:2:4
Label D ${aChild4}
SetName D ${aChild4} ${aName4}
set aName5 Label_1_1_3
###set aChild5 [NewChild D ${aLabel_Root}]
set aChild5 0:2:5
Label D ${aChild5}
SetName D ${aChild5} ${aName5}
set aName6 Label_1_2_1
###set aChild6 [NewChild D ${aLabel_Root}]
set aChild6 0:2:6
Label D ${aChild6}
SetName D ${aChild6} ${aName6}
set aName7 Label_1_2_2
###set aChild7 [NewChild D ${aLabel_Root}]
set aChild7 0:2:7
Label D ${aChild7}
SetName D ${aChild7} ${aName7}
set aName8 Label_1_2_2_1
###set aChild8 [NewChild D ${aLabel_Root}]
set aChild8 0:2:8
Label D ${aChild8}
SetName D ${aChild8} ${aName8}
set aName9 Label_1_2_2_2
###set aChild9 [NewChild D ${aLabel_Root}]
set aChild9 0:2:9
Label D ${aChild9}
SetName D ${aChild9} ${aName9}
set aName10 Label_1_3
###set aChild10 [NewChild D ${aLabel_Root}]
set aChild10 0:2:10
Label D ${aChild10}
SetName D ${aChild10} ${aName10}
SetNode D ${aLabel_Root}
AppendNode D ${aLabel_Root} ${aChild1}
AppendNode D ${aLabel_Root} ${aChild2}
AppendNode D ${aChild1} ${aChild3}
AppendNode D ${aChild1} ${aChild4}
AppendNode D ${aChild1} ${aChild5}
AppendNode D ${aChild2} ${aChild6}
AppendNode D ${aChild2} ${aChild7}
AppendNode D ${aChild4} ${aChild8}
AppendNode D ${aChild4} ${aChild9}
AppendNode D ${aLabel_Root} ${aChild10}
# Close/Open the transaction
NewCommand D
# Forget the attribute
ForgetAll D ${aLabel_Root}
# Close/Open the transaction
NewCommand D
# Undo-Redo-Undo
Undo D
Redo D
Undo D
# Get a value of the attribute
set IsDone [catch {InitChildNodeIterator D ${aLabel_Root} 0} aResult]
if { ${IsDone} != 0 } {
puts ${aResult}
puts "ChildNodeNextBrother for InitChildNodeIterator Doc TreeNode AllLevels=0 : Error"
return
}
ChildNodeNextBrother
set aFirstBrotherNode [ChildNodeValue]
set aFirstBrotherNode [lindex ${aFirstBrotherNode} 0]
ChildNodeNextBrother
set aSecondBrotherNode [ChildNodeValue]
set aSecondBrotherNode [lindex ${aSecondBrotherNode} 0]
if { [string first ${aChild2} ${aFirstBrotherNode}] != 0 ||
[string first ${aChild10} ${aSecondBrotherNode}] != 0} {
puts "aFirstBrotherNode=${aFirstBrotherNode} aChild2=${aChild2}"
puts "aSecondBrotherNode=${aSecondBrotherNode} aChild10=${aChild10}"
puts "ChildNodeNextBrother for InitChildNodeIterator Doc TreeNode AllLevels=0 : Error"
return
}
puts "ChildNodeNextBrother for InitChildNodeIterator Doc TreeNode AllLevels=0 : OK"
|