Design: 04.03.02.01/P04
This is an abstract, language-independent design. Grim
details may be found in the
corresponding source code.
You may return to the
documentation
for the module containing this program design, or to the
entire hierarchical table of
topics covered by the PVT.
PROGRAM 4: Simultaneous use of all color table entries
CHARACTERISTICS: ynny
OPERATOR SCRIPT:
USE OF ENTIRE COLOUR TABLE: Five of the six labelled squares
should contain a square grid of polymarkers of a single color.
Identify the square containing a different display.
DESIGN:
inquire color representation #0 as realized to determine
bckcol = background color
inquire color representation #1 as realized to determine
forcol = foreground color
inquire workstation state table lengths to determine
colsiz = number of settable entries in color table
maxci = maximum color index = colsiz-1
TEST: #SR 1 2 7
"All the entries within the reported size of the color
table should be usable and effective."
set all even entries = background color
odd entries = foreground color:
for ix = 2 to maxci by 2
set color representation for #ix to bckcol
next ix
for ix = 3 to maxci by 2
set color representation for #ix to forcol
next ix
sqside = integer number of polymarkers per side of square array
= sqrt(colsiz/4 + 1) + 1
(this ensures all color slots will be used)
side1 = 0.1
side2 = 0.9
sqinc = increment for square = (side2-side1) / (sqside-1)
mrksiz = polymarker size in WC = min(0.05, 0.1 * sqinc)
set polymarker size = mrksiz (in WC)
set polymarker style = plus (+)
(this prevents overwriting by markers in the background color)
divide screen up into six labelled square areas
perm = randomize order from 1 to 6
nxtcol = next color index to use = 0
for ix = 1 to 6
window = perm(ix)
set tranformation to scale unit square into this window
if (window = 1) then
simulate incorrect display:
ngsq = window
set polymarker color = 1
siz = 0
for xloc = side1 to (side2 + 0.5*sqinc) by sqinc
for yloc = side1 to (side2 + 0.5*sqinc) by sqinc
siz = siz+1
xa(siz) = xloc
ya(siz) = yloc
next yloc
next xloc
put a polymarker at a non-aligned position:
siz = siz+1
xa(siz) = side1 + sqinc * ((random integer from 0 to sqside-2) + 0.5)
ya(siz) = side1 + sqinc * ((random integer from 0 to sqside-2) + 0.5)
display polymarker: siz, xa,ya
elseif (window = 2) then
simulate correct display:
set polymarker color = 1
siz = 0
for xloc = side1 to (side2 + 0.5*sqinc) by sqinc
for yloc = side1 to (side2 + 0.5*sqinc) by sqinc
siz = siz+1
xa(siz) = xloc
ya(siz) = yloc
next yloc
next xloc
display polymarker: siz, xa,ya
else
draw an actual grid:
for xloc = side1 to (side2 + 0.5*sqinc) by sqinc
for yloc = side1 to (side2 + 0.5*sqinc) by sqinc
visible aligned marker:
if (nxtcol < maxci) then
nxtcol = nxtcol+1
else
nxtcol = 1
endif
set polymarker color = nxtcol
xa(1) = xloc
ya(1) = yloc
display single polymarker: xa,ya
invisible mis-aligned marker:
if (nxtcol < maxci) then
nxtcol = nxtcol+1
else
nxtcol = 0
endif
set polymarker color = nxtcol
xa(1) = side1 + sqinc * ((random integer from 0 to sqside-2) +
random from 0.3 to 0.7)
ya(1) = side1 + sqinc * ((random integer from 0 to sqside-2) + )
random from 0.3 to 0.7)
display single polymarker: xa,ya
next yloc
next xloc
endif
next ix
OPQA/USE OF ENTIRE COLOUR TABLE: Which area does NOT contain a
<sqside> by <sqside> square grid of polymarkers of a single
colour?
pass/fail depending on (operator response = ngsq)
END PROGRAM 4