Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
emulab
emulab-devel
Commits
009d1d4e
Commit
009d1d4e
authored
20 years ago
by
Leigh B. Stoller
Browse files
Options
Downloads
Patches
Plain Diff
Allow the building and floor to be specified in the URL so that we
can see other robot areas.
parent
6095eb48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
www/robotmap.php3
+29
-15
29 additions, 15 deletions
www/robotmap.php3
www/robotrack/robotrack.php3
+20
-5
20 additions, 5 deletions
www/robotrack/robotrack.php3
with
49 additions
and
20 deletions
www/robotmap.php3
+
29
−
15
View file @
009d1d4e
...
...
@@ -22,10 +22,22 @@ $isadmin = ISADMIN($uid);
unset
(
$prefix
);
#
# One robot map right now ...
#
$building
=
"MEB-ROBOTS"
;
$floor
=
4
;
# Verify page arguments. First 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
;
}
#
# Optional pid,eid. Without a building/floor, show all the nodes for the
...
...
@@ -201,10 +213,10 @@ $uniqueid = $matches[1];
$perl_args
=
(
"-o
$prefix
-t -z -n "
.
# From clicking on a map image.
((
isset
(
$
formfields
[
show_cameras
]
)
&&
strcmp
(
$
formfields
[
show_cameras
]
,
"Yep"
)
==
0
)
?
"-v "
:
""
)
.
((
isset
(
$
formfields
[
show_exclusion
]
)
&&
strcmp
(
$
formfields
[
show_exclusion
]
,
"Yep"
)
==
0
)
?
"-x "
:
""
)
.
((
isset
(
$show_cameras
)
&&
strcmp
(
$show_cameras
,
"Yep"
)
==
0
)
?
"-v "
:
""
)
.
((
isset
(
$show_exclusion
)
&&
strcmp
(
$show_exclusion
,
"Yep"
)
==
0
)
?
"-x "
:
""
)
.
(
isset
(
$map_x
)
?
"-c
$map_x
,
$map_y
"
:
""
)
.
(
isset
(
$floor
)
?
"-f
$floor
"
:
""
)
.
(
isset
(
$pid
)
?
"-e
$pid
,
$eid
"
:
""
)
.
...
...
@@ -239,7 +251,9 @@ if (isset($pid)) {
echo
"<center>
\n
"
;
# Wrap the image and zoom controls together in an input form.
echo
"<form method=
\"
post
\"
action=
\"
robotmap.php3
\"
>
\n
"
;
echo
"<form method=post action='robotmap.php3"
.
((
isset
(
$building
)
&&
isset
(
$floor
))
?
"?building=${building}&floor=${floor}"
:
""
)
.
"'>"
;
echo
"Click on the image to get its X,Y coordinates<br>
\n
"
;
# The image may be clicked to get node info or set a new center-point.
...
...
@@ -344,16 +358,16 @@ if (count($locations)) {
echo
"</table></td>
\n
"
;
}
if
(
isset
(
$
formfields
[
show_cameras
]
)
&&
strcmp
(
$
formfields
[
show_cameras
]
,
"Yep"
)
==
0
)
{
if
(
isset
(
$show_cameras
)
&&
strcmp
(
$show_cameras
,
"Yep"
)
==
0
)
{
$cam_checked
=
"checked"
;
}
else
{
$cam_checked
=
""
;
}
if
(
isset
(
$
formfields
[
show_exclusion
]
)
&&
strcmp
(
$
formfields
[
show_exclusion
]
,
"Yep"
)
==
0
)
{
if
(
isset
(
$show_exclusion
)
&&
strcmp
(
$show_exclusion
,
"Yep"
)
==
0
)
{
$excl_checked
=
"checked"
;
}
else
{
...
...
@@ -365,7 +379,7 @@ echo "<td align=\"left\" valign=\"top\" class=\"stealth\">
<tr><th>Display Options</th></tr>
<tr>
<td><input type=checkbox
name=
\"
formfields[
show_cameras
]
\"
name=show_cameras
value=Yep
$cam_checked
>Show <a
href=
\"
doc/docwrapper.php3?docname=mobilewireless.html#VISION
\"
>Tracking
...
...
@@ -373,7 +387,7 @@ echo "<td align=\"left\" valign=\"top\" class=\"stealth\">
</tr>
<tr>
<td><input type=checkbox
name=
\"
formfields[
show_exclusion
]
\"
name=show_exclusion
value=Yep
$excl_checked
>Show <a
href=
\"
doc/docwrapper.php3?docname=mobilewireless.html#VISION
\"
>Exclusion
...
...
This diff is collapsed.
Click to expand it.
www/robotrack/robotrack.php3
+
20
−
5
View file @
009d1d4e
...
...
@@ -13,10 +13,22 @@ LOGGEDINORDIE($uid);
PAGEHEADER
(
"Real Time Robot Tracking Applet"
);
#
# One robot map right now ...
#
$building
=
"MEB-ROBOTS"
;
$floor
=
4
;
# Verify page arguments. First 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
;
}
$ppm
=
1
;
#
...
...
@@ -29,6 +41,9 @@ if (mysql_num_rows($query_result)) {
$row
=
mysql_fetch_array
(
$query_result
);
$ppm
=
$row
[
"pixels_per_meter"
];
}
else
{
USERERROR
(
"No such building/floor
$building
/
$floor
"
,
1
);
}
#
# Draw the legend and some explanatory text.
...
...
@@ -98,7 +113,7 @@ if (isset($fake))
echo
"<applet name='tracker' code='RoboTrack.class'
archive='tracker.jar'
width='
900
' height='
60
0'
width='
1025
' height='
115
0'
alt='You need java to run this applet'>
<param name='pipeurl' value='
$pipeurl
'>
<param name='floorurl' value='
$baseurl
'>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment