From 8533eb7d10c59cdcd6023e2c1a9edb19f16af756 Mon Sep 17 00:00:00 2001 From: Brad Miller Date: Wed, 1 Oct 2014 06:32:22 -0400 Subject: Initial commit of files from FIRSTForge project --- FakeRobot/README.txt | 1 + FakeRobot/build.xml | 74 ++ ...beans-modules-java-j2seproject-copylibstask.jar | Bin 0 -> 22335 bytes FakeRobot/lib/NetworkTables.jar | Bin 0 -> 43275 bytes FakeRobot/lib/nblibraries.properties | 3 + FakeRobot/lib/networktables-desktop-r156.jar | Bin 0 -> 80957 bytes FakeRobot/lib/networktables-desktop-r157.jar | Bin 0 -> 80997 bytes FakeRobot/lib/networktables-desktop-r158.jar | Bin 0 -> 80997 bytes FakeRobot/manifest.mf | 3 + FakeRobot/nbproject/build-impl.xml | 1078 ++++++++++++++++++++ FakeRobot/nbproject/genfiles.properties | 8 + FakeRobot/nbproject/project.properties | 75 ++ FakeRobot/nbproject/project.xml | 18 + .../livewindowfakerobot/LiveWindowFakeRobot.java | 82 ++ 14 files changed, 1342 insertions(+) create mode 100644 FakeRobot/README.txt create mode 100644 FakeRobot/build.xml create mode 100644 FakeRobot/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar create mode 100644 FakeRobot/lib/NetworkTables.jar create mode 100644 FakeRobot/lib/nblibraries.properties create mode 100644 FakeRobot/lib/networktables-desktop-r156.jar create mode 100644 FakeRobot/lib/networktables-desktop-r157.jar create mode 100644 FakeRobot/lib/networktables-desktop-r158.jar create mode 100644 FakeRobot/manifest.mf create mode 100644 FakeRobot/nbproject/build-impl.xml create mode 100644 FakeRobot/nbproject/genfiles.properties create mode 100644 FakeRobot/nbproject/project.properties create mode 100644 FakeRobot/nbproject/project.xml create mode 100644 FakeRobot/src/livewindowfakerobot/LiveWindowFakeRobot.java (limited to 'FakeRobot') diff --git a/FakeRobot/README.txt b/FakeRobot/README.txt new file mode 100644 index 0000000..a688c5c --- /dev/null +++ b/FakeRobot/README.txt @@ -0,0 +1 @@ +This is for testing the LiveWindow funcitonality in the SmartDashboard. \ No newline at end of file diff --git a/FakeRobot/build.xml b/FakeRobot/build.xml new file mode 100644 index 0000000..427012b --- /dev/null +++ b/FakeRobot/build.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + Builds, tests, and runs the project FakeRobot. + + + diff --git a/FakeRobot/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar b/FakeRobot/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar new file mode 100644 index 0000000..4cabe27 Binary files /dev/null and b/FakeRobot/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar differ diff --git a/FakeRobot/lib/NetworkTables.jar b/FakeRobot/lib/NetworkTables.jar new file mode 100644 index 0000000..8ed6d45 Binary files /dev/null and b/FakeRobot/lib/NetworkTables.jar differ diff --git a/FakeRobot/lib/nblibraries.properties b/FakeRobot/lib/nblibraries.properties new file mode 100644 index 0000000..81b4b5f --- /dev/null +++ b/FakeRobot/lib/nblibraries.properties @@ -0,0 +1,3 @@ +libs.CopyLibs.classpath=\ + ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar +libs.CopyLibs.displayName=CopyLibs Task diff --git a/FakeRobot/lib/networktables-desktop-r156.jar b/FakeRobot/lib/networktables-desktop-r156.jar new file mode 100644 index 0000000..6911fc6 Binary files /dev/null and b/FakeRobot/lib/networktables-desktop-r156.jar differ diff --git a/FakeRobot/lib/networktables-desktop-r157.jar b/FakeRobot/lib/networktables-desktop-r157.jar new file mode 100644 index 0000000..12b49a6 Binary files /dev/null and b/FakeRobot/lib/networktables-desktop-r157.jar differ diff --git a/FakeRobot/lib/networktables-desktop-r158.jar b/FakeRobot/lib/networktables-desktop-r158.jar new file mode 100644 index 0000000..5efdd68 Binary files /dev/null and b/FakeRobot/lib/networktables-desktop-r158.jar differ diff --git a/FakeRobot/manifest.mf b/FakeRobot/manifest.mf new file mode 100644 index 0000000..1574df4 --- /dev/null +++ b/FakeRobot/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/FakeRobot/nbproject/build-impl.xml b/FakeRobot/nbproject/build-impl.xml new file mode 100644 index 0000000..0f3637b --- /dev/null +++ b/FakeRobot/nbproject/build-impl.xml @@ -0,0 +1,1078 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + + + + + + java -cp "${run.classpath.with.dist.jar}" ${main.class} + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + Must select one file in the IDE or set profile.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FakeRobot/nbproject/genfiles.properties b/FakeRobot/nbproject/genfiles.properties new file mode 100644 index 0000000..3fda7d0 --- /dev/null +++ b/FakeRobot/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=42e58587 +build.xml.script.CRC32=65e52e08 +build.xml.stylesheet.CRC32=28e38971@1.50.3.46 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=42e58587 +nbproject/build-impl.xml.script.CRC32=3c08be4f +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.3.46 diff --git a/FakeRobot/nbproject/project.properties b/FakeRobot/nbproject/project.properties new file mode 100644 index 0000000..fbbd528 --- /dev/null +++ b/FakeRobot/nbproject/project.properties @@ -0,0 +1,75 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=FakeRobot +application.vendor=Sam +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/FakeRobot.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.networktables-desktop-r158.jar=lib/networktables-desktop-r158.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.networktables-desktop-r158.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=livewindowfakerobot.LiveWindowFakeRobot +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/FakeRobot/nbproject/project.xml b/FakeRobot/nbproject/project.xml new file mode 100644 index 0000000..7b230c0 --- /dev/null +++ b/FakeRobot/nbproject/project.xml @@ -0,0 +1,18 @@ + + + org.netbeans.modules.java.j2seproject + + + FakeRobot + + + + + + + + + .\lib\nblibraries.properties + + + diff --git a/FakeRobot/src/livewindowfakerobot/LiveWindowFakeRobot.java b/FakeRobot/src/livewindowfakerobot/LiveWindowFakeRobot.java new file mode 100644 index 0000000..bfb544d --- /dev/null +++ b/FakeRobot/src/livewindowfakerobot/LiveWindowFakeRobot.java @@ -0,0 +1,82 @@ + +package livewindowfakerobot; + +import edu.wpi.first.wpilibj.networktables.NetworkTable; +import edu.wpi.first.wpilibj.tables.ITable; +import java.util.Timer; +import java.util.TimerTask; + +/** + * + * @author Sam + */ +public class LiveWindowFakeRobot { + + private static final NetworkTable liveWindow = NetworkTable.getTable("LiveWindow"); + + private static final ITable STATUS = createTable(liveWindow, "~STATUS~", "LW Status"), + + wrist = createTable(liveWindow, "Wrist", "LW Subsystem"), + wPotentiometer = createTable(wrist, "Potentiometer", "Analog Input"), + wVictor = createTable(wrist, "Victor", "Speed Controller"), + + elevator = createTable(liveWindow, "Elevator", "LW Subsystem"), + ePotentiometer = createTable(elevator, "Potentiometer", "Analog Input"), + eVictor = createTable(elevator, "Victor", "Speed Controller"), + + testSys = createTable(liveWindow, "TestSystem", "LW Subsystem"), + tComp = createTable(testSys, "Compressor", "Compressor"), + tGearTooth = createTable(testSys, "Gear Tooth Sensor", "Gear Tooth Sensor"), + tVictor = createTable(testSys, "Victor", "Speed Controller"), + tPotentiometer = createTable(testSys, "Potentiometer", "Analog Input"), + tRelay = createTable(testSys, "Spike", "Relay"), + tDigitalOutput = createTable(testSys, "Digital Output", "Digital Output"), + tGyro = createTable(testSys, "Gyro", "LWGyro"), + tSolenoid = createTable(testSys, "Solenoid", "Solenoid"), + tServo = createTable(testSys, "Serov the Servo", "Servo"), + tAccel = createTable(testSys, "Accelerometer", "Accelerometer"), + tEncoder1 = createTable(testSys, "Encoder 1", "Encoder"), + tUltra = createTable(testSys, "Ultrasonic", "Ultrasonic"), + tCompass = createTable(testSys, "Compass", "Compass"), + tSwitch = createTable(testSys, "Limit Switch", "Digital Input"); + + public static void main(String[] args) { + + System.out.println(); + + STATUS.putBoolean("LW Enabled", false); + STATUS.putString("Robot", "Testing"); + wPotentiometer.putNumber("Value", 2.6); + ePotentiometer.putNumber("Value", -11.6872); + tSwitch.putString("Value", "Off"); + + + (new Timer()).schedule( + new TimerTask(){ + @Override + public void run() { + wPotentiometer.putNumber("Value", (Math.random()-.5) * 24); + ePotentiometer.putNumber("Value", (Math.random()-.5) * 24); + tPotentiometer.putNumber("Value", (Math.random()-.5) * 24); + tGyro.putNumber("Value", Math.random() * 360); + tAccel.putNumber("Value", (Math.random()-.5)*8); + tSwitch.putString("Value", Math.random() < 0.5 ? "On" : "Off"); + tEncoder1.putNumber("Speed", Math.random() * 20); + tEncoder1.putNumber("Distance", Math.random() * 10); + tEncoder1.putNumber("Distance per Tick", Math.random()); + tCompass.putNumber("Value", Math.random()); + tUltra.putNumber("Value", (Math.random()-.5) * 200); + tGearTooth.putNumber("Value", (int)(Math.random() * 100)); + }}, + 0, 500); + + } + + private static ITable createTable(ITable parent, String name, String type) { + ITable table = parent.getSubTable(name); + System.out.println(table); + table.putString("~TYPE~", type); + table.putString("Name", name); + return table; + } +} -- cgit v1.2.3-54-g00ecf