All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 0b016a54 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Pass building/floor around so that Robot tracker can operate on other

areas.
parent 7300d5f7
......@@ -38,7 +38,7 @@ public class RoboTrack extends JApplet {
static final SimpleDateFormat TIME_FORMAT =
new SimpleDateFormat("hh:mm:ss");
static final Date now = new Date();
String uid, auth;
String uid, auth, building, floor;
boolean shelled = false;
/*
......@@ -55,10 +55,12 @@ public class RoboTrack extends JApplet {
URLConnection uc;
/* Get our parameters then */
uid = this.getParameter("uid");
auth = this.getParameter("auth");
pipeurl = this.getParameter("pipeurl");
baseurl = this.getParameter("floorurl");
uid = this.getParameter("uid");
auth = this.getParameter("auth");
pipeurl = this.getParameter("pipeurl");
baseurl = this.getParameter("floorurl");
building = this.getParameter("building");
floor = this.getParameter("floor");
pixels_per_meter = Double.parseDouble(this.getParameter("ppm"));
// form the URL that we use to get the background image
......@@ -1387,6 +1389,8 @@ public class RoboTrack extends JApplet {
*/
public boolean GetNodeInfo() {
String urlstring = "nodeinfo.php3?fromapplet=1"
+ "&floor=" + floor
+ "&building=" + building
+ "&nocookieuid="
+ URLEncoder.encode(uid)
+ "&nocookieauth="
......@@ -1458,6 +1462,8 @@ public class RoboTrack extends JApplet {
*/
public boolean GetObstacles() {
String urlstring = "obstacles.php3?fromapplet=1"
+ "&floor=" + floor
+ "&building=" + building
+ "&nocookieuid="
+ URLEncoder.encode(uid)
+ "&nocookieauth="
......@@ -1528,6 +1534,8 @@ public class RoboTrack extends JApplet {
*/
public boolean GetCameras() {
String urlstring = "cameras.php3?fromapplet=1"
+ "&floor=" + floor
+ "&building=" + building
+ "&nocookieuid="
+ URLEncoder.encode(uid)
+ "&nocookieauth="
......
......@@ -261,7 +261,8 @@ if ($isadmin || TBWebCamAllowed($uid)) {
echo " <a href=webcam.php3>Webcam View</a> (Updated in real time)";
echo " <br>\n";
}
echo " <a href=robotrack/robotrack.php3>Track robots in real time</a>";
echo " <a href=robotrack/robotrack.php3?building=${building}&floor=${floor}>".
"Track robots in real time</a>";
echo " <br>\n";
if (isset($map_x) && isset($map_y)) {
......
......@@ -14,10 +14,22 @@ $uid = GETLOGIN();
LOGGEDINORDIE($uid);
#
# One robot map right now ...
#
$building = "MEB-ROBOTS";
$floor = 4;
# Verify page arguments. Allow user to optionally specify building/floor.
#
if (isset($building) && $building != "") {
# Sanitize for the shell.
if (!preg_match("/^[-\w]+$/", $building)) {
PAGEARGERROR("Invalid building argument.");
}
# Optional floor argument. Sanitize for the shell.
if (isset($floor) && !preg_match("/^[-\w]+$/", $floor)) {
PAGEARGERROR("Invalid floor argument.");
}
}
else {
$building = "MEB-ROBOTS";
$floor = 4;
}
# Initial goo.
header("Content-Type: text/plain");
......
......@@ -14,10 +14,22 @@ $uid = GETLOGIN();
LOGGEDINORDIE($uid);
#
# One robot map right now ...
#
$building = "MEB-ROBOTS";
$floor = 4;
# Verify page arguments. Allow user to optionally specify building/floor.
#
if (isset($building) && $building != "") {
# Sanitize for the shell.
if (!preg_match("/^[-\w]+$/", $building)) {
PAGEARGERROR("Invalid building argument.");
}
# Optional floor argument. Sanitize for the shell.
if (isset($floor) && !preg_match("/^[-\w]+$/", $floor)) {
PAGEARGERROR("Invalid floor argument.");
}
}
else {
$building = "MEB-ROBOTS";
$floor = 4;
}
# Initial goo.
header("Content-Type: text/plain");
......
......@@ -14,10 +14,22 @@ $uid = GETLOGIN();
LOGGEDINORDIE($uid);
#
# One robot map right now ...
#
$building = "MEB-ROBOTS";
$floor = 4;
# Verify page arguments. Allow user to optionally specify building/floor.
#
if (isset($building) && $building != "") {
# Sanitize for the shell.
if (!preg_match("/^[-\w]+$/", $building)) {
PAGEARGERROR("Invalid building argument.");
}
# Optional floor argument. Sanitize for the shell.
if (isset($floor) && !preg_match("/^[-\w]+$/", $floor)) {
PAGEARGERROR("Invalid floor argument.");
}
}
else {
$building = "MEB-ROBOTS";
$floor = 4;
}
# Initial goo.
header("Content-Type: text/plain");
......
......@@ -14,10 +14,22 @@ $uid = GETLOGIN();
LOGGEDINORDIE($uid);
#
# One robot map right now ...
#
$building = "MEB-ROBOTS";
$floor = 4;
# Verify page arguments. Allow user to optionally specify building/floor.
#
if (isset($building) && $building != "") {
# Sanitize for the shell.
if (!preg_match("/^[-\w]+$/", $building)) {
PAGEARGERROR("Invalid building argument.");
}
# Optional floor argument. Sanitize for the shell.
if (isset($floor) && !preg_match("/^[-\w]+$/", $floor)) {
PAGEARGERROR("Invalid floor argument.");
}
}
else {
$building = "MEB-ROBOTS";
$floor = 4;
}
# Initial goo.
header("Content-Type: text/plain");
......
......@@ -13,7 +13,7 @@ LOGGEDINORDIE($uid);
PAGEHEADER("Real Time Robot Tracking Applet");
#
# Verify page arguments. First allow user to optionally specify building/floor.
# Verify page arguments. Allow user to optionally specify building/floor.
#
if (isset($building) && $building != "") {
# Sanitize for the shell.
......@@ -69,7 +69,7 @@ echo "<table cellspacing=5 cellpadding=5 border=0 class=\"stealth\">
shows the current position (x, y, orientation),
the destination position,
and the battery level (percentage and voltage).
The shaded areas (blue border) are <em>exclusion</em>
The shaded areas are <em>exclusion</em>
zones where robots are not allowed to go. You can
<b>right click</b> on a robot to bring up its
info page. See below for instructions on how to
......@@ -104,7 +104,7 @@ if ($retval) {
}
$auth = $HTTP_COOKIE_VARS[$TBAUTHCOOKIE];
$pipeurl = "robopipe.php3?foo=bar";
$pipeurl = "robopipe.php3?building=$building&floor=$floor";
$baseurl = "../floormap_aux.php3?prefix=$uniqueid";
# Temp for debugging.
......@@ -120,6 +120,8 @@ echo "<applet name='tracker' code='RoboTrack.class'
<param name='uid' value='$uid'>
<param name='auth' value='$auth'>
<param name='ppm' value='$ppm'>
<param name='building' value='$building'>
<param name='floor' value='$floor'>
</applet>\n";
echo "<br>
......
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