Skip to content

Commit

Permalink
Merge with 2020.2.2 (#201)
Browse files Browse the repository at this point in the history
* Update ProjectYear to 2020 (#184)

* fix case of Requires in comments (#193)

* Fix frc namespace for CustomComponents (#195)

use export declarations for subsystem-declerations.h
Don't add frc namespace for CustomComponents

* Update to export to 2020.2.2 (#200)

Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
  • Loading branch information
sciencewhiz and PeterJohnson committed Jan 19, 2020
1 parent d71658f commit fdfd619
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/main/java/robotbuilder/exporters/GenericExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public boolean export(RobotTree robotTree) throws IOException {
}
}
if(wpilibRelease == null) {
wpilibRelease = "2020.1.2"; // this shouldn't need to be relied upon,
wpilibRelease = "2020.2.2"; // this shouldn't need to be relied upon,
// but its better than generating nothing.
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/cpp/Command-constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#foreach($param in $params)
m_$param.getName() = $param.getName();
#end
// Use requires() here to declare subsystem dependencies
// eg. requires(Robot::chassis.get());
// Use Requires() here to declare subsystem dependencies
// eg. Requires(Robot::chassis.get());
#@autogenerated_code("requires", " ")
#parse("${exporter_path}Command-requires.cpp")
#end
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/CommandBasedRobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void Robot::RobotInit() {
// This MUST be here. If the OI creates Commands (which it very likely
// will), constructing it during the construction of CommandBase (from
// which commands extend), subsystems are not guaranteed to be
// yet. Thus, their requires() statements may grab null pointers. Bad
// yet. Thus, their Requires() statements may grab null pointers. Bad
// news. Don't move it.
oi.reset(new OI());

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/cpp/ExportDescription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ Instruction Names: ["Export", "Import", "Declaration", "Construction", "LiveWind
Defaults:
Component:
Export: "RobotMap"
Declaration: "static std::shared_ptr<frc::${ClassName}> #variable($Name);"
Declaration: "std::shared_ptr<frc::${ClassName}> #variable($Name);"
Import: "\\#include \"frc/${ClassName}.h\""
CustomComponent:
Export: "RobotMap"
Import: "\\#include \"Custom/${ClassName}.h\""
Declaration: "static std::shared_ptr<frc::${ClassName}> #variable($Name);"
Declaration: "std::shared_ptr<${ClassName}> #variable($Name);"
None:
Export: ""
Import: ""
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/cpp/InstantCommand-constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#foreach($param in $params)
m_$param.getName() = $param.getName();
#end
// Use requires() here to declare subsystem dependencies
// eg. requires(Robot::chassis.get());
// Use Requires() here to declare subsystem dependencies
// eg. Requires(Robot::chassis.get());
#@autogenerated_code("requires", " ")
#parse("${exporter_path}Command-requires.cpp")
#end
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/cpp/PIDCommand-constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#foreach($param in $params)
m_$param.getName() = $param.getName();
#end
// Use requires() here to declare subsystem dependencies
// eg. requires(Robot::chassis.get());
// Use Requires() here to declare subsystem dependencies
// eg. Requires(Robot::chassis.get());
#@autogenerated_code("requires", " ")
#parse("${exporter_path}Command-requires.cpp")
#end
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/cpp/PIDCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#parse("${exporter_path}PIDCommand-pid.cpp")
#end

// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
// Use Requires() here to declare subsystem dependencies
// eg. Requires(chassis);
#@autogenerated_code("requires", " ")
#parse("${exporter_path}Command-requires.cpp")
#end
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/export/cpp/Subsystem-declarations.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#set($subsystem = $helper.getByName($subsystem_name, $robot))
#foreach ($component in $components)
#if ($component.subsystem == $subsystem.subsystem && $component != $subsystem)
std::shared_ptr<frc::#type($component)> #variable($component.name);
#declaration($component)

#end
#end
4 changes: 2 additions & 2 deletions src/main/resources/export/cpp/TimedCommand-constructor.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#set($command = $helper.getByName($command_name, $robot))

#class($command.name)::#class($command.name)(double timeout) : frc::TimedCommand(timeout) {
// Use requires() here to declare subsystem dependencies
// eg. requires(Robot::chassis.get());
// Use Requires() here to declare subsystem dependencies
// eg. Requires(Robot::chassis.get());
#@autogenerated_code("requires", " ")
#parse("${exporter_path}Command-requires.cpp")
#end
Expand Down

0 comments on commit fdfd619

Please sign in to comment.