mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Added default world files to examples.
This saves a step and prevents one of the biggest user errors with the pacgoat example. Change-Id: Icdceb1da37c4b456f1a34daa815f3bbe2a47e18e
This commit is contained in:
@@ -250,6 +250,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 +334,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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user