mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Compare commits
25 Commits
jenkins-re
...
jenkins-st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cad83ed3ca | ||
|
|
62d6579428 | ||
|
|
1d7b17a2ba | ||
|
|
738859c4ea | ||
|
|
127ff0ac0a | ||
|
|
472f51fc73 | ||
|
|
0f0850ca95 | ||
|
|
ab27f795b7 | ||
|
|
b16a037759 | ||
|
|
1e812ac4d9 | ||
|
|
ecc6815f68 | ||
|
|
ca9f5a676d | ||
|
|
debf9e0ee9 | ||
|
|
15abbb36c2 | ||
|
|
d9b974300f | ||
|
|
e60baf41a9 | ||
|
|
09cb3a22cd | ||
|
|
27ecd35834 | ||
|
|
ff6d180305 | ||
|
|
410b739c23 | ||
|
|
2144b853d1 | ||
|
|
f87c517e6d | ||
|
|
77dac9bd77 | ||
|
|
56cf287b39 | ||
|
|
dc970d9a6b |
@@ -1,10 +1,12 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
INCLUDE(CMakeForceCompiler)
|
||||
set(ARM_PREFIX arm-none-linux-gnueabi)
|
||||
#set(ARM_PREFIX arm-frc-linux-gnueabi)
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
CMAKE_FORCE_CXX_COMPILER(${ARM_PREFIX}-g++ GNU)
|
||||
CMAKE_FORCE_C_COMPILER(${ARM_PREFIX}-gcc GNU)
|
||||
set(CMAKE_CXX_FLAGS "-march=armv7-a -mcpu=cortex-a9 -mfloat-abi=softfp -Wall -Wno-psabi" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g" CACHE STRING "" FORCE) # still want debugging for release?
|
||||
#SET(CMAKE_FIND_ROOT_PATH /usr/arm-frc-linux-gnueabi)
|
||||
SET(CMAKE_FIND_ROOT_PATH $ENV{USER_HOME}/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/arm-none-linux-gnueabi/libc)
|
||||
|
||||
@@ -105,6 +105,7 @@ 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.");
|
||||
@@ -133,7 +134,7 @@ public class WPILibCore extends AbstractUIPlugin {
|
||||
}
|
||||
|
||||
public String getDefaultVersion() {
|
||||
return "2013-test-0.4";
|
||||
return "0.2";
|
||||
}
|
||||
|
||||
public String getCurrentVersion() {
|
||||
|
||||
@@ -22,12 +22,12 @@ import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
|
||||
public abstract class AbstractInstaller {
|
||||
protected File installLocation;
|
||||
protected String version;
|
||||
protected String version, installedVersion;
|
||||
|
||||
public AbstractInstaller(String version) {
|
||||
this.installLocation = new File(WPILibCore.getDefault().getWPILibBaseDir()
|
||||
+ File.separator + getFeatureName() + File.separator + version);
|
||||
public AbstractInstaller(String version, String installedVersion, String path) {
|
||||
this.installLocation = new File(path);
|
||||
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");
|
||||
WPILibCore.logInfo("Install necessary for " + getFeatureName());
|
||||
try {
|
||||
install();
|
||||
} catch (InstallException e) {
|
||||
@@ -64,9 +64,9 @@ public abstract class AbstractInstaller {
|
||||
getErrorMessage(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
updateInstalledVersion(version);
|
||||
WPILibCore.logInfo("Installed");
|
||||
WPILibCore.logInfo("Installed" + getFeatureName());
|
||||
|
||||
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();
|
||||
return installLocation.exists() && !version.contains("DEVELOPMENT") && version.equals(installedVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,7 +138,7 @@ public abstract class AbstractInstaller {
|
||||
}
|
||||
|
||||
// Call 'unzip'
|
||||
final String[] cmd = {"unzip", tmpFile.getAbsolutePath(), "-d", installLocation.getAbsolutePath()};
|
||||
final String[] cmd = {"unzip" , "-o", 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()) {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
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;
|
||||
@@ -11,7 +9,7 @@ import edu.wpi.first.wpilib.plugins.core.preferences.PreferenceConstants;
|
||||
public class ToolsInstaller extends AbstractInstaller {
|
||||
|
||||
public ToolsInstaller(String version) {
|
||||
super(version);
|
||||
super(version, WPILibCore.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLS_VERSION), WPILibCore.getDefault().getWPILibBaseDir() + "/tools");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -22,13 +20,8 @@ public class ToolsInstaller extends AbstractInstaller {
|
||||
@Override
|
||||
protected void updateInstalledVersion(String version) {
|
||||
IPreferenceStore prefs = WPILibCore.getDefault().getPreferenceStore();
|
||||
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);
|
||||
}
|
||||
prefs.setValue(PreferenceConstants.TOOLS_VERSION, version);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,8 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
IPreferenceStore store = WPILibCore.getDefault().getPreferenceStore();
|
||||
store.setDefault(PreferenceConstants.TEAM_NUMBER,
|
||||
WPILibCore.getDefault().getProjectProperties(null).getProperty("team-number", "0"));
|
||||
store.setDefault(PreferenceConstants.TOOLS_VERSION, WPILibCore.getDefault().getDefaultVersion());
|
||||
store.setDefault(PreferenceConstants.UPDATE_TOOLS_VERSION, true);
|
||||
String val = store.getString(PreferenceConstants.TOOLS_VERSION);
|
||||
if (!store.contains(PreferenceConstants.TOOLS_VERSION) && val != null)
|
||||
store.setValue(PreferenceConstants.TOOLS_VERSION, "none");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
|
||||
}
|
||||
|
||||
private String getCurrentVersion() {
|
||||
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
|
||||
return "4.4.1-csery-gcc";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -11,7 +11,8 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
|
||||
public class ToolchainInstaller extends AbstractInstaller {
|
||||
|
||||
public ToolchainInstaller(String version) {
|
||||
super(version);
|
||||
super(version,
|
||||
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED), WPILibCPPPlugin.getDefault().getToolchain());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -21,11 +22,8 @@ public class ToolchainInstaller extends AbstractInstaller {
|
||||
|
||||
@Override
|
||||
protected void updateInstalledVersion(String 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);
|
||||
}
|
||||
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
|
||||
version);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
|
||||
}
|
||||
|
||||
private String getCurrentVersion() {
|
||||
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
|
||||
return "4.4.1-csery-gcc";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -11,7 +11,9 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
|
||||
public class ToolchainInstaller extends AbstractInstaller {
|
||||
|
||||
public ToolchainInstaller(String version) {
|
||||
super(version);
|
||||
super(version,
|
||||
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED),
|
||||
WPILibCPPPlugin.getDefault().getToolchain());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -21,16 +23,12 @@ public class ToolchainInstaller extends AbstractInstaller {
|
||||
|
||||
@Override
|
||||
protected void updateInstalledVersion(String 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);
|
||||
}
|
||||
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
|
||||
version);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InputStream getInstallResourceStream() {
|
||||
return ToolchainInstaller.class.getResourceAsStream("/resources/toolchain.zip");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<feature
|
||||
id="edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature"
|
||||
label="Windows Toolchain for Robot C++ Development"
|
||||
version="0.2.0"
|
||||
version="0.3.0"
|
||||
provider-name="Worcester Polytechnic Institute"
|
||||
os="win32">
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature</artifactId>
|
||||
<version>0.2.0</version>
|
||||
<version>0.3.0</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
|
||||
<parent>
|
||||
|
||||
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Windows
|
||||
Bundle-SymbolicName: edu.wpi.first.wpilib.plugins.cpp.toolchains.windows;singleton:=true
|
||||
Bundle-Version: 0.2.0
|
||||
Bundle-Version: 0.3.0
|
||||
Bundle-Activator: edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.Activator
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>edu.wpi.first.wpilib.plugins.cpp.toolchains.windows</artifactId>
|
||||
<version>0.2.0</version>
|
||||
<version>0.3.0</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<parent>
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin implements IStartup {
|
||||
}
|
||||
|
||||
private String getCurrentVersion() {
|
||||
return WPILibCPPPlugin.getDefault().getDefaultToolchainVersion();
|
||||
return "4.4.1-csery-gcc";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -11,7 +11,8 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
|
||||
public class ToolchainInstaller extends AbstractInstaller {
|
||||
|
||||
public ToolchainInstaller(String version) {
|
||||
super(version);
|
||||
super(version,
|
||||
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_INSTALLED), WPILibCPPPlugin.getDefault().getToolchain());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -21,11 +22,8 @@ public class ToolchainInstaller extends AbstractInstaller {
|
||||
|
||||
@Override
|
||||
protected void updateInstalledVersion(String 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);
|
||||
}
|
||||
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.TOOLCHAIN_INSTALLED,
|
||||
version);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,7 +57,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,$cpp-location/lib" 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>
|
||||
|
||||
@@ -27,3 +27,6 @@ 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
|
||||
|
||||
@@ -58,13 +58,9 @@ 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 + getPreferenceStore().getString(PreferenceConstants.TOOLCHAIN_VERSION);
|
||||
+ File.separator + "toolchains" + File.separator + "current";
|
||||
}
|
||||
|
||||
public String getCurrentVersion() {
|
||||
@@ -82,7 +78,7 @@ public class WPILibCPPPlugin extends AbstractUIPlugin implements IStartup {
|
||||
|
||||
public String getCPPDir() {
|
||||
return WPILibCore.getDefault().getWPILibBaseDir()
|
||||
+ File.separator + "cpp" + File.separator + getPreferenceStore().getString(PreferenceConstants.LIBRARY_VERSION);
|
||||
+ File.separator + "cpp" + File.separator + "current";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
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;
|
||||
@@ -19,28 +14,23 @@ import edu.wpi.first.wpilib.plugins.cpp.preferences.PreferenceConstants;
|
||||
public class CPPInstaller extends AbstractInstaller {
|
||||
|
||||
public CPPInstaller(String version) {
|
||||
super(version);
|
||||
super(version,
|
||||
WPILibCPPPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.LIBRARY_INSTALLED), WPILibCPPPlugin.getDefault().getCPPDir());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFeatureName() {
|
||||
return "cpp";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateInstalledVersion(String 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);
|
||||
}
|
||||
WPILibCPPPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.LIBRARY_INSTALLED,
|
||||
version);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected InputStream getInstallResourceStream() {
|
||||
return CPPInstaller.class.getResourceAsStream("/resources/cpp.zip");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFeatureName()
|
||||
{
|
||||
return "cpp";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,6 @@ package edu.wpi.first.wpilib.plugins.cpp.preferences;
|
||||
* Constant definitions for plug-in preferences
|
||||
*/
|
||||
public class PreferenceConstants {
|
||||
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";
|
||||
public static final String LIBRARY_INSTALLED = "libraryVersion_current";
|
||||
public static final String TOOLCHAIN_INSTALLED = "toolchainVersion_current";
|
||||
}
|
||||
|
||||
@@ -18,11 +18,8 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
*/
|
||||
public void initializeDefaultPreferences() {
|
||||
IPreferenceStore store = WPILibCPPPlugin.getDefault().getPreferenceStore();
|
||||
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);
|
||||
if (!store.contains(PreferenceConstants.LIBRARY_INSTALLED))
|
||||
store.setValue(PreferenceConstants.LIBRARY_INSTALLED,
|
||||
"none");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="tail -F -s 0 -n 0 ${deploy.log.file}"/>
|
||||
command="tail -F -n 0 ${deploy.log.file}"/>
|
||||
</target>
|
||||
|
||||
<target name="kill-program" depends="get-target-ip" description="Kill the currently running FRC program">
|
||||
|
||||
@@ -157,15 +157,6 @@
|
||||
</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
|
||||
|
||||
@@ -78,12 +78,16 @@ 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/"+getCurrentVersion()+"/ant/build.properties");
|
||||
File file = new File(WPILibCore.getDefault().getWPILibBaseDir()+"/java/current/ant/build.properties");
|
||||
props = new AntPropertiesParser(new FileInputStream(file)).getProperties(defaults);
|
||||
} catch (Exception e) {
|
||||
WPILibJavaPlugin.logError("Error getting properties.", e);
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
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;
|
||||
@@ -19,7 +16,9 @@ import edu.wpi.first.wpilib.plugins.java.preferences.PreferenceConstants;
|
||||
public class JavaInstaller extends AbstractInstaller {
|
||||
|
||||
public JavaInstaller(String version) {
|
||||
super(version);
|
||||
super(version,
|
||||
WPILibJavaPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.LIBRARY_INSTALLED),
|
||||
WPILibJavaPlugin.getDefault().getJavaPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -30,14 +29,7 @@ public class JavaInstaller extends AbstractInstaller {
|
||||
@Override
|
||||
protected void updateInstalledVersion(String version) {
|
||||
IPreferenceStore prefs = WPILibJavaPlugin.getDefault().getPreferenceStore();
|
||||
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();
|
||||
prefs.setValue(PreferenceConstants.LIBRARY_INSTALLED, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,5 @@ package edu.wpi.first.wpilib.plugins.java.preferences;
|
||||
* Constant definitions for plug-in preferences
|
||||
*/
|
||||
public class PreferenceConstants {
|
||||
public static final String LIBRARY_VERSION = "libraryVersionPreference";
|
||||
public static final String UPDATE_LIBRARY_VERSION = "udpateLibraryVersionPreference";
|
||||
public static final String LIBRARY_INSTALLED = "libraryVersion_current";
|
||||
}
|
||||
|
||||
@@ -18,9 +18,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
*/
|
||||
public void initializeDefaultPreferences() {
|
||||
IPreferenceStore store = WPILibJavaPlugin.getDefault().getPreferenceStore();
|
||||
store.setDefault(PreferenceConstants.LIBRARY_VERSION,
|
||||
WPILibCore.getDefault().getProjectProperties(null)
|
||||
.getProperty("version", WPILibJavaPlugin.getDefault().getCurrentVersion()));
|
||||
store.setDefault(PreferenceConstants.UPDATE_LIBRARY_VERSION, true);
|
||||
if (!store.contains(PreferenceConstants.LIBRARY_INSTALLED))
|
||||
store.setValue(PreferenceConstants.LIBRARY_INSTALLED, "none");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,10 @@ password=
|
||||
deploy.dir=/home/admin
|
||||
deploy.kill.command=. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r
|
||||
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
|
||||
deploy.log.command=tail -F -s 0 -n 0 ${deploy.log.file}
|
||||
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}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<feature url="features/edu.wpi.first.wpilib.plugins.cpp.toolchains.mac.feature_0.2.0.jar" id="edu.wpi.first.wpilib.plugins.cpp.toolchains.mac.feature" version="0.2.0">
|
||||
<category name="edu.wpi.first.wpilib.plugins.cpp.toolchains"/>
|
||||
</feature>
|
||||
<feature url="features/edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature_0.2.0.jar" id="edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature" version="0.2.0">
|
||||
<feature url="features/edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature_0.3.0.jar" id="edu.wpi.first.wpilib.plugins.cpp.toolchains.windows.feature" version="0.3.0">
|
||||
<category name="edu.wpi.first.wpilib.plugins.cpp.toolchains"/>
|
||||
</feature>
|
||||
<category-def name="edu.wpi.first.wpilib.plugins" label="WPILib Robot Development">
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
#ifndef __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
#define __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
|
||||
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_7
|
||||
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_8
|
||||
|
||||
#endif // __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_nInterfaceGlobals_h__
|
||||
#define __nFRC_2015_1_0_7_nInterfaceGlobals_h__
|
||||
#ifndef __nFRC_2015_1_0_8_nInterfaceGlobals_h__
|
||||
#define __nFRC_2015_1_0_8_nInterfaceGlobals_h__
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
extern unsigned int g_currentTargetClass;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_nInterfaceGlobals_h__
|
||||
#endif // __nFRC_2015_1_0_8_nInterfaceGlobals_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_AI_h__
|
||||
#define __nFRC_2015_1_0_7_AI_h__
|
||||
#ifndef __nFRC_2015_1_0_8_AI_h__
|
||||
#define __nFRC_2015_1_0_8_AI_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tAI
|
||||
@@ -140,4 +140,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_AI_h__
|
||||
#endif // __nFRC_2015_1_0_8_AI_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_AO_h__
|
||||
#define __nFRC_2015_1_0_7_AO_h__
|
||||
#ifndef __nFRC_2015_1_0_8_AO_h__
|
||||
#define __nFRC_2015_1_0_8_AO_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tAO
|
||||
@@ -47,4 +47,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_AO_h__
|
||||
#endif // __nFRC_2015_1_0_8_AO_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Accel_h__
|
||||
#define __nFRC_2015_1_0_7_Accel_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Accel_h__
|
||||
#define __nFRC_2015_1_0_8_Accel_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tAccel
|
||||
@@ -99,4 +99,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Accel_h__
|
||||
#endif // __nFRC_2015_1_0_8_Accel_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Accumulator_h__
|
||||
#define __nFRC_2015_1_0_7_Accumulator_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Accumulator_h__
|
||||
#define __nFRC_2015_1_0_8_Accumulator_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tAccumulator
|
||||
@@ -84,4 +84,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Accumulator_h__
|
||||
#endif // __nFRC_2015_1_0_8_Accumulator_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Alarm_h__
|
||||
#define __nFRC_2015_1_0_7_Alarm_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Alarm_h__
|
||||
#define __nFRC_2015_1_0_8_Alarm_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tAlarm
|
||||
@@ -54,4 +54,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Alarm_h__
|
||||
#endif // __nFRC_2015_1_0_8_Alarm_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_AnalogTrigger_h__
|
||||
#define __nFRC_2015_1_0_7_AnalogTrigger_h__
|
||||
#ifndef __nFRC_2015_1_0_8_AnalogTrigger_h__
|
||||
#define __nFRC_2015_1_0_8_AnalogTrigger_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tAnalogTrigger
|
||||
@@ -126,4 +126,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_AnalogTrigger_h__
|
||||
#endif // __nFRC_2015_1_0_8_AnalogTrigger_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_BIST_h__
|
||||
#define __nFRC_2015_1_0_7_BIST_h__
|
||||
#ifndef __nFRC_2015_1_0_8_BIST_h__
|
||||
#define __nFRC_2015_1_0_8_BIST_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tBIST
|
||||
@@ -87,4 +87,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_BIST_h__
|
||||
#endif // __nFRC_2015_1_0_8_BIST_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Counter_h__
|
||||
#define __nFRC_2015_1_0_7_Counter_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Counter_h__
|
||||
#define __nFRC_2015_1_0_8_Counter_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tCounter
|
||||
@@ -216,4 +216,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Counter_h__
|
||||
#endif // __nFRC_2015_1_0_8_Counter_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_DIO_h__
|
||||
#define __nFRC_2015_1_0_7_DIO_h__
|
||||
#ifndef __nFRC_2015_1_0_8_DIO_h__
|
||||
#define __nFRC_2015_1_0_8_DIO_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tDIO
|
||||
@@ -245,4 +245,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_DIO_h__
|
||||
#endif // __nFRC_2015_1_0_8_DIO_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_DMA_h__
|
||||
#define __nFRC_2015_1_0_7_DMA_h__
|
||||
#ifndef __nFRC_2015_1_0_8_DMA_h__
|
||||
#define __nFRC_2015_1_0_8_DMA_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tDMA
|
||||
@@ -185,4 +185,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_DMA_h__
|
||||
#endif // __nFRC_2015_1_0_8_DMA_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Encoder_h__
|
||||
#define __nFRC_2015_1_0_7_Encoder_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Encoder_h__
|
||||
#define __nFRC_2015_1_0_8_Encoder_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tEncoder
|
||||
@@ -196,4 +196,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Encoder_h__
|
||||
#endif // __nFRC_2015_1_0_8_Encoder_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Global_h__
|
||||
#define __nFRC_2015_1_0_7_Global_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Global_h__
|
||||
#define __nFRC_2015_1_0_8_Global_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tGlobal
|
||||
@@ -101,4 +101,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Global_h__
|
||||
#endif // __nFRC_2015_1_0_8_Global_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Interrupt_h__
|
||||
#define __nFRC_2015_1_0_7_Interrupt_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Interrupt_h__
|
||||
#define __nFRC_2015_1_0_8_Interrupt_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tInterrupt
|
||||
@@ -90,4 +90,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Interrupt_h__
|
||||
#endif // __nFRC_2015_1_0_8_Interrupt_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_PWM_h__
|
||||
#define __nFRC_2015_1_0_7_PWM_h__
|
||||
#ifndef __nFRC_2015_1_0_8_PWM_h__
|
||||
#define __nFRC_2015_1_0_8_PWM_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tPWM
|
||||
@@ -80,6 +80,15 @@ 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
|
||||
@@ -108,4 +117,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_PWM_h__
|
||||
#endif // __nFRC_2015_1_0_8_PWM_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Power_h__
|
||||
#define __nFRC_2015_1_0_7_Power_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Power_h__
|
||||
#define __nFRC_2015_1_0_8_Power_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tPower
|
||||
@@ -214,4 +214,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Power_h__
|
||||
#endif // __nFRC_2015_1_0_8_Power_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_Relay_h__
|
||||
#define __nFRC_2015_1_0_7_Relay_h__
|
||||
#ifndef __nFRC_2015_1_0_8_Relay_h__
|
||||
#define __nFRC_2015_1_0_8_Relay_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tRelay
|
||||
@@ -65,4 +65,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_Relay_h__
|
||||
#endif // __nFRC_2015_1_0_8_Relay_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_SPI_h__
|
||||
#define __nFRC_2015_1_0_7_SPI_h__
|
||||
#ifndef __nFRC_2015_1_0_8_SPI_h__
|
||||
#define __nFRC_2015_1_0_8_SPI_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tSPI
|
||||
@@ -65,4 +65,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_SPI_h__
|
||||
#endif // __nFRC_2015_1_0_8_SPI_h__
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_2015_1_0_7_SysWatchdog_h__
|
||||
#define __nFRC_2015_1_0_7_SysWatchdog_h__
|
||||
#ifndef __nFRC_2015_1_0_8_SysWatchdog_h__
|
||||
#define __nFRC_2015_1_0_8_SysWatchdog_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_7
|
||||
namespace nFRC_2015_1_0_8
|
||||
{
|
||||
|
||||
class tSysWatchdog
|
||||
@@ -98,4 +98,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_7_SysWatchdog_h__
|
||||
#endif // __nFRC_2015_1_0_8_SysWatchdog_h__
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
ni-libraries/libFRC_NetworkCommunication.so.1.5.0
Executable file → Normal file
BIN
ni-libraries/libFRC_NetworkCommunication.so.1.5.0
Executable file → Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ni-libraries/libFRC_NetworkCommunicationLV.so.1.5.0
Executable file → Normal file
BIN
ni-libraries/libFRC_NetworkCommunicationLV.so.1.5.0
Executable file → Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ni-libraries/libRoboRIO_FRC_ChipObject.so.1.2.0
Executable file → Normal file
BIN
ni-libraries/libRoboRIO_FRC_ChipObject.so.1.2.0
Executable file → Normal file
Binary file not shown.
BIN
ni-libraries/libfrccanfirmwareupdate.so
Executable file → Normal file
BIN
ni-libraries/libfrccanfirmwareupdate.so
Executable file → Normal file
Binary file not shown.
Binary file not shown.
0
ni-libraries/libfrccansae.so.1.0.0
Executable file → Normal file
0
ni-libraries/libfrccansae.so.1.0.0
Executable file → Normal file
Binary file not shown.
Binary file not shown.
BIN
ni-libraries/libi2c.so.1.0.0
Executable file → Normal file
BIN
ni-libraries/libi2c.so.1.0.0
Executable file → Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
0
ni-libraries/libspi.so.1.0.0
Executable file → Normal file
0
ni-libraries/libspi.so.1.0.0
Executable file → Normal file
@@ -4,7 +4,6 @@ project(WPILibC++)
|
||||
file(GLOB_RECURSE SRC_FILES src/*.cpp)
|
||||
include_directories(include/ ${NWT_API_INCLUDES} ${HAL_API_INCLUDES})
|
||||
add_library(WPILib STATIC ${SRC_FILES})
|
||||
set(CMAKE_CXX_FLAGS "-fPIC")
|
||||
target_link_libraries(WPILib)
|
||||
INSTALL(TARGETS WPILib ARCHIVE DESTINATION lib COMPONENT lib)
|
||||
INSTALL(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT headers)
|
||||
|
||||
@@ -18,7 +18,7 @@ static const char *kTableName = "Preferences";
|
||||
/** The value of the save field */
|
||||
static const char *kSaveField = "~S A V E~";
|
||||
/** The file to save to */
|
||||
static const char *kFileName = "wpilib-preferences.ini";
|
||||
static const char *kFileName = "/home/lvuser/wpilib-preferences.ini";
|
||||
/** The characters to put between a field and value */
|
||||
static const char *kValuePrefix = "=\"";
|
||||
/** The characters to put after the value */
|
||||
|
||||
@@ -3,6 +3,6 @@ project(WPILibC++IntegrationTests)
|
||||
|
||||
file(GLOB_RECURSE SRC_FILES src/*.cpp src/gtest/src/gtest-all.cc src/gtest/src/gtest_main.cc)
|
||||
include_directories(include/ src/gtest/ src/gtest/include/ ../wpilibC++Devices/include/ ${WPILIB_INCLUDES} ${HAL_API_INCLUDES} ${NWT_API_INCLUDES})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||
add_executable(FRCUserProgram ${SRC_FILES})
|
||||
target_link_libraries(FRCUserProgram WPILib WPILibAthena WPILib HALAthena NetworkTables ${NI_LIBS})
|
||||
|
||||
target_link_libraries(FRCUserProgram WPILib WPILibAthena WPILib HALAthena NetworkTables ${NI_LIBS} rt)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <cstdio>
|
||||
#include <fstream>
|
||||
|
||||
static const char *kFileName = "wpilib-preferences.ini";
|
||||
static const char *kFileName = "/home/lvuser/wpilib-preferences.ini";
|
||||
static const double kSaveTime = 0.2;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(WPILibSim)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2 -Wall -Wextra -Wno-unused-parameter -fPIC")
|
||||
|
||||
get_filename_component(HAL_API_INCLUDES $ENV{ALLWPILIB}/hal/include REALPATH)
|
||||
get_filename_component(NWT_API_INCLUDES $ENV{ALLWPILIB}/networktables/cpp/include REALPATH)
|
||||
add_subdirectory(build/wpilibC++)
|
||||
|
||||
@@ -9,13 +9,36 @@ import edu.wpi.first.wpilibj.hal.HALUtil;
|
||||
import edu.wpi.first.wpilibj.livewindow.LiveWindowSendable;
|
||||
import edu.wpi.first.wpilibj.tables.ITable;
|
||||
|
||||
/**
|
||||
* Class for operating the PCM (Pneumatics compressor module)
|
||||
* The PCM automatically will run in close-loop mode by default whenever a Solenoid object is
|
||||
* created. For most cases the Compressor object does not need to be
|
||||
* instantiated or used in a robot program.
|
||||
*
|
||||
* This class is only required in cases where more detailed status or to enable/disable
|
||||
* closed loop control. Note: you cannot operate the compressor directly from this class as
|
||||
* doing so would circumvent the safety provided in using the pressure switch and closed
|
||||
* loop control. You can only turn off closed loop control, thereby stopping the compressor
|
||||
* from operating.
|
||||
*/
|
||||
public class Compressor extends SensorBase implements LiveWindowSendable {
|
||||
private ByteBuffer m_pcm;
|
||||
|
||||
/**
|
||||
* Create an instance of the Compressor
|
||||
* @param pcmID
|
||||
* The PCM CAN device ID. Most robots that use PCM will have a single module. Use this
|
||||
* for supporting a second module other than the default.
|
||||
*/
|
||||
public Compressor(int pcmId) {
|
||||
initCompressor(pcmId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of the Compressor
|
||||
* Makes a new instance of the compressor using the default address. Additional modules can be
|
||||
* supported by making a new instancce and specifying the CAN ID
|
||||
*/
|
||||
public Compressor() {
|
||||
initCompressor(getDefaultSolenoidModule());
|
||||
}
|
||||
@@ -26,14 +49,30 @@ public class Compressor extends SensorBase implements LiveWindowSendable {
|
||||
m_pcm = CompressorJNI.initializeCompressor((byte)module);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the compressor running in closed loop control mode
|
||||
* Use the method in cases where you would like to manually stop and start the compressor
|
||||
* for applications such as conserving battery or making sure that the compressor motor
|
||||
* doesn't start during critical operations.
|
||||
*/
|
||||
public void start() {
|
||||
setClosedLoopControl(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the compressor from running in closed loop control mode.
|
||||
* Use the method in cases where you would like to manually stop and start the compressor
|
||||
* for applications such as conserving battery or making sure that the compressor motor
|
||||
* doesn't start during critical operations.
|
||||
*/
|
||||
public void stop() {
|
||||
setClosedLoopControl(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enabled status of the compressor
|
||||
* @returns true if the compressor is on
|
||||
*/
|
||||
public boolean enabled() {
|
||||
ByteBuffer status = ByteBuffer.allocateDirect(4);
|
||||
status.order(ByteOrder.LITTLE_ENDIAN);
|
||||
@@ -44,6 +83,10 @@ public class Compressor extends SensorBase implements LiveWindowSendable {
|
||||
return on;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current pressure switch value
|
||||
* @return true if the pressure is low by reading the pressure switch that is plugged into the PCM
|
||||
*/
|
||||
public boolean getPressureSwitchValue() {
|
||||
ByteBuffer status = ByteBuffer.allocateDirect(4);
|
||||
status.order(ByteOrder.LITTLE_ENDIAN);
|
||||
@@ -54,6 +97,10 @@ public class Compressor extends SensorBase implements LiveWindowSendable {
|
||||
return on;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current being used by the compressor
|
||||
* @return current consumed in amps for the compressor motor
|
||||
*/
|
||||
public float getCompressorCurrent() {
|
||||
ByteBuffer status = ByteBuffer.allocateDirect(4);
|
||||
status.order(ByteOrder.LITTLE_ENDIAN);
|
||||
@@ -64,6 +111,12 @@ public class Compressor extends SensorBase implements LiveWindowSendable {
|
||||
return current;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the PCM in closed loop control mode
|
||||
* @param on
|
||||
* If true sets the compressor to be in closed loop control mode otherwise
|
||||
* normal operation of the compressor is disabled.
|
||||
*/
|
||||
public void setClosedLoopControl(boolean on) {
|
||||
ByteBuffer status = ByteBuffer.allocateDirect(4);
|
||||
status.order(ByteOrder.LITTLE_ENDIAN);
|
||||
@@ -72,6 +125,10 @@ public class Compressor extends SensorBase implements LiveWindowSendable {
|
||||
HALUtil.checkStatus(status.asIntBuffer());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current operating mode of the PCM
|
||||
* @return true if compressor is operating on closed-loop mode, otherwise return false.
|
||||
*/
|
||||
public boolean getClosedLoopControl() {
|
||||
ByteBuffer status = ByteBuffer.allocateDirect(4);
|
||||
status.order(ByteOrder.LITTLE_ENDIAN);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Preferences {
|
||||
/**
|
||||
* The file to save to
|
||||
*/
|
||||
private static final String FILE_NAME = "wpilib-preferences.ini";
|
||||
private static final String FILE_NAME = "/home/lvuser/wpilib-preferences.ini";
|
||||
/**
|
||||
* The characters to put between a field and value
|
||||
*/
|
||||
|
||||
@@ -94,7 +94,7 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
*/
|
||||
protected static void checkDigitalChannel(final int channel) {
|
||||
if (channel < 0 || channel >= kDigitalChannels) {
|
||||
System.err.println("Requested digital channel number is out of range.");
|
||||
throw new IndexOutOfBoundsException("Requested digital channel number is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,6 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
*/
|
||||
protected static void checkRelayChannel(final int channel) {
|
||||
if (channel < 0 || channel >= kRelayChannels) {
|
||||
System.err.println("Requested relay channel number is out of range.");
|
||||
throw new IndexOutOfBoundsException("Requested relay channel number is out of range.");
|
||||
}
|
||||
}
|
||||
@@ -121,7 +120,6 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
*/
|
||||
protected static void checkPWMChannel(final int channel) {
|
||||
if (channel < 0 || channel >= kPwmChannels) {
|
||||
System.err.println("Requested PWM channel number is out of range.");
|
||||
throw new IndexOutOfBoundsException("Requested PWM channel number is out of range.");
|
||||
}
|
||||
}
|
||||
@@ -134,8 +132,8 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
* @param channel The channel number to check.
|
||||
*/
|
||||
protected static void checkAnalogInputChannel(final int channel) {
|
||||
if (channel <= 0 || channel > kAnalogInputChannels) {
|
||||
System.err.println("Requested analog channel number is out of range.");
|
||||
if (channel < 0 || channel >= kAnalogInputChannels) {
|
||||
throw new IndexOutOfBoundsException("Requested analog input channel number is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,8 +145,8 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
* @param channel The channel number to check.
|
||||
*/
|
||||
protected static void checkAnalogOutputChannel(final int channel) {
|
||||
if (channel <= 0 || channel > kAnalogOutputChannels) {
|
||||
System.err.println("Requested analog channel number is out of range.");
|
||||
if (channel < 0 || channel >= kAnalogOutputChannels) {
|
||||
throw new IndexOutOfBoundsException("Requested analog output channel number is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +158,7 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
*/
|
||||
protected static void checkSolenoidChannel(final int channel) {
|
||||
if (channel < 0 || channel >= kSolenoidChannels) {
|
||||
System.err.println("Requested solenoid channel number is out of range.");
|
||||
throw new IndexOutOfBoundsException("Requested solenoid channel number is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +170,7 @@ public abstract class SensorBase { // TODO: Refactor
|
||||
*/
|
||||
protected static void checkPDPChannel(final int channel) {
|
||||
if (channel < 0 || channel >= kPDPChannels) {
|
||||
System.err.println("Requested solenoid channel number is out of range.");
|
||||
throw new IndexOutOfBoundsException("Requested PDP channel number is out of range.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class SolenoidBase extends SensorBase {
|
||||
* @param mask The channels you want to be affected.
|
||||
*/
|
||||
protected synchronized void set(int value, int mask) {
|
||||
IntBuffer status = IntBuffer.allocate(1);
|
||||
IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer();
|
||||
for (int i = 0; i < SensorBase.kSolenoidChannels; i++) {
|
||||
int local_mask = 1 << i;
|
||||
if ((mask & local_mask) != 0)
|
||||
@@ -62,7 +62,7 @@ public abstract class SolenoidBase extends SensorBase {
|
||||
*/
|
||||
public byte getAll() {
|
||||
byte value = 0;
|
||||
IntBuffer status = IntBuffer.allocate(1);
|
||||
IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer();
|
||||
for (int i = 0; i < SensorBase.kSolenoidChannels; i++) {
|
||||
value |= SolenoidJNI.getSolenoid(m_ports[i], status) << i;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import edu.wpi.first.wpilibj.test.AbstractComsSetup;
|
||||
*/
|
||||
public class PrefrencesTest extends AbstractComsSetup {
|
||||
private static final Logger logger = Logger.getLogger(PrefrencesTest.class.getName());
|
||||
|
||||
|
||||
private NetworkTable prefTable;
|
||||
private Preferences pref;
|
||||
private long check;
|
||||
@@ -45,7 +45,7 @@ public class PrefrencesTest extends AbstractComsSetup {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
try {
|
||||
File file = new File("wpilib-preferences.ini");
|
||||
File file = new File("/home/lvuser/wpilib-preferences.ini");
|
||||
file.mkdirs();
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
@@ -109,7 +109,7 @@ public class PrefrencesTest extends AbstractComsSetup {
|
||||
assertEquals(pref.getFloat("checkedValueFloat", 0), 1, 0);
|
||||
assertTrue(pref.getBoolean("checkedValueBoolean", false));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testPreferencesToNetworkTables(){
|
||||
String networkedNumber = "networkCheckedValue";
|
||||
|
||||
Reference in New Issue
Block a user