Commit a8c02b39 authored by Russ Fish's avatar Russ Fish

Add special handling for the pc600 Wireless Cluster.

parent 6a3d122e
...@@ -51,6 +51,7 @@ my $show_exclusion = 0; ...@@ -51,6 +51,7 @@ my $show_exclusion = 0;
my $show_nodes = 1; my $show_nodes = 1;
my $building; my $building;
my $pc600wifi_bldg = "MEB-MRC600";
my $floor; my $floor;
my $image; my $image;
...@@ -497,18 +498,19 @@ sub dofloor($$) ...@@ -497,18 +498,19 @@ sub dofloor($$)
# Grab the nodes on this floor in this building. We want to know # Grab the nodes on this floor in this building. We want to know
# their allocation status so we know what colors to use. # their allocation status so we know what colors to use.
# #
my $query = "select loc.*,r.pid,r.eid,r.vname, ". my $query = "select loc.*,r.pid,r.eid,r.vname,f.feature, ".
" n.battery_voltage,n.battery_percentage, ". " n.battery_voltage,n.battery_percentage, ".
" n.destination_x,n.destination_y,n.destination_orientation ". " n.destination_x,n.destination_y,n.destination_orientation ".
" from location_info as loc ". " from location_info as loc ".
"left join reserved as r on r.node_id=loc.node_id ". "left join reserved as r on r.node_id=loc.node_id ".
"left join nodes as n on n.node_id=loc.node_id ". "left join nodes as n on n.node_id=loc.node_id ".
(defined($feature_filter)?"left join node_features as f on f.node_id=loc.node_id ":"") . "left join node_features as f on f.node_id=loc.node_id " .
"where loc.building='$building' " . "where loc.building='$building' " .
(defined($feature_filter)?" and f.feature='$feature_filter' ":"") . (defined($feature_filter)?" and f.feature='$feature_filter' ":"") .
(defined($pid) ? " and r.pid='$pid' and r.eid='$eid'" : ""); (defined($pid) ? " and r.pid='$pid' and r.eid='$eid'" : "");
my $query_result = DBQueryFatal($query . " and loc.floor='$floor'"); # Overlap dots left-to right, top-to-bottom where they are close-packed.
my $order = " order by loc.loc_x, loc.loc_y";
my $query_result = DBQueryFatal($query . " and loc.floor='$floor'" . $order );
my $newnodes_query = "select * from new_nodes ". my $newnodes_query = "select * from new_nodes ".
"where building='$building'"; "where building='$building'";
...@@ -517,7 +519,7 @@ sub dofloor($$) ...@@ -517,7 +519,7 @@ sub dofloor($$)
# When ghosting is turned on, get nodes from all floors to be overlaid. # When ghosting is turned on, get nodes from all floors to be overlaid.
my ($ghost_result, $ghost_newnodes_result); my ($ghost_result, $ghost_newnodes_result);
if ($ghost) { if ($ghost) {
$ghost_result = DBQueryFatal($query); $ghost_result = DBQueryFatal($query . $order);
$ghost_newnodes_result = DBQueryFatal($newnodes_query); $ghost_newnodes_result = DBQueryFatal($newnodes_query);
} }
...@@ -794,6 +796,12 @@ sub dofloor($$) ...@@ -794,6 +796,12 @@ sub dofloor($$)
} }
} }
} }
# Link to a special page for the pc600 Wifi Cluster nodes.
my $ispc600wifi = defined($rowref->{"feature"}) &&
$rowref->{"feature"} eq "pc600wifi";
$props->{'ISPC600WIFI'} = $ispc600wifi;
my $x2 = $x + $DOT_RAD; my $x2 = $x + $DOT_RAD;
if ($ghost && $rowref->{"floor"} != $floor) { if ($ghost && $rowref->{"floor"} != $floor) {
$err = $baseimage->Draw(stroke=>$color, strokewidth=>'1.5', $err = $baseimage->Draw(stroke=>$color, strokewidth=>'1.5',
...@@ -872,9 +880,12 @@ sub dofloor($$) ...@@ -872,9 +880,12 @@ sub dofloor($$)
if (defined($o) && (($o < 0.0 && $o > -180.0) || if (defined($o) && (($o < 0.0 && $o > -180.0) ||
($o > 180.0 && $o < 360.0))); ($o > 180.0 && $o < 360.0)));
# No labels on the pc600 wifi cluster nodes, except on their own map.
if (!$ispc600wifi || $building eq $pc600wifi_bldg) {
$err = $baseimage->Annotate(fill=>'black', x=>$lx, y=>$ly, $err = $baseimage->Annotate(fill=>'black', x=>$lx, y=>$ly,
text=>"$label"); text=>"$label");
warn "$err" if "$err"; warn "$err" if "$err";
}
$props->{"X1"} = $x - $DOT_RAD; $props->{"X1"} = $x - $DOT_RAD;
$props->{"Y1"} = $y - $DOT_RAD; $props->{"Y1"} = $y - $DOT_RAD;
...@@ -1098,12 +1109,16 @@ sub writefiles($@) ...@@ -1098,12 +1109,16 @@ sub writefiles($@)
my $isobs = $map{$nodeid}->{"ISOBS"}; my $isobs = $map{$nodeid}->{"ISOBS"};
my $descr = $map{$nodeid}->{"DESCR"}; my $descr = $map{$nodeid}->{"DESCR"};
my $isnew = $map{$nodeid}->{"ISNEW"}; my $isnew = $map{$nodeid}->{"ISNEW"};
my $ispc600wifi = $map{$nodeid}->{"ISPC600WIFI"};
my $link = ($isobs ? my $link = ($isobs ?
"showobstacle.php3?id=${nodeid}" : "showobstacle.php3?id=${nodeid}" :
($isnew ? ($isnew ?
"newnode_edit.php3?id=${isnew}" : "newnode_edit.php3?id=${isnew}" :
"shownode.php3?node_id=${nodeid}")); ($ispc600wifi ?
my $title = ($isobs ? $descr : $nodeid); "floormap.php3?building=${pc600wifi_bldg}" :
"shownode.php3?node_id=${nodeid}")));
my $title = ($isobs ? $descr :
($ispc600wifi ? "pc600 Wifi Cluster" : $nodeid));
$title .= " (vname=" . $map{$nodeid}->{'VNAME'} . ")" $title .= " (vname=" . $map{$nodeid}->{'VNAME'} . ")"
if (exists($map{$nodeid}->{'VNAME'})); if (exists($map{$nodeid}->{'VNAME'}));
......
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