1#INTERFACE CAF 2# Basic attributes 3# TDataStd_RealArray 4# 5# Testing attribute: User defined (additional GUID) TDataStd_RealArray 6# 7# Testing command: SetRealArray 8# Testing command: GetRealArray 9# 10 11puts "caf001-C6" 12set QA_DUP 0 13 14# Add an attributes to a data framework 15set aFrom1 1 16set aTo1 2 17set aSetAttr11 3. 18set aSetAttr12 4. 19set aLabel 0:2 20set isDelta 0 21set aGuid1 "12e94511-6dbc-11d4-b9c8-0060b0ee281b" 22 23SetRealArray D ${aLabel} ${isDelta} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12} 24SetRealArray D ${aLabel} ${isDelta} -g ${aGuid1} ${aFrom1} ${aTo1} ${aSetAttr11} ${aSetAttr12} 25 26# Close/Open the transaction 27NewCommand D 28 29# Forget the attribute 30ForgetAll D ${aLabel} 31 32# Close/Open the transaction 33NewCommand D 34 35# Undo-Redo-Undo 36Undo D 37Redo D 38Undo D 39 40# Save Document 41Format D XmlOcaf 42set aFile ${imagedir}/caf001-C6.xml 43SaveAs D ${aFile}; 44Close D 45 46#Open a document 47Open ${aFile} D 48 49# Get a value of the attribute 50set IsGood 1 51set aMessage1 "Add TDataStd_RealArray attribute: Error" 52set aGetAttr1 [GetRealArray D ${aLabel}] 53set aLen1 [llength ${aGetAttr1}] 54set aGetAttr2 [GetRealArray D ${aLabel} ${aGuid1}] 55set aLen2 [llength ${aGetAttr2}] 56 57if { ${aLen1} != [expr ${aTo1} - ${aFrom1} + 1] } { 58 set IsGood 0 59 puts "aLen1=${aLen1}" 60 puts ${aMessage1} 61} 62if { ${aLen2} != [expr ${aTo1} - ${aFrom1} + 1] } { 63 set IsGood 0 64 puts "aLen2=${aLen2}" 65 puts ${aMessage1} 66} 67 68set aGetAttr11 [lindex ${aGetAttr1} 0] 69set aGetAttr21 [lindex ${aGetAttr2} 0] 70if { ${aGetAttr11} != ${aGetAttr21} } { 71 set IsGood 0 72 puts "aGetAttr11=${aGetAttr11}" 73 puts "aGetAttr21=${aGetAttr21}" 74 puts ${aMessage1} 75} 76set aGetAttr12 [lindex ${aGetAttr1} 1] 77set aGetAttr22 [lindex ${aGetAttr2} 1] 78if { ${aGetAttr12} != ${aGetAttr22} } { 79 set IsGood 0 80 puts "aGetAttr12=${aGetAttr12}" 81 puts "aGetAttr22=${aGetAttr22}" 82 puts ${aMessage1} 83} 84 85if { ${IsGood} == 0} { 86 puts "Add TDataStd_RealArray attribute: Error" 87} else { 88 puts "Add TDataStd_RealArray attribute: OK" 89} 90