| #INTERFACE CAF | |
| # Basic attributes | |
| # | |
| # Testing attribute: TDataStd_Plane | |
| # | |
| # Testing command: SetPlane | |
| # Testing command: GetPlane | |
| # | |
| puts "caf001-I2" | |
| set aTokList { :,} | |
| # Add an attribute to a data framework | |
| set aSetX1 10 | |
| set aSetY1 20 | |
| set aSetZ1 30 | |
| set aSetDX1 -1 | |
| set aSetDY1 0 | |
| set aSetDZ1 0 | |
| plane aPlane1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1} | |
| set aDumpPlane1 [dump aPlane1] | |
| # [llength ${aDumpPlane1}] = 22 | |
| # Format of ${aDumpPlane1}: | |
| # *********** Dump of aPlane1 ************* | |
| # Plane | |
| # Origin :10, 20, 30 | |
| # Axis :-1, 0, 0 | |
| # XAxis :-0, 0, -1 | |
| # YAxis :-0, -1, 0 | |
| set anOriginX_Plane1 [lindex [split [lindex ${aDumpPlane1} 7] ${aTokList}] 1] | |
| set anOriginY_Plane1 [lindex [split [lindex ${aDumpPlane1} 8] ${aTokList}] 0] | |
| set anOriginZ_Plane1 [lindex [split [lindex ${aDumpPlane1} 9] ${aTokList}] 0] | |
| set anAxisDX_Plane1 [lindex [split [lindex ${aDumpPlane1} 11] ${aTokList}] 1] | |
| set anAxisDY_Plane1 [lindex [split [lindex ${aDumpPlane1} 12] ${aTokList}] 0] | |
| set anAxisDZ_Plane1 [lindex [split [lindex ${aDumpPlane1} 13] ${aTokList}] 0] | |
| set aLabel 0:2 | |
| SetPlane D ${aLabel} aPlane1 | |
| # Close/Open the transaction | |
| NewCommand D | |
| # Set a new value of the attribute | |
| set aSetX2 -10 | |
| set aSetY2 -20 | |
| set aSetZ2 -30 | |
| set aSetDX2 0 | |
| set aSetDY2 -1 | |
| set aSetDZ2 0 | |
| plane aPlane3 ${aSetX2} ${aSetY2} ${aSetZ2} ${aSetDX2} ${aSetDY2} ${aSetDZ2} | |
| SetPlane D ${aLabel} aPlane3 | |
| # Close/Open the transaction | |
| NewCommand D | |
| # Undo | |
| Undo D | |
| # Get a value of the attribute | |
| GetPlane D ${aLabel} aPlane4 | |
| set aDumpPlane4 [dump aPlane4] | |
| set anOriginX_Plane4 [lindex [split [lindex ${aDumpPlane4} 7] ${aTokList}] 1] | |
| set anOriginY_Plane4 [lindex [split [lindex ${aDumpPlane4} 8] ${aTokList}] 0] | |
| set anOriginZ_Plane4 [lindex [split [lindex ${aDumpPlane4} 9] ${aTokList}] 0] | |
| set anAxisDX_Plane4 [lindex [split [lindex ${aDumpPlane4} 11] ${aTokList}] 1] | |
| set anAxisDY_Plane4 [lindex [split [lindex ${aDumpPlane4} 12] ${aTokList}] 0] | |
| set anAxisDZ_Plane4 [lindex [split [lindex ${aDumpPlane4} 13] ${aTokList}] 0] | |
| if { ${anOriginX_Plane1} != ${anOriginX_Plane4} || | |
| ${anOriginY_Plane1} != ${anOriginY_Plane4} || | |
| ${anOriginZ_Plane1} != ${anOriginZ_Plane4} || | |
| ${anAxisDX_Plane1} != ${anAxisDX_Plane4} || | |
| ${anAxisDY_Plane1} != ${anAxisDY_Plane4} || | |
| ${anAxisDZ_Plane1} != ${anAxisDZ_Plane4} } { | |
| puts "anOriginX_Plane1=${anOriginX_Plane1} anOriginX_Plane4=${anOriginX_Plane4}" | |
| puts "anOriginY_Plane1=${anOriginY_Plane1} anOriginY_Plane4=${anOriginY_Plane4}" | |
| puts "anOriginZ_Plane1=${anOriginZ_Plane1} anOriginZ_Plane4=${anOriginZ_Plane4}" | |
| puts "anAxisDX_Plane1=${anAxisDX_Plane1} anAxisDX_Plane4=${anAxisDX_Plane4}" | |
| puts "anAxisDY_Plane1=${anAxisDY_Plane1} anAxisDY_Plane4=${anAxisDY_Plane4}" | |
| puts "anAxisDZ_Plane1=${anAxisDZ_Plane1} anAxisDZ_Plane4=${anAxisDZ_Plane4}" | |
| puts "Set a value of TDataStd_Plane attribute: Error" | |
| return | |
| } | |
| puts "Set a value of TDataStd_Plane attribute: OK" |