Commit 7962bca1 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Fix a few things ... also not sure I inderstand this Jar file stuff yet.

parent c1848555
......@@ -26,7 +26,11 @@ RoboTrack.class: $(SRCDIR)/RoboTrack.java
$(JAVAC) -deprecation -d . $^
$(TESTBED_SRCDIR)/www/robotrack/tracker.jar: RoboTrack.class
$(JAR) cvf $@ *.class
echo '$(filter-out RoboTrack.class, $(shell echo *.class))'
$(JAR) cvf $@ $^ $(patsubst %,'%',$(filter-out RoboTrack.class, $(shell echo *.class)))
foo:
echo '$(filter-out RoboTrack.class, $(wildcard *.class))'
install:
......
......@@ -147,8 +147,8 @@ public class RoboTrack extends JApplet {
int dx, dy; // Destination x,y coords
double dor = 500.0; // Destination orientation
boolean gotdest = false; // We have a valid destination
double battery_voltage = -1.0;
double battery_percentage = -1.0;
double battery_voltage = 500.0;
double battery_percentage = 500.0;
String pname, vname;
int index;
}
......@@ -246,6 +246,11 @@ public class RoboTrack extends JApplet {
robbie.dor = Float.parseFloat(tokens.nextToken().trim());
robbie.gotdest = true;
}
else {
// Consume next two tokens.
str = tokens.nextToken();
str = tokens.nextToken();
}
str = tokens.nextToken().trim();
if (str.length() > 0)
......@@ -463,9 +468,9 @@ public class RoboTrack extends JApplet {
case 5: return (robbie.gotdest ? "" + robbie.dx : "");
case 6: return (robbie.gotdest ? "" + robbie.dy : "");
case 7: return (robbie.dor != 500.0 ? "" + robbie.dor : "");
case 8: return (robbie.battery_percentage != -1.0 ?
case 8: return (robbie.battery_percentage != 500.0 ?
"" + robbie.battery_percentage : "");
case 9: return (robbie.battery_voltage != -1.0 ?
case 9: return (robbie.battery_voltage != 500.0 ?
"" + robbie.battery_voltage : "");
}
return "Foo";
......@@ -492,11 +497,18 @@ public class RoboTrack extends JApplet {
public static void main(String argv[]) {
final RoboTrack robomap = new RoboTrack();
URL url = RoboTrack.class.getResource("robots-4.jpg");
try
{
URL url = new URL("file://robots-4.jpg");
robomap.init();
robomap.is = System.in;
robomap.floorimage = robomap.getImage(url);
}
catch(Throwable th)
{
th.printStackTrace();
}
robomap.init();
robomap.is = System.in;
robomap.floorimage = robomap.getImage(url);
Frame f = new Frame("Robot Map");
f.addWindowListener(new WindowAdapter() {
......
......@@ -100,7 +100,7 @@ while (1) {
if (!isset($bper))
$bper = "";
echo "$pname, $vname, $x, $y, $or, $dx, $dy, $dor, $bvolts, $bper\n";
echo "$pname, $vname, $x, $y, $or, $dx, $dy, $dor, $bper, $bvolts\n";
}
flush();
sleep(1);
......
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