Commit 5713fac4 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Two wireless changes:

* On the shownode page include the channels that a wireless interface
  is currently set to, by looking at the interface_settings table. So,
  if you click on an allocated node in the wireless map, you can see
  what channels it is using.

  Still to be done; map between a channel number and a frequency.

* On the floormap page, create a small table at the top of the page,
  listing what frequencies are in use on each floor. This is rather
  primitive of course, especially the part where I assume we have just
  one building, but it will do for now.

This is not complete. We probably need some sense of scale on the
parent e2d292dc
......@@ -64,6 +64,28 @@ else {
# Figure out what channels are in use for the current building. We only
# have one building (MEB) at the moment, so this is quite easy.
$channels = array();
$query_result =
DBQueryFatal("select loc.*,s.capval from location_info as loc ".
"left join interface_settings as s on ".
" s.node_id=loc.node_id and s.capkey='channel'");
while ($row = mysql_fetch_array($query_result)) {
$channel = $row["capval"];
$node_id = $row["node_id"];
$locfloor = $row["floor"];
if (!isset($channel))
$channels[$locfloor][$channel] = $channel;
# Run the script. It will produce two output files; an image and an areamap.
# We want to embed both of these images into the page we send back. This
......@@ -175,6 +197,23 @@ else {
Click on the dots below to see information about the node\n";
if (count($channels)) {
echo "<br><br>
<table align=center border=2 cellpadding=0 cellspacing=2>
<tr><th>Floor</th><th>Channels in Use</th></tr>\n";
while (list($floor, $chanlist) = each($channels)) {
echo "<tr><td>$floor</td>\n";
echo " <td>";
echo implode(",", array_keys($chanlist));
echo " </td>
echo "</table>\n";
# Image
echo "<img src=\"floormap_aux.php3?prefix=$uniqueid\" usemap=\"#floormap\">
......@@ -1978,12 +1978,16 @@ function SHOWNODE($node_id, $flags = 0) {
echo "<tr><th>Interface</th><th>Model; protocols</th>\n";
$query_result =
DBQueryFatal("select i.*,it.*,c.* from interfaces as i ".
DBQueryFatal("select i.*,it.*,c.*,s.capval as channel ".
" from interfaces as i ".
"left join interface_types as it on ".
" i.interface_type=it.type ".
"left join interface_capabilities as c on ".
" i.interface_type=c.type and ".
" c.capkey='protocols' ".
"left join interface_settings as s on ".
" s.node_id=i.node_id and s.iface=i.iface and ".
" s.capkey='channel' ".
"where i.node_id='$node_id' and ".
" i.role='" . TBDB_IFACEROLE_EXPERIMENT . "'".
"order by iface");
......@@ -1994,9 +1998,16 @@ function SHOWNODE($node_id, $flags = 0) {
$man = $row["manufacturuer"];
$model = $row["model"];
$protocols = $row["capval"];
$channel = $row["channel"];
if (isset($channel)) {
$channel = " (channel $channel)";
$channel = "";
echo "<tr>
<td>$iface:&nbsp </td>
<td>$iface:&nbsp $channel</td>
<td class=left>$type ($man $model; $protocols)</td>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment