f0cddd16 |
1 | puts "===========" |
2 | puts "OCC27530" |
3 | puts "===========" |
4 | puts "" |
5 | ########################################################################## |
6 | # Visualization - AIS_InteractiveContext::HilightNextDetected() doesn't work in Neutral Point |
7 | ########################################################################## |
8 | |
9 | proc check_highlighting { theHiBoxIdx theCoords } { |
10 | set aNext [expr ($theHiBoxIdx + 1) % 3] |
11 | set aNextNext [expr ($theHiBoxIdx + 2) % 3] |
12 | set hiColor [vreadpixel [lindex $theCoords [expr $theHiBoxIdx * 2] ] [lindex $theCoords [expr $theHiBoxIdx * 2 + 1] ] name] |
13 | set nextColor [vreadpixel [lindex $theCoords [expr $aNext * 2] ] [lindex $theCoords [expr $aNext * 2 + 1] ] name] |
14 | set nextNextColor [vreadpixel [lindex $theCoords [expr $aNextNext * 2] ] [lindex $theCoords [expr $aNextNext * 2 + 1] ] name] |
15 | |
aaf8d6a9 |
16 | if {$hiColor == "CYAN 1" && $nextColor == "YELLOW 1" && $nextNextColor == "YELLOW 1"} { |
f0cddd16 |
17 | return true |
18 | } else { |
19 | return false |
20 | } |
21 | } |
22 | |
23 | pload VISUALIZATION MODELING |
24 | |
25 | box b0 3 3 3 |
26 | box b1 1 1 1 3 2 1 |
27 | box b2 1.5 1.5 1.5 4 4 4 |
28 | |
29 | set coords { } |
30 | # b0_x, b0_y |
31 | lappend coords 355 |
32 | lappend coords 186 |
33 | # b1_x, b1_y |
34 | lappend coords 266 |
35 | lappend coords 333 |
36 | # b2_x, b2_y |
37 | lappend coords 177 |
38 | lappend coords 2 |
39 | |
40 | vinit |
41 | vclear |
42 | vdisplay b0 b1 b2 |
43 | vleft |
44 | vfit |
45 | |
46 | # MoveTo in area that is common for all boxes |
47 | vmoveto 210 280 |
48 | |
49 | if { ![check_highlighting 0 $coords] } { |
50 | puts "ERROR: incorrect highlighting of box b0" |
51 | } |
52 | |
53 | # check vselnext |
54 | vselnext |
55 | if { ![check_highlighting 1 $coords] } { |
56 | puts "ERROR: incorrect highlighting of box b1 after vselnext call" |
57 | } |
58 | vselnext |
59 | if { ![check_highlighting 2 $coords] } { |
60 | puts "ERROR: incorrect highlighting of box b2 after vselnext call" |
61 | } |
62 | vselnext |
63 | if { ![check_highlighting 0 $coords] } { |
64 | puts "ERROR: incorrect highlighting of box b0 after vselnext call" |
65 | } |
66 | |
67 | # check vselprev |
68 | vselprev |
69 | if { ![check_highlighting 2 $coords] } { |
70 | puts "ERROR: incorrect highlighting of box b2 after vselprev call" |
71 | } |
72 | vselprev |
73 | if { ![check_highlighting 1 $coords] } { |
74 | puts "ERROR: incorrect highlighting of box b1 after vselprev call" |
75 | } |
76 | vselprev |
77 | if { ![check_highlighting 0 $coords] } { |
78 | puts "ERROR: incorrect highlighting of box b0 after vselprev call" |
79 | } |