To test the algorithm of the equal extending polygon is not very easy.
There are
three ways to do the it,
A. General test at user's
level
--textWS,
start the text workstation;
--Configure
a Proximity Product under the Editor GUI of
"Alarm/Alert and Proximity Alarm Product". For example,
"DENSPENES Alarm None AOR+50KM";
--Click
on "Save & Exit" to effect the configuration;
--Wait
until catched a DENSPENES product;
--Display
the warning product in the "Current Alerm Queue" to
see if the lat-long polygon in this message is a complex one,
succh as is there any concave vertex. If so, the code works
basicly.
Please
reference to
http://www-sdd.fsl.noaa.gov/~jing/d2d/padesign.html
for how
to using the PA monitor.
B. Black box test
You can
configure "AOR+distance" and give message with a complex
lat-long
polygon in the testPAMonitor.tcl, the test driver.
--copy
the testPAMonitor.tcl under $FXA_HOME/bin/;
--Modify
the last line of the textPAMonitor.tcl, the PA GUI code,
from "#source &env(FXA_HOME)/bin/testPAMonitor.tcl"
to "source &env(FXA_HOME)/bin/testPAMonitor.tcl".
So, the test driver will be called.
--Run
the PA monitor with,
textPAWish textPAMonitor.tcl
--See
the test result
The given polygon is extended and matched AOR if
"...Extend polygon equally.
...
matchResult= 1"
is dispaied.
For example,
-----------------------------------------------------------------------------
lothar$ textPAWish textPAMonitor.tcl
textPAWish 2983 20:42:15.174 InfoFileServer.C 132 VERBOSE: default
path:
/scratch/ws4-fslt/jing/linux5.1.2/linux/D-2D/data/localizationDataSets/FSL/
textPAWish 2983 20:42:15.175 InfoFileServer.C 132 VERBOSE: default
path:
/scratch/ws4-fslt/jing/linux5.1.2/linux/D-2D/data/localization/nationalData/
textPAWish 2983 20:42:15.175 InfoFileServer.C 132 VERBOSE: default
path:
/scratch/ws4-fslt/jing/linux5.1.2/linux/D-2D/data/
textPAWish 2983 20:42:15.175 InfoFileServer.C 132 VERBOSE: default
path:
textPAWish 2983 20:42:15.261 textPAWish.C 170 EVENT: textPAWish 2983
app
initialized
textPAWish 2983 20:42:15.266 TclLogStream.C 52 PROBLEM: File
/scratch/ws4-fslt/jing/linux5.1.2/linux/D-2D/data/localizationDataSets/FSL/textP
AActions.txt is not existing!
textPAWish 2983 20:42:15.271 PaAlarmAOR.C 182 DEBUG: Configure
PA area to AOR+
distand: 500
textPAWish 2983 20:42:15.280 PaAlarmAOR.C 983 DEBUG: Extend polygon
equally.
textPAWish 2983 20:42:15.310 PaAlarmAOR.C 798 DEBUG: Matched
BOU
textPAWish 2983 20:42:15.310 PaAlarmAOR.C 798 DEBUG: Matched
GJT
textPAWish 2983 20:42:15.310 PaAlarmAOR.C 798 DEBUG: Matched
CYS
textPAWish 2983 20:42:15.310 PaAlarmAOR.C 798 DEBUG: Matched
RIW
matchResult= 1
lothar$
----------------------------------------------------------------------------
--How to set lat-long polygon in the testPAMonitor.tcl
The messagePolygon13, messagePolygon14, messagePolygon15
and messagePolygon16 are the example data for test the
code. You can change the message #(13 to 16) and the
extand distance ("AOR+500KM") in the
proc testPolygonExt {} {...}
to using the data messages.
For example,
proc testPolygonExt { } {
global messagePolygon15
setAORConfig "AOR+800KM"
set matchResult [matchArea $messagePolygon15]
puts stdout "\nmatchResult= $matchResult"
}
Also, you can create new case data, your polygons.
The polygon should with concave vertice,
but self-intersecting.
Using the D2D baseline editor is a way to interactively
draw a lat-long poligon and get data from the baseline files.
The format of the lat-long polygon is from WRP107.
C. White box test
Same as
the black test, but you should review the codes of files,
PaAlarmAOR.H
PaAlarmAOR.C
textPAWish.C
textPAMonitor.tcl.
and insert
"printf(...)" in,
searchPolygon()
matchAORExtention()
equalExtendPolygon()
cutCorners()
concaveProcess()
polygonConcave()
isPointInPolygon()
to see
if the code works correctly.
This is
hard, I always do the test with this way during the
algorithm
development, and used a lot of case data.
I hope you do the C test if you have
enough time, because it is helpful to
me to improve the algorithm if you can
figure out some bugs.
I'm working on a paper, the "Equal Extending
Polygon and Proximity Alarm".
There is no good way to help you review
the code before the paper is done,
since the inline documetation is not
good enough to understand, we need
some pictures which will appear in the
paper. Otherwise, you can come
to FSL, we can discusss this algorithm.
Please lot me know if you have any question.
Thanks
Xiangbao Jing