-
Notifications
You must be signed in to change notification settings - Fork 109
Refactor Operation Interface #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Operation Interface #586
Conversation
JLLeitschuh
commented
May 19, 2016
- Operations now use local state variables for input and output sockets rather than regenerating them on the fly
- Moved name, description, category, icon, and aliases to a separate description object
- Socket classes are now interfaces
- Refactors Generated Operations to be in source code
- Changed socket get methods to return List instead of FooSocket<?>[]
build.gradle
Outdated
| removeExisting true | ||
| } | ||
| generateCodeFromSource.onlyIf { !project.hasProperty('skipGenerate') } | ||
| //generateCodeFromSource.onlyIf { false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line
7529a23 to
347db13
Compare
| import java.util.List; | ||
|
|
||
|
|
||
| public class FiveSourceOneDestinationOperation<T1, T2, T3, T4, T5, R> implements Operation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add documentation for how and when to use this
8113b8f to
d536300
Compare
|
For some reason, most operations in the palette don't display their images. |
| new OperationMetaData(NewPointOperation.DESCRIPTION, () -> new NewPointOperation(isf, osf)), | ||
| new OperationMetaData(NewSizeOperation.DESCRIPTION, () -> new NewSizeOperation(isf, osf)), | ||
|
|
||
| // Raw OpenCV operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this comment and associated newlines since OpenCV operations are in their own file
|
Missing operations: |
45b9c26 to
6abb294
Compare
| for (OutputSocket socket : e.getStep().getOutputSockets()) { | ||
| if (socket == this.outputSocket) { | ||
| this.eventBus.post(new ConnectionRemovedEvent(this)); | ||
| this.remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my note on line 97
| public InputSocket<?>[] createInputSockets(EventBus eventBus) { | ||
| throw new UnsupportedOperationException("This method should not be used"); | ||
| public List<InputSocket> getInputSockets() { | ||
| return ImmutableList.of(switcherSocket, inputSocket); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style with new lines
|
Regarding the icon issue: InputStreams can only be read once. Two ways to solve it:
|
|
Huh, I figured that the constructor would close the stream. Should just change the icons utility class to return the icons (and cache them in memory) instead of streams. |
- Operations now use local state variables for input and output sockets rather than regenerating them on the fly - Moved name, description, category, icon, and aliases to a separate description object - Socket classes are now interfaces - Refactors Generated Operations to be in source code - Changed socket get methods to return List<FooSocket> instead of FooSocket<?>[]
6abb294 to
3cdd6e0
Compare
| protected final String getNetworkProtocolNameAcronym() { | ||
| return "ROS"; | ||
| } | ||
| private final JavaToMessageConverter<D, ?> converter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.