forked from WPIRoboticsProjects/GRIP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autodiscover operations at startup. Use annotations for descriptions
Re-enable CompatibilityTest. Fix some backwards compatbility issues. Not really a fan of injecting the Injector into the Operations class. Need to see if there's a better solution
1 parent
142b1de
commit 0868182
Showing
5 changed files
with
180 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package edu.wpi.grip.core; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import static edu.wpi.grip.core.OperationDescription.Category; | ||
import static edu.wpi.grip.core.OperationDescription.Category.MISCELLANEOUS; | ||
|
||
/** | ||
* Annotates an {@link Operation} subclass to describe it. This annotation gets transformed into a | ||
* {@link OperationDescription}. All operation classes with this annotation will be automatically | ||
* discovered and added to the palette at startup. | ||
*/ | ||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface Description { | ||
|
||
/** | ||
* The name of the operation being described. | ||
*/ | ||
String name(); | ||
|
||
/** | ||
* A brief summary of the operation. In-depth descriptions, usage guides, and examples | ||
* should be on the wiki, not here. | ||
*/ | ||
String summary(); | ||
|
||
/** | ||
* The category the operation belongs to. Defaults to | ||
* {@link OperationDescription.Category#MISCELLANEOUS MISCELLANEOUS}. | ||
*/ | ||
Category category() default MISCELLANEOUS; | ||
|
||
/** | ||
* All known aliases of the operation. If the name of the operation changes, the previous name | ||
* should be here. Defaults to an empty array. | ||
*/ | ||
String[] aliases() default {}; | ||
|
||
/** | ||
* The name of the icon to use to display the operation. If empty ({@code ""}), no icon will be | ||
* shown. The icon should be located in {@code /edu/wpi/grip/ui/icons/}. | ||
*/ | ||
String iconName() default ""; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 127 additions & 1 deletion
128
core/src/main/java/edu/wpi/grip/core/operations/composite/DistanceTransformOperation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters