|
From: <il...@pr...> - 2005-02-16 10:52:56
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20274 Modified Files: map4b.php Log Message: For interfaces running as access points (i.e. those without peers entered), show only the portion of the circle that represents the direction in which radiation is being emitted (based on the recorded direction and spread). Partial ImageArc was buggy in old versions of GD/PHP but appears to be reliable now. Index: map4b.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/map4b.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- map4b.php 9 May 2004 03:32:30 -0000 1.4 +++ map4b.php 16 Feb 2005 10:52:46 -0000 1.5 @@ -91,12 +91,17 @@ .",e" .",n" .",active" + .",antspread" + .",direction" ." FROM" ." netloc" + .",config" .",admin" .",physloc" ." WHERE" - ." physloc.nodeid = netloc.nodeid AND admin.nodeid = netloc.nodeid" + ." physloc.nodeid = netloc.nodeid" + ." AND admin.nodeid = netloc.nodeid" + ." AND config.nodeid = netloc.nodeid" ." AND" ." peerid is null" ." AND" @@ -109,8 +114,20 @@ $result = mysql_query($q, $db) or die(mysql_error($db)); while ($row = mysql_fetch_assoc($result)) { + if (isset($row["antspread"]) + && (isset($row["direction"]) || intval($row["antspread"] == 360))) { + $start = intval($row["direction"]) - 90 - intval($row["antspread"]) / 2; + $end = intval($row["direction"]) - 90 + intval($row["antspread"]) / 2; + if ($start < 0) { + $start += 360; + $end += 360; + } + } else { + $start = 0; + $end = 360; + } list($x,$y) = coord(doubleval($row["e"]), doubleval($row["n"])); - ImageArc($im, $x,$y, 10, 10, 0, 360, + ImageArc($im, $x,$y, 10, 10, $start, $end, intval($row["active"]) ? $LIGHTBLUE : $LIGHTGREY); plotx($im, $x, $y, $RED, $row["nodename"], $BLACK); } |