Commit c80322fe authored by Leigh B. Stoller's avatar Leigh B. Stoller

Checkpoint a bunch of little fixes. Robot motion via the applet works

pretty good at this point, although still not able to set just the
orientation without moving x,y. Will work on that next.
parent 57650d6c
...@@ -1017,7 +1017,7 @@ public class RoboTrack extends JApplet { ...@@ -1017,7 +1017,7 @@ public class RoboTrack extends JApplet {
"&nodeidlist[" + robbie.pname + "]=\"" + "&nodeidlist[" + robbie.pname + "]=\"" +
robbie.drag_x / pixels_per_meter + "," + robbie.drag_x / pixels_per_meter + "," +
robbie.drag_y / pixels_per_meter + "," + robbie.drag_y / pixels_per_meter + "," +
robbie.or + "\""; robbie.drag_or + "\"";
// Clear it in the map (when it repaints). // Clear it in the map (when it repaints).
robbie.dragging = false; robbie.dragging = false;
...@@ -1066,11 +1066,14 @@ public class RoboTrack extends JApplet { ...@@ -1066,11 +1066,14 @@ public class RoboTrack extends JApplet {
str = str + "\n" + tmp; str = str + "\n" + tmp;
} }
input.close(); input.close();
System.out.println(str);
JOptionPane.showMessageDialog(getContentPane(), if (str.length() > 0) {
str, "Submit Failed", System.out.println(str);
JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(getContentPane(),
str, "Submit Failed",
JOptionPane.ERROR_MESSAGE);
}
} }
catch(Throwable th) catch(Throwable th)
{ {
......
...@@ -87,19 +87,19 @@ if ($destx =~ /^([\d.]+)$/) { ...@@ -87,19 +87,19 @@ if ($destx =~ /^([\d.]+)$/) {
$destx = $1; $destx = $1;
} }
else { else {
die("*** Bad data in pid: $destx.\n"); die("*** Bad data in destx: $destx.\n");
} }
if ($desty =~ /^([\d.]+)$/) { if ($desty =~ /^([\d.]+)$/) {
$desty = $1; $desty = $1;
} }
else { else {
die("*** Bad data in pid: $desty.\n"); die("*** Bad data in desty: $desty.\n");
} }
if ($desto =~ /^([\d.]+)$/) { if ($desto =~ /^([-\d.]+)$/) {
$desto = $1; $desto = $1;
} }
else { else {
die("*** Bad data in pid: $desto.\n"); die("*** Bad data in desto: $desto.\n");
} }
# #
......
...@@ -81,12 +81,12 @@ while (list ($node_id, $value) = each ($nodeidlist)) { ...@@ -81,12 +81,12 @@ while (list ($node_id, $value) = each ($nodeidlist)) {
# #
unset($matches); unset($matches);
if (!preg_match("/^(.*),(.*),(.*)$/", $value, $matches)) { if (!preg_match("/^\"(.*),(.*),(.*)\"$/", $value, $matches)) {
USERERROR("Must specify x,y,o coordinates for $node_id!", 1); USERERROR("Must specify x,y,o coordinates for $node_id!", 1);
} }
$x = $matches[0]; $x = $matches[1];
$y = $matches[1]; $y = $matches[2];
$o = $matches[2]; $o = $matches[3];
if (! (TBvalid_float($x) && TBvalid_float($y) && TBvalid_float($o))) { if (! (TBvalid_float($x) && TBvalid_float($y) && TBvalid_float($o))) {
USERERROR("Must specify proper x,y,o coordinates for $node_id!", 1); USERERROR("Must specify proper x,y,o coordinates for $node_id!", 1);
...@@ -104,17 +104,23 @@ while (list ($node_id, $value) = each ($nodeidlist)) { ...@@ -104,17 +104,23 @@ while (list ($node_id, $value) = each ($nodeidlist)) {
# #
unset($matches); unset($matches);
if (!preg_match("/^(.*),(.*),(.*)$/", $value, $matches)) { if (!preg_match("/^\"(.*),(.*),(.*)\"$/", $value, $matches)) {
USERERROR("Must specify x,y,o coordinates for $node_id!", 1); USERERROR("Must specify x,y,o coordinates for $node_id!", 1);
} }
$x = $matches[0]; $x = $matches[1];
$y = $matches[1]; $y = $matches[2];
$o = $matches[2]; $o = $matches[3];
$retval = SUEXEC($uid, "nobody", if (! TBNodeIDtoExpt($node_id, $pid, $eid, $gid)) {
"websetdest -x $x -y $y -o $o $node_id", USERERROR("$node_id is not reserved to an experiment!", 1);
}
$retval = SUEXEC($uid, "$pid,$gid",
"websetdest -d -x $x -y $y -o $o $node_id",
SUEXEC_ACTION_IGNORE); SUEXEC_ACTION_IGNORE);
SUEXECERROR(SUEXEC_ACTION_CONTINUE);
# #
# Report fatal errors. # Report fatal errors.
# #
......
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