Design: 04.02.01.02/P11
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 11: Appearance of bundled attributes
CHARACTERISTICS: ynny
OPERATOR SCRIPT:
MANDATORY LINETYPES: This screen should display examples of each
of the mandatory linetypes actually supported by the
implementation. You should not consider whether all 4 are
present, but simply whether each linestyle is recognizable from
the verbal description. Enter a list of integers which identify
the linetypes in the same order as they appear in the prompt.
NON-MANDATORY REGISTERED LINETYPES: This screen displays a sample
of supported registered linetypes (at most 8). For each
displayed line, look up its linetype identifier in the ISO
register and verify that the actual appearance of the line agrees
with the ISO specification.
IMPLEMENTOR DEFINED LINETYPES: This screen displays a sample of
implementor defined linetypes (at most 8). For each displayed
line, look up its linetype identifier in the implementor's
documentation and verify that the actual appearance of the line
agrees with the specification.
VARIOUS LINEWIDTH SCALE FACTORS: Several numbered pairs of
rectangles are drawn. Compare the vertical sizes for each pair.
One pair should have the same size for both members. Although
the program tries to line up the bottom of the rectangles, there
is no requirement that they be aligned, so judge only according
to size.
POSITIVE LINEWIDTH BELOW MINIMUM: as above, for VARIOUS LINEWIDTH
SCALE FACTORS.
NEGATIVE LINEWIDTH: as above, for VARIOUS LINEWIDTH SCALE
FACTORS.
POSITIVE LINEWIDTH ABOVE MAXIMUM: as above, for VARIOUS LINEWIDTH
SCALE FACTORS.
DEFINED POLYLINE COLOR INDICES: All lines but one are drawn in
the background color. Identify the single line drawn in the
default foreground color.
UNDEFINED POLYLINE COLOR INDICES: A star is drawn with several
horizontal lines beneath it. Normally, all of these will be the
same color as the star. Count up and report the number of lines
which match the star in color.
DESIGN:
set all ASFs to BUNDLED
use <inquire polyline facilities> to determine:
numlt = number of available linetypes
lavslt = list of available standard linetypes
lavrlt = list of available registered (non-mandatory) linetypes
lavilt = list of available implementor-defined linetypes
(may be derived directly from linetype value, if reported
number of linetypes < 0)
numlw = number of available line-widths
nomlw = nominal line-width (DC)
minlw,maxlw = minimum,maximum line-width (DC)
use <inquire workstation state table lengths> to determine:
szbt = size of polyline bundle table
*** *** *** linetype
Use default background color=0, foreground=1
stddx = size of lavslt
for ix = 1, stddx
<set polyline representation>:
index = ix
linetype = ixth entry in lavslt
linewidth = 1.0
color = 1
next ix
Display in random order bundles 1 thru stddx
TEST: #SR 3 4 5 6 35 36
"The mandatory linetypes (1-4) should be recognizable from
their standard description."
OPQA/MANDATORY LINETYPES: List, in order, the numeric labels for
linetypes: solid, dotted, dashed, dotted-dashed.
pass/fail depending on (all displayed linetypes correctly identified)
regdx = size of lavrlt
if regdx < 1 skip to neg_type
numdis = min(regdx, 8, szbt)
lindis = numdis entries, randomly chosen from lavrlt
for ix = 1, numdis
<set polyline representation>:
index = ix
linetype = ixth entry in lindis
linewidth = 1.0
color = 1
next ix
display in order and label bundles 1 thru numdis
TEST: #SR 3 4 5 6 35 37
"The registered non-mandatory linetypes (> 4) should agree
with their registered description."
OPQA/NON-MANDATORY REGISTERED LINETYPES: Is each linetype
depicted according to its numeric identifier's specification in
the ISO register?
pass/fail depending on (operator responds "yes")
neg_type:
impdx = size of lavilt
if impdx < 1 goto end_linetype
numdis = min(impdx, 8, szbt)
lindis = numdis entries, randomly chosen from lavilt
for ix = 1, numdis
<set polyline representation>:
index = ix
linetype = ixth entry in lindis
linewidth = 1.0
color = 1
next ix
display in order and label bundles 1 thru numdis
TEST: #SR 3 4 5 6 35 38
"Implementor-defined linetypes (< 1) should agree with the
descriptions supplied by the implementor."
OPQA/IMPLEMENTOR DEFINED LINETYPES: Is each linetype depicted
according to its numeric identifier's specification in the
implementor documentation?
pass/fail depending on (operator responds "yes")
end_linetype:
*** *** *** line-width
from dialog common:
wcpdc = WC unit / DC unit
qvis = minimum distinguishable length in DC-units
Are there at least two visually distinguishable line-widths?
if (numlw = 1) or
(maxlw <= 1.02 * minlw) or
(maxlw-minlw < qvis) then
only one distinguishable:
tstlw1 = first linewidth to be tested = maxlw
tstlw2 = last linewidth to be tested = tstlw1
mult = 2
else
tstlw1 = first linewidth to be tested = minlw
tstlw2 = last linewidth to be tested = maxlw
if (numlw = 0) then
continuous range of linewidths available - take 4 geometric steps
mult = 0.9999 * ((tstlw2/tstlw1) ** 0.25)
else
discrete set of linewidths available - test min/max only
mult = 0.9999 * (tstlw2/tstlw1)
endif
endif
numpas = 0 = number of tests passed so far
thislw = tstlw1
loop thru various linewidths
next_lw:
OPQA/VARIOUS LINEWIDTH SCALE FACTORS: invoke SHPLBW subroutine to
test bundle with requested line width = thislw
expected line width = thislw
if abort indicated
if (numpas < 2) then
message about linewidth too big for the screen
goto min_max_coerce
else
goto do_test_msg
endif
elseif failure indicated
numpas = 0
goto do_test_msg
endif
numpas = numpas+1
set up for next linewidth to be tested:
thislw = thislw * mult
if thislw <= tstlw2 goto next_lw
do_test_msg:
TEST: #SR 3 4 5 6 42 43 44
"Available linewidth scale factors should control the
realized thickness of a polyline."
pass/fail depending on (numpas > 0)
min_max_coerce:
TEST: #SR 3 4 5 6 42 43 45
"A requested positive linewidth scale factor below the
minimum available should be realized as the minimum."
OPQA/POSITIVE LINEWIDTH BELOW MINIMUM: invoke subroutine SHPLBW
to test bundle with requested line width = minlw/2
expected line width = minlw
pass/fail depending on return code from SHPLBW
TEST: #SR 3 4 5 6 42 43 45
"A requested negative linewidth scale factor should be
realized as the minimum."
OPQA/NEGATIVE LINEWIDTH: invoke subroutine SHPLBW to test
bundle with requested line width = -maxlw-100
expected line width = minlw
pass/fail depending on return code from SHPLBW
OPQA/POSITIVE LINEWIDTH ABOVE MAXIMUM: invoke subroutine SHPLBW
to test requested line width = maxlw*2
expected line width = maxlw
if abort indicated
message about line width too big for the screen
else
TEST: #SR 3 4 5 6 42 43 45
"A requested linewidth scale factor above the maximum
available should be realized as the maximum."
pass/fail depending on return code from SHPLBW
endif
*** *** *** polyline color index
TEST: #SR 3 4 5 6 46 47 48
"A defined polyline color index should cause the addressed
entry in the color table to be used when rendering a
polyline."
bckcol = background color = realized color spec for entry #0
forcol = foreground color = realized color spec for entry #1
szcolt = maximum size of color table (including entry #0)
numdis = number of lines to be drawn = min(8, szcolt, szbt)
lncol = random permutation of #0,#1, and numdis-2 random choices
from entries #2 to #szcolt-1
visdx = from lncol, randomly select an entry to be made visible
but not the one that contains 0, since this may not be
re-settable.
for ix = 1 to numdis
set entry lncol(ix) in color table to bckcol
<set polyline representation>:
index = ix
linetype = 1
linewidth = 1.0
color = lncol(ix)
next ix
set entry lncol(visdx) in color table to forcol
Display bundles 1 thru numdis and label them
OPQA/DEFINED POLYLINE COLOR INDICES: which line is visible?
pass/fail depending on (response = line colored by visdx)
end_def_col:
TEST: #SR 3 4 5 6 46 47 49
"An undefined polyline color index should cause entry
number 1 in the color table to be used when rendering a
polyline."
set entry #1 in color table opposite from BCKCOL
set entry #1 different from FORCOL - make sure undefined default
to *current* color-rep of #1, not just a predefined color.
explct = number of explicit lines of color #1 = random integer
from 0 to min(4, szbt-3)
u1,u2,u3 = 3 undefined, positive color indices - all greater
than maximum defined entry in color table
draw star with color #1
set up bundles 1 thru 3 to linestyle=1, width=1, color index= undf(1,2,3)
set up bundles 4 thru (explct+3) to linestyle=1, width=1, color index=1
display in random order bundles #1 thru explct+3
OPQA/UNDEFINED POLYLINE COLOR INDICES: how many lines are the
same color as the star?
pass/fail depending on response = 3+explct
END PROGRAM 11