61c421bf |
1 | puts "================" |
2 | puts "OCC2932" |
3 | puts "================" |
4 | puts "" |
5 | ####################################################################################### |
6 | # Create Attribute Delta depending on actual change of the attribute |
7 | ####################################################################################### |
8 | # Case 11 (TDataStd_Plane) |
9 | ####################################################################################### |
10 | |
11 | # Create a new document and set UndoLimit |
e837410d |
12 | NewDocument D BinOcaf |
61c421bf |
13 | UndoLimit D 100 |
14 | |
15 | # Create a label and set attributes |
16 | NewCommand D |
17 | set Label 0:2 |
18 | |
19 | ############################################ |
20 | # Create a plane |
21 | set X 10 |
22 | set Y 20 |
23 | set Z 30 |
24 | set DX -1 |
25 | set DY 0 |
26 | set DZ 0 |
27 | plane Plane ${X} ${Y} ${Z} ${DX} ${DY} ${DZ} |
28 | ############################################ |
29 | |
30 | set Real1 300. |
31 | set Real2 400. |
32 | set modified_attribute TDataStd_Real |
33 | |
34 | ############################################ |
35 | # Set TDataStd_Plane |
36 | SetPlane D ${Label} Plane |
37 | ############################################ |
38 | |
39 | SetReal D ${Label} ${Real1} |
40 | set list [DumpCommand D] |
41 | |
42 | # Open a transaction |
43 | NewCommand D |
44 | set list [DumpCommand D] |
45 | |
46 | ############################################ |
47 | # Set old value for TDataStd_Plane |
48 | SetPlane D ${Label} Plane |
49 | ############################################ |
50 | |
51 | # Set new value for TDataStd_Real |
52 | SetReal D ${Label} ${Real2} |
53 | set list [DumpCommand D] |
54 | |
55 | # Open a transaction |
56 | NewCommand D |
57 | set list [DumpCommand D] |
58 | |
59 | # Checking |
60 | set ll [llength ${list}] |
61 | set good_length 17 |
62 | puts "length = ${ll}" |
63 | puts "good_length = ${good_length}" |
64 | |
65 | if { ${ll} != ${good_length} } { |
66 | puts "OCC2932 Error (case 1)" |
67 | } else { |
68 | set name_attribute [lindex ${list} [expr ${good_length} - 1]] |
69 | puts "name_attribute = ${name_attribute}" |
70 | puts "modified_attribute = ${modified_attribute}" |
71 | if {[string compare ${name_attribute} ${modified_attribute}] == 0} { |
72 | puts "OCC2932 OK" |
73 | } else { |
74 | puts "OCC2932 Error (case 2)" |
75 | } |
76 | } |