mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Compare commits
233 Commits
jenkins-re
...
jenkins-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46dc99a115 | ||
|
|
91d714d2e9 | ||
|
|
9a28aaaa7c | ||
|
|
96a76ba89e | ||
|
|
d26059a4fb | ||
|
|
ee0d835304 | ||
|
|
6080a3b186 | ||
|
|
3d06a763a2 | ||
|
|
e1480ec798 | ||
|
|
a5d9ba412c | ||
|
|
2434515d41 | ||
|
|
741618250b | ||
|
|
8b8d7e77cd | ||
|
|
c093a553ee | ||
|
|
a1375e58cd | ||
|
|
15ff7f5038 | ||
|
|
c17ba98f72 | ||
|
|
dee755ab19 | ||
|
|
92c54f5f5d | ||
|
|
1fde00643f | ||
|
|
47443b4e1e | ||
|
|
f01e5b5570 | ||
|
|
22c4207553 | ||
|
|
bea9eb0efa | ||
|
|
b72eb4b812 | ||
|
|
0d8c454727 | ||
|
|
d61d491a02 | ||
|
|
786e844a9f | ||
|
|
170b5860ee | ||
|
|
26c50ebe02 | ||
|
|
46c659d6b6 | ||
|
|
6fdd491081 | ||
|
|
fe4535dfa0 | ||
|
|
636e2e13ad | ||
|
|
d3f5b74668 | ||
|
|
8116bbd15b | ||
|
|
37052246a5 | ||
|
|
a649d3b553 | ||
|
|
6a7e7cf611 | ||
|
|
77997e52fb | ||
|
|
e655072efc | ||
|
|
0427fc34c4 | ||
|
|
e33d80be14 | ||
|
|
8381eee185 | ||
|
|
1c24096cc9 | ||
|
|
3a684d28b2 | ||
|
|
8786b242b2 | ||
|
|
b29a4bebf2 | ||
|
|
db0b421019 | ||
|
|
8efe998270 | ||
|
|
ac60198842 | ||
|
|
8a5ee71fd8 | ||
|
|
af4ce1074a | ||
|
|
7636041393 | ||
|
|
745489fec7 | ||
|
|
04f9ca4feb | ||
|
|
ca5dfbe492 | ||
|
|
07619a37a0 | ||
|
|
34d3d756ea | ||
|
|
61a5fcce18 | ||
|
|
82c4563d34 | ||
|
|
fa337bc747 | ||
|
|
8ae7e973f2 | ||
|
|
574f2e692a | ||
|
|
827341caa2 | ||
|
|
dd272e6bcb | ||
|
|
3bdaa63a28 | ||
|
|
41b393c210 | ||
|
|
11cf860ecd | ||
|
|
2168d2cb77 | ||
|
|
430722c4a3 | ||
|
|
497f38fe0e | ||
|
|
9f2dcdeab6 | ||
|
|
ac07142e4c | ||
|
|
19a7243bfc | ||
|
|
e3ac0b628c | ||
|
|
709a88ad68 | ||
|
|
6b844b52ec | ||
|
|
9056edf932 | ||
|
|
ff2ea1287d | ||
|
|
b41690b387 | ||
|
|
ce8e65d41e | ||
|
|
66622b43e7 | ||
|
|
568b842c73 | ||
|
|
4d142cdafa | ||
|
|
2ae8f40a58 | ||
|
|
4833316571 | ||
|
|
16f9db30a9 | ||
|
|
e092742f40 | ||
|
|
4f6fa2482b | ||
|
|
52408e2658 | ||
|
|
d986ffac81 | ||
|
|
bc3c5447e7 | ||
|
|
b125e6b40a | ||
|
|
88a043bda4 | ||
|
|
c57d01af94 | ||
|
|
6abde412c1 | ||
|
|
5e6cd0bf9e | ||
|
|
ec03c3068d | ||
|
|
45f3b76103 | ||
|
|
dac04cb4a2 | ||
|
|
7d026be264 | ||
|
|
5893d28f39 | ||
|
|
cd01945908 | ||
|
|
36c53667cd | ||
|
|
ea610eb302 | ||
|
|
d04476bb2f | ||
|
|
2bb0a32c15 | ||
|
|
cdbe80315f | ||
|
|
517e708fd8 | ||
|
|
70825be690 | ||
|
|
43532198c7 | ||
|
|
4da9ebe1fd | ||
|
|
9479793e1d | ||
|
|
20e9f499b0 | ||
|
|
3d897cef58 | ||
|
|
fa229f2b13 | ||
|
|
b1056cf6d7 | ||
|
|
8e707169a1 | ||
|
|
47961c8b13 | ||
|
|
b59f4141c4 | ||
|
|
d62d82b28b | ||
|
|
a9d30c0389 | ||
|
|
6e0c84d942 | ||
|
|
bb8ea17acf | ||
|
|
c683e24aa9 | ||
|
|
7b371f6d7c | ||
|
|
f6de7bc961 | ||
|
|
c00d9f1523 | ||
|
|
6ec2d262c8 | ||
|
|
3c8b31608c | ||
|
|
29f36b0eac | ||
|
|
486885e8bf | ||
|
|
020d97580a | ||
|
|
28a41e4ac2 | ||
|
|
f590cda8f9 | ||
|
|
c98f54dbbc | ||
|
|
81840b2c49 | ||
|
|
78ccb48fd3 | ||
|
|
b9913d3e12 | ||
|
|
56430ccd7c | ||
|
|
d412584f16 | ||
|
|
364a3afad4 | ||
|
|
97456f40f7 | ||
|
|
7e5ed03d28 | ||
|
|
14a1e6ae8e | ||
|
|
529f5b773f | ||
|
|
91c70daf5b | ||
|
|
e86312cd6f | ||
|
|
99dc3c90ed | ||
|
|
4ad8818a8a | ||
|
|
e4babbe4d6 | ||
|
|
9ec5164075 | ||
|
|
033e5f37b4 | ||
|
|
e3d256e441 | ||
|
|
867e4080dc | ||
|
|
4be9732e9c | ||
|
|
cd29e1c32f | ||
|
|
e73b3ed7b5 | ||
|
|
d7a9794080 | ||
|
|
6234fe06f5 | ||
|
|
c7a90b2ccc | ||
|
|
e5443f0e78 | ||
|
|
0abe19a1ae | ||
|
|
ccd64090bb | ||
|
|
c6891fc034 | ||
|
|
6f4d6ed998 | ||
|
|
0670ff145f | ||
|
|
655ade6436 | ||
|
|
7cfa0d04d7 | ||
|
|
f1476be276 | ||
|
|
9be6ee4712 | ||
|
|
9050ea7e3d | ||
|
|
c1f68eb2b0 | ||
|
|
fb53eea6b2 | ||
|
|
6c294e137b | ||
|
|
988defee16 | ||
|
|
279ae1cd9d | ||
|
|
49f6b90d15 | ||
|
|
6cd5eeab6f | ||
|
|
c883c9e2fc | ||
|
|
54951c888f | ||
|
|
739508ff83 | ||
|
|
f67849a9b1 | ||
|
|
7c5b3c6286 | ||
|
|
eb536ba340 | ||
|
|
19737ba443 | ||
|
|
9f0bed2e6f | ||
|
|
86e4c3b77c | ||
|
|
e216d1abd6 | ||
|
|
20aeb5c6cc | ||
|
|
3ad31dd4d7 | ||
|
|
4c5b8c8c46 | ||
|
|
747cdc8a58 | ||
|
|
c3c7baa15c | ||
|
|
2fdb7c8eba | ||
|
|
1d0a6b8ace | ||
|
|
08fdf45f6e | ||
|
|
7338471194 | ||
|
|
da0cc0c83f | ||
|
|
6e0637e771 | ||
|
|
8d49d8255b | ||
|
|
3b53f84c8f | ||
|
|
05bb3cdd71 | ||
|
|
18de3aebdd | ||
|
|
de5e5ab405 | ||
|
|
6b6e5d9530 | ||
|
|
fa20e6ca4f | ||
|
|
e56aa87af4 | ||
|
|
63bb8e1f32 | ||
|
|
c1e63acc14 | ||
|
|
68ba9bfeae | ||
|
|
aa643d8ba7 | ||
|
|
1f8a3d5bf3 | ||
|
|
2fa04c1750 | ||
|
|
cd3db9631e | ||
|
|
8ccb99d87c | ||
|
|
b14ca08474 | ||
|
|
b898cec901 | ||
|
|
687e2c6711 | ||
|
|
594d0d8029 | ||
|
|
0f825b7179 | ||
|
|
345ceafa0d | ||
|
|
b030be68d3 | ||
|
|
fba155804e | ||
|
|
97f954aef6 | ||
|
|
80194e9809 | ||
|
|
767686ae2e | ||
|
|
7f30b6bff4 | ||
|
|
8c395ca292 | ||
|
|
5b2520c35f | ||
|
|
fa8d7b843c | ||
|
|
c68ee3001e |
14
.gitignore
vendored
14
.gitignore
vendored
@@ -10,6 +10,11 @@ bin/
|
||||
.project
|
||||
.classpath
|
||||
**/dependency-reduced-pom.xml
|
||||
wpilibj/wpilibJavaJNI/nivision/*.c
|
||||
wpilibj/wpilibJavaJNI/nivision/*.cpp
|
||||
wpilibj/wpilibJavaJNI/nivision/*.s
|
||||
wpilibj/wpilibJavaJNI/nivision/*_arm.ini
|
||||
wpilibj/wpilibJavaJNI/nivision/*.java
|
||||
|
||||
# Created by the jenkins test script
|
||||
test-reports
|
||||
@@ -17,8 +22,9 @@ test-reports
|
||||
# Added by the users of vagrant
|
||||
jdk-7u45-linux-arm-vfp-sflt.gz
|
||||
|
||||
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
|
||||
# Created by http://www.gitignore.io
|
||||
|
||||
@@ -154,6 +160,10 @@ local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
### Python ###
|
||||
*.pyc
|
||||
__pycache__
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.8)
|
||||
project(All-WPILib)
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter -fPIC")
|
||||
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||
|
||||
file(GLOB_RECURSE NI_LIBS ni-libraries/*.so*)
|
||||
list(REMOVE_ITEM NI_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/ni-libraries/libwpi.so ${CMAKE_CURRENT_SOURCE_DIR}/ni-libraries/libwpi_2015.so)
|
||||
|
||||
@@ -52,4 +52,11 @@
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="edu.wpi.first.wpilib.plugins.riolog"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
toolbarPath="WPILib"
|
||||
tooltip="Launch the SmartDashboard to get feedback from the robot.">
|
||||
</action>
|
||||
<action
|
||||
class="edu.wpi.first.wpilib.plugins.core.actions.RunSimulationSmartDashboardAction"
|
||||
icon="icons/smartdashboard16x16.png"
|
||||
id="edu.wpi.first.wpilib.plugins.core.actions.RunSimulationSmartDashboardAction"
|
||||
label="Run S&imulation SmartDashboard"
|
||||
menubarPath="edu.wpi.first.wpilib.plugins.core.menu/edu.wpi.first.wpilib.plugins.core.actions"
|
||||
tooltip="Launch the SmartDashboard to get feedback from a simulated robot.">
|
||||
</action>
|
||||
<action
|
||||
class="edu.wpi.first.wpilib.plugins.core.actions.RunRobotBuilderAction"
|
||||
icon="icons/robotbuilder16x16.png"
|
||||
|
||||
@@ -85,6 +85,28 @@
|
||||
<outputDirectory>${tools-zip}</outputDirectory>
|
||||
<destFileName>SmartDashboard.jar</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilib</groupId>
|
||||
<artifactId>sfx</artifactId>
|
||||
<type>zip</type>
|
||||
<classifier>zip</classifier>
|
||||
<outputDirectory>${tools-zip}/../</outputDirectory>
|
||||
<destFileName>sfx.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilib.networktables</groupId>
|
||||
<artifactId>OutlineViewer</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<outputDirectory>${tools-zip}</outputDirectory>
|
||||
<destFileName>OutlineViewer.jar</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>edu.wpi.first.wpilib</groupId>
|
||||
<artifactId>java-installer</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<outputDirectory>${tools-zip}</outputDirectory>
|
||||
<destFileName>java-installer.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
@@ -129,6 +151,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<unzip src="${tools-zip}/../sfx.zip" dest="${tools-zip}"/>
|
||||
<zip destfile="${project.build.directory}/classes/resources/tools.zip"
|
||||
basedir="${tools-zip}"
|
||||
update="true" />
|
||||
@@ -194,5 +217,16 @@
|
||||
<artifactId>SmartDashboard</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilib</groupId>
|
||||
<artifactId>sfx</artifactId>
|
||||
<type>zip</type>
|
||||
<version>LATEST</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>edu.wpi.first.wpilib.networktables</groupId>
|
||||
<artifactId>OutlineViewer</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package edu.wpi.first.wpilib.plugins.core.actions;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
|
||||
/**
|
||||
* Our sample action implements workbench action delegate.
|
||||
* The action proxy will be created by the workbench and
|
||||
* shown in the UI. When the user tries to use the action,
|
||||
* this delegate will be created and execution will be
|
||||
* delegated to it.
|
||||
* @see IWorkbenchWindowActionDelegate
|
||||
*/
|
||||
public class RunSimulationSmartDashboardAction implements IWorkbenchWindowActionDelegate {
|
||||
/**
|
||||
* The constructor.
|
||||
*/
|
||||
public RunSimulationSmartDashboardAction() {
|
||||
}
|
||||
|
||||
/**
|
||||
* The action has been activated. The argument of the
|
||||
* method represents the 'real' action sitting
|
||||
* in the workbench UI.
|
||||
* @see IWorkbenchWindowActionDelegate#run
|
||||
*/
|
||||
public void run(IAction action) {
|
||||
File dir = new File(WPILibCore.getDefault().getWPILibBaseDir()+File.separator+"tools");
|
||||
File[] files = dir.listFiles(new FilenameFilter() {
|
||||
@Override public boolean accept(File dir, String name) {
|
||||
return name.startsWith("SmartDashboard") && name.endsWith(".jar");
|
||||
}
|
||||
});
|
||||
if (files == null || files.length < 1) return;
|
||||
String[] cmd = {"java", "-jar", files[0].getAbsolutePath(), "-ip", "localhost"};
|
||||
try {
|
||||
DebugPlugin.exec(cmd, new File(System.getProperty("user.home")));
|
||||
} catch (CoreException e) {
|
||||
WPILibCore.logError("Error running SmartDashboard.", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Selection in the workbench has been changed. We
|
||||
* can change the state of the 'real' action here
|
||||
* if we want, but this can only happen after
|
||||
* the delegate has been created.
|
||||
* @see IWorkbenchWindowActionDelegate#selectionChanged
|
||||
*/
|
||||
public void selectionChanged(IAction action, ISelection selection) {
|
||||
}
|
||||
|
||||
/**
|
||||
* We can use this method to dispose of any system
|
||||
* resources we previously allocated.
|
||||
* @see IWorkbenchWindowActionDelegate#dispose
|
||||
*/
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
/**
|
||||
* We will cache window object in order to
|
||||
* be able to provide parent shell for the message dialog.
|
||||
* @see IWorkbenchWindowActionDelegate#init
|
||||
*/
|
||||
public void init(IWorkbenchWindow window) {
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,6 @@ import java.io.OutputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
@@ -17,6 +15,7 @@ import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
|
||||
@@ -117,7 +116,7 @@ public abstract class AbstractInstaller {
|
||||
protected void install() throws InstallException {
|
||||
if(installLocation.exists()) {
|
||||
if(!removeFileHandler(installLocation, true)) {
|
||||
JOptionPane.showMessageDialog(null,
|
||||
MessageDialog.openError(null, "Error",
|
||||
String.format("Could not update the old wpilib folder.%n"
|
||||
+ "Please close any WPILib tools and restart Eclipse."));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package edu.wpi.first.wpilib.plugins.core.launching;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
|
||||
public class SimulationNotification {
|
||||
private static final String URL = "https://wpilib.screenstepslive.com/s/4485/m/23353";
|
||||
private static final String SIMULATION_UNSUPPORTED_MSG =
|
||||
"Simulation is unsupported on your current setup.\n" +
|
||||
"For more information see: " + URL;
|
||||
|
||||
public static void showUnsupported() {
|
||||
String title = "Simulation Unsupported";
|
||||
String message = SIMULATION_UNSUPPORTED_MSG;
|
||||
MessageDialog.openError(null, title, message);
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI(URL));
|
||||
} catch (IOException e) {
|
||||
WPILibCore.logError("Can't open "+URL, e);
|
||||
} catch (URISyntaxException e) {
|
||||
WPILibCore.logError("Can't open "+URL, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean supportsSimulation() {
|
||||
String[] cmd = {"frcsim", "--version"};
|
||||
try {
|
||||
DebugPlugin.exec(cmd, new File(System.getProperty("user.home")));
|
||||
return true;
|
||||
} catch (CoreException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,10 +36,10 @@ public abstract class ExampleWizard extends Wizard implements INewWizard {
|
||||
*/
|
||||
protected abstract void doFinish(IExampleProject ex, String teamNumber) throws CoreException;
|
||||
|
||||
protected abstract IWizardPage getDetailsPage();
|
||||
protected abstract IWizardPage getDetailsPage(INewProjectInfo info);
|
||||
|
||||
public abstract IExampleProject makeExampleProject(String name, String description,
|
||||
List<String> tags, List<String> folders, List<IExampleProject.ExportFile> files);
|
||||
List<String> tags, String world, List<String> folders, List<IExampleProject.ExportFile> files);
|
||||
|
||||
public abstract URL getResourceURL();
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class ExampleWizard extends Wizard implements INewWizard {
|
||||
}
|
||||
page1 = new ExampleWizardChoicePage(this, selection);
|
||||
addPage(page1);
|
||||
page2 = getDetailsPage();
|
||||
page2 = getDetailsPage(page1);
|
||||
addPage(page2);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.event.ChangeListener;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
@@ -36,11 +37,12 @@ import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
* OR with the extension that matches the expected one (mpe).
|
||||
*/
|
||||
|
||||
public class ExampleWizardChoicePage extends WizardPage {
|
||||
public class ExampleWizardChoicePage extends WizardPage implements INewProjectInfo {
|
||||
private Tree exampleTree;
|
||||
private Browser descriptionText;
|
||||
private IExampleProject selectedExample;
|
||||
private ExampleWizard parent;
|
||||
private ChangeListener listener;
|
||||
|
||||
/**
|
||||
* Constructor for SampleNewWizardPage.
|
||||
@@ -89,6 +91,20 @@ public class ExampleWizardChoicePage extends WizardPage {
|
||||
dialogChanged();
|
||||
setControl(container);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
if (selectedExample != null) {
|
||||
return selectedExample.getName();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getWorld() {
|
||||
if (selectedExample != null) {
|
||||
return selectedExample.getWorld();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if the current workbench selection is a suitable container to use.
|
||||
@@ -137,7 +153,6 @@ public class ExampleWizardChoicePage extends WizardPage {
|
||||
/**
|
||||
* Ensures that both text fields are set.
|
||||
*/
|
||||
|
||||
private void dialogChanged() {
|
||||
if (exampleTree.getSelection().length > 0) {
|
||||
Object selectedData = exampleTree.getSelection()[0].getData();
|
||||
@@ -157,6 +172,7 @@ public class ExampleWizardChoicePage extends WizardPage {
|
||||
return;
|
||||
}
|
||||
|
||||
listener.stateChanged(null);
|
||||
updateStatus(null);
|
||||
}
|
||||
|
||||
@@ -211,6 +227,11 @@ public class ExampleWizardChoicePage extends WizardPage {
|
||||
tags.add(tagElementList.item(i).getTextContent());
|
||||
}
|
||||
}
|
||||
String world = "";
|
||||
if (element.getElementsByTagName("world") != null &&
|
||||
element.getElementsByTagName("world").item(0) != null) {
|
||||
world = element.getElementsByTagName("world").item(0).getTextContent();
|
||||
}
|
||||
List<String> packages = new ArrayList<String>();
|
||||
tagsElement = element.getElementsByTagName("packages").item(0);
|
||||
if (tagsElement.getNodeType() == Node.ELEMENT_NODE) {
|
||||
@@ -231,10 +252,15 @@ public class ExampleWizardChoicePage extends WizardPage {
|
||||
}
|
||||
}
|
||||
}
|
||||
return parent.makeExampleProject(name, description, tags, packages, files);
|
||||
return parent.makeExampleProject(name, description, tags, world, packages, files);
|
||||
}
|
||||
|
||||
public IExampleProject getExampleProject() {
|
||||
return selectedExample;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerChangeListener(ChangeListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,10 @@ public interface IExampleProject extends ProjectType {
|
||||
this.destination = destination;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The world file to use for simulation, if empty
|
||||
* the default is used.
|
||||
*/
|
||||
String getWorld();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package edu.wpi.first.wpilib.plugins.core.wizards;
|
||||
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
public interface INewProjectInfo {
|
||||
String getName();
|
||||
String getWorld();
|
||||
void registerChangeListener(ChangeListener changeListener);
|
||||
|
||||
public static INewProjectInfo Null = new INewProjectInfo() {
|
||||
@Override
|
||||
public String getWorld() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerChangeListener(ChangeListener changeListener) {}
|
||||
};
|
||||
}
|
||||
@@ -39,6 +39,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
private boolean showPackage;
|
||||
private boolean showProjectTypes;
|
||||
private TeamNumberPage teamNumberPage;
|
||||
private INewProjectInfo info;
|
||||
|
||||
/**
|
||||
* Constructor for SampleNewWizardPage.
|
||||
@@ -46,17 +47,20 @@ public class NewProjectMainPage extends WizardPage {
|
||||
*
|
||||
* @param pageName
|
||||
*/
|
||||
public NewProjectMainPage(ISelection selection, TeamNumberPage teamNumberPage) {
|
||||
public NewProjectMainPage(ISelection selection, TeamNumberPage teamNumberPage, INewProjectInfo info) {
|
||||
super("wizardPage");
|
||||
this.teamNumberPage = teamNumberPage;
|
||||
showPackage = true;
|
||||
showProjectTypes = false;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see IDialogPage#createControl(Composite)
|
||||
*/
|
||||
public void createControl(Composite parent) {
|
||||
System.out.println(info.getName() +" -- "+ info.getWorld());
|
||||
|
||||
Composite container = new Composite(parent, SWT.NULL);
|
||||
GridLayout layout = new GridLayout();
|
||||
container.setLayout(layout);
|
||||
@@ -130,7 +134,7 @@ public class NewProjectMainPage extends WizardPage {
|
||||
comp.setLayout(groupLayout);
|
||||
worldText = new Text(comp, SWT.BORDER | SWT.SINGLE);
|
||||
worldText.setLayoutData(gd);
|
||||
worldText.setText("/usr/share/frcsim/worlds/GearsBotDemo.world");
|
||||
worldText.setText("/usr/share/frcsim/worlds/GearsBotDemo.world");
|
||||
worldText.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
dialogChanged();
|
||||
@@ -161,11 +165,18 @@ public class NewProjectMainPage extends WizardPage {
|
||||
@Override public void stateChanged(ChangeEvent e) {
|
||||
String teamNumber = TeamNumberPage.getTeamNumberFromPage(teamNumberPage);
|
||||
packageText.setText("org.usfirst.frc.team"+teamNumber+".robot");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
info.registerChangeListener(new ChangeListener() {
|
||||
@Override public void stateChanged(ChangeEvent e) {
|
||||
projectNameText.setText(info.getName());
|
||||
if (!"".equals(info.getWorld())) {
|
||||
worldText.setText(info.getWorld());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
@@ -48,4 +49,8 @@ public class ProjectComboField {
|
||||
combo.addModifyListener(modifyListener);
|
||||
}
|
||||
|
||||
public void addSelectionListener(SelectionListener selectionListener) {
|
||||
combo.addSelectionListener(selectionListener);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -80,6 +80,12 @@ public class ProjectCreationUtils {
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
WPILibCore.logError("Can't create new project.", e);
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog.openError(Display.getDefault().getActiveShell(), "Error", "Error creating project! This may occur if a project of the same name with different case exists in the Workspace");
|
||||
}
|
||||
});
|
||||
}
|
||||
}else {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<option id="gnu.cpp.compiler.option.debugging.level.969129918" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.option.include.paths.394786621" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${WPILIB}/cpp/current/include""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src}""/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.dialect.std.1060340803" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1033680971" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
||||
@@ -40,6 +41,7 @@
|
||||
<option id="gnu.cpp.link.option.paths.1566479969" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""${WPILIB}/cpp/current/lib""/>
|
||||
</option>
|
||||
<option id="gnu.cpp.link.option.flags.675338432" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a" valueType="string"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.132949138" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
@@ -55,55 +57,6 @@
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.release.300115601">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.release.300115601" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="FRCUserProgram" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.release.300115601" name="Release" parent="cdt.managedbuild.config.gnu.cross.exe.release">
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.release.300115601." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.release.2008160346" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.release">
|
||||
<option id="cdt.managedbuild.option.gnu.cross.prefix.511797597" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix" value="arm-frc-linux-gnueabi-" valueType="string"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.2130959809" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
|
||||
<builder buildPath="${workspace_loc:/$project}/Release" id="cdt.managedbuild.builder.gnu.cross.1554116591" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.985086840" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
|
||||
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.2030238370" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
|
||||
<option id="gnu.c.compiler.option.debugging.level.188807954" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.884664323" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1342658383" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
|
||||
<option id="gnu.cpp.compiler.option.optimization.level.1371546365" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
|
||||
<option id="gnu.cpp.compiler.option.debugging.level.1242574722" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1782227077" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1397048702" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.716979188" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.126686576" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
</inputType>
|
||||
</tool>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.886832650" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1915412749" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.671283127" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.2017904325" moduleId="org.eclipse.cdt.core.settings" name="Simulate">
|
||||
<externalSettings/>
|
||||
@@ -129,7 +82,7 @@
|
||||
<listOptionValue builtIn="false" value="${WPILIB}/cpp/current/sim/include"/>
|
||||
<listOptionValue builtIn="false" value="/usr/include"/>
|
||||
<listOptionValue builtIn="false" value="/usr/include/gazebo-3.1"/>
|
||||
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.0"/>
|
||||
<listOptionValue builtIn="false" value="/usr/include/sdformat-2.2"/>
|
||||
</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"/>
|
||||
<option id="gnu.cpp.compiler.option.debugging.level.937474733" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
|
||||
@@ -143,9 +96,7 @@
|
||||
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.66697269" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
|
||||
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.2094820582" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
|
||||
<option id="gnu.cpp.link.option.libs.1563598353" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="WPILibSim"/>
|
||||
<listOptionValue builtIn="false" value="WPILib"/>
|
||||
<listOptionValue builtIn="false" value="gazebo"/>
|
||||
<listOptionValue builtIn="false" value="gazebo_transport"/>
|
||||
<listOptionValue builtIn="false" value="gazebo_msgs"/>
|
||||
@@ -182,12 +133,6 @@
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751;cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.;cdt.managedbuild.tool.gnu.cross.c.compiler.1261239456;cdt.managedbuild.tool.gnu.c.compiler.input.1793678673">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.300115601;cdt.managedbuild.config.gnu.cross.exe.release.300115601.;cdt.managedbuild.tool.gnu.cross.c.compiler.985086840;cdt.managedbuild.tool.gnu.c.compiler.input.884664323">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.300115601;cdt.managedbuild.config.gnu.cross.exe.release.300115601.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1342658383;cdt.managedbuild.tool.gnu.cpp.compiler.input.1782227077">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1104744751;cdt.managedbuild.config.gnu.cross.exe.debug.1104744751.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1505235107;cdt.managedbuild.tool.gnu.cpp.compiler.input.1033680971">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
@@ -197,9 +142,6 @@
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/$project"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/$project"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Simulate">
|
||||
<resource resourceType="PROJECT" workspacePath="/$project"/>
|
||||
</configuration>
|
||||
|
||||
@@ -1,20 +1,3 @@
|
||||
# Deployment information
|
||||
username=admin
|
||||
password=
|
||||
deploy.dir=/home/admin
|
||||
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
|
||||
deploy.log.file=/var/local/natinst/log/FRC_UserProgram.log
|
||||
command.dir=/home/lvuser/
|
||||
|
||||
# Libraries to use
|
||||
wpilib=${user.home}/wpilib/cpp/${cpp-version}
|
||||
wpilib.lib=${wpilib}/lib
|
||||
|
||||
# Ant support
|
||||
wpilib.ant.dir=${wpilib}/ant
|
||||
jsch.jar=${wpilib.ant.dir}/jsch-0.1.50.jar
|
||||
classloadertask.jar=${wpilib.ant.dir}/ant-classloadertask.jar
|
||||
|
||||
# Build information
|
||||
out=FRCUserProgram
|
||||
src.dir=src
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
<property file="${user.home}/wpilib/wpilib.properties"/>
|
||||
<property file="build.properties"/>
|
||||
<property file="${user.home}/wpilib/cpp/${version}/ant/build.properties"/>
|
||||
|
||||
<import file="${wpilib.ant.dir}/build.xml"/>
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@ private:
|
||||
|
||||
void AutonomousInit()
|
||||
{
|
||||
autonomousCommand->Start();
|
||||
if (autonomousCommand != NULL)
|
||||
autonomousCommand->Start();
|
||||
}
|
||||
|
||||
void AutonomousPeriodic()
|
||||
@@ -37,7 +38,8 @@ private:
|
||||
// teleop starts running. If you want the autonomous to
|
||||
// continue until interrupted by another command, remove
|
||||
// this line or comment it out.
|
||||
autonomousCommand->Cancel();
|
||||
if (autonomousCommand != NULL)
|
||||
autonomousCommand->Cancel();
|
||||
}
|
||||
|
||||
void TeleopPeriodic()
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
while (IsOperatorControl() && IsEnabled())
|
||||
{
|
||||
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
|
||||
Wait(0.005); // wait for a motor update time
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
while (IsOperatorControl() && IsEnabled())
|
||||
{
|
||||
// Get the current going through channel 7, in Amperes.
|
||||
// The PDP returns the current in increments of 0.125A.
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This sample shows how to use the new CANTalon to just run a motor in a basic
|
||||
* throttle mode, in the same manner as you might control a traditional PWM
|
||||
* controlled motor.
|
||||
*
|
||||
*/
|
||||
class Robot : public SampleRobot {
|
||||
CANTalon m_motor;
|
||||
|
||||
Joystick m_stick;
|
||||
|
||||
// update every 0.01 seconds/10 milliseconds.
|
||||
// The talon only receives control packets every 10ms.
|
||||
double kUpdatePeriod = 0.010;
|
||||
|
||||
public:
|
||||
Robot()
|
||||
: m_motor(1), // Initialize the Talon as device 1. Use the roboRIO web
|
||||
// interface to change the device number on the talons.
|
||||
m_stick(0)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Runs the motor from the output of a Joystick.
|
||||
*/
|
||||
void OperatorControl() {
|
||||
while (IsOperatorControl() && IsEnabled()) {
|
||||
// Takes a number from -1.0 (full reverse) to +1.0 (full forwards).
|
||||
m_motor.Set(m_stick.GetY());
|
||||
|
||||
Wait(kUpdatePeriod); // Wait a bit so that the loop doesn't lock everything up.
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot);
|
||||
@@ -0,0 +1,63 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* This is a quick sample program to show how to use the new Talon SRX over CAN.
|
||||
* This particular sample demonstrates running a basic PID control loop with an
|
||||
* analog potentiometer.
|
||||
*
|
||||
*/
|
||||
class Robot : public SampleRobot {
|
||||
CANTalon m_motor;
|
||||
|
||||
public:
|
||||
Robot()
|
||||
: m_motor(1) // Initialize the Talon as device 1. Use the roboRIO web
|
||||
// interface to change the device number on the m_motors.
|
||||
{
|
||||
// This sets the mode of the m_motor. The options are:
|
||||
// kPercentVbus: basic throttle; no closed-loop.
|
||||
// kCurrent: Runs the motor with the specified current if possible.
|
||||
// kSpeed: Runs a PID control loop to keep the motor going at a constant
|
||||
// speed using the specified sensor.
|
||||
// kPosition: Runs a PID control loop to move the motor to a specified move
|
||||
// the motor to a specified sensor position.
|
||||
// kVoltage: Runs the m_motor at a constant voltage, if possible.
|
||||
// kFollower: The m_motor will run at the same throttle as the specified other talon.
|
||||
m_motor.SetControlMode(CANSpeedController::kPosition);
|
||||
// This command allows you to specify which feedback device to use when doing
|
||||
// closed-loop control. The options are:
|
||||
// AnalogPot: Basic analog potentiometer
|
||||
// QuadEncoder: Quadrature Encoder
|
||||
// AnalogEncoder: Analog Encoder
|
||||
// EncRising: Counts the rising edges of the QuadA pin (allows use of a
|
||||
// non-quadrature encoder)
|
||||
// EncFalling: Same as EncRising, but counts on falling edges.
|
||||
m_motor.SetFeedbackDevice(CANTalon::AnalogPot);
|
||||
// This sets the basic P, I , and D values (F, Izone, and rampRate can also
|
||||
// be set, but are ignored here).
|
||||
// These must all be positive floating point numbers (SetSensorDirection will
|
||||
// multiply the sensor values by negative one in case your sensor is flipped
|
||||
// relative to your motor).
|
||||
// These values are in units of throttle / sensor_units where throttle ranges
|
||||
// from -1023 to +1023 and sensor units are from 0 - 1023 for analog
|
||||
// potentiometers, encoder ticks for encoders, and position / 10ms for
|
||||
// speeds.
|
||||
m_motor.SetPID(1.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the motor from the output of a Joystick.
|
||||
*/
|
||||
void OperatorControl() {
|
||||
while (IsOperatorControl() && IsEnabled()) {
|
||||
// In closed loop mode, this sets the goal in the units mentioned above.
|
||||
// Since we are using an analog potentiometer, this will try to go to
|
||||
// the middle of the potentiometer range.
|
||||
m_motor.Set(512);
|
||||
|
||||
Wait(5.0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(Robot);
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
while (IsOperatorControl() && IsEnabled())
|
||||
{
|
||||
// Retrieve the net displacement of the Encoder since the lsat Reset.
|
||||
SmartDashboard::PutNumber("Encoder Distance", m_encoder.GetDistance());
|
||||
|
||||
@@ -13,7 +13,7 @@ private:
|
||||
SpeedController* motor;
|
||||
Potentiometer* pot;
|
||||
|
||||
static const double kP_real = 4, kI_real = 0.07,
|
||||
static constexpr double kP_real = 4, kI_real = 0.07,
|
||||
kP_simulation = 18, kI_simulation = 0.2;
|
||||
|
||||
public:
|
||||
|
||||
@@ -13,7 +13,7 @@ private:
|
||||
SpeedController* motor;
|
||||
Potentiometer* pot; // TODO: Make Potentiometer
|
||||
|
||||
static const double kP_real = 1, kP_simulation = 0.05;
|
||||
static constexpr double kP_real = 1, kP_simulation = 0.05;
|
||||
|
||||
public:
|
||||
Wrist();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* Uses IMAQdx to manually acquire a new image each frame, and annotate the image by drawing
|
||||
* a circle on it, and show it on the FRC Dashboard.
|
||||
*/
|
||||
class IntermediateVisionRobot : public SampleRobot
|
||||
{
|
||||
IMAQdxSession session;
|
||||
Image *frame;
|
||||
IMAQdxError imaqError;
|
||||
|
||||
public:
|
||||
void RobotInit() override {
|
||||
// create an image
|
||||
frame = imaqCreateImage(IMAQ_IMAGE_RGB, 0);
|
||||
// open the camera
|
||||
imaqError = IMAQdxOpenCamera("cam0", IMAQdxCameraControlModeController, &session);
|
||||
if(imaqError != IMAQdxErrorSuccess) {
|
||||
DriverStation::ReportError("IMAQdxOpenCamera error: " + std::to_string((long)imaqError) + "\n");
|
||||
}
|
||||
imaqError = IMAQdxConfigureGrab(session);
|
||||
if(imaqError != IMAQdxErrorSuccess) {
|
||||
DriverStation::ReportError("IMAQdxConfigureGrab error: " + std::to_string((long)imaqError) + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
void OperatorControl() override {
|
||||
// acquire images
|
||||
IMAQdxStartAcquisition(session);
|
||||
|
||||
// grab an image, draw the circle, and provide it for the camera server which will
|
||||
// in turn send it to the dashboard.
|
||||
while(IsOperatorControl() && IsEnabled()) {
|
||||
IMAQdxGrab(session, frame, true, NULL);
|
||||
if(imaqError != IMAQdxErrorSuccess) {
|
||||
DriverStation::ReportError("IMAQdxGrab error: " + std::to_string((long)imaqError) + "\n");
|
||||
} else {
|
||||
imaqDrawShapeOnImage(frame, frame, { 10, 10, 100, 100 }, DrawMode::IMAQ_DRAW_VALUE, ShapeMode::IMAQ_SHAPE_OVAL, 0.0f);
|
||||
CameraServer::GetInstance()->SetImage(frame);
|
||||
}
|
||||
}
|
||||
// stop image acquisition
|
||||
IMAQdxStopAcquisition(session);
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(IntermediateVisionRobot);
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
void OperatorControl()
|
||||
{
|
||||
robotDrive.SetSafetyEnabled(false);
|
||||
while (IsOperatorControl())
|
||||
while (IsOperatorControl() && IsEnabled())
|
||||
{
|
||||
// Use the joystick X axis for lateral movement, Y axis for forward movement, and Z axis for rotation.
|
||||
// This sample does not use field-oriented drive, so the gyro input is set to zero.
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
* Runs the motor from the output of a Joystick.
|
||||
*/
|
||||
void OperatorControl() {
|
||||
while (IsOperatorControl()) {
|
||||
while (IsOperatorControl() && IsEnabled()) {
|
||||
// Set the motor controller's output.
|
||||
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed forwards).
|
||||
m_motor.Set(m_stick.GetY());
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
* Simultaneously displays encoder values on the SmartDashboard.
|
||||
*/
|
||||
void OperatorControl() {
|
||||
while (IsOperatorControl()) {
|
||||
while (IsOperatorControl() && IsEnabled()) {
|
||||
// Set the motor controller's output.
|
||||
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed forwards).
|
||||
m_motor.Set(m_stick.GetY());
|
||||
|
||||
@@ -12,8 +12,8 @@ private:
|
||||
double driveForwardSpeed;
|
||||
double distance;
|
||||
double error;
|
||||
static const double TOLERANCE = .1;
|
||||
static const double KP = -1.0 / 5.0;
|
||||
static constexpr double TOLERANCE = .1;
|
||||
static constexpr double KP = -1.0 / 5.0;
|
||||
void init(double dist, double maxSpeed);
|
||||
public:
|
||||
DriveForward();
|
||||
|
||||
@@ -13,9 +13,9 @@ class Collector: public Subsystem
|
||||
{
|
||||
public:
|
||||
// Constants for some useful speeds
|
||||
static const double FORWARD = 1;
|
||||
static const double STOP = 0;
|
||||
static const double REVERSE = -1;
|
||||
static constexpr double FORWARD = 1;
|
||||
static constexpr double STOP = 0;
|
||||
static constexpr double REVERSE = -1;
|
||||
|
||||
private:
|
||||
// Subsystem devices
|
||||
|
||||
@@ -12,10 +12,10 @@ class Pivot: public PIDSubsystem
|
||||
{
|
||||
public:
|
||||
// Constants for some useful angles
|
||||
static const double COLLECT = 105;
|
||||
static const double LOW_GOAL = 90;
|
||||
static const double SHOOT = 45;
|
||||
static const double SHOOT_NEAR = 30;
|
||||
static constexpr double COLLECT = 105;
|
||||
static constexpr double LOW_GOAL = 90;
|
||||
static constexpr double SHOOT = 45;
|
||||
static constexpr double SHOOT_NEAR = 30;
|
||||
|
||||
private:
|
||||
// Subsystem devices
|
||||
|
||||
@@ -17,7 +17,7 @@ private:
|
||||
Compressor* compressor;
|
||||
#endif
|
||||
|
||||
static const double MAX_PRESSURE = 2.55;
|
||||
static constexpr double MAX_PRESSURE = 2.55;
|
||||
|
||||
public:
|
||||
Pneumatics();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
* Uses the CameraServer class to automatically capture video from a USB webcam
|
||||
* and send it to the FRC dashboard without doing any vision processing. This
|
||||
* is the easiest way to get camera images to the dashboard. Just add this to the
|
||||
* RobotInit() method in your program.
|
||||
*/
|
||||
class QuickVisionRobot : public SampleRobot
|
||||
{
|
||||
public:
|
||||
void RobotInit() override {
|
||||
CameraServer::GetInstance()->SetQuality(75);
|
||||
CameraServer::GetInstance()->StartAutomaticCapture();
|
||||
}
|
||||
|
||||
void OperatorControl() override {
|
||||
}
|
||||
};
|
||||
|
||||
START_ROBOT_CLASS(QuickVisionRobot);
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
while (IsOperatorControl() && IsEnabled())
|
||||
{
|
||||
// Retrieve the button values. GetRawButton will return
|
||||
// true if the button is pressed and false if not.
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
*/
|
||||
void OperatorControl()
|
||||
{
|
||||
while (IsOperatorControl())
|
||||
while (IsOperatorControl() && IsEnabled())
|
||||
{
|
||||
// The output of GetRawButton is true/false depending on whether
|
||||
// the button is pressed; Set takes a boolean for for whether to
|
||||
|
||||
@@ -87,7 +87,12 @@
|
||||
<description>Example programs that demonstrate the use of the various commonly used sensors on FRC robots</description>
|
||||
</tagDescription>
|
||||
|
||||
<example>
|
||||
<tagDescription>
|
||||
<name>Vision</name>
|
||||
<description>Example programs that demonstrate the use of a camera for image acquisition and processing</description>
|
||||
</tagDescription>
|
||||
|
||||
<example>
|
||||
<name>Motor Controller</name>
|
||||
<description>Demonstrate controlling a single motor with a Joystick.</description>
|
||||
<tags>
|
||||
@@ -123,6 +128,40 @@
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>CAN Talon SRX</name>
|
||||
<description>Quick demo of running the SRX at a given throttle value.</description>
|
||||
<tags>
|
||||
<tag>Robot and Motor</tag>
|
||||
<tag>Digital</tag>
|
||||
<tag>Actuators</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/CANTalon/src/Robot.cpp" destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>CAN Talon SRX PID</name>
|
||||
<description>Quick demo of running the SRX with a PID loop.</description>
|
||||
<tags>
|
||||
<tag>Robot and Motor</tag>
|
||||
<tag>Digital</tag>
|
||||
<tag>Actuators</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/CANTalonPID/src/Robot.cpp" destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Relay</name>
|
||||
<description>Demonstrate controlling a Relay from Joystick buttons.</description>
|
||||
@@ -240,8 +279,45 @@
|
||||
destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
|
||||
<example>
|
||||
<name>Simple vision program</name>
|
||||
<description>The minimal program to acquire images from an attached USB camera on the robot
|
||||
and send them to the dashboard.</description>
|
||||
<tags>
|
||||
<tag>Vision</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/QuickVision/src/Robot.cpp"
|
||||
destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Intermediate vision</name>
|
||||
<description>An example program that acquires images from an attached USB camera and adds some
|
||||
annotation to the image as you might do for showing operators the result of some image
|
||||
recognition, and sends it to the dashboard for display.
|
||||
</description>
|
||||
<tags>
|
||||
<tag>Vision</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/IntermediateVision/src/Robot.cpp"
|
||||
destination="src/Robot.cpp"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
|
||||
<example>
|
||||
<name>GearsBot</name>
|
||||
<description>A fully functional example CommandBased program for
|
||||
WPIs GearsBot robot. This code can run on your computer if it
|
||||
@@ -250,6 +326,7 @@
|
||||
<tag>CommandBased Robot</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
<world>/usr/share/frcsim/worlds/GearsBotDemo.world</world>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
<package>src/Commands</package>
|
||||
@@ -333,7 +410,8 @@
|
||||
<tags>
|
||||
<tag>CommandBased Robot</tag>
|
||||
<tag>Complete List</tag>
|
||||
</tags>
|
||||
</tags>
|
||||
<world>/usr/share/frcsim/worlds/PacGoat2014.world</world>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
<package>src/Commands</package>
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
void OperatorControl()
|
||||
{
|
||||
myRobot.SetSafetyEnabled(true);
|
||||
while (IsOperatorControl())
|
||||
while (IsOperatorControl() && IsEnabled())
|
||||
{
|
||||
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
|
||||
Wait(0.005); // wait for a motor update time
|
||||
|
||||
@@ -154,7 +154,7 @@ public class DeployLaunchShortcut implements ILaunchShortcut
|
||||
"Debug/FRCUserProgram");
|
||||
|
||||
config.setAttribute("org.eclipse.cdt.dsf.gdb.DEBUG_NAME", "arm-frc-linux-gnueabi-gdb");
|
||||
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, "/home/admin/FRCUserProgram");
|
||||
config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, "/home/lvuser/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");
|
||||
|
||||
@@ -43,8 +43,8 @@ public class RSEUtils {
|
||||
RSECorePlugin.getTheCoreRegistry().getSystemTypeById("org.eclipse.rse.systemtype.ssh");
|
||||
host = registry.createHost(profile.getName(), systemType, connectionName, hostName,
|
||||
"The remote target for debugging the robot for team "+teamNumber+".");
|
||||
host.setDefaultUserId("admin");
|
||||
SystemSignonInformation info = new SystemSignonInformation(hostName, "admin",
|
||||
host.setDefaultUserId("lvuser");
|
||||
SystemSignonInformation info = new SystemSignonInformation(hostName, "lvuser",
|
||||
"", systemType);
|
||||
PasswordPersistenceManager.getInstance().add(info, true, false);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.eclipse.ui.IFileEditorInput;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.launching.AntLauncher;
|
||||
import edu.wpi.first.wpilib.plugins.core.launching.SimulationNotification;
|
||||
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
|
||||
|
||||
/**
|
||||
@@ -79,7 +80,12 @@ public class SimulateLaunchShortcut implements ILaunchShortcut {
|
||||
* @param activeProj The project that the script will be run on/from
|
||||
* @param mode The mode it will be run in (ILaunchManager.RUN_MODE or ILaunchManager.DEBUG_MODE)
|
||||
*/
|
||||
public void runConfig(IProject activeProj, String mode){
|
||||
public void runConfig(IProject activeProj, String mode) {
|
||||
if (!SimulationNotification.supportsSimulation()) {
|
||||
SimulationNotification.showUnsupported();
|
||||
return;
|
||||
}
|
||||
|
||||
String targets = "simulate";
|
||||
|
||||
if(mode.equals(ILaunchManager.RUN_MODE)){
|
||||
|
||||
@@ -7,16 +7,17 @@ import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
|
||||
import edu.wpi.first.wpilib.plugins.cpp.wizards.newproject.CPPProjectType;
|
||||
|
||||
public class ExampleCPPProject extends CPPProjectType implements IExampleProject {
|
||||
private String name, description;
|
||||
private String name, description, world;
|
||||
private List<String> tags;
|
||||
private List<String> directories;
|
||||
private List<ExportFile> files;
|
||||
|
||||
public ExampleCPPProject(String name, String description, List<String> tags,
|
||||
List<String> directories, List<ExportFile> files) {
|
||||
String world, List<String> directories, List<ExportFile> files) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.tags = tags;
|
||||
this.world = world;
|
||||
this.directories = directories;
|
||||
this.files = files;
|
||||
}
|
||||
@@ -32,6 +33,10 @@ public class ExampleCPPProject extends CPPProjectType implements IExampleProject
|
||||
public List<String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public String getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFolders(String packageName) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ExampleWizard;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject.ExportFile;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
|
||||
import edu.wpi.first.wpilib.plugins.cpp.WPILibCPPPlugin;
|
||||
@@ -38,9 +39,9 @@ public class ExampleCPPWizard extends ExampleWizard {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IWizardPage getDetailsPage() {
|
||||
protected IWizardPage getDetailsPage(INewProjectInfo info) {
|
||||
if (detailsPage != null) return detailsPage;
|
||||
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage());
|
||||
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage(), info);
|
||||
detailsPage.setTitle("Create Example Robot C++ Project");
|
||||
detailsPage.setDescription("This wizard creates a new example project based on your selection.");
|
||||
detailsPage.setShowPackage(false);
|
||||
@@ -49,8 +50,8 @@ public class ExampleCPPWizard extends ExampleWizard {
|
||||
|
||||
@Override
|
||||
public IExampleProject makeExampleProject(String name, String description,
|
||||
List<String> tags, List<String> folders, List<ExportFile> files) {
|
||||
return new ExampleCPPProject(name, description, tags, folders, files);
|
||||
List<String> tags, String world, List<String> folders, List<ExportFile> files) {
|
||||
return new ExampleCPPProject(name, description, tags, world, folders, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchWizard;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
|
||||
@@ -56,7 +57,7 @@ public class NewCPPWizard extends Wizard implements INewWizard {
|
||||
teamNumberPage = new TeamNumberPage(selection);
|
||||
addPage(teamNumberPage);
|
||||
}
|
||||
page = new NewProjectMainPage(selection, teamNumberPage);
|
||||
page = new NewProjectMainPage(selection, teamNumberPage, INewProjectInfo.Null);
|
||||
page.setTitle("Create New Robot C++ Project");
|
||||
page.setDescription("This wizard creates a new Robot C++ Project configured to use WPILib for programming FRC robots.");
|
||||
page.setShowPackage(false);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Deployment information
|
||||
username=lvuser
|
||||
password=
|
||||
deploy.dir=/home/lvuser
|
||||
deploy.kill.command=/usr/local/frc/bin/frcKillRobot.sh -t -r
|
||||
command.dir=/home/lvuser/
|
||||
|
||||
# Libraries to use
|
||||
wpilib=${user.home}/wpilib/cpp/${cpp-version}
|
||||
wpilib.lib=${wpilib}/lib
|
||||
roboRIOAllowedImages=23
|
||||
|
||||
# Ant support
|
||||
wpilib.ant.dir=${wpilib}/ant
|
||||
jsch.jar=${wpilib.ant.dir}/jsch-0.1.50.jar
|
||||
classloadertask.jar=${wpilib.ant.dir}/ant-classloadertask.jar
|
||||
@@ -19,11 +19,42 @@
|
||||
<!-- Targets -->
|
||||
|
||||
<target name="get-target-ip">
|
||||
<property name="ant.enable.asserts" value="true"/>
|
||||
<property name="target" value="roboRIO-${team-number}.local" />
|
||||
<echo>Target: ${target}</echo>
|
||||
<echo>Trying Target: ${target}</echo>
|
||||
<if>
|
||||
<isreachable host="${target}" timeout="5"/>
|
||||
<then>
|
||||
<echo>roboRIO found via mDNS</echo>
|
||||
</then>
|
||||
<else>
|
||||
<var name="target" unset="true"/>
|
||||
<echo> roboRIO not found via mDNS, falling back to static USB</echo>
|
||||
<property name="target" value="172.22.11.2"/>
|
||||
<if>
|
||||
<isreachable host="${target}" timeout="5"/>
|
||||
<then>
|
||||
<echo>roboRIO found via static USB</echo>
|
||||
</then>
|
||||
<else>
|
||||
<var name="target" unset="true"/>
|
||||
<math result="ip.upper" operand1="${team-number}" operation="/" operand2="100" datatype="int"/>
|
||||
<math result="ip.lower" operand1="${team-number}" operation="%" operand2="100" datatype="int"/>
|
||||
<property name="target" value="10.${ip.upper}.${ip.lower}.2"/>
|
||||
<echo>roboRIO not found via USB, falling back to static address of ${target}</echo>
|
||||
<assert name="roboRIOFound" message="roboRIO not found, please check that the roboRIO is connected, imaged and that the team number is set properly in Eclipse">
|
||||
<bool>
|
||||
<isreachable host="${target}" timeout="5"/>
|
||||
</bool>
|
||||
</assert>
|
||||
<echo>roboRIO found via Ethernet static</echo>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="deploy" depends="get-target-ip" description="Deploy the progam and start it running.">
|
||||
<target name="deploy" depends="get-target-ip, dependencies" description="Deploy the progam and start it running.">
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
@@ -42,11 +73,6 @@
|
||||
trust="true"
|
||||
command=". /etc/profile.d/natinst-path.sh; chmod a+x ${deploy.dir}/${out}; ${deploy.kill.command};"/>
|
||||
|
||||
<sshexec host="${target}"
|
||||
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">
|
||||
@@ -57,28 +83,6 @@
|
||||
command="/usr/local/frc/bin/frcKillRobot.sh"/>
|
||||
</target>
|
||||
|
||||
<target name="debug-deploy" depends="get-target-ip" description="Deploy the jar and start the program running in debug mode.">
|
||||
<echo>[athena-deploy] Killing running program</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="killall FRCUserProgram; sleep 1"/>
|
||||
<echo>[athena-debug-deploy] Copying code over.</echo>
|
||||
<scp file="${dist.jar}" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<scp file="${wpilib.ant.dir}/debugcppprogram" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<scp file="${wpilib.ant.dir}/debugjavaprogram" todir="${username}@${target}:${deploy.dir}"
|
||||
password="${password}" trust="true"/>
|
||||
<echo>[athena-debug-deploy] Starting program.</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="chmod a+x debug*program; ${deploy.debug.command}"/>
|
||||
</target>
|
||||
|
||||
<!-- Simulation support -->
|
||||
<target name="simulate">
|
||||
<parallel>
|
||||
@@ -102,4 +106,21 @@
|
||||
</sequential>
|
||||
</parallel>
|
||||
</target>
|
||||
|
||||
<target name="dependencies" depends="get-target-ip">
|
||||
<property name="ant.enable.asserts" value="true"/>
|
||||
<post to="http://${target}/nisysapi/server" logfile="sysProps.xml" verbose="false" encoding="UTF-16LE" append="false">
|
||||
<prop name="Function" value="GetPropertiesOfItem"/>
|
||||
<prop name="Plugins" value="nisyscfg"/>
|
||||
<prop name="Items" value="system"/>
|
||||
</post>
|
||||
<loadfile srcFile="sysProps.xml" encoding="UTF-16LE" property="roboRIOSysValues"/>
|
||||
<propertyregex property="roboRIOImage" input="${roboRIOSysValues}" regexp="FRC_roboRIO_2015_v([0-9]+)" select="\1" defaultValue="ImageRegExFail"/>
|
||||
<assert message="roboRIO Image does not match plugin, allowed image version: ${roboRIOAllowedImages}">
|
||||
<bool>
|
||||
<contains string="${roboRIOAllowedImages}" substring="${roboRIOImage}"/>
|
||||
</bool>
|
||||
</assert>
|
||||
<echo>roboRIO image version validated</echo>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
@@ -1 +1 @@
|
||||
/home/admin/FRCUserProgram
|
||||
/usr/local/frc/bin/netconsole-host /home/lvuser/FRCUserProgram
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Robot extends IterativeRobot {
|
||||
|
||||
public void autonomousInit() {
|
||||
// schedule the autonomous command (example)
|
||||
autonomousCommand.start();
|
||||
if (autonomousCommand != null) autonomousCommand.start();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,15 @@ public class Robot extends IterativeRobot {
|
||||
// teleop starts running. If you want the autonomous to
|
||||
// continue until interrupted by another command, remove
|
||||
// this line or comment it out.
|
||||
autonomousCommand.cancel();
|
||||
if (autonomousCommand != null) autonomousCommand.cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called when the disabled button is hit.
|
||||
* You can use it to reset subsystems before shutting down.
|
||||
*/
|
||||
public void disabledInit(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package $package;
|
||||
|
||||
import com.ni.vision.NIVision;
|
||||
import com.ni.vision.NIVision.DrawMode;
|
||||
import com.ni.vision.NIVision.Image;
|
||||
import com.ni.vision.NIVision.ShapeMode;
|
||||
import edu.wpi.first.wpilibj.SampleRobot;
|
||||
|
||||
/**
|
||||
* This is a demo program showing the use of the NIVision class to do vision processing.
|
||||
* The image is acquired from the USB Webcam, then a circle is overlayed on it.
|
||||
* The NIVision class supplies dozens of methods for different types of processing.
|
||||
* The resulting image can then be sent to the FRC PC Dashboard with setImage()
|
||||
*/
|
||||
public class Robot extends SampleRobot {
|
||||
int session;
|
||||
Image frame;
|
||||
|
||||
public void robotInit() {
|
||||
|
||||
frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);
|
||||
|
||||
/**
|
||||
* the camera name (ex "cam1") can be found through the roborio web interface
|
||||
*/
|
||||
session = NIVision.IMAQdxOpenCamera("cam1",
|
||||
NIVision.IMAQdxCameraControlMode.CameraControlModeController);
|
||||
NIVision.IMAQdxConfigureGrab(session);
|
||||
}
|
||||
|
||||
public void operatorControl() {
|
||||
NIVision.IMAQdxStartAcquisition(session);
|
||||
|
||||
/**
|
||||
* grab an image, draw the circle, and provide it for the camera server
|
||||
* which will in turn send it to the dashboard.
|
||||
*/
|
||||
NIVision.Rect rect = new NIVision.Rect(10, 10, 100, 100);
|
||||
|
||||
while (isOperatorControl() && isEnabled()) {
|
||||
|
||||
NIVision.IMAQdxGrab(session, frame, 1);
|
||||
NIVision.imaqDrawShapeOnImage(frame, frame, rect,
|
||||
DrawMode.DRAW_VALUE, ShapeMode.SHAPE_OVAL, 0.0f);
|
||||
|
||||
CameraServer.getInstance().setImage(frame);
|
||||
}
|
||||
NIVision.IMAQdxStopAcquisition(session);
|
||||
}
|
||||
|
||||
public void test() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.SpeedController;
|
||||
import edu.wpi.first.wpilibj.CANTalon;
|
||||
import edu.wpi.first.wpilibj.SampleRobot;
|
||||
import edu.wpi.first.wpilibj.Timer;
|
||||
|
||||
/**
|
||||
* This is a short sample program demonstrating how to use the basic throttle
|
||||
* mode of the new CAN Talon.
|
||||
*/
|
||||
public class Robot extends SampleRobot {
|
||||
|
||||
CANTalon motor;
|
||||
|
||||
public Robot() {
|
||||
motor = new CANTalon(1); // Initialize the CanTalonSRX on device 1.
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the motor.
|
||||
*/
|
||||
public void operatorControl() {
|
||||
while (isOperatorControl() && isEnabled()) {
|
||||
// Set the motor's output to half power.
|
||||
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed
|
||||
// going forward)
|
||||
motor.set(0.5);
|
||||
|
||||
Timer.delay(0.01); // Note that the CANTalon only receives updates every
|
||||
// 10ms, so updating more quickly would not gain you
|
||||
// anything.
|
||||
}
|
||||
motor.disable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.SpeedController;
|
||||
import edu.wpi.first.wpilibj.CANTalon;
|
||||
import edu.wpi.first.wpilibj.SampleRobot;
|
||||
import edu.wpi.first.wpilibj.Timer;
|
||||
|
||||
/**
|
||||
* This is a short sample program demonstrating how to use the Talon SRX over
|
||||
* CAN to run a closed-loop PID controller with an analog potentiometer.
|
||||
*/
|
||||
public class Robot extends SampleRobot {
|
||||
|
||||
CANTalon motor;
|
||||
|
||||
public Robot() {
|
||||
motor = new CANTalon(1); // Initialize the CanTalonSRX on device 1.
|
||||
|
||||
// This sets the mode of the m_motor. The options are:
|
||||
// PercentVbus: basic throttle; no closed-loop.
|
||||
// Current: Runs the motor with the specified current if possible.
|
||||
// Speed: Runs a PID control loop to keep the motor going at a constant
|
||||
// speed using the specified sensor.
|
||||
// Position: Runs a PID control loop to move the motor to a specified move
|
||||
// the motor to a specified sensor position.
|
||||
// Voltage: Runs the m_motor at a constant voltage, if possible.
|
||||
// Follower: The m_motor will run at the same throttle as the specified
|
||||
// other talon.
|
||||
motor.changeControlMode(CANTalon.ControlMode.Position);
|
||||
// This command allows you to specify which feedback device to use when doing
|
||||
// closed-loop control. The options are:
|
||||
// AnalogPot: Basic analog potentiometer
|
||||
// QuadEncoder: Quadrature Encoder
|
||||
// AnalogEncoder: Analog Encoder
|
||||
// EncRising: Counts the rising edges of the QuadA pin (allows use of a
|
||||
// non-quadrature encoder)
|
||||
// EncFalling: Same as EncRising, but counts on falling edges.
|
||||
motor.setFeedbackDevice(CANTalon.FeedbackDevice.AnalogPot);
|
||||
// This sets the basic P, I , and D values (F, Izone, and rampRate can also
|
||||
// be set, but are ignored here).
|
||||
// These must all be positive floating point numbers (reverseSensor will
|
||||
// multiply the sensor values by negative one in case your sensor is flipped
|
||||
// relative to your motor).
|
||||
// These values are in units of throttle / sensor_units where throttle ranges
|
||||
// from -1023 to +1023 and sensor units are from 0 - 1023 for analog
|
||||
// potentiometers, encoder ticks for encoders, and position / 10ms for
|
||||
// speeds.
|
||||
motor.setPID(1.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
public void operatorControl() {
|
||||
while (isOperatorControl() && isEnabled()) {
|
||||
// In closed loop mode, this sets the goal in the units mentioned above.
|
||||
// Since we are using an analog potentiometer, this will try to go to
|
||||
// the middle of the potentiometer range.
|
||||
motor.set(512);
|
||||
|
||||
Timer.delay(5.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class Robot extends SampleRobot {
|
||||
*/
|
||||
public void operatorControl() {
|
||||
robotDrive.setSafetyEnabled(true);
|
||||
while (isOperatorControl()) {
|
||||
while (isOperatorControl() && isEnabled()) {
|
||||
|
||||
// Use the joystick X axis for lateral movement, Y axis for forward movement, and Z axis for rotation.
|
||||
// This sample does not use field-oriented drive, so the gyro input is set to zero.
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Robot extends SampleRobot {
|
||||
* Runs the motor from a joystick.
|
||||
*/
|
||||
public void operatorControl() {
|
||||
while (isOperatorControl()) {
|
||||
while (isOperatorControl() && isEnabled()) {
|
||||
// Set the motor's output.
|
||||
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed going forward)
|
||||
motor.set(stick.getY());
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
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 CameraServer class.
|
||||
* With start automatic capture, there is no opertunity to process the image.
|
||||
* Look at the AdvancedVision sample for how to process the image before sending it to the FRC PC Dashboard.
|
||||
*/
|
||||
public class Robot extends SampleRobot {
|
||||
|
||||
CameraServer server;
|
||||
|
||||
public Robot() {
|
||||
server = CameraServer.getInstance();
|
||||
server.setQuality(50);
|
||||
}
|
||||
|
||||
/**
|
||||
* start up automatic capture you should see the video stream from the
|
||||
* webcam in your FRC PC Dashboard.
|
||||
*/
|
||||
public void operatorControl() {
|
||||
|
||||
server.startAutomaticCapture("cam1");
|
||||
|
||||
while (isOperatorControl() && isEnabled()) {
|
||||
/** robot code here! **/
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class Robot extends SampleRobot {
|
||||
*/
|
||||
public void operatorControl() {
|
||||
myRobot.setSafetyEnabled(true);
|
||||
while (isOperatorControl()) {
|
||||
while (isOperatorControl() && isEnabled()) {
|
||||
myRobot.tankDrive(leftStick, rightStick);
|
||||
Timer.delay(0.005); // wait for a motor update time
|
||||
}
|
||||
|
||||
@@ -81,6 +81,11 @@
|
||||
<description>Example programs that demonstrate the use of the various commonly used sensors on FRC robots</description>
|
||||
</tagDescription>
|
||||
|
||||
<tagDescription>
|
||||
<name>Vision</name>
|
||||
<description>Example programs that demonstrate the use of USB Cameras and image processing</description>
|
||||
</tagDescription>
|
||||
|
||||
<example>
|
||||
<name>Getting Started</name>
|
||||
<description>An example program which demonstrates the simplest autonomous and
|
||||
@@ -154,6 +159,40 @@
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>CAN Talon SRX</name>
|
||||
<description>Demonstrate running a Talon SRX with the basic throttle mode.</description>
|
||||
<tags>
|
||||
<tag>Actuators</tag>
|
||||
<tag>Complete List</tag>
|
||||
<tag>Robot and Motor</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/CANTalon/src/org/usfirst/frc/team190/robot/Robot.java"
|
||||
destination="src/$package-dir/Robot.java"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>CAN Talon SRX PID</name>
|
||||
<description>Demonstrate running a Talon SRX with PID Closed Loop control.</description>
|
||||
<tags>
|
||||
<tag>Actuators</tag>
|
||||
<tag>Complete List</tag>
|
||||
<tag>Robot and Motor</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/CANTalonPID/src/org/usfirst/frc/team190/robot/Robot.java"
|
||||
destination="src/$package-dir/Robot.java"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
|
||||
<tagDescription>
|
||||
<name>CommandBased Robot</name>
|
||||
@@ -166,6 +205,7 @@
|
||||
<tags>
|
||||
<tag>CommandBased Robot</tag>
|
||||
</tags>
|
||||
<world>/usr/share/frcsim/worlds/GearsBotDemo.world</world>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
<package>src/$package-dir/commands</package>
|
||||
@@ -198,6 +238,7 @@
|
||||
<tags>
|
||||
<tag>CommandBased Robot</tag>
|
||||
</tags>
|
||||
<world>/usr/share/frcsim/worlds/PacGoat2014.world</world>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
<package>src/$package-dir/commands</package>
|
||||
@@ -251,4 +292,35 @@
|
||||
destination="src/$package-dir/triggers/DoubleButton.java"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Quick Vision</name>
|
||||
<description>Demonstrate the use of the CameraServer class to stream from a USB Webcam without processing the images.</description>
|
||||
<tags>
|
||||
<tag>Vision</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/QuickVision/src/org/usfirst/frc/team190/robot/Robot.java"
|
||||
destination="src/$package-dir/Robot.java"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Advanced Vision</name>
|
||||
<description>Demonstrate the use of the NIVision class to capture image from a Webcam, process them, and then send them to the dashboard.</description>
|
||||
<tags>
|
||||
<tag>Vision</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/AdvancedVision/src/org/usfirst/frc/team190/robot/Robot.java"
|
||||
destination="src/$package-dir/Robot.java"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
</examples>
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Robot extends SampleRobot {
|
||||
*/
|
||||
public void operatorControl() {
|
||||
myRobot.setSafetyEnabled(true);
|
||||
while (isOperatorControl()) {
|
||||
while (isOperatorControl() && isEnabled()) {
|
||||
myRobot.arcadeDrive(stick); // drive with arcade style (use right stick)
|
||||
Timer.delay(0.005); // wait for a motor update time
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package edu.wpi.first.wpilib.plugins.java.launching;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
@@ -15,8 +16,6 @@ import org.eclipse.debug.core.ILaunch;
|
||||
import org.eclipse.debug.core.ILaunchConfigurationType;
|
||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||
import org.eclipse.debug.core.ILaunchManager;
|
||||
import org.eclipse.debug.core.IStreamListener;
|
||||
import org.eclipse.debug.core.model.IStreamMonitor;
|
||||
import org.eclipse.debug.ui.IDebugUIConstants;
|
||||
import org.eclipse.debug.ui.ILaunchShortcut;
|
||||
import org.eclipse.jdt.core.IJavaElement;
|
||||
@@ -37,13 +36,13 @@ import edu.wpi.first.wpilib.plugins.java.WPILibJavaPlugin;
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public abstract class JavaLaunchShortcut implements ILaunchShortcut {
|
||||
private static final int DEBUG_ATTACH_ATTEMPTS = 20;
|
||||
private static final int DEBUG_ATTACH_RETRY_DELAY_SEC = 2;
|
||||
|
||||
//Class constants - used to delineate types for launch shortcuts
|
||||
public static final String DEPLOY_TYPE = "edu.wpi.first.wpilib.plugins.core.deploy";
|
||||
private static final String ANT_SERVER_THREAD_NAME = "Ant Build Server Connection";
|
||||
|
||||
// NOTE: This string must be changed if the port is changed.
|
||||
private static final String DEBUG_START_TEXT = "Listening for transport dt_socket at address: 8348";
|
||||
|
||||
private static ILaunch lastDeploy = null;
|
||||
|
||||
/**
|
||||
@@ -155,11 +154,9 @@ public abstract class JavaLaunchShortcut implements ILaunchShortcut {
|
||||
lastDeploy = AntLauncher.runAntFile(new File (activeProj.getLocation().toOSString() + File.separator + "build.xml"), targets, null, mode);
|
||||
|
||||
if((mode.equals(ILaunchManager.DEBUG_MODE))&&(getLaunchType().equals(DEPLOY_TYPE))) {
|
||||
ILaunchConfigurationWorkingCopy config;
|
||||
try {
|
||||
config = getRemoteDebugConfig(activeProj);
|
||||
startDebugConfig(config, lastDeploy);
|
||||
} catch (CoreException e) {
|
||||
startDebugConfig(getRemoteDebugConfig(activeProj));
|
||||
} catch (CoreException | InterruptedException e) {
|
||||
WPILibJavaPlugin.logError("Debug attach failed", e);
|
||||
}
|
||||
}
|
||||
@@ -190,20 +187,28 @@ public abstract class JavaLaunchShortcut implements ILaunchShortcut {
|
||||
return WPILibCore.getDefault().getTargetIP(proj);
|
||||
}
|
||||
|
||||
private void startDebugConfig(final ILaunchConfigurationWorkingCopy config, ILaunch deploy) throws CoreException {
|
||||
IStreamListener listener = new IStreamListener() {
|
||||
@Override
|
||||
public void streamAppended(String text, IStreamMonitor monitor) {
|
||||
if (text.contains(DEBUG_START_TEXT)) {
|
||||
try {
|
||||
config.launch(ILaunchManager.DEBUG_MODE, null);
|
||||
} catch (CoreException e) {
|
||||
WPILibJavaPlugin.logError("Error starting debug config..", e);
|
||||
}
|
||||
monitor.removeListener(this);
|
||||
private void startDebugConfig(final ILaunchConfigurationWorkingCopy config)
|
||||
throws CoreException, InterruptedException {
|
||||
int remainingAttempts = DEBUG_ATTACH_ATTEMPTS;
|
||||
|
||||
// Retry until success or rethrow of exception on failure
|
||||
while (true) {
|
||||
try {
|
||||
WPILibJavaPlugin.logInfo("Attemping to attach debugger...");
|
||||
config.launch(ILaunchManager.DEBUG_MODE, null);
|
||||
WPILibJavaPlugin.logInfo("Debugger attached.");
|
||||
break;
|
||||
} catch (CoreException e) {
|
||||
if (--remainingAttempts > 0) {
|
||||
String errorMsg = MessageFormat.format("Unable to attach debugger. "
|
||||
+ "{0} attempts remain - waiting {1} second(s) before retrying...",
|
||||
remainingAttempts, DEBUG_ATTACH_RETRY_DELAY_SEC);
|
||||
WPILibJavaPlugin.logError(errorMsg, null);
|
||||
Thread.sleep(DEBUG_ATTACH_RETRY_DELAY_SEC * 1000);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
};
|
||||
deploy.getProcesses()[0].getStreamsProxy().getOutputStreamMonitor().addListener(listener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package edu.wpi.first.wpilib.plugins.java.launching;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.launching.SimulationNotification;
|
||||
|
||||
public class SimulateLaunchShortcut extends JavaLaunchShortcut {
|
||||
|
||||
|
||||
@@ -11,7 +13,11 @@ public class SimulateLaunchShortcut extends JavaLaunchShortcut {
|
||||
* @param mode The mode it will be run in (ILaunchManager.RUN_MODE or ILaunchManager.DEBUG_MODE)
|
||||
*/
|
||||
public void runConfig(IProject activeProj, String mode){
|
||||
runConfigHelper(activeProj, mode, "simulate", "debug-simulate");
|
||||
if (SimulationNotification.supportsSimulation()) {
|
||||
runConfigHelper(activeProj, mode, "simulate", "debug-simulate");
|
||||
} else {
|
||||
SimulationNotification.showUnsupported();
|
||||
}
|
||||
}
|
||||
|
||||
protected String getHostname(IProject proj) {
|
||||
|
||||
@@ -7,16 +7,17 @@ import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
|
||||
import edu.wpi.first.wpilib.plugins.java.wizards.newproject.JavaProjectType;
|
||||
|
||||
public class ExampleJavaProject extends JavaProjectType implements IExampleProject {
|
||||
private String name, description;
|
||||
private String name, description, world;
|
||||
private List<String> tags;
|
||||
private List<String> packages;
|
||||
private List<ExportFile> files;
|
||||
|
||||
public ExampleJavaProject(String name, String description, List<String> tags,
|
||||
List<String> packages, List<ExportFile> files) {
|
||||
String world, List<String> packages, List<ExportFile> files) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.tags = tags;
|
||||
this.world = world;
|
||||
this.packages = packages;
|
||||
this.files = files;
|
||||
}
|
||||
@@ -32,6 +33,10 @@ public class ExampleJavaProject extends JavaProjectType implements IExampleProje
|
||||
public List<String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public String getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFolders(String packageName) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.eclipse.jface.wizard.IWizardPage;
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ExampleWizard;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject.ExportFile;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
|
||||
@@ -40,9 +41,9 @@ public class ExampleJavaWizard extends ExampleWizard {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IWizardPage getDetailsPage() {
|
||||
protected IWizardPage getDetailsPage(INewProjectInfo info) {
|
||||
if (detailsPage != null) return detailsPage;
|
||||
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage());
|
||||
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage(), info);
|
||||
detailsPage.setTitle("Create Example Robot Java Project");
|
||||
detailsPage.setDescription("This wizard creates a new example project based on your selection.");
|
||||
return detailsPage;
|
||||
@@ -50,8 +51,8 @@ public class ExampleJavaWizard extends ExampleWizard {
|
||||
|
||||
@Override
|
||||
public IExampleProject makeExampleProject(String name, String description,
|
||||
List<String> tags, List<String> folders, List<ExportFile> files) {
|
||||
return new ExampleJavaProject(name, description, tags, folders, files);
|
||||
List<String> tags, String world, List<String> folders, List<ExportFile> files) {
|
||||
return new ExampleJavaProject(name, description, tags, world, folders, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,9 @@ import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.wizard.WizardPage;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
@@ -76,6 +78,15 @@ public class FileTemplateWizardMainPage extends WizardPage {
|
||||
});
|
||||
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
projectsCombo.setLayoutData(gd);
|
||||
projectsCombo.addSelectionListener(new SelectionListener() {
|
||||
public void widgetSelected(SelectionEvent e){
|
||||
if (project == null){
|
||||
project = projectsCombo.getProject();
|
||||
}
|
||||
packageText.setText(getDefaultPackage());
|
||||
}
|
||||
public void widgetDefaultSelected(SelectionEvent e){}
|
||||
});
|
||||
projectsCombo.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
dialogChanged();
|
||||
@@ -116,6 +127,7 @@ public class FileTemplateWizardMainPage extends WizardPage {
|
||||
*/
|
||||
|
||||
private void initialize() {
|
||||
WPILibJavaPlugin.logInfo("initialize");
|
||||
projectsCombo.setProject(project);
|
||||
packageText.setText(getDefaultPackage());
|
||||
}
|
||||
@@ -130,7 +142,7 @@ public class FileTemplateWizardMainPage extends WizardPage {
|
||||
|
||||
// Update the default package if necessary
|
||||
if (project == null || !project.equals(projectsCombo.getProject())) {
|
||||
String oldDefault = getDefaultPackage();
|
||||
String oldDefault = getDefaultPackage();
|
||||
project = projectsCombo.getProject();
|
||||
if (packageString.equals(oldDefault)) {
|
||||
packageText.setText(getDefaultPackage());
|
||||
@@ -200,4 +212,4 @@ public class FileTemplateWizardMainPage extends WizardPage {
|
||||
if (defaultPackage != null) return defaultPackage;
|
||||
else return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchWizard;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
|
||||
@@ -56,7 +57,7 @@ public class NewJavaWizard extends Wizard implements INewWizard {
|
||||
teamNumberPage = new TeamNumberPage(selection);
|
||||
addPage(teamNumberPage);
|
||||
}
|
||||
page = new NewProjectMainPage(selection, teamNumberPage);
|
||||
page = new NewProjectMainPage(selection, teamNumberPage, INewProjectInfo.Null);
|
||||
page.setProjectTypes(JavaProjectType.TYPES);
|
||||
page.setTitle("Create New Robot Java Project");
|
||||
page.setDescription("This wizard creates a new Robot Java Project configured to use WPILib for programming FRC robots.");
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
# Deployment information
|
||||
username=admin
|
||||
username=lvuser
|
||||
password=
|
||||
deploy.dir=/home/admin
|
||||
deploy.dir=/home/lvuser
|
||||
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 -n 0 ${deploy.log.file}
|
||||
debug.flag.dir=/tmp/
|
||||
debug.flag.command=chown lvuser:ni ${debug.flag.dir}frcdebug
|
||||
command.dir=/home/lvuser/
|
||||
version=current
|
||||
roboRIOJRE.dir=/usr/local/frc/JRE
|
||||
|
||||
# Libraries to use
|
||||
wpilib=${user.home}/wpilib/java/${version}
|
||||
@@ -21,6 +20,7 @@ networktables.sources=${wpilib.lib}/NetworkTables-sources.jar
|
||||
#jnaerator.jar=${wpilib.lib}/jnaerator-runtime.jar
|
||||
#classpath=${wpilib.jar}:${networktables.jar}:${jna.jar}:${jnaerator.jar}
|
||||
classpath=${wpilib.jar}:${networktables.jar}
|
||||
roboRIOAllowedImages=23
|
||||
|
||||
# Ant support
|
||||
wpilib.ant.dir=${wpilib}/ant
|
||||
|
||||
@@ -19,8 +19,39 @@
|
||||
<!-- Targets -->
|
||||
|
||||
<target name="get-target-ip">
|
||||
<property name="ant.enable.asserts" value="true"/>
|
||||
<property name="target" value="roboRIO-${team-number}.local" />
|
||||
<echo>Target: ${target}</echo>
|
||||
<echo>Trying Target: ${target}</echo>
|
||||
<if>
|
||||
<isreachable host="${target}" timeout="5"/>
|
||||
<then>
|
||||
<echo>roboRIO found via mDNS</echo>
|
||||
</then>
|
||||
<else>
|
||||
<var name="target" unset="true"/>
|
||||
<echo> roboRIO not found via mDNS, falling back to static USB</echo>
|
||||
<property name="target" value="172.22.11.2"/>
|
||||
<if>
|
||||
<isreachable host="${target}" timeout="5"/>
|
||||
<then>
|
||||
<echo>roboRIO found via static USB</echo>
|
||||
</then>
|
||||
<else>
|
||||
<var name="target" unset="true"/>
|
||||
<math result="ip.upper" operand1="${team-number}" operation="/" operand2="100" datatype="int"/>
|
||||
<math result="ip.lower" operand1="${team-number}" operation="%" operand2="100" datatype="int"/>
|
||||
<property name="target" value="10.${ip.upper}.${ip.lower}.2"/>
|
||||
<echo>roboRIO not found via USB, falling back to static address of ${target}</echo>
|
||||
<assert name="roboRIOFound" message="roboRIO not found, please check that the roboRIO is connected, imaged and that the team number is set properly in Eclipse">
|
||||
<bool>
|
||||
<isreachable host="${target}" timeout="5"/>
|
||||
</bool>
|
||||
</assert>
|
||||
<echo>roboRIO found via Ethernet static</echo>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="compile" description="Compile the source code.">
|
||||
@@ -66,7 +97,11 @@
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
|
||||
<!-- We're running a clean here to get around a known ant issue where it does not detected changed constant variables.
|
||||
To get around this, we're recompiling the entire project, which is not an issue for most teams. If this is an issue
|
||||
for you, you can remove the clean here, just be sure to do a full rebuild after you've changed any constants.
|
||||
Reference: http://stackoverflow.com/questions/6430001/ant-doesnt-recompile-constants -->
|
||||
<target name="deploy" depends="clean,jar,get-target-ip,dependencies" 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"/>
|
||||
<scp file="${wpilib.ant.dir}/robotCommand" todir="${username}@${target}:${command.dir}" password="${password}" trust="true"/>
|
||||
@@ -78,14 +113,9 @@
|
||||
trust="true"
|
||||
command="${deploy.kill.command};"/>
|
||||
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="${deploy.log.command}"/>
|
||||
</target>
|
||||
|
||||
<target name="debug-deploy" depends="get-target-ip,jar" description="Deploy the jar and start the program running.">
|
||||
<target name="debug-deploy" depends="jar,get-target-ip,dependencies" 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 -->
|
||||
@@ -105,11 +135,6 @@
|
||||
trust="true"
|
||||
command="${deploy.kill.command}"/>
|
||||
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
command="${deploy.log.command}"/>
|
||||
</target>
|
||||
|
||||
<!-- Simulate -->
|
||||
@@ -180,4 +205,28 @@
|
||||
</sequential>
|
||||
</parallel>
|
||||
</target>
|
||||
|
||||
<target name="dependencies" depends="get-target-ip">
|
||||
<property name="ant.enable.asserts" value="true"/>
|
||||
<post to="http://${target}/nisysapi/server" logfile="sysProps.xml" verbose="false" encoding="UTF-16LE" append="false">
|
||||
<prop name="Function" value="GetPropertiesOfItem"/>
|
||||
<prop name="Plugins" value="nisyscfg"/>
|
||||
<prop name="Items" value="system"/>
|
||||
</post>
|
||||
<loadfile srcFile="sysProps.xml" encoding="UTF-16LE" property="roboRIOSysValues"/>
|
||||
<propertyregex property="roboRIOImage" input="${roboRIOSysValues}" regexp="FRC_roboRIO_2015_v([0-9]+)" select="\1" defaultValue="ImageRegExFail"/>
|
||||
<assert message="roboRIO Image does not match plugin, allowed image version: ${roboRIOAllowedImages}">
|
||||
<bool>
|
||||
<contains string="${roboRIOAllowedImages}" substring="${roboRIOImage}"/>
|
||||
</bool>
|
||||
</assert>
|
||||
<echo>roboRIO image version validated</echo>
|
||||
<echo>Checking for JRE. If this fails install the JRE using these instructions: http://wpilib.screenstepslive.com/s/4485/m/13809/l/243933-installing-java-8-on-the-roborio-java-only</echo>
|
||||
<sshexec host="${target}"
|
||||
username="${username}"
|
||||
password="${password}"
|
||||
trust="true"
|
||||
failonerror="true"
|
||||
command="test -d ${roboRIOJRE.dir}"/>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
/usr/local/frc/JRE/bin/java
|
||||
-jar /home/admin/FRCUserProgram.jar
|
||||
env LD_PRELOAD=/lib/libstdc++.so.6.0.20 /usr/local/frc/bin/netconsole-host /usr/local/frc/JRE/bin/java -jar /home/lvuser/FRCUserProgram.jar
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
/usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y
|
||||
-jar /home/admin/FRCUserProgram.jar
|
||||
env LD_PRELOAD=/lib/libstdc++.so.6.0.20 /usr/local/frc/bin/netconsole-host /usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar /home/lvuser/FRCUserProgram.jar
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: WPILib_Riolog
|
||||
Bundle-SymbolicName: edu.wpi.first.wpilib.plugins.riolog;singleton:=true
|
||||
Bundle-Version: 0.1.0.qualifier
|
||||
Bundle-Activator: netconsole2.Activator
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-Vendor: WPI & FIRST
|
||||
13
eclipse-plugins/edu.wpi.first.wpilib.plugins.riolog/README
Normal file
13
eclipse-plugins/edu.wpi.first.wpilib.plugins.riolog/README
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
Riolog
|
||||
|
||||
This is an Eclipse plugin that receives and displays text from UDP port 6666. It
|
||||
defines a new view that displays the received text.
|
||||
|
||||
To compile, open project in an Eclipse instance with the appropriate plugin
|
||||
development tools, and Export as a deployable plugin/fragment.
|
||||
|
||||
To install, copy the resulting jar file into $eclipse/dropins/, and start
|
||||
Eclipse (-clean may be necessary).
|
||||
|
||||
To enable, go to Window>Show View>Other... and choose General>Riolog.
|
||||
@@ -0,0 +1,7 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = plugin.xml,\
|
||||
META-INF/,\
|
||||
.,\
|
||||
icons/,\
|
||||
contexts.xml
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<contexts>
|
||||
<context id="text" title="Riolog">
|
||||
<description>This is the context help for the Riolog It was generated by a PDE template.</description>
|
||||
<topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
|
||||
<enablement>
|
||||
<with variable="platform">
|
||||
<test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
|
||||
</with>
|
||||
</enablement>
|
||||
</topic>
|
||||
</context>
|
||||
</contexts>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 344 B |
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.views">
|
||||
<view
|
||||
name="Riolog"
|
||||
icon="icons/riolog.png"
|
||||
category="org.eclipse.ui"
|
||||
class="netconsole2.views.RiologView"
|
||||
id="netconsole2.views.RiologView">
|
||||
</view>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.perspectiveExtensions">
|
||||
<perspectiveExtension
|
||||
targetID="org.eclipse.jdt.ui.JavaPerspective">
|
||||
<view
|
||||
ratio="0.5"
|
||||
relative="org.eclipse.ui.views.ProblemView"
|
||||
relationship="right"
|
||||
id="netconsole2.views.RiologView">
|
||||
</view>
|
||||
</perspectiveExtension>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.help.contexts">
|
||||
<contexts
|
||||
file="contexts.xml">
|
||||
</contexts>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
15
eclipse-plugins/edu.wpi.first.wpilib.plugins.riolog/pom.xml
Normal file
15
eclipse-plugins/edu.wpi.first.wpilib.plugins.riolog/pom.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>edu.wpi.first.wpilib.plugins.riolog</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>edu.wpi.first.wpilib.plugins</groupId>
|
||||
<artifactId>edu.wpi.first.wpilib.plugins</artifactId>
|
||||
<version>0.1.0.qualifier</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,61 @@
|
||||
package netconsole2;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "riolog"; //$NON-NLS-1$
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an image descriptor for the image file at the given
|
||||
* plug-in relative path
|
||||
*
|
||||
* @param path the path
|
||||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,414 @@
|
||||
package netconsole2.views;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.DatagramPacket;
|
||||
import java.net.DatagramSocket;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.FillLayout;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.IActionBars;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.part.ViewPart;
|
||||
|
||||
|
||||
public class RiologView extends ViewPart {
|
||||
public static Action confAction(String name, String tooltip, String img,
|
||||
Action e) {
|
||||
e.setText(name);
|
||||
e.setToolTipText(tooltip);
|
||||
e.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
|
||||
.getImageDescriptor(img));
|
||||
return e;
|
||||
}
|
||||
|
||||
public static byte[] getPacket(DatagramSocket socket, DatagramPacket buf) {
|
||||
try {
|
||||
socket.receive(buf);
|
||||
} catch (IOException e) {
|
||||
return null;
|
||||
}
|
||||
byte[] ret = new byte[buf.getLength()];
|
||||
System.arraycopy(buf.getData(), 0, ret, 0, ret.length);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static DatagramSocket makeRecvSocket() {
|
||||
DatagramSocket socket = null;
|
||||
try {
|
||||
socket = new DatagramSocket(null);
|
||||
socket.setReuseAddress(true);
|
||||
socket.bind(new InetSocketAddress(6666));
|
||||
} catch (SocketException e) {
|
||||
e.printStackTrace();
|
||||
socket.close();
|
||||
return null;
|
||||
}
|
||||
return socket;
|
||||
}
|
||||
|
||||
public static Thread startDaemonThread(Runnable r, String name) {
|
||||
Thread t = new Thread(r, name);
|
||||
t.setDaemon(true);
|
||||
t.start();
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the view as specified by the extension.
|
||||
*/
|
||||
public static final String ID = "netconsole2.views.RiologView";
|
||||
|
||||
Text text;
|
||||
Thread listener;
|
||||
Thread transferer;
|
||||
|
||||
volatile DatagramSocket socket_hook = null;
|
||||
volatile boolean discard = false;
|
||||
volatile boolean paused = false;
|
||||
volatile boolean cleanup = false;
|
||||
|
||||
private Action clearAction;
|
||||
private Action pauseAction;
|
||||
private Action discardAction;
|
||||
private Action unpauseAction;
|
||||
private Action undiscardAction;
|
||||
private Button discardButton;
|
||||
private Button pauseButton;
|
||||
|
||||
/**
|
||||
* The constructor.
|
||||
*/
|
||||
public RiologView() {
|
||||
}
|
||||
|
||||
private void contributeToActionBars() {
|
||||
IActionBars bars = getViewSite().getActionBars();
|
||||
fillLocalPullDown(bars.getMenuManager());
|
||||
fillLocalToolBar(bars.getToolBarManager());
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a callback that will allow us to create the viewer and initialize
|
||||
* it.
|
||||
*/
|
||||
public void createPartControl(Composite parent) {
|
||||
GridLayout glayout = new GridLayout();
|
||||
glayout.numColumns = 1;
|
||||
parent.setLayout(glayout);
|
||||
|
||||
text = new Text(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL
|
||||
| SWT.READ_ONLY);
|
||||
{
|
||||
GridData gdata = new GridData();
|
||||
gdata.grabExcessVerticalSpace = true;
|
||||
gdata.grabExcessHorizontalSpace = true;
|
||||
gdata.horizontalAlignment = SWT.FILL;
|
||||
gdata.verticalAlignment = SWT.FILL;
|
||||
text.setLayoutData(gdata);
|
||||
}
|
||||
|
||||
Composite row = new Composite(parent, SWT.NONE);
|
||||
|
||||
row.setLayout(new FillLayout(SWT.HORIZONTAL));
|
||||
|
||||
{
|
||||
GridData gdata = new GridData();
|
||||
gdata.grabExcessVerticalSpace = false;
|
||||
gdata.grabExcessHorizontalSpace = true;
|
||||
gdata.horizontalAlignment = SWT.FILL;
|
||||
gdata.verticalAlignment = SWT.CENTER;
|
||||
row.setLayoutData(gdata);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Create the help context id for the viewer's control
|
||||
PlatformUI.getWorkbench().getHelpSystem()
|
||||
.setHelp(parent, "netconsole2.text");
|
||||
makeActions();
|
||||
makeButtons(row);
|
||||
hookContextMenu();
|
||||
contributeToActionBars();
|
||||
startListening();
|
||||
}
|
||||
|
||||
public void makeButtons(Composite parent) {
|
||||
pauseButton = new Button(parent, SWT.TOGGLE);
|
||||
pauseButton.setText(pauseAction.getText());
|
||||
pauseButton.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (pauseButton.getSelection()) {
|
||||
pauseAction.run();
|
||||
} else {
|
||||
unpauseAction.run();
|
||||
}
|
||||
}
|
||||
});
|
||||
discardButton = new Button(parent, SWT.TOGGLE);
|
||||
discardButton.setText(discardAction.getText());
|
||||
discardButton.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (discardButton.getSelection()) {
|
||||
discardAction.run();
|
||||
} else {
|
||||
undiscardAction.run();
|
||||
}
|
||||
}
|
||||
});
|
||||
Button clearButton = new Button(parent, SWT.PUSH);
|
||||
clearButton.setText(clearAction.getText());
|
||||
clearButton.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
clearAction.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
stopListening();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
private void fillContextMenu(IMenuManager manager) {
|
||||
manager.add(pauseAction);
|
||||
manager.add(unpauseAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(clearAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(discardAction);
|
||||
manager.add(undiscardAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(confAction("Copy", "Copy selected text",
|
||||
ISharedImages.IMG_TOOL_COPY, new Action() {
|
||||
@Override
|
||||
public void run() {
|
||||
text.copy();
|
||||
}
|
||||
}));
|
||||
manager.add(confAction("Select All", "Select all text", "",
|
||||
new Action() {
|
||||
@Override
|
||||
public void run() {
|
||||
text.selectAll();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private void fillLocalPullDown(IMenuManager manager) {
|
||||
manager.add(pauseAction);
|
||||
manager.add(unpauseAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(clearAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(discardAction);
|
||||
manager.add(undiscardAction);
|
||||
}
|
||||
|
||||
private void fillLocalToolBar(IToolBarManager manager) {
|
||||
manager.add(pauseAction);
|
||||
manager.add(unpauseAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(clearAction);
|
||||
manager.add(new Separator());
|
||||
manager.add(discardAction);
|
||||
manager.add(undiscardAction);
|
||||
}
|
||||
|
||||
private void hookContextMenu() {
|
||||
MenuManager menuMgr = new MenuManager("#PopupMenu");
|
||||
menuMgr.setRemoveAllWhenShown(true);
|
||||
menuMgr.addMenuListener(new IMenuListener() {
|
||||
public void menuAboutToShow(IMenuManager manager) {
|
||||
RiologView.this.fillContextMenu(manager);
|
||||
}
|
||||
});
|
||||
Menu menu = menuMgr.createContextMenu(text);
|
||||
text.setMenu(menu);
|
||||
}
|
||||
|
||||
private void makeActions() {
|
||||
clearAction = confAction("Clear Log", "Empty the textbox",
|
||||
ISharedImages.IMG_ETOOL_CLEAR, new Action() {
|
||||
public void run() {
|
||||
text.setText("");
|
||||
}
|
||||
});
|
||||
|
||||
pauseAction = confAction("Pause Display",
|
||||
"Stop adding packets to the textbox",
|
||||
ISharedImages.IMG_ELCL_STOP, new Action() {
|
||||
public void run() {
|
||||
pauseAction.setEnabled(false);
|
||||
unpauseAction.setEnabled(true);
|
||||
pauseButton.setSelection(true);
|
||||
pauseButton.setText("Show 0 Packets");
|
||||
paused = true;
|
||||
}
|
||||
});
|
||||
pauseAction.setEnabled(true);
|
||||
unpauseAction = confAction("Continue Display",
|
||||
"Continue adding packets to the textbox",
|
||||
ISharedImages.IMG_TOOL_FORWARD, new Action() {
|
||||
public void run() {
|
||||
paused = false;
|
||||
transferer.interrupt();
|
||||
pauseAction.setEnabled(true);
|
||||
unpauseAction.setEnabled(false);
|
||||
pauseButton.setSelection(false);
|
||||
pauseButton.setText(pauseAction.getText());
|
||||
}
|
||||
});
|
||||
unpauseAction.setEnabled(false);
|
||||
|
||||
discardAction = confAction("Discard Incoming",
|
||||
"Drop all incoming packets", ISharedImages.IMG_ETOOL_DELETE,
|
||||
new Action() {
|
||||
public void run() {
|
||||
discard = true;
|
||||
discardAction.setEnabled(false);
|
||||
undiscardAction.setEnabled(true);
|
||||
discardButton.setSelection(true);
|
||||
discardButton.setText(undiscardAction.getText());
|
||||
}
|
||||
});
|
||||
discardAction.setEnabled(true);
|
||||
undiscardAction = confAction("Accept Incoming",
|
||||
"Accept all incoming packets", ISharedImages.IMG_OBJ_ADD,
|
||||
new Action() {
|
||||
public void run() {
|
||||
discard = false;
|
||||
discardAction.setEnabled(true);
|
||||
undiscardAction.setEnabled(false);
|
||||
discardButton.setSelection(false);
|
||||
discardButton.setText(discardAction.getText());
|
||||
}
|
||||
});
|
||||
undiscardAction.setEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Passing the focus request to the viewer's control.
|
||||
*/
|
||||
public void setFocus() {
|
||||
text.setFocus();
|
||||
}
|
||||
|
||||
public static String drainToString(ArrayList<byte[]> arr) {
|
||||
int netlength = 0;
|
||||
for (byte[] b : arr) {
|
||||
netlength += b.length;
|
||||
}
|
||||
|
||||
byte[] sum = new byte[netlength];
|
||||
int mark = 0;
|
||||
for (int i=0;i<arr.size();i++) {
|
||||
byte[] b = arr.get(i);
|
||||
System.arraycopy(b, 0, sum, mark, b.length);
|
||||
arr.set(i, null);
|
||||
mark += b.length;
|
||||
}
|
||||
arr.clear();
|
||||
return new String(sum);
|
||||
|
||||
}
|
||||
|
||||
void startListening() {
|
||||
final BlockingQueue<byte[]> queue = new LinkedBlockingQueue<>();
|
||||
listener = startDaemonThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DatagramSocket socket = makeRecvSocket();
|
||||
if (socket == null)
|
||||
return;
|
||||
socket_hook = socket;
|
||||
byte[] buf = new byte[4096];
|
||||
DatagramPacket datagram = new DatagramPacket(buf, buf.length);
|
||||
while (!Thread.interrupted()) {
|
||||
byte[] s = getPacket(socket, datagram);
|
||||
if (s != null && !discard) {
|
||||
try {
|
||||
queue.put(s);
|
||||
} catch (InterruptedException e) {
|
||||
socket.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
socket.close();
|
||||
}
|
||||
}, "Riolog-Listener");
|
||||
transferer = startDaemonThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final ArrayList<byte[]> temp = new ArrayList<>();
|
||||
while (!cleanup) {
|
||||
try {
|
||||
temp.add(queue.take());
|
||||
} catch (InterruptedException e) {
|
||||
if (cleanup) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
queue.drainTo(temp);
|
||||
if (!paused) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (text.isDisposed())
|
||||
return;
|
||||
text.append(drainToString(temp));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (paused) {
|
||||
if (temp.size() == 1) {
|
||||
pauseButton.setText("Show 1 Packet\u2002");
|
||||
} else {
|
||||
pauseButton.setText("Show " + String.valueOf(temp.size()) + " Packets");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}, "Riolog-Transfer");
|
||||
}
|
||||
|
||||
void stopListening() {
|
||||
cleanup = true;
|
||||
if (socket_hook != null) {
|
||||
socket_hook.close();
|
||||
}
|
||||
listener.interrupt();
|
||||
transferer.interrupt();
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,13 @@
|
||||
<module>edu.wpi.first.wpilib.plugins.cpp.feature</module>
|
||||
<module>edu.wpi.first.wpilib.plugins.java</module>
|
||||
<module>edu.wpi.first.wpilib.plugins.java.feature</module>
|
||||
<module>edu.wpi.first.wpilib.plugins.riolog</module>
|
||||
<module>edu.wpi.first.wpilib.plugins.updatesite</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<!-- local-repository>C:/Users/wpilibj-buildmaster/maven-repository</local-repository-->
|
||||
<tycho-version>0.18.1</tycho-version>
|
||||
<tycho-version>0.21.0</tycho-version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#define CTR_TxTimeout_MESSAGE "CTRE CAN Transmit Timeout"
|
||||
#define CTR_InvalidParamValue_MESSAGE "CTRE CAN Invalid Parameter"
|
||||
#define CTR_UnexpectedArbId_MESSAGE "CTRE Unexpected Arbitration ID (CAN Node ID)"
|
||||
#define CTR_TxFailed_MESSAGE "CTRE CAN Transmit Error"
|
||||
#define CTR_SigNotUpdated_MESSAGE "CTRE CAN Signal Not Updated"
|
||||
|
||||
#define NiFpga_Status_FifoTimeout_MESSAGE "NIFPGA: FIFO timeout error"
|
||||
#define NiFpga_Status_TransferAborted_MESSAGE "NIFPGA: Transfer aborted error"
|
||||
@@ -45,3 +47,18 @@
|
||||
#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE "HAL: Attempted to read AnalogTrigger pulse output."
|
||||
#define PARAMETER_OUT_OF_RANGE -1028
|
||||
#define PARAMETER_OUT_OF_RANGE_MESSAGE "HAL: A parameter is out of range."
|
||||
#define RESOURCE_IS_ALLOCATED -1029
|
||||
#define RESOURCE_IS_ALLOCATED_MESSAGE "HAL: Resource already allocated"
|
||||
|
||||
#define VI_ERROR_SYSTEM_ERROR_MESSAGE "HAL - VISA: System Error";
|
||||
#define VI_ERROR_INV_OBJECT_MESSAGE "HAL - VISA: Invalid Object"
|
||||
#define VI_ERROR_RSRC_LOCKED_MESSAGE "HAL - VISA: Resource Locked"
|
||||
#define VI_ERROR_RSRC_NFOUND_MESSAGE "HAL - VISA: Resource Not Found"
|
||||
#define VI_ERROR_INV_RSRC_NAME_MESSAGE "HAL - VISA: Invalid Resource Name"
|
||||
#define VI_ERROR_QUEUE_OVERFLOW_MESSAGE "HAL - VISA: Queue Overflow"
|
||||
#define VI_ERROR_IO_MESSAGE "HAL - VISA: General IO Error"
|
||||
#define VI_ERROR_ASRL_PARITY_MESSAGE "HAL - VISA: Parity Error"
|
||||
#define VI_ERROR_ASRL_FRAMING_MESSAGE "HAL - VISA: Framing Error"
|
||||
#define VI_ERROR_ASRL_OVERRUN_MESSAGE "HAL - VISA: Buffer Overrun Error"
|
||||
#define VI_ERROR_RSRC_BUSY_MESSAGE "HAL - VISA: Resource Busy"
|
||||
#define VI_ERROR_INV_PARAMETER_MESSAGE "HAL - VISA: Invalid Parameter"
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "Accelerometer.hpp"
|
||||
#include "Analog.hpp"
|
||||
#include "CAN.hpp"
|
||||
#include "Compressor.hpp"
|
||||
#include "Digital.hpp"
|
||||
#include "Solenoid.hpp"
|
||||
@@ -23,6 +22,7 @@
|
||||
#include "Errors.hpp"
|
||||
#include "PDP.hpp"
|
||||
#include "Power.hpp"
|
||||
#include "SerialPort.hpp"
|
||||
|
||||
#include "Utilities.hpp"
|
||||
#include "Semaphore.hpp"
|
||||
@@ -177,7 +177,20 @@ struct HALJoystickPOVs {
|
||||
int16_t povs[kMaxJoystickPOVs];
|
||||
};
|
||||
|
||||
typedef uint32_t HALJoystickButtons;
|
||||
struct HALJoystickButtons {
|
||||
uint32_t buttons;
|
||||
uint8_t count;
|
||||
};
|
||||
|
||||
struct HALJoystickDescriptor {
|
||||
uint8_t isXbox;
|
||||
uint8_t type;
|
||||
char name[256];
|
||||
uint8_t axisCount;
|
||||
uint8_t axisTypes;
|
||||
uint8_t buttonCount;
|
||||
uint8_t povCount;
|
||||
};
|
||||
|
||||
inline float intToFloat(int value)
|
||||
{
|
||||
@@ -212,9 +225,15 @@ extern "C"
|
||||
int HALGetAllianceStation(enum HALAllianceStationID *allianceStation);
|
||||
int HALGetJoystickAxes(uint8_t joystickNum, HALJoystickAxes *axes);
|
||||
int HALGetJoystickPOVs(uint8_t joystickNum, HALJoystickPOVs *povs);
|
||||
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons, uint8_t *count);
|
||||
int HALGetJoystickButtons(uint8_t joystickNum, HALJoystickButtons *buttons);
|
||||
int HALGetJoystickDescriptor(uint8_t joystickNum, HALJoystickDescriptor *desc);
|
||||
int HALSetJoystickOutputs(uint8_t joystickNum, uint32_t outputs, uint16_t leftRumble, uint16_t rightRumble);
|
||||
int HALGetMatchTime(float *matchTime);
|
||||
|
||||
void HALSetNewDataSem(pthread_mutex_t *);
|
||||
void HALSetNewDataSem(MULTIWAIT_ID sem);
|
||||
|
||||
bool HALGetSystemActive(int32_t *status);
|
||||
bool HALGetBrownedOut(int32_t *status);
|
||||
|
||||
int HALInitialize(int mode = 0);
|
||||
void HALNetworkCommunicationObserveUserProgramStarting();
|
||||
|
||||
@@ -11,4 +11,9 @@ extern "C"
|
||||
double getPDPTemperature(int32_t *status);
|
||||
double getPDPVoltage(int32_t *status);
|
||||
double getPDPChannelCurrent(uint8_t channel, int32_t *status);
|
||||
double getPDPTotalCurrent(int32_t *status);
|
||||
double getPDPTotalPower(int32_t *status);
|
||||
double getPDPTotalEnergy(int32_t *status);
|
||||
void resetPDPTotalEnergy(int32_t *status);
|
||||
void clearPDPStickyFaults(int32_t *status);
|
||||
}
|
||||
|
||||
@@ -8,8 +8,14 @@ extern "C"
|
||||
float getVinCurrent(int32_t *status);
|
||||
float getUserVoltage6V(int32_t *status);
|
||||
float getUserCurrent6V(int32_t *status);
|
||||
bool getUserActive6V(int32_t *status);
|
||||
int getUserCurrentFaults6V(int32_t *status);
|
||||
float getUserVoltage5V(int32_t *status);
|
||||
float getUserCurrent5V(int32_t *status);
|
||||
bool getUserActive5V(int32_t *status);
|
||||
int getUserCurrentFaults5V(int32_t *status);
|
||||
float getUserVoltage3V3(int32_t *status);
|
||||
float getUserCurrent3V3(int32_t *status);
|
||||
bool getUserActive3V3(int32_t *status);
|
||||
int getUserCurrentFaults3V3(int32_t *status);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ extern "C"
|
||||
|
||||
MULTIWAIT_ID initializeMultiWait();
|
||||
void deleteMultiWait(MULTIWAIT_ID sem);
|
||||
int8_t takeMultiWait(MULTIWAIT_ID sem, int32_t timeout);
|
||||
int8_t takeMultiWait(MULTIWAIT_ID sem, MUTEX_ID m, int32_t timeout);
|
||||
int8_t giveMultiWait(MULTIWAIT_ID sem);
|
||||
}
|
||||
|
||||
|
||||
29
hal/include/HAL/SerialPort.hpp
Normal file
29
hal/include/HAL/SerialPort.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __vxworks
|
||||
#include <vxWorks.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void serialInitializePort(uint8_t port, int32_t *status);
|
||||
void serialSetBaudRate(uint8_t port, uint32_t baud, int32_t *status);
|
||||
void serialSetDataBits(uint8_t port, uint8_t bits, int32_t *status);
|
||||
void serialSetParity(uint8_t port, uint8_t parity, int32_t *status);
|
||||
void serialSetStopBits(uint8_t port, uint8_t stopBits, int32_t *status);
|
||||
void serialSetWriteMode(uint8_t port, uint8_t mode, int32_t *status);
|
||||
void serialSetFlowControl(uint8_t port, uint8_t flow, int32_t *status);
|
||||
void serialSetTimeout(uint8_t port, float timeout, int32_t *status);
|
||||
void serialEnableTermination(uint8_t port, char terminator, int32_t *status);
|
||||
void serialDisableTermination(uint8_t port, int32_t *status);
|
||||
void serialSetReadBufferSize(uint8_t port, uint32_t size, int32_t *status);
|
||||
void serialSetWriteBufferSize(uint8_t port, uint32_t size, int32_t *status);
|
||||
int32_t serialGetBytesReceived(uint8_t port, int32_t *status);
|
||||
uint32_t serialRead(uint8_t port, char* buffer, int32_t count, int32_t *status);
|
||||
uint32_t serialWrite(uint8_t port, const char *buffer, int32_t count, int32_t *status);
|
||||
void serialFlush(uint8_t port, int32_t *status);
|
||||
void serialClear(uint8_t port, int32_t *status);
|
||||
void serialClose(uint8_t port, int32_t *status);
|
||||
}
|
||||
@@ -1,232 +0,0 @@
|
||||
#include "HAL/CAN.hpp"
|
||||
#include <map>
|
||||
|
||||
struct CANMessage
|
||||
{
|
||||
uint8_t data[8];
|
||||
};
|
||||
|
||||
static std::map<uint32_t, CANMessage> outgoingMessages;
|
||||
static std::map<uint32_t, CANMessage> incomingMessages;
|
||||
|
||||
static const uint32_t kFullMessageIDMask = 0x1fffffff;
|
||||
|
||||
/**
|
||||
* Gets the data from the outgoing hashmap and calls
|
||||
* CANSessionMux...sendMessage.
|
||||
*/
|
||||
void canTxSend(uint32_t arbID, uint8_t length, int32_t period)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
int32_t status;
|
||||
|
||||
FRC_NetworkCommunication_CANSessionMux_sendMessage(
|
||||
arbID, message.data, length, period, &status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time an single byte field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt8(uint32_t arbID, uint8_t offset, uint8_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
message.data[offset] = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a short integer field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt16(uint32_t arbID, uint8_t offset, uint16_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
*(uint16_t *)(message.data + offset) = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a long integer field changes in a message.data,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackInt32(uint32_t arbID, uint8_t offset, uint32_t value)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
*(uint32_t *)(message.data + offset) = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time an 8.8 fixed point field changes in a message,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackFXP16(uint32_t arbID, uint8_t offset, double value)
|
||||
{
|
||||
int16_t raw = value * 255.0;
|
||||
|
||||
canTxPackInt16(arbID, offset, raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a field in the outgoing hashmap.
|
||||
*
|
||||
* This is called every time a 16.16 fixed point field changes in a message,
|
||||
* such as when a setter on a CAN device is called.
|
||||
*/
|
||||
void canTxPackFXP32(uint32_t arbID, uint8_t offset, double value)
|
||||
{
|
||||
int32_t raw = value * 65535.0;
|
||||
|
||||
canTxPackInt32(arbID, offset, raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint8_t canTxUnpackInt8(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return message.data[offset];
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint16_t canTxUnpackInt16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint16_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
uint32_t canTxUnpackInt32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = outgoingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint32_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
double canTxUnpackFXP16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int16_t raw = canTxUnpackInt16(arbID, offset);
|
||||
|
||||
return raw / 255.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the outgoing hashmap.
|
||||
*
|
||||
* This is called in getters for configuration data.
|
||||
*/
|
||||
double canTxUnpackFXP32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int32_t raw = canTxUnpackInt32(arbID, offset);
|
||||
|
||||
return raw / 65535.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data from CANSessionMux (if it's available) and put it in the incoming
|
||||
* hashmap.
|
||||
*
|
||||
* @return true if there's new data. Otherwise, the last received value should
|
||||
* still be in the hashmap.
|
||||
*/
|
||||
bool canRxReceive(uint32_t arbID)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
uint8_t length;
|
||||
uint32_t timestamp;
|
||||
int32_t status;
|
||||
|
||||
FRC_NetworkCommunication_CANSessionMux_receiveMessage(
|
||||
&arbID, kFullMessageIDMask, message.data, &length, ×tamp, &status);
|
||||
|
||||
return status != ERR_CANSessionMux_MessageNotFound;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint8_t canRxUnpackInt8(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return message.data[offset];
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint16_t canRxUnpackInt16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint16_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
uint32_t canRxUnpackInt32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
CANMessage &message = incomingMessages[arbID];
|
||||
|
||||
return *reinterpret_cast<uint32_t *>(message.data + offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
double canRxUnpackFXP16(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int16_t raw = canRxUnpackInt16(arbID, offset);
|
||||
|
||||
return raw / 255.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack a field from the incoming hashmap.
|
||||
*
|
||||
* This is called in getters for status data.
|
||||
*/
|
||||
double canRxUnpackFXP32(uint32_t arbID, uint8_t offset)
|
||||
{
|
||||
int32_t raw = canRxUnpackInt32(arbID, offset);
|
||||
|
||||
return raw / 65535.0;
|
||||
}
|
||||
@@ -242,7 +242,7 @@ void setPWMPeriodScale(void* digital_port_pointer, uint32_t squelchMask, int32_t
|
||||
|
||||
/**
|
||||
* Allocate a DO PWM Generator.
|
||||
* Allocate PWM generators so that they are not accidently reused.
|
||||
* Allocate PWM generators so that they are not accidentally reused.
|
||||
*
|
||||
* @return PWM Generator refnum
|
||||
*/
|
||||
@@ -299,12 +299,12 @@ void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status) {
|
||||
if(id < 4)
|
||||
digitalSystem->writePWMDutyCycleA(id, (uint8_t)rawDutyCycle, status);
|
||||
else
|
||||
digitalSystem->writePWMDutyCycleB(id - 3, (uint8_t)rawDutyCycle, status);
|
||||
digitalSystem->writePWMDutyCycleB(id - 4, (uint8_t)rawDutyCycle, status);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure which DO channel the PWM siganl is output on
|
||||
* Configure which DO channel the PWM signal is output on
|
||||
*
|
||||
* @param pwmGenerator The generator index reserved by AllocateDO_PWM()
|
||||
* @param channel The Digital Output channel to output on
|
||||
@@ -384,7 +384,11 @@ bool allocateDIO(void* digital_port_pointer, bool input, int32_t *status) {
|
||||
DigitalPort* port = (DigitalPort*) digital_port_pointer;
|
||||
char buf[64];
|
||||
snprintf(buf, 64, "DIO %d", port->port.pin);
|
||||
if (DIOChannels->Allocate(port->port.pin, buf) == ~0ul) return false;
|
||||
if (DIOChannels->Allocate(port->port.pin, buf) == ~0ul) {
|
||||
*status = RESOURCE_IS_ALLOCATED;
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
Synchronized sync(digitalDIOSemaphore);
|
||||
|
||||
@@ -420,7 +424,11 @@ bool allocatePWMChannel(void* digital_port_pointer, int32_t *status) {
|
||||
DigitalPort* port = (DigitalPort*) digital_port_pointer;
|
||||
char buf[64];
|
||||
snprintf(buf, 64, "PWM %d", port->port.pin);
|
||||
if (PWMChannels->Allocate(port->port.pin, buf) == ~0ul) return false;
|
||||
if (PWMChannels->Allocate(port->port.pin, buf) == ~0ul) {
|
||||
*status = RESOURCE_IS_ALLOCATED;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (port->port.pin > tPWM::kNumHdrRegisters-1) {
|
||||
snprintf(buf, 64, "PWM %d and DIO %d", port->port.pin, remapMXPPWMChannel(port->port.pin) + 10);
|
||||
if (DIOChannels->Allocate(remapMXPPWMChannel(port->port.pin) + 10, buf) == ~0ul) return false;
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
#ifndef __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
#define __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
|
||||
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_9
|
||||
#define nRoboRIO_FPGANamespace nFRC_2015_1_0_A
|
||||
|
||||
#endif // __RoboRIO_FRC_ChipObject_Aliases_h__
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) National Instruments 2008. All Rights Reserved.
|
||||
// Do Not Edit... this file is generated!
|
||||
|
||||
#ifndef __nFRC_C0EF_1_1_0_nInterfaceGlobals_h__
|
||||
#define __nFRC_C0EF_1_1_0_nInterfaceGlobals_h__
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_C0EF_1_1_0
|
||||
{
|
||||
extern unsigned int g_currentTargetClass;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_C0EF_1_1_0_nInterfaceGlobals_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_9_nInterfaceGlobals_h__
|
||||
#define __nFRC_2015_1_0_9_nInterfaceGlobals_h__
|
||||
#ifndef __nFRC_2015_1_0_A_nInterfaceGlobals_h__
|
||||
#define __nFRC_2015_1_0_A_nInterfaceGlobals_h__
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
extern unsigned int g_currentTargetClass;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_nInterfaceGlobals_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_AI_h__
|
||||
#define __nFRC_2015_1_0_9_AI_h__
|
||||
#ifndef __nFRC_2015_1_0_A_AI_h__
|
||||
#define __nFRC_2015_1_0_A_AI_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tAI
|
||||
@@ -140,4 +140,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_AI_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_AO_h__
|
||||
#define __nFRC_2015_1_0_9_AO_h__
|
||||
#ifndef __nFRC_2015_1_0_A_AO_h__
|
||||
#define __nFRC_2015_1_0_A_AO_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tAO
|
||||
@@ -47,4 +47,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_AO_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_Accel_h__
|
||||
#define __nFRC_2015_1_0_9_Accel_h__
|
||||
#ifndef __nFRC_2015_1_0_A_Accel_h__
|
||||
#define __nFRC_2015_1_0_A_Accel_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tAccel
|
||||
@@ -99,4 +99,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_Accel_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_Accumulator_h__
|
||||
#define __nFRC_2015_1_0_9_Accumulator_h__
|
||||
#ifndef __nFRC_2015_1_0_A_Accumulator_h__
|
||||
#define __nFRC_2015_1_0_A_Accumulator_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tAccumulator
|
||||
@@ -84,4 +84,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_Accumulator_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_Alarm_h__
|
||||
#define __nFRC_2015_1_0_9_Alarm_h__
|
||||
#ifndef __nFRC_2015_1_0_A_Alarm_h__
|
||||
#define __nFRC_2015_1_0_A_Alarm_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tAlarm
|
||||
@@ -54,4 +54,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_Alarm_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_AnalogTrigger_h__
|
||||
#define __nFRC_2015_1_0_9_AnalogTrigger_h__
|
||||
#ifndef __nFRC_2015_1_0_A_AnalogTrigger_h__
|
||||
#define __nFRC_2015_1_0_A_AnalogTrigger_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tAnalogTrigger
|
||||
@@ -126,4 +126,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_AnalogTrigger_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_BIST_h__
|
||||
#define __nFRC_2015_1_0_9_BIST_h__
|
||||
#ifndef __nFRC_2015_1_0_A_BIST_h__
|
||||
#define __nFRC_2015_1_0_A_BIST_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tBIST
|
||||
@@ -87,4 +87,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_BIST_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_Counter_h__
|
||||
#define __nFRC_2015_1_0_9_Counter_h__
|
||||
#ifndef __nFRC_2015_1_0_A_Counter_h__
|
||||
#define __nFRC_2015_1_0_A_Counter_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tCounter
|
||||
@@ -216,4 +216,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_Counter_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_DIO_h__
|
||||
#define __nFRC_2015_1_0_9_DIO_h__
|
||||
#ifndef __nFRC_2015_1_0_A_DIO_h__
|
||||
#define __nFRC_2015_1_0_A_DIO_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tDIO
|
||||
@@ -245,4 +245,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_DIO_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_DMA_h__
|
||||
#define __nFRC_2015_1_0_9_DMA_h__
|
||||
#ifndef __nFRC_2015_1_0_A_DMA_h__
|
||||
#define __nFRC_2015_1_0_A_DMA_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tDMA
|
||||
@@ -185,4 +185,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_DMA_h__
|
||||
#endif // __nFRC_2015_1_0_A_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_9_Encoder_h__
|
||||
#define __nFRC_2015_1_0_9_Encoder_h__
|
||||
#ifndef __nFRC_2015_1_0_A_Encoder_h__
|
||||
#define __nFRC_2015_1_0_A_Encoder_h__
|
||||
|
||||
#include "tSystemInterface.h"
|
||||
|
||||
namespace nFPGA
|
||||
{
|
||||
namespace nFRC_2015_1_0_9
|
||||
namespace nFRC_2015_1_0_A
|
||||
{
|
||||
|
||||
class tEncoder
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
typedef enum
|
||||
{
|
||||
kNumSystems = 4,
|
||||
kNumSystems = 8,
|
||||
} tIfaceConstants;
|
||||
|
||||
typedef
|
||||
@@ -196,4 +196,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __nFRC_2015_1_0_9_Encoder_h__
|
||||
#endif // __nFRC_2015_1_0_A_Encoder_h__
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user