Skip to content
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

Add UI support for custom Python operations #640

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

SamCarlberg
Copy link
Member

@SamCarlberg SamCarlberg commented Jul 26, 2016

Screenshot

screen shot 2016-07-26 at 3 16 41 pm

Issues

  • The text 'editor' is just a TextArea, might want to make it more full-featured
  • Poor layout for the Create New button
  • Need to add something to the wiki explaining how to make sockets (after PR gets merged)

@SamCarlberg SamCarlberg changed the title Add barebones UI support for custom Python operations Add UI support for custom Python operations Jul 26, 2016
@codecov-io
Copy link

codecov-io commented Jul 26, 2016

Current coverage is 53.19% (diff: 18.21%)

Merging #640 into master will decrease coverage by 1.38%

@@             master       #640   diff @@
==========================================
  Files           209        213     +4   
  Lines          6715       6961   +246   
  Methods           0          0          
  Messages          0          0          
  Branches        656        693    +37   
==========================================
+ Hits           3665       3703    +38   
- Misses         2882       3089   +207   
- Partials        168        169     +1   

Sunburst

Powered by Codecov. Last update 765dd48...81a60b7

@AustinShalit
Copy link
Member

I think the "Create New" button needs a margin.

When searching for operations, what do you think about getting rid of the categories and just showing operations?

@AustinShalit
Copy link
Member

@SamCarlberg
Copy link
Member Author

I think it's good to keep search results separate, it makes it easier to know what category the operations belong to. Unless if it turns out that people use the search bar for the majority of the time.

Doesn't crash when new python scripts have errors (just alerts the user).
Loading erroneous scripts from disk will be logged but not added to the operations list
loader.load();
return loader.getController();
} catch (IOException e) {
throw new RuntimeException("Couldn't load python editor", e);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugly

}

@FXML
private void openWiki() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at how we did it for the AboutDialog

@AustinShalit AustinShalit modified the milestone: v2.0.0 Jul 29, 2016
@AustinShalit
Copy link
Member

closes #470

+ " outputs.createNumberSocketHint(\"sum\", 0.0),\n"
+ "]\n\n\n" // two blank lines
+ "def perform(a, b):\n"
+ " return a + b\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this a file? What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes some sense. I'd like to keep the contents in memory though to minimize disk accesses.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it in a read once file.
Cache the string in memory after its loaded.
It will make it easier to edit in the future.

@SamCarlberg
Copy link
Member Author

I think we're going to need to use the official OpenCV python libraries instead of accessing the Java bindings through python.

@JLLeitschuh
Copy link
Member

Are we waiting on this for the opencv library change?

@SamCarlberg
Copy link
Member Author

Haven't had the time to figure out how to deal with the OpenCV python libraries

@AustinShalit AustinShalit modified the milestones: v1.5.0, 1.6.0 Aug 27, 2016
@AustinShalit AustinShalit modified the milestones: 1.6.0, v1.5.0, Future Oct 5, 2016
Conflicts:
	build.gradle
	core/src/test/java/edu/wpi/grip/core/PythonTest.java
	core/src/test/java/edu/wpi/grip/core/serialization/ProjectTest.java
	ui/src/test/java/edu/wpi/grip/ui/PaletteTest.java
@SamCarlberg
Copy link
Member Author

So this is going to be interesting. We don't need to include python bindings for OpenCV (you can just use pip install opencv-python). But we will need a way of converting the JavaCV mats to and from numpy arrays

@JLLeitschuh
Copy link
Member

Write a library to emulate numpy in jython

@ianfinlay-aus
Copy link

I like this feature: was thinking how to dynamically add OpenCV2 calls into the tool, amd import/export the custom library for sharing

@SamCarlberg
Copy link
Member Author

Wow, this is an old PR. IIRC it never moved forward because it's really just a python wrapper around the java libraries (which are wrappers around the C++ library...), and wouldn't support the normal python libraries people would use to interface with OpenCV like numpy or opencv2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants