Compare commits

..

1 Commits

Author SHA1 Message Date
Alex Henning
8856927fd8 Added support for Jenkins to generate doxygen.
Change-Id: I2febfe42cc9301446f796376cfe8e1ef6744f19a
2014-08-12 15:06:43 -04:00
196 changed files with 1468 additions and 4562 deletions

158
.gitignore vendored
View File

@@ -1,82 +1,21 @@
# WPIlib Specific
wpilibc/build/
hal/build/
networktables/cpp/build/
build/
networktables/OutlineViewer/nbproject/private
*~
target/
dist/
bin/
.project
.cproject
.settings/
.classpath
**/dependency-reduced-pom.xml
# Created by the jenkins test script
test-reports
# Added by the users of vagrant
jdk-7u45-linux-arm-vfp-sflt.gz
# Created by http://www.gitignore.io
### Linux ###
*~
# KDE directory preferences
.directory
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Java ###
#Java File extentions
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
@@ -84,90 +23,3 @@ Temporary Items
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### C++ ###
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Compiled Dynamic libraries
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
### CMake ###
CMakeCache.txt
CMakeFiles
cmake_install.cmake
install_manifest.txt
### Gradle ###
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
### Vagrant ###
.vagrant/
### Eclipse ###
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
# sbteclipse plugin
.target
# TeXlipse plugin
.texlipse

125
Vagrantfile vendored
View File

@@ -1,125 +0,0 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "puphpet/ubuntu1404-x64"
# Run the bootstrap.sh shell script to setup the enviroment
config.vm.provision :shell, path: "bootstrap.sh"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
config.vm.network "public_network", bridge: 'en0'
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
# vb.customize ["modifyvm", :id, "--memory", "1024"]
# end
#
# View the documentation for the provider you're using for more
# information on available options.
# Enable provisioning with CFEngine. CFEngine Community packages are
# automatically installed. For example, configure the host as a
# policy server and optionally a policy file to run:
#
# config.vm.provision "cfengine" do |cf|
# cf.am_policy_hub = true
# # cf.run_file = "motd.cf"
# end
#
# You can also configure and bootstrap a client to an existing
# policy server:
#
# config.vm.provision "cfengine" do |cf|
# cf.policy_server_address = "10.0.2.15"
# end
# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file default.pp in the manifests_path directory.
#
# config.vm.provision "puppet" do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "site.pp"
# end
# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
#
# config.vm.provision "chef_solo" do |chef|
# chef.cookbooks_path = "../my-recipes/cookbooks"
# chef.roles_path = "../my-recipes/roles"
# chef.data_bags_path = "../my-recipes/data_bags"
# chef.add_recipe "mysql"
# chef.add_role "web"
#
# # You may also specify custom JSON attributes:
# chef.json = { mysql_password: "foo" }
# end
# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision "chef_client" do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# If you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
end

View File

@@ -1,61 +0,0 @@
#!/usr/bin/env bash
# Update the apt-get repository list
apt-get update
# Download and install Java
apt-get --yes --force-yes install default-jre
apt-get --yes --force-yes install default-jdk
# Install Maven
apt-get --yes --force-yes install maven
# Install git-review
apt-get --yes --force-yes install python-pip
apt-get --yes --force-yes install python-setuptools
easy_install pip
yes | pip install git-review
# Download and install the gcc linux arm-toolchains
# Get the 32 bit c library
apt-get --yes --force-yes install libc6-i386
# Download the tool to unzip .zip files
apt-get --yes --force-yes install unzip
# The variables associated with the toolchains
TOOL_VER="1.0.1"
TOOL_DIR=~/../home/vagrant/wpilib/toolchains
# Create the toolchains directory
mkdir -p $TOOL_DIR
# Download the toolchains to this directory
wget -P ${TOOL_DIR}/ http://first.wpi.edu/FRC/c/maven/edu/wpi/first/wpilib/plugins/cpp/toolchains/linux/${TOOL_VER}/linux-${TOOL_VER}.zip
# Unzip the file
unzip -q ${TOOL_DIR}/linux-${TOOL_VER}.zip -d ${TOOL_DIR}/
# Remove the unneeded zip file
rm ${TOOL_DIR}/linux-${TOOL_VER}.zip
# Change the name of the directory
mv -f $TOOL_DIR/linux-${TOOL_VER} ${TOOL_DIR}/arm-none-linux-gnueabi-4.4.1
chown -R vagrant $TOOL_DIR/arm-none-linux-gnueabi-4.4.1
# Add the arm toolchains to the path variable
echo 'PATH=$PATH:/home/vagrant/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/bin/' >> /home/vagrant/.bashrc
# Install the jdk-linux-arm-vfp-sflt
# Create the target directory for the jdk
mkdir -p /home/vagrant/jdk-linux-arm-vfp-sflt/
# Unzip the jdk into this new directory
tar -xzf /vagrant/jdk-7u45-linux-arm-vfp-sflt.gz -C /home/vagrant/jdk-linux-arm-vfp-sflt/
# Install sshpass for the test system
apt-get --yes --force-yes install sshpass
# Keep this at the end of this file
printf "\n\n"
printf "Your virtual enviroment is now nearly set-up.\n"
printf "You can access your enviroment using 'vagrant ssh'.\n"
printf "Please run 'cd /vagrant' to navigate to the repository.\n"
printf "Once you have navigated there please run 'git review -s' to complete the setup of git review.\n"

18
cmake/run-cpp-tests.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Temporary method to deploy C++ integration tests to the RoboRIO
if [ $(which sshpass) ]
then
# Send stderr to /dev/null - the only thing printed to it is the login prompt
sshpass -p "" ssh admin@10.1.90.2 killall FRCUserProgram java 2> /dev/null
sshpass -p "" scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin 2> /dev/null
sshpass -p "" ssh admin@10.1.90.2 ./FRCUserProgram --gtest_color=yes $* 2> /dev/null
else
ssh admin@10.1.90.2 killall FRCUserProgram
scp target/cmake/wpilibc/wpilibC++IntegrationTests/FRCUserProgram admin@10.1.90.2:/home/admin
ssh admin@10.1.90.2 ./FRCUserProgram --gtest_color=yes $*
fi

View File

@@ -105,7 +105,6 @@ public class WPILibCore extends AbstractUIPlugin {
public void saveGlobalProperties(Properties props) {
try {
props.setProperty("version", "current");
props.store(new FileOutputStream(new File(WPILibCore.getDefault()
.getWPILibBaseDir() + "/wpilib.properties")),
"Don't add new properties, they will be deleted by the eclipse plugin.");
@@ -134,7 +133,7 @@ public class WPILibCore extends AbstractUIPlugin {
}
public String getDefaultVersion() {
return "0.2";
return "2013-test-0.4";
}
public String getCurrentVersion() {

View File

@@ -22,12 +22,12 @@ import edu.wpi.first.wpilib.plugins.core.WPILibCore;
public abstract class AbstractInstaller {
protected File installLocation;
protected String version, installedVersion;
protected String version;
public AbstractInstaller(String version, String installedVersion, String path) {
this.installLocation = new File(path);
public AbstractInstaller(String version) {
this.installLocation = new File(WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + getFeatureName() + File.separator + version);
this.version = version;
this.installedVersion = installedVersion;
}
/**
@@ -55,7 +55,7 @@ public abstract class AbstractInstaller {
WPILibCore.logInfo("Installing "+getFeatureName()+" if necessary");
if (!isInstalled()) {
WPILibCore.logInfo("Install necessary for " + getFeatureName());
WPILibCore.logInfo("Install necessary");
try {
install();
} catch (InstallException e) {
@@ -64,9 +64,9 @@ public abstract class AbstractInstaller {
getErrorMessage(e));
}
}
updateInstalledVersion(version);
WPILibCore.logInfo("Installed" + getFeatureName());
WPILibCore.logInfo("Installed");
return Status.OK_STATUS;
}
@@ -105,7 +105,7 @@ public abstract class AbstractInstaller {
* @return True for is there and newer, false otherwise.
*/
protected boolean isInstalled() {
return installLocation.exists() && !version.contains("DEVELOPMENT") && version.equals(installedVersion);
return installLocation.exists();
}
/**
@@ -138,7 +138,7 @@ public abstract class AbstractInstaller {
}
// Call 'unzip'
final String[] cmd = {"unzip" , "-o", tmpFile.getAbsolutePath(), "-d", installLocation.getAbsolutePath()};
final String[] cmd = {"unzip", tmpFile.getAbsolutePath(), "-d", installLocation.getAbsolutePath()};
WPILibCore.logInfo("unzip "+tmpFile.getAbsolutePath()+" -d "+installLocation.getAbsolutePath());
final Process unzipProcess = DebugPlugin.exec(cmd, installLocation);
try (final InputStream is = unzipProcess.getInputStream()) {

View File

@@ -1,6 +1,8 @@
package edu.wpi.first.wpilib.plugins.core.installer;
import java.io.InputStream;
import java.util.Properties;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
@@ -9,7 +11,7 @@ import edu.wpi.first.wpilib.plugins.core.preferences.PreferenceConstants;
public class ToolsInstaller extends AbstractInstaller {
public ToolsInstaller(String version) {
super(version, WPILibCore.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLS_VERSION), WPILibCore.getDefault().getWPILibBaseDir() + "/tools");
super(version);
}
@Override
@@ -20,8 +22,13 @@ public class ToolsInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibCore.getDefault().getPreferenceStore();
prefs.setValue(PreferenceConstants.TOOLS_VERSION, version);
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLS_VERSION)) {
WPILibCore.logInfo("Forcing library version to "+version);
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("version", version);
WPILibCore.getDefault().saveGlobalProperties(props);
prefs.setValue(PreferenceConstants.TOOLS_VERSION, version);
}
}
@Override

View File

@@ -19,8 +19,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
IPreferenceStore store = WPILibCore.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.TEAM_NUMBER,
WPILibCore.getDefault().getProjectProperties(null).getProperty("team-number", "0"));
String val = store.getString(PreferenceConstants.TOOLS_VERSION);
if (!store.contains(PreferenceConstants.TOOLS_VERSION) && val != null)
store.setValue(PreferenceConstants.TOOLS_VERSION, "none");
store.setDefault(PreferenceConstants.TOOLS_VERSION, WPILibCore.getDefault().getDefaultVersion());
store.setDefault(PreferenceConstants.UPDATE_TOOLS_VERSION, true);
}
}

View File

@@ -35,7 +35,7 @@ public class NewProjectMainPage extends WizardPage {
private Text worldText;
private Button worldButton;
Button iterativeRobot, commandRobot, sampleRobot;
Button iterativeRobot, commandRobot;
private boolean showPackage;
private boolean showProjectTypes;
private TeamNumberPage teamNumberPage;
@@ -109,12 +109,6 @@ public class NewProjectMainPage extends WizardPage {
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
commandRobot.setLayoutData(gd);
sampleRobot = new Button(projectTypeGroup, SWT.RADIO | SWT.WRAP);
sampleRobot.setText("Sample Robot: A robot project used for small sample programs or for highly advanced programs with more complete control over program flow");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 300;
sampleRobot.setLayoutData(gd);
}
label = new Label(container, SWT.NULL);
@@ -220,7 +214,6 @@ public class NewProjectMainPage extends WizardPage {
public ProjectType getProjectType() {
if (!showProjectTypes) return null;
else if (iterativeRobot.getSelection()) return types.get(ProjectType.ITERATIVE);
else if (sampleRobot.getSelection()) return types.get(ProjectType.SAMPLE);
else return types.get(ProjectType.COMMAND_BASED);
}

View File

@@ -4,7 +4,7 @@ import java.net.URL;
import java.util.Map;
public interface ProjectType {
String SAMPLE = "SAMPLE";
String SIMPLE = "SIMPLE";
String ITERATIVE = "ITERATIVE";
String COMMAND_BASED = "COMMAND_BASED";

View File

@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
}
private String getCurrentVersion() {
return "4.4.1-csery-gcc";
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
}
/*

View File

@@ -11,8 +11,7 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class ToolchainInstaller extends AbstractInstaller {
public ToolchainInstaller(String version) {
super(version,
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED), WPILibCPPPlugin.getDefault().getToolchain());
super(version);
}
@Override
@@ -22,8 +21,11 @@ public class ToolchainInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
version);
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION)) {
System.out.println("Forcing library version to "+version);
prefs.setValue(PreferenceConstants.TOOLCHAIN_VERSION, version);
}
}
@Override

View File

@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
}
private String getCurrentVersion() {
return "4.4.1-csery-gcc";
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
}
/*

View File

@@ -11,9 +11,7 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class ToolchainInstaller extends AbstractInstaller {
public ToolchainInstaller(String version) {
super(version,
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED),
WPILibCPPPlugin.getDefault().getToolchain());
super(version);
}
@Override
@@ -23,12 +21,16 @@ public class ToolchainInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
version);
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION)) {
System.out.println("Forcing library version to "+version);
prefs.setValue(PreferenceConstants.TOOLCHAIN_VERSION, version);
}
}
@Override
protected InputStream getInstallResourceStream() {
return ToolchainInstaller.class.getResourceAsStream("/resources/toolchain.zip");
}
}

View File

@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
}
private String getCurrentVersion() {
return "4.4.1-csery-gcc";
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
}
/*

View File

@@ -11,8 +11,7 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class ToolchainInstaller extends AbstractInstaller {
public ToolchainInstaller(String version) {
super(version,
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED), WPILibCPPPlugin.getDefault().getToolchain());
super(version);
}
@Override
@@ -22,8 +21,11 @@ public class ToolchainInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
version);
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION)) {
System.out.println("Forcing library version to "+version);
prefs.setValue(PreferenceConstants.TOOLCHAIN_VERSION, version);
}
}
@Override

View File

@@ -29,16 +29,17 @@
<option id="gnu.cpp.compiler.option.debugging.level.1682909384" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.1597382905" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/src&quot;"/>
<listOptionValue builtIn="false" value="&quot;$cpp-location/include&quot;"/>
<listOptionValue builtIn="false" value="$cpp-location/include"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.963785380" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1367166630" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool command="g++" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser" id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1568604896" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<option id="gnu.cpp.link.option.paths.1928585110" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;$cpp-location/lib&quot;"/>
<listOptionValue builtIn="false" value="$cpp-location/lib"/>
</option>
<option id="gnu.cpp.link.option.libs.1072058280" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
<listOptionValue builtIn="false" value="WPILib"/>
<listOptionValue builtIn="false" value="WPILibAthena"/>
<listOptionValue builtIn="false" value="WPILib"/>
<listOptionValue builtIn="false" value="HALAthena"/>
@@ -57,7 +58,7 @@
<listOptionValue builtIn="false" value="dl"/>
<listOptionValue builtIn="false" value="pthread"/>
</option>
<option id="gnu.cpp.link.option.flags.1747959472" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath-link,&quot;$cpp-location/lib&quot;" valueType="string"/>
<option id="gnu.cpp.link.option.flags.1747959472" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath-link,$cpp-location/lib" valueType="string"/>
<option id="gnu.cpp.link.option.other.1891020896" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" valueType="stringList">
<listOptionValue builtIn="false" value="-export-dynamic"/>
</option>
@@ -154,7 +155,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/src&quot;"/>
<listOptionValue builtIn="false" value="$cpp-location/sim/include"/>
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.1"/>
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.0"/>
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.0"/>
</option>
<option id="gnu.cpp.compiler.option.optimization.level.1648211502" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>

View File

@@ -27,6 +27,3 @@ sim.exe=Simulate/${out}
wpilib.sim=${wpilib}/sim
sim.tools=${wpilib.sim}/tools
sim.lib=${wpilib.sim}/lib
# Use the current C++ library by default
cpp-version=current

View File

@@ -2,7 +2,6 @@
#define $classname_H
#include "../CommandBase.h"
#include "WPILib.h"
class $classname: public CommandBase
{

View File

@@ -5,7 +5,6 @@
#include "Commands/Command.h"
#include "Subsystems/ExampleSubsystem.h"
#include "OI.h"
#include "WPILib.h"
/**
* The base for all commands. All atomic commands should subclass CommandBase.

View File

@@ -2,7 +2,6 @@
#define $classname_H
#include "Commands/CommandGroup.h"
#include "WPILib.h"
class $classname: public CommandGroup
{

View File

@@ -2,7 +2,6 @@
#define EXAMPLE_COMMAND_H
#include "../CommandBase.h"
#include "WPILib.h"
class ExampleCommand: public CommandBase
{

View File

@@ -3,6 +3,9 @@
#include "SmartDashboard/SmartDashboard.h"
#include "LiveWindow/LiveWindow.h"
#@autogenerated_code("pid", "")
#parse("${exporter-path}PIDSubsystem-pid.cpp")
#end
$classname::$classname() :
PIDSubsystem("$classname", 1.0, 0.0, 0.0)
{

View File

@@ -1,7 +1,6 @@
#ifndef ROBOTMAP_H
#define ROBOTMAP_H
#include "WPILib.h"
/**
* The RobotMap is a mapping from the ports sensors and actuators are wired into

View File

@@ -1,12 +1,15 @@
#include "$classname.h"
// TODO: convert into C++ template
#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up"
import edu.wpi.first.wpilibj.command.Trigger;
$classname::$classname()
/**
* New and improved C++
*/
public class $classname extends Trigger
{
public:
bool get()
{
return false;
}
}
bool $classname::Get()
{
return false;
}

View File

@@ -1,13 +1,9 @@
#ifndef $classname_H
#define $classname_H
// TODO: convert into C++ template
#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up"
import edu.wpi.first.wpilibj.command.Trigger;
#include "WPILib.h"
class $classname: public Trigger
public class $classname extends Trigger
{
public:
$classname();
bool Get();
};
#endif
bool get();
}

View File

@@ -26,6 +26,9 @@ DriveTrain::DriveTrain() : Subsystem("DriveTrain") {
right_encoder->SetDistancePerPulse((double) (4.0/12.0*M_PI) / 360.0);
#endif
left_encoder->Start();
right_encoder->Start();
rangefinder = new AnalogInput(6);
gyro = new Gyro(1);

View File

@@ -1,6 +1,7 @@
#ifndef DriveTrain_H
#define DriveTrain_H
#include "Commands/Subsystem.h"
#include "WPILib.h"
/**

View File

@@ -1,59 +0,0 @@
#include "WPILib.h"
class Robot: public IterativeRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick
LiveWindow *lw;
int autoLoopCounter;
public:
Robot() :
myRobot(0, 1), // these must be initialized in the same order
stick(1), // as they are declared above.
lw(NULL),
autoLoopCounter(0)
{
myRobot.SetExpiration(0.1);
}
private:
void RobotInit()
{
lw = LiveWindow::GetInstance();
}
void AutonomousInit()
{
autoLoopCounter = 0;
}
void AutonomousPeriodic()
{
if(autoLoopCounter < 100) //Check if we've completed 100 loops (approximately 2 seconds)
{
myRobot.Drive(-0.5, 0.0); // drive forwards half speed
autoLoopCounter++;
} else {
myRobot.Drive(0.0, 0.0); // stop robot
}
}
void TeleopInit()
{
}
void TeleopPeriodic()
{
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
}
void TestPeriodic()
{
lw->Run();
}
};
START_ROBOT_CLASS(Robot);

View File

@@ -0,0 +1,24 @@
#include <networktables/NetworkTable.h>
#include <iostream>
using namespace std;
// This is a simple robot program
int main()
{
NetworkTable::SetServerMode();
NetworkTable::SetTeam(190);
NetworkTable* table = NetworkTable::GetTable("SmartDashboard");
cout << "Started up" << endl;
long i = 0;
while (true)
{
cout << i << endl;
table->PutNumber("i", i);
i++;
sleep(1);
}
return 0;
}

View File

@@ -9,7 +9,7 @@
* points than get none. When called sequentially, this command will block until
* the hot goal is detected or until it is timed out.
*/
class CheckForHotGoal : public Command {
class CheckForHotGoal : Command {
public:
CheckForHotGoal(double time);
void Initialize();

View File

@@ -6,7 +6,6 @@
#include "Commands/SetPivotSetpoint.h"
#include "Commands/DriveForward.h"
#include "Commands/Shoot.h"
#include "Commands/CheckForHotGoal.h"
DriveAndShootAutonomous::DriveAndShootAutonomous() {
AddSequential(new CloseClaw());

View File

@@ -43,6 +43,8 @@ DriveTrain::DriveTrain() :
leftEncoder->SetDistancePerPulse((4.0/*in*/*M_PI)/(360.0*12.0/*in/ft*/));
#endif
rightEncoder->Start();
leftEncoder->Start();
LiveWindow::GetInstance()->AddSensor("DriveTrain", "Right Encoder", rightEncoder);
LiveWindow::GetInstance()->AddSensor("DriveTrain", "Left Encoder", leftEncoder);

View File

@@ -0,0 +1,17 @@
package $package;
/**
* Simplest possible robot program
*
* @author Team $team-number
*/
public class Robot {
/**
* @param args Input....
*/
public static void main(String[] args) {
// Do stuff here!
}
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<examples>
<!-- TODO add back in when there are enough samples to justify tags
<tagDescription>
<name>Simple Robot</name>
<description>Examples for simple robot programs.</description>
@@ -11,34 +10,47 @@
variety of tasks such as sending and receiving values to both
dashboards and co-processors.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>-->
<tagDescription>
<name>Getting Started with C++</name>
<description>Examples for getting started with FRC C++</description>
</tagDescription>
<example>
<name>Getting Started</name>
<description>An example program which demonstrates the simplest autonomous and
teleoperated routines.</description>
<tags>
<tag>Getting Started with C++</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/GettingStarted/src/Robot.cpp"
destination="src/Robot.cpp"></file>
</files>
</example>
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>
<example>
<name>Simple Robot Example</name>
<description>The simplest possible program that compiles. This
shows the structure of a simple program that does nothing at
all.</description>
<tags>
<tag>Simple Robot</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/Simple Robot Example/Robot.java" destination="src/Robot.cpp" />
</files>
</example>
<example>
<name>Network Table Counter</name>
<description>A simple program that increments a network table
variable once every second. This shows the structure of a simple
program that only uses network tables.</description>
<tags>
<tag>Simple Robot</tag>
<tag>Network Tables</tag>
</tags>
<packages>
<package>src</package>
</packages>
<files>
<file source="examples/Network Table Counter/Robot.cpp" destination="src/Robot.cpp" />
</files>
</example>
<example>
<name>GearsBot</name>
@@ -47,6 +59,7 @@
supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
</tags>
<packages>
<package>src</package>
@@ -124,12 +137,14 @@
destination="src/Subsystems/Wrist.h"></file>
</files>
</example>
<example>
<name>PacGoat</name>
<description>A fully functional example CommandBased program for FRC Team 190&#39;s 2014 robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
<tag>2014 Season</tag>
</tags>
<packages>
<package>src</package>

View File

@@ -17,7 +17,7 @@ class Robot: public SampleRobot
public:
Robot() :
myRobot(0, 1), // these must be initialized in the same order
myRobot(1, 2), // these must be initialized in the same order
stick(1) // as they are declared above.
{
myRobot.SetExpiration(0.1);

View File

@@ -58,9 +58,13 @@ public class WPILibCPPPlugin extends AbstractUIPlugin implements IStartup {
return plugin;
}
public String getDefaultToolchainVersion() {
return "arm-none-linux-gnueabi-4.4.1";
}
public String getToolchain() {
return WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + "toolchains" + File.separator + "current";
+ File.separator + "toolchains" + File.separator + getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_VERSION);
}
public String getCurrentVersion() {
@@ -78,7 +82,7 @@ public class WPILibCPPPlugin extends AbstractUIPlugin implements IStartup {
public String getCPPDir() {
return WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + "cpp" + File.separator + "current";
+ File.separator + "cpp" + File.separator + getPreferenceStore().getString(PreferenceConstants.LIBRARY_VERSION);
}
@Override

View File

@@ -1,6 +1,11 @@
package edu.wpi.first.wpilib.plugins.cpp.installer;
import java.io.InputStream;
import java.util.Properties;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.installer.AbstractInstaller;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
@@ -14,23 +19,28 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
public class CPPInstaller extends AbstractInstaller {
public CPPInstaller(String version) {
super(version,
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.LIBRARY_INSTALLED), WPILibCPPPlugin.getDefault().getCPPDir());
super(version);
}
@Override
protected String getFeatureName() {
return "cpp";
}
@Override
protected void updateInstalledVersion(String version) {
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.LIBRARY_INSTALLED,
version);
IPreferenceStore prefs = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (prefs.getBoolean(PreferenceConstants.UPDATE_LIBRARY_VERSION)) {
WPILibCPPPlugin.logInfo("Forcing library version to "+version);
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("cpp-version", version);
WPILibCore.getDefault().saveGlobalProperties(props);
prefs.setValue(PreferenceConstants.LIBRARY_VERSION, version);
}
}
@Override
protected InputStream getInstallResourceStream() {
return CPPInstaller.class.getResourceAsStream("/resources/cpp.zip");
}
@Override
protected String getFeatureName()
{
return "cpp";
}
}

View File

@@ -111,11 +111,6 @@ public class DeployLaunchShortcut implements ILaunchShortcut
// Debug deploys are done with the Eclipse Remote System Explorer,
// which lets it work with Eclipse's C++ debugger.
// Kill running program before using RSE as RSE can't
WPILibCPPPlugin.logInfo("Running ant file: " + activeProj.getLocation().toOSString() + File.separator + "build.xml");
WPILibCPPPlugin.logInfo("Targets: kill-program, Mode: " + mode);
AntLauncher.runAntFile(new File (activeProj.getLocation().toOSString() + File.separator + "build.xml"), "kill-program", null, mode);
// TODO: figure out UI issues. that's why this is undocumented
ILaunchConfigurationWorkingCopy config;
try {
@@ -144,37 +139,21 @@ public class DeployLaunchShortcut implements ILaunchShortcut
String remote_connection = RSEUtils.getTarget(teamNumber).getName();
ILaunchConfigurationWorkingCopy config = type.newInstance(null, activeProj.getName());
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, "");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "org.eclipse.rse.remotecdt.RemoteGDBDebugger");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_REGISTER_GROUPS, "");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, "run");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, "main");
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, true);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, activeProj.getName());
Collection<Executable> exes = ExecutablesManager.getExecutablesManager().getExecutablesForProject(activeProj);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
exes.size() > 0 ? exes.toArray(new Executable[0])[0].getPath().makeRelativeTo(activeProj.getLocation()).toString():
"Debug/FRCUserProgram");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, "/home/admin/FRCUserProgram");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION, remote_connection);
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, false);
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_PORT, "2345");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_GDBSERVER_COMMAND, "gdbserver");
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, WPILibCPPPlugin.getDefault().getToolchain() + "/bin/arm-none-linux-gnueabi-gdb");
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_CONNECTION, remote_connection);
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, "gdbserver");
List<String> solibs = new ArrayList<>();
solibs.add(WPILibCPPPlugin.getDefault().getToolchain() + "/arm-non-linux-gnueabi/libc/lib");
solibs.add(WPILibCPPPlugin.getDefault().getToolchain() + "/arm-non-linux-gnueabi/libc/usr/lib");
solibs.add(WPILibCPPPlugin.getDefault().getCPPDir() + "/lib");
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, solibs);
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, true);
config.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_STOP_ON_SOLIB_EVENTS, false);
config.doSave();
return config;
}
}

View File

@@ -16,10 +16,8 @@ public class RSEUtils {
public static IHost getTarget(int teamNumber) {
// The ip address based on the team number
//String hostName = "10."+(teamNumber/100)+"."+(teamNumber%100)+".2";
//String connectionName = hostName; //"Team "+teamNumber;
String hostName = "roboRIO-" + teamNumber + ".local";
String connectionName = hostName;
String hostName = "10."+(teamNumber/100)+"."+(teamNumber%100)+".2";
String connectionName = hostName; //"Team "+teamNumber;
// get the singleton RSE registry
try {

View File

@@ -0,0 +1,118 @@
package edu.wpi.first.wpilib.plugins.cpp.preferences;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.preferences.ComboFieldEditor;
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
/**
* This class represents a preference page that
* is contributed to the Preferences dialog. By
* subclassing <samp>FieldEditorPreferencePage</samp>, we
* can use the field support built into JFace that allows
* us to create a page that is small and knows how to
* save, restore and apply itself.
* <p>
* This page is used to modify preferences only. They
* are stored in the preference store that belongs to
* the main plug-in class. That way, preferences can
* be accessed directly via the preference store.
*/
public class CPPPreferencePage
extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
ComboFieldEditor toolchainVersionEditor;
BooleanFieldEditor autoUpdateToolchainEditor;
private ComboFieldEditor wpiLibVersionEditor;
private BooleanFieldEditor autoUpdateEditor;
public CPPPreferencePage() {
super(GRID);
setPreferenceStore(WPILibCPPPlugin.getDefault().getPreferenceStore());
setDescription("Change workspace level settings for C++.");
}
/**
* Creates the field editors. Field editors are abstractions of
* the common GUI blocks needed to manipulate various types
* of preferences. Each field editor knows how to save and
* restore itself.
*/
public void createFieldEditors() {
wpiLibVersionEditor = new ComboFieldEditor(PreferenceConstants.LIBRARY_VERSION,
"&Library Version:", getFieldEditorParent(), getInstalledVersions());
addField(wpiLibVersionEditor);
autoUpdateEditor = new BooleanFieldEditor(PreferenceConstants.UPDATE_LIBRARY_VERSION,
"&Auto Update Library Version", getFieldEditorParent());
addField(autoUpdateEditor);
toolchainVersionEditor = new ComboFieldEditor(PreferenceConstants.TOOLCHAIN_VERSION,
"&Toolchain Version:", getFieldEditorParent(), getInstalledToolchains());
addField(toolchainVersionEditor);
autoUpdateToolchainEditor = new BooleanFieldEditor(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION,
"&Auto Update Toolchain Version", getFieldEditorParent());
addField(autoUpdateToolchainEditor);
}
private List<String> getInstalledVersions() {
File[] dirs = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"cpp")
.listFiles(new FileFilter() {
@Override public boolean accept(File f) {
return f.isDirectory();
}
});
List<String> versions = new ArrayList<String>();
for (File dir : dirs) {
versions.add(dir.getName());
}
Collections.sort(versions);
return versions;
}
private List<String> getInstalledToolchains() {
File[] dirs = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"toolchains")
.listFiles(new FileFilter() {
@Override public boolean accept(File f) {
return f.isDirectory();
}
});
List<String> versions = new ArrayList<String>();
for (File dir : dirs) {
versions.add(dir.getName());
}
Collections.sort(versions);
return versions;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
public void init(IWorkbench workbench) {
WPILibCPPPlugin.logInfo("Preferences initialized.");
Properties props = WPILibCore.getDefault().getProjectProperties(null);
getPreferenceStore().setValue(PreferenceConstants.LIBRARY_VERSION,
props.getProperty("cpp-version", WPILibCPPPlugin.getDefault().getCurrentVersion()));
}
@Override public void performApply() {
performOk();
}
@Override public boolean performOk() {
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("cpp-version", wpiLibVersionEditor.getChoice());
WPILibCore.getDefault().saveGlobalProperties(props);
return super.performOk();
}
}

View File

@@ -4,6 +4,8 @@ package edu.wpi.first.wpilib.plugins.cpp.preferences;
* Constant definitions for plug-in preferences
*/
public class PreferenceConstants {
public static final String LIBRARY_INSTALLED = "libraryVersion_current";
public static final String TOOLCHAIN_INSTALLED = "toolchainVersion_current";
public static final String LIBRARY_VERSION = "libraryVersionPreference";
public static final String UPDATE_LIBRARY_VERSION = "udpateLibraryVersionPreference";
public static final String TOOLCHAIN_VERSION = "toolchainVersionPreference";
public static final String UPDATE_TOOLCHAIN_VERSION = "udpateToolchainVersionPreference";
}

View File

@@ -18,8 +18,11 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
*/
public void initializeDefaultPreferences() {
IPreferenceStore store = WPILibCPPPlugin.getDefault().getPreferenceStore();
if (!store.contains(PreferenceConstants.LIBRARY_INSTALLED))
store.setValue(PreferenceConstants.LIBRARY_INSTALLED,
"none");
store.setDefault(PreferenceConstants.LIBRARY_VERSION,
WPILibCore.getDefault().getProjectProperties(null)
.getProperty("cpp-version", WPILibCPPPlugin.getDefault().getCurrentVersion()));
store.setDefault(PreferenceConstants.UPDATE_LIBRARY_VERSION, true);
store.setDefault(PreferenceConstants.TOOLCHAIN_VERSION, WPILibCPPPlugin.getDefault().getDefaultToolchainVersion());
store.setDefault(PreferenceConstants.UPDATE_TOOLCHAIN_VERSION, true);
}
}

View File

@@ -38,18 +38,10 @@ public class CPPProjectType implements ProjectType {
return files;
}
};
static ProjectType SAMPLE = new CPPProjectType() {
@Override public Map<String, String> getFiles(String packageName) {
Map<String, String> files = super.getFiles(packageName);
files.put("src/Robot.cpp", "sample/Robot.cpp");
return files;
}
};
@SuppressWarnings("serial")
static Map<String, ProjectType> TYPES = new HashMap<String, ProjectType>() {{
put(ProjectType.ITERATIVE, ITERATIVE);
put(ProjectType.COMMAND_BASED, COMMAND_BASED);
put(ProjectType.SAMPLE, SAMPLE);
}};
@Override

View File

@@ -46,15 +46,7 @@
username="${username}"
password="${password}"
trust="true"
command="tail -F -n 0 ${deploy.log.file}"/>
</target>
<target name="kill-program" depends="get-target-ip" description="Kill the currently running FRC program">
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="/usr/local/frc/bin/frcKillRobot.sh"/>
command="tail -F -s 0 -n 0 ${deploy.log.file}"/>
</target>
<target name="debug-deploy" depends="get-target-ip" description="Deploy the jar and start the program running in debug mode.">

View File

@@ -157,6 +157,15 @@
</enablement>
</commonWizard>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
<page
category="edu.wpi.first.wpilib.plugins.core.preferences.WPILibPreferencePage"
class="edu.wpi.first.wpilib.plugins.java.preferences.JavaPreferencePage"
id="edu.wpi.first.wpilib.plugins.java.preferences.JavaPreferencePage"
name="Java Preferences">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer

View File

@@ -92,7 +92,7 @@
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaFinal</artifactId>
<artifactId>wpilibJavaDevices</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
<outputDirectory>${java-zip}/lib</outputDirectory>
@@ -107,13 +107,6 @@
<type>javadoc</type>
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
<outputDirectory>${java-zip}/javadoc-jar</outputDirectory>
</artifactItem>
</artifactItems>
<overWriteReleases>false</overWriteReleases>
@@ -336,12 +329,6 @@
<version>0.1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaFinal</artifactId>
<version>0.1.0-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
<!-- dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
@@ -374,12 +361,6 @@
</dependency>
<!-- Javadoc -->
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJava</artifactId>
<version>0.1.0-SNAPSHOT</version>
<type>javadoc</type>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibJavaDevices</artifactId>

View File

@@ -1,38 +0,0 @@
package $package;
import edu.wpi.first.wpilibj.buttons.Button;
import $package.commands.ExampleCommand;
/**
* This class is the glue that binds the controls on the physical operator
* interface to the commands and command groups that allow control of the robot.
*/
public class OI {
//// CREATING BUTTONS
// One type of button is a joystick button which is any button on a joystick.
// You create one by telling it which joystick it's on and which button
// number it is.
// Joystick stick = new Joystick(port);
// Button button = new JoystickButton(stick, buttonNumber);
// There are a few additional built in buttons you can use. Additionally,
// by subclassing Button you can create custom triggers and bind those to
// commands the same as any other Button.
//// TRIGGERING COMMANDS WITH BUTTONS
// Once you have a button, it's trivial to bind it to a button in one of
// three ways:
// Start the command when the button is pressed and let it run the command
// until it is finished as determined by it's isFinished method.
// button.whenPressed(new ExampleCommand());
// Run the command while the button is being held down and interrupt it once
// the button is released.
// button.whileHeld(new ExampleCommand());
// Start the command when the button is released and let it run the command
// until it is finished as determined by it's isFinished method.
// button.whenReleased(new ExampleCommand());
}

View File

@@ -18,7 +18,6 @@ import $package.subsystems.ExampleSubsystem;
public class Robot extends IterativeRobot {
public static final ExampleSubsystem exampleSubsystem = new ExampleSubsystem();
public static OI oi;
Command autonomousCommand;
@@ -27,7 +26,6 @@ public class Robot extends IterativeRobot {
* used for any initialization code.
*/
public void robotInit() {
oi = new OI();
// instantiate the command used for the autonomous period
autonomousCommand = new ExampleCommand();
}

View File

@@ -1,18 +0,0 @@
package $package;
/**
* The RobotMap is a mapping from the ports sensors and actuators are wired into
* to a variable name. This provides flexibility changing wiring, makes checking
* the wiring easier and significantly reduces the number of magic numbers
* floating around.
*/
public class RobotMap {
// For example to map the left and right motors, you could define the
// following variables to use with your drivetrain subsystem.
// public static final int leftMotor = 1;
// public static final int rightMotor = 2;
// If you are using multiple modules, make sure to define both the port
// number and the module. For example you with a rangefinder:
// public static final int rangefinderPort = 1;
// public static final int rangefinderModule = 1;
}

View File

@@ -1,69 +0,0 @@
package $package;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class Robot extends IterativeRobot {
RobotDrive myRobot;
Joystick stick;
int autoLoopCounter;
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
myRobot = new RobotDrive(0,1);
stick = new Joystick(1);
}
/**
* This function is run once each time the robot enters autonomous mode
*/
public void autonomousInit() {
autoLoopCounter = 0;
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
if(autoLoopCounter < 100) //Check if we've completed 100 loops (approximately 2 seconds)
{
myRobot.drive(-0.5, 0.0); // drive forwards half speed
autoLoopCounter++;
} else {
myRobot.drive(0.0, 0.0); // stop robot
}
}
/**
* This function is called once each time the robot enters tele-operated mode
*/
public void teleopInit(){
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
myRobot.arcadeDrive(stick);
}
/**
* This function is called periodically during test mode
*/
public void testPeriodic() {
LiveWindow.run();
}
}

View File

@@ -0,0 +1,39 @@
package $package;
import edu.wpi.first.wpilibj.networktables.NetworkTable;
/**
* An example of a network table counter.
*
* @author Team $team-number
*/
public class Robot {
private static NetworkTable table;
/**
* @param args
*/
public static void main(String[] args) {
NetworkTable.setServerMode();
NetworkTable.setTeam(190);
table = NetworkTable.getTable("SmartDashboard");
System.out.println("Started up");
long i = 0;
while (true) {
System.out.println(i);
table.putNumber("i", i);
i++;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

View File

@@ -0,0 +1,17 @@
package $package;
/**
* Simplest possible robot program
*
* @author Team $team-number
*/
public class Robot {
/**
* @param args Input....
*/
public static void main(String[] args) {
// Do stuff here!
}
}

View File

@@ -1,49 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<examples>
<!-- TODO add back in when there are enough samples to justify tags
<tagDescription>
<name>Simple Robot</name>
<description>Examples for simple robot programs.</description>
</tagDescription>
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>
<tagDescription>
<name>Network Tables</name>
<description>Examples of how to use Network Tables to accomplish a
variety of tasks such as sending and receiving values to both
dashboards and co-processors.</description>
</tagDescription>
<tagDescription>
<name>Simulation</name>
<description>Examples that can be run in simulation.</description>
</tagDescription>-->
<tagDescription>
<name>Getting Started with Java</name>
<description>Examples for getting started with FRC Java</description>
</tagDescription>
<example>
<name>Getting Started</name>
<description>An example program which demonstrates the simplest autonomous and
teleoperated routines.</description>
<tags>
<tag>Getting Started with Java</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/GettingStarted/src/org/usfirst/frc/team190/robot/Robot.java"
destination="src/$package-dir/Robot.java"></file>
</files>
<name>Simple Robot Example</name>
<description>The simplest possible program that compiles. This
shows the structure of a simple program that does nothing at
all.</description>
<tags>
<tag>Simple Robot</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/Simple Robot Example/Robot.java" destination="src/$package-dir/Robot.java" />
</files>
</example>
<example>
<name>Network Table Counter</name>
<description>A simple program that increments a network table
variable once every second. This shows the structure of a simple
program that only uses network tables.</description>
<tags>
<tag>Simple Robot</tag>
<tag>Network Tables</tag>
</tags>
<packages>
<package>src/$package-dir</package>
</packages>
<files>
<file source="examples/Network Table Counter/Robot.java" destination="src/$package-dir/Robot.java" />
</files>
</example>
<tagDescription>
<name>CommandBased Robot</name>
<description>Examples for CommandBased robot programs.</description>
</tagDescription>
<example>
<name>GearsBot</name>
<description>A fully functional example CommandBased program for WPIs GearsBot robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
</tags>
<packages>
<package>src/$package-dir</package>
@@ -76,6 +90,8 @@
<description>A fully functional example CommandBased program for FRC Team 190&#39;s 2014 robot. This code can run on your computer if it supports simulation.</description>
<tags>
<tag>CommandBased Robot</tag>
<tag>Simulation</tag>
<tag>2014 Season</tag>
</tags>
<packages>
<package>src/$package-dir</package>

View File

@@ -3,9 +3,6 @@ package $package;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Timer;
/**
* This is a demo program showing the use of the RobotDrive class.
@@ -28,7 +25,7 @@ public class Robot extends SampleRobot {
Joystick stick;
public Robot() {
myRobot = new RobotDrive(0, 1);
myRobot = new RobotDrive(1, 2);
myRobot.setExpiration(0.1);
stick = new Joystick(1);
}

View File

@@ -78,16 +78,12 @@ public class WPILibJavaPlugin extends AbstractUIPlugin implements IStartup {
return "DEVELOPMENT";
}
}
public String getJavaPath() {
return WPILibCore.getDefault().getWPILibBaseDir()
+ File.separator + "java" + File.separator + "current";
}
public Properties getProjectProperties(IProject project) {
Properties defaults = WPILibCore.getDefault().getProjectProperties(project);
Properties props;
try {
File file = new File(WPILibCore.getDefault().getWPILibBaseDir()+"/java/current/ant/build.properties");
File file = new File(WPILibCore.getDefault().getWPILibBaseDir()+"/java/"+getCurrentVersion()+"/ant/build.properties");
props = new AntPropertiesParser(new FileInputStream(file)).getProperties(defaults);
} catch (Exception e) {
WPILibJavaPlugin.logError("Error getting properties.", e);

View File

@@ -1,8 +1,11 @@
package edu.wpi.first.wpilib.plugins.java.installer;
import java.io.InputStream;
import java.util.Properties;
import org.eclipse.jface.preference.IPreferenceStore;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.installer.AbstractInstaller;
import edu.wpi.first.wpilib.plugins.java.WPILibJavaPlugin;
import edu.wpi.first.wpilib.plugins.java.preferences.PreferenceConstants;
@@ -16,9 +19,7 @@ import edu.wpi.first.wpilib.plugins.java.preferences.PreferenceConstants;
public class JavaInstaller extends AbstractInstaller {
public JavaInstaller(String version) {
super(version,
WPILibJavaPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.LIBRARY_INSTALLED),
WPILibJavaPlugin.getDefault().getJavaPath());
super(version);
}
@Override
@@ -29,7 +30,14 @@ public class JavaInstaller extends AbstractInstaller {
@Override
protected void updateInstalledVersion(String version) {
IPreferenceStore prefs = WPILibJavaPlugin.getDefault().getPreferenceStore();
prefs.setValue(PreferenceConstants.LIBRARY_INSTALLED, version);
if (prefs.getBoolean(PreferenceConstants.UPDATE_LIBRARY_VERSION)) {
WPILibJavaPlugin.logInfo("Forcing library version to "+version);
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("version", version);
WPILibCore.getDefault().saveGlobalProperties(props);
prefs.setValue(PreferenceConstants.LIBRARY_VERSION, version);
}
WPILibJavaPlugin.getDefault().updateProjects();
}
@Override

View File

@@ -0,0 +1,96 @@
package edu.wpi.first.wpilib.plugins.java.preferences;
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.preferences.ComboFieldEditor;
import edu.wpi.first.wpilib.plugins.java.WPILibJavaPlugin;
/**
* This class represents a preference page that
* is contributed to the Preferences dialog. By
* subclassing <samp>FieldEditorPreferencePage</samp>, we
* can use the field support built into JFace that allows
* us to create a page that is small and knows how to
* save, restore and apply itself.
* <p>
* This page is used to modify preferences only. They
* are stored in the preference store that belongs to
* the main plug-in class. That way, preferences can
* be accessed directly via the preference store.
*/
public class JavaPreferencePage
extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
ComboFieldEditor wpiLibVersionEditor;
BooleanFieldEditor autoUpdateEditor;
public JavaPreferencePage() {
super(GRID);
setPreferenceStore(WPILibJavaPlugin.getDefault().getPreferenceStore());
setDescription("Change workspace level settings for Java.");
}
/**
* Creates the field editors. Field editors are abstractions of
* the common GUI blocks needed to manipulate various types
* of preferences. Each field editor knows how to save and
* restore itself.
*/
public void createFieldEditors() {
wpiLibVersionEditor = new ComboFieldEditor(PreferenceConstants.LIBRARY_VERSION,
"&Library Version:", getFieldEditorParent(), getInstalledVersions());
addField(wpiLibVersionEditor);
autoUpdateEditor = new BooleanFieldEditor(PreferenceConstants.UPDATE_LIBRARY_VERSION,
"&Auto Update Library Version", getFieldEditorParent());
addField(autoUpdateEditor);
}
private List<String> getInstalledVersions() {
File[] dirs = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"java")
.listFiles(new FileFilter() {
@Override public boolean accept(File f) {
return f.isDirectory();
}
});
List<String> versions = new ArrayList<String>();
for (File dir : dirs) {
versions.add(dir.getName());
}
Collections.sort(versions);
return versions;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
public void init(IWorkbench workbench) {
WPILibJavaPlugin.logInfo("Preferences initialized.");
Properties props = WPILibCore.getDefault().getProjectProperties(null);
getPreferenceStore().setValue(PreferenceConstants.LIBRARY_VERSION,
props.getProperty("version", WPILibJavaPlugin.getDefault().getCurrentVersion()));
}
@Override public void performApply() {
performOk();
}
@Override public boolean performOk() {
Properties props = WPILibCore.getDefault().getProjectProperties(null);
props.setProperty("version", wpiLibVersionEditor.getChoice());
WPILibCore.getDefault().saveGlobalProperties(props);
WPILibJavaPlugin.getDefault().updateProjects();
return super.performOk();
}
}

View File

@@ -4,5 +4,6 @@ package edu.wpi.first.wpilib.plugins.java.preferences;
* Constant definitions for plug-in preferences
*/
public class PreferenceConstants {
public static final String LIBRARY_INSTALLED = "libraryVersion_current";
public static final String LIBRARY_VERSION = "libraryVersionPreference";
public static final String UPDATE_LIBRARY_VERSION = "udpateLibraryVersionPreference";
}

View File

@@ -18,7 +18,9 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
*/
public void initializeDefaultPreferences() {
IPreferenceStore store = WPILibJavaPlugin.getDefault().getPreferenceStore();
if (!store.contains(PreferenceConstants.LIBRARY_INSTALLED))
store.setValue(PreferenceConstants.LIBRARY_INSTALLED, "none");
store.setDefault(PreferenceConstants.LIBRARY_VERSION,
WPILibCore.getDefault().getProjectProperties(null)
.getProperty("version", WPILibJavaPlugin.getDefault().getCurrentVersion()));
store.setDefault(PreferenceConstants.UPDATE_LIBRARY_VERSION, true);
}
}

View File

@@ -8,10 +8,10 @@ import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
import edu.wpi.first.wpilib.plugins.java.WPILibJavaPlugin;
public class JavaProjectType implements ProjectType {
static ProjectType SAMPLE = new JavaProjectType() {
static ProjectType SIMPLE = new JavaProjectType() {
@Override public Map<String, String> getFiles(String packageName) {
Map<String, String> files = super.getFiles(packageName);
files.put("src/"+packageName.replace(".", "/")+"/Robot.java", "sample/Robot.java");
files.put("src/"+packageName.replace(".", "/")+"/Robot.java", "simple/Robot.java");
return files;
}
};
@@ -33,8 +33,6 @@ public class JavaProjectType implements ProjectType {
@Override public Map<String, String> getFiles(String packageName) {
Map<String, String> files = super.getFiles(packageName);
files.put("src/"+packageName.replace(".", "/")+"/Robot.java", "command-based/Robot.java");
files.put("src/"+packageName.replace(".", "/")+"/RobotMap.java", "command-based/RobotMap.java");
files.put("src/"+packageName.replace(".", "/")+"/OI.java", "command-based/OI.java");
files.put("src/"+packageName.replace(".", "/")+"/commands/ExampleCommand.java", "command-based/ExampleCommand.java");
files.put("src/"+packageName.replace(".", "/")+"/subsystems/ExampleSubsystem.java", "command-based/ExampleSubsystem.java");
return files;
@@ -42,7 +40,7 @@ public class JavaProjectType implements ProjectType {
};
@SuppressWarnings("serial")
static Map<String, ProjectType> TYPES = new HashMap<String, ProjectType>() {{
put(ProjectType.SAMPLE, SAMPLE);
put(ProjectType.SIMPLE, SIMPLE);
put(ProjectType.ITERATIVE, ITERATIVE);
put(ProjectType.COMMAND_BASED, COMMAND_BASED);
}};

View File

@@ -2,12 +2,10 @@
username=admin
password=
deploy.dir=/home/admin
deploy.kill.command=. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
deploy.debug.command = /usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar ${deploy.dir}/FRCUserProgram.jar
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
deploy.log.command=tail -F -n 0 ${deploy.log.file}
debug.flag.dir=/tmp/
command.dir=/home/lvuser/
version=current
# Libraries to use
wpilib=${user.home}/wpilib/java/${version}

View File

@@ -32,9 +32,9 @@
includeAntRuntime="no"
includeJavaRuntime="no"
classpath="${classpath}"
target="${ant.java.version}"
source="${ant.java.version}"
compiler="javac${ant.java.version}"
target="1.7"
source="1.7"
compiler="javac1.7"
debug="true">
</javac>
</target>
@@ -76,35 +76,25 @@
username="${username}"
password="${password}"
trust="true"
command="${deploy.kill.command};"/>
command=". /etc/profile.d/natinst-path.sh; ${deploy.kill.command};"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="${deploy.log.command}"/>
command="tail -F -s 0 -n 0 ${deploy.log.file}"/>
</target>
<target name="debug-deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
<echo>[athena-deploy] Copying code over.</echo>
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}" password="${password}" trust="true"/>
<!-- The remoteDebugCommand file is used by /usr/local/frc/bin/frcRunRobot.sh on the roboRIO -->
<scp file="${wpilib.ant.dir}/robotDebugCommand" todir="${username}@${target}:${command.dir}" password="${password}" trust="true"/>
<!-- The frcdebug file is used as a flag for /usr/local/frc/bin/frcRunRobot.sh to run the robot program in debug mode -->
<scp file="${wpilib.ant.dir}/frcdebug" todir="${username}@${target}:${debug.flag.dir}" password="${password}" trust="true"/>
<echo>[athena-deploy] Starting Debug program.</echo>
<echo>[athena-deploy] Starting program.</echo>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="${deploy.kill.command}"/>
<sshexec host="${target}"
username="${username}"
password="${password}"
trust="true"
command="${deploy.log.command}"/>
username="${username}"
password="${password}"
trust="true"
command=". /etc/profile.d/natinst-path.sh; ${deploy.debug.command}"/>
</target>
<!-- Simulate -->

View File

@@ -1,2 +0,0 @@
# This file is used as a flag to determine if debugging should be used.
# It is uploaded to the robot when launched in debug mode and should be removed automatically once used.

View File

@@ -1,3 +0,0 @@
/usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y
-jar /home/admin/FRCUserProgram.jar

View File

@@ -6,9 +6,6 @@
#include <stdint.h>
#endif
#include <iostream>
#include "errno.h"
extern "C"
{
typedef void (*InterruptHandlerFunction)(uint32_t interruptAssertedMask, void *param);

View File

@@ -4,6 +4,6 @@
#ifndef __RoboRIO_FRC_ChipObject_Aliases_h__
#define __RoboRIO_FRC_ChipObject_Aliases_h__
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_8
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_7
#endif // __RoboRIO_FRC_ChipObject_Aliases_h__

View File

@@ -1,15 +1,15 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_nInterfaceGlobals_h__
#define __nFRC_2015_1_0_8_nInterfaceGlobals_h__
#ifndef __nFRC_2015_1_0_7_nInterfaceGlobals_h__
#define __nFRC_2015_1_0_7_nInterfaceGlobals_h__
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
extern unsigned int g_currentTargetClass;
}
}
#endif // __nFRC_2015_1_0_8_nInterfaceGlobals_h__
#endif // __nFRC_2015_1_0_7_nInterfaceGlobals_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_AI_h__
#define __nFRC_2015_1_0_8_AI_h__
#ifndef __nFRC_2015_1_0_7_AI_h__
#define __nFRC_2015_1_0_7_AI_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tAI
@@ -140,4 +140,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_AI_h__
#endif // __nFRC_2015_1_0_7_AI_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_AO_h__
#define __nFRC_2015_1_0_8_AO_h__
#ifndef __nFRC_2015_1_0_7_AO_h__
#define __nFRC_2015_1_0_7_AO_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tAO
@@ -47,4 +47,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_AO_h__
#endif // __nFRC_2015_1_0_7_AO_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Accel_h__
#define __nFRC_2015_1_0_8_Accel_h__
#ifndef __nFRC_2015_1_0_7_Accel_h__
#define __nFRC_2015_1_0_7_Accel_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tAccel
@@ -99,4 +99,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Accel_h__
#endif // __nFRC_2015_1_0_7_Accel_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Accumulator_h__
#define __nFRC_2015_1_0_8_Accumulator_h__
#ifndef __nFRC_2015_1_0_7_Accumulator_h__
#define __nFRC_2015_1_0_7_Accumulator_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tAccumulator
@@ -84,4 +84,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Accumulator_h__
#endif // __nFRC_2015_1_0_7_Accumulator_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Alarm_h__
#define __nFRC_2015_1_0_8_Alarm_h__
#ifndef __nFRC_2015_1_0_7_Alarm_h__
#define __nFRC_2015_1_0_7_Alarm_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tAlarm
@@ -54,4 +54,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Alarm_h__
#endif // __nFRC_2015_1_0_7_Alarm_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_AnalogTrigger_h__
#define __nFRC_2015_1_0_8_AnalogTrigger_h__
#ifndef __nFRC_2015_1_0_7_AnalogTrigger_h__
#define __nFRC_2015_1_0_7_AnalogTrigger_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tAnalogTrigger
@@ -126,4 +126,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_AnalogTrigger_h__
#endif // __nFRC_2015_1_0_7_AnalogTrigger_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_BIST_h__
#define __nFRC_2015_1_0_8_BIST_h__
#ifndef __nFRC_2015_1_0_7_BIST_h__
#define __nFRC_2015_1_0_7_BIST_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tBIST
@@ -87,4 +87,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_BIST_h__
#endif // __nFRC_2015_1_0_7_BIST_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Counter_h__
#define __nFRC_2015_1_0_8_Counter_h__
#ifndef __nFRC_2015_1_0_7_Counter_h__
#define __nFRC_2015_1_0_7_Counter_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tCounter
@@ -216,4 +216,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Counter_h__
#endif // __nFRC_2015_1_0_7_Counter_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_DIO_h__
#define __nFRC_2015_1_0_8_DIO_h__
#ifndef __nFRC_2015_1_0_7_DIO_h__
#define __nFRC_2015_1_0_7_DIO_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tDIO
@@ -245,4 +245,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_DIO_h__
#endif // __nFRC_2015_1_0_7_DIO_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_DMA_h__
#define __nFRC_2015_1_0_8_DMA_h__
#ifndef __nFRC_2015_1_0_7_DMA_h__
#define __nFRC_2015_1_0_7_DMA_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tDMA
@@ -185,4 +185,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_DMA_h__
#endif // __nFRC_2015_1_0_7_DMA_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Encoder_h__
#define __nFRC_2015_1_0_8_Encoder_h__
#ifndef __nFRC_2015_1_0_7_Encoder_h__
#define __nFRC_2015_1_0_7_Encoder_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tEncoder
@@ -196,4 +196,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Encoder_h__
#endif // __nFRC_2015_1_0_7_Encoder_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Global_h__
#define __nFRC_2015_1_0_8_Global_h__
#ifndef __nFRC_2015_1_0_7_Global_h__
#define __nFRC_2015_1_0_7_Global_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tGlobal
@@ -101,4 +101,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Global_h__
#endif // __nFRC_2015_1_0_7_Global_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Interrupt_h__
#define __nFRC_2015_1_0_8_Interrupt_h__
#ifndef __nFRC_2015_1_0_7_Interrupt_h__
#define __nFRC_2015_1_0_7_Interrupt_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tInterrupt
@@ -90,4 +90,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Interrupt_h__
#endif // __nFRC_2015_1_0_7_Interrupt_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_PWM_h__
#define __nFRC_2015_1_0_8_PWM_h__
#ifndef __nFRC_2015_1_0_7_PWM_h__
#define __nFRC_2015_1_0_7_PWM_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tPWM
@@ -80,15 +80,6 @@ public:
virtual unsigned char readPeriodScaleHdr(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
{
kNumZeroLatchElements = 20,
} tZeroLatch_IfaceConstants;
virtual void writeZeroLatch(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
virtual bool readZeroLatch(unsigned char bitfield_index, tRioStatusCode *status) = 0;
typedef enum
@@ -117,4 +108,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_PWM_h__
#endif // __nFRC_2015_1_0_7_PWM_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Power_h__
#define __nFRC_2015_1_0_8_Power_h__
#ifndef __nFRC_2015_1_0_7_Power_h__
#define __nFRC_2015_1_0_7_Power_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tPower
@@ -214,4 +214,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Power_h__
#endif // __nFRC_2015_1_0_7_Power_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_Relay_h__
#define __nFRC_2015_1_0_8_Relay_h__
#ifndef __nFRC_2015_1_0_7_Relay_h__
#define __nFRC_2015_1_0_7_Relay_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tRelay
@@ -65,4 +65,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_Relay_h__
#endif // __nFRC_2015_1_0_7_Relay_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_SPI_h__
#define __nFRC_2015_1_0_8_SPI_h__
#ifndef __nFRC_2015_1_0_7_SPI_h__
#define __nFRC_2015_1_0_7_SPI_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tSPI
@@ -65,4 +65,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_SPI_h__
#endif // __nFRC_2015_1_0_7_SPI_h__

View File

@@ -1,14 +1,14 @@
// Copyright (c) National Instruments 2008. All Rights Reserved.
// Do Not Edit... this file is generated!
#ifndef __nFRC_2015_1_0_8_SysWatchdog_h__
#define __nFRC_2015_1_0_8_SysWatchdog_h__
#ifndef __nFRC_2015_1_0_7_SysWatchdog_h__
#define __nFRC_2015_1_0_7_SysWatchdog_h__
#include "tSystemInterface.h"
namespace nFPGA
{
namespace nFRC_2015_1_0_8
namespace nFRC_2015_1_0_7
{
class tSysWatchdog
@@ -98,4 +98,4 @@ private:
}
}
#endif // __nFRC_2015_1_0_8_SysWatchdog_h__
#endif // __nFRC_2015_1_0_7_SysWatchdog_h__

View File

@@ -52,10 +52,8 @@ void enableInterrupts(void* interrupt_pointer, int32_t *status)
*/
void disableInterrupts(void* interrupt_pointer, int32_t *status)
{
Interrupt* anInterrupt = (Interrupt*)interrupt_pointer;
anInterrupt->manager->disable(status);
}
/**

View File

@@ -88,11 +88,6 @@ private:
uint32_t arbId;
uint8_t toSend[8];
uint32_t periodMs;
txJob_t() : arbId(0),periodMs(0)
{
for(int i=0;i<sizeof(toSend);++i)
toSend[i] = 0;
}
};
class rxEvent_t{

View File

@@ -101,7 +101,8 @@ PCM::PCM(UINT8 deviceNumber): CtreCanNode(deviceNumber)
RegisterRx(STATUS_DEBUG | deviceNumber );
RegisterTx(CONTROL_1 | deviceNumber, kCANPeriod);
/* enable close loop */
SetClosedLoopControl(1);
CtreCanNode::txTask<PcmControl_t> toFill = GetTx<PcmControl_t>(CONTROL_1 | GetDeviceNumber());
toFill->closedLoopEnable = 1;
}
/* PCM D'tor
*/
@@ -215,7 +216,7 @@ CTR_Code PCM::GetCompressorCurrent(float &status)
uint32_t temp =(rx->compressorCurrentTop6);
temp <<= 4;
temp |= rx->compressorCurrentBtm4;
status = temp * 0.03125; /* 5.5 fixed pt value in Amps */
status = 20.1612903225806 * temp;
return rx.err;
}
@@ -229,7 +230,7 @@ CTR_Code PCM::GetSolenoidVoltage(float &status)
uint32_t raw =(rx->solenoidVoltageTop8);
raw <<= 2;
raw |= rx->solenoidVoltageBtm2;
status = (double) raw * 0.03125; /* 5.5 fixed pt value in Volts */
status = (double) raw * 24.7800586510264 / 1000;
return rx.err;
}
@@ -296,7 +297,7 @@ CTR_Code PCM::GetSolenoidStickyFault(bool &status)
CTR_Code PCM::GetBatteryVoltage(float &status)
{
GET_PCM_STATUS();
status = (float)rx->battVoltage * 0.05 + 4.0; /* 50mV per unit plus 4V. */
status = (float)rx->battVoltage * ((59.0420332355816) / 1000.0);;
return rx.err;
}
/* Return status of module enable/disable

View File

@@ -110,7 +110,7 @@ CTR_Code PDP::GetChannelCurrent(UINT8 idx, double &current)
}
}
/* convert to amps */
current = (double)raw * 0.125; /* 7.3 fixed pt value in Amps */
current = 0.06724511900000001*raw + 1.527114967;
/* signal caller with success */
return retval;
}
@@ -118,14 +118,14 @@ CTR_Code PDP::GetVoltage(double &voltage)
{
GET_STATUS3();
uint32_t raw = rx->busVoltage;
voltage = (double)raw * 0.05 + 4.0; /* 50mV per unit plus 4V. */;
voltage = 0.0554413328606877 * raw;
return rx.err;
}
CTR_Code PDP::GetTemperature(double &tempC)
{
GET_STATUS3();
uint32_t raw = rx->temp;
tempC = (double)raw * 1.03250836957542 - 67.8564500484966;
tempC = ((double)raw-67.8564500484966)*1.03250836957542;
return rx.err;
}
//------------------ C interface --------------------------------------------//

View File

@@ -1,5 +1,4 @@
allwpilib=../..
version=DEVELOPMENT
all: java cpp site
@@ -9,7 +8,7 @@ java:
cp -r $(allwpilib)/wpilibj/wpilibJava/src/main/java/* build/java/
cp -r $(allwpilib)/wpilibj/wpilibJavaDevices/src/main/java/* build/java/
# cp -r $(allwpilib)/networktables/java/src/main/java/* build/java/
( cat java.doxy ; echo "PROJECT_NUMBER=${version}" ) | doxygen -
doxygen java.doxy
cpp:
mkdir -p build/cpp/
@@ -20,7 +19,7 @@ cpp:
cp -r $(allwpilib)/wpilibc/wpilibC++Devices/include build/cpp/
# cp -r $(allwpilib)/networktables/cpp/lib build/cpp/
# cp -r $(allwpilib)/networktables/cpp/include build/cpp/
( cat cpp.doxy ; echo "PROJECT_NUMBER=${version}" ) | doxygen -
doxygen cpp.doxy
# TODO: HAL

View File

@@ -794,9 +794,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = nivision.h \
pcre.h \
*/NetworkCommunication/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the

View File

@@ -1,24 +0,0 @@
apply plugin: 'java'
apply plugin: 'maven'
group = "edu.wpi.frc.wpilib"
version = "2.0"
sourceCompatibility = 1.7
sourceSets {
main {
java {
srcDirs = ["src"]
}
}
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile project(":java")
}

View File

@@ -1,19 +0,0 @@
apply plugin: 'cpp'
libraries {
main {}
}
sources {
main {
cpp {
source {
srcDirs = ["lib/share", "lib/Athena"]
// includes = "**/*.cpp"
}
exportedHeaders {
srcDirs = ["include"]
}
}
}
}

View File

@@ -1,24 +0,0 @@
apply plugin: 'java'
apply plugin: 'maven'
group = "edu.wpi.frc.wpilib"
version = "2.0"
sourceCompatibility = 1.7
sourceSets {
main {
java {
srcDirs = ["src"]
}
}
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile project(":java")
}

View File

@@ -1,39 +0,0 @@
apply plugin: 'java'
apply plugin: 'maven'
group = "edu.wpi.frc.wpilib"
version = "2.0"
sourceSets {
main {
java {
srcDirs = ["src/main/java", "Athena/src/main/java"]
}
}
test {
java {
srcDirs = ["Athena/src/test/java"]
excludes = ["edu/wpi/first/wpilibj/networktables2/system/SystemTest.java"]
}
}
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'org.jmock', name: 'jmock-junit4', version: '2.6.0'
testCompile group: 'org.jmock', name: 'jmock-legacy', version: '2.6.0'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://localhost/tmp/myRepo/")
pom.artifactId = 'networktables'
}
}
}

View File

@@ -1 +0,0 @@
include "java", "java-table-viewer"

BIN
ni-libraries/libFRC_NetworkCommunication.so.1.5.0 Normal file → Executable file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More