...
 
Commits (1)
  • Gary Wong's avatar
    Add CalculateWirelessStatus() function. · 5511a8ec
    Gary Wong authored
    Intended to estimate Powder wireless resources to appear on the front page.
    This is HORRIBLY quick and dirty and definitely needs to be thrown away.
    It estimates the number of OAI experiments (1 SDR + 1 OTS UE) that could
    be accommodated as a stopgap measure for the tech preview demo.  It must
    be replaced before we have real wireless sites installed.
    5511a8ec
......@@ -1097,6 +1097,53 @@ function CalculateAggregateStatus(&$amlist, &$fedlist, &$status,
}
}
function CalculateWirelessStatus() {
$result = array();
$query_result =
DBQueryFatal( "SELECT COUNT(DISTINCT w.node_id1) AS c FROM wires AS w " .
"LEFT OUTER JOIN reserved AS r1 ON " .
"w.node_id1=r1.node_id LEFT OUTER JOIN reserved AS r2 " .
"ON w.node_id2=r2.node_id WHERE w.node_id1 LIKE 'nuc%' " .
"AND w.node_id2 LIKE 'ue%' AND w.external_wire IS NULL" .
"OR w.external_wire=''" );
$row = mysql_fetch_array( $query_result );
$radiated1 = $row[ 'c' ];
$query_result =
DBQueryFatal( "SELECT COUNT(DISTINCT w.node_id2) FROM wires AS w " .
"LEFT OUTER JOIN reserved AS r1 ON " .
"w.node_id1=r1.node_id LEFT OUTER JOIN reserved AS r2 " .
"ON w.node_id2=r2.node_id WHERE w.node_id2 LIKE 'nuc%' " .
"AND w.node_id1 LIKE 'ue%' AND w.external_wire IS NULL" .
"OR w.external_wire=''" );
$row = mysql_fetch_array( $query_result );
$radiated2 = $row[ 'c' ];
$query_result =
DBQueryFatal( "SELECT COUNT(DISTINCT w.node_id1) FROM wires AS w " .
"LEFT OUTER JOIN reserved AS r1 ON " .
"w.node_id1=r1.node_id LEFT OUTER JOIN reserved AS r2 " .
"ON w.node_id2=r2.node_id WHERE w.node_id1 LIKE 'nuc%' " .
"AND w.node_id2 LIKE 'ue%' AND w.external_wire != ''" );
$row = mysql_fetch_array( $query_result );
$controlled1 = $row[ 'c' ];
$query_result =
DBQueryFatal( "SELECT COUNT(DISTINCT w.node_id2) FROM wires AS w " .
"LEFT OUTER JOIN reserved AS r1 ON " .
"w.node_id1=r1.node_id LEFT OUTER JOIN reserved AS r2 " .
"ON w.node_id2=r2.node_id WHERE w.node_id2 LIKE 'nuc%' " .
"AND w.node_id1 LIKE 'ue%' AND w.external_wire != ''" );
$row = mysql_fetch_array( $query_result );
$controlled2 = $row[ 'c' ];
return array(
"radiated" => $radiated1 + $radiated2;
"controlled" => $controlled1 + $controlled2;
);
}
function SpitAggregateStatus($extended = false) {
$amlist = array();
$fedlist = array();
......