Graph2D & gwoptics for Processing 3?

edited December 2015 in Developing Processing

Howdy all,

I helped develop the OpenBCI GUI (https://github.com/OpenBCI/OpenBCI_Processing) using Processing 2. I'm trying to update the code to work with Processing 3, but I'm running into some frustrating errors that appear to be because of deprecated libraries—gwoptics, specifically.

When I try to begin the GUI interface, I get an error that crashes the application.

If the debugger is disabled, I get the following error:

noDebugger

If I enable the debugger, the error appears as follows:

Any ideas?

-Conor

Answers

  • edited October 2015

    PVector's normalize() return the PVector itself:
    https://processing.org/reference/PVector_normalize_.html

    Maybe the Graph2D class is invoking normalize() by reflection expecting void instead? :-??

    Who knows a library recompilation would solve the issue automatically? [-O<

  • How would I go about doing a library recompilation? Is this something I'd need to do in Eclipse or can I do this from the Processing IDE?

    Any thoughts on why the error message is different if I enable/disable the debugger?

  • edited October 2015
    • Gotta confess although I've got a good knowledge of Java, it's more restricted to Processing's IDE.
    • The ideal would be for the original author to recompile the lib against Processing 3 on his own.
    • So it automatically picks up any method signature's changes which happened between Processing 2 to Processing 3.
    • And of course it becomes officially available as a 3rd-party library for PDE.
  • Answer ✓

    Interesting in that I had exactly the same problem with my Shapes3D library and it was solved by rebuilding it using the PS3 core libraries.

    You can't build a library in Processing you need something like Eclipse or Netbeans. As GoToLoop said the best solution is to ask the library author to update the library. The author of gwOptics is Professor Andreas Freise and I think his processing tag is @Andreas or @Andreas_Processing (both will get an email now because of the 'at' sign)

    Not sure about Graph2D

  • edited October 2015

    Indeed any tiny modification on a method's signature, as changing void normalize() to PVector normalize(), demands a recompilation for any classes accessing that method.
    Since the method was void, no code modification is required for the library. Merely a rebuild. ;;)

  • Thanks for the help, guys.

    How easy would a rebuild be to do on my own? Is it possible? I reached out to Andreas by email yesterday. Hoping to hear back, but in the case that I don't, I'll need to figure this out on my own. We've got a huge application built that heavily depends on the gwoptics library. There's basically no way of dropping it at this point. I want to be able to export the sketch as a standalone app/exe, something that we've had trouble doing with the older version of Processing. Rumor has it that the Processing 3 has fixed app export bugs (especially serial stuff).

    Application Screenshot: OpenBCI_GUI

  • If the library comes with the source code it should be easy enough to do if you are familiar with Eclipse. If you don't hear from Andreas I am sure someone on this forum would do it for you.

  • Thanks, @Quark. I'll give it a few days.

  • edited January 2016

    Hi. Is there any update on this issue? I am requiring the gwoptics lib as well in processing 3. Or is there perhaps an alternative that offers the same functionality for displaying timeseries? Thanks.

    --edit-- I just found the gwoptics lib in your github project @crussoma. Works splendid! Don't mind that I use it until gwoptics is officially supported? Thanks

  • Hi Samuel. As a matter of fact, we did fix this issue. We recently updated the .jar file so that it is now compiled against the Processing 3 core: https://github.com/OpenBCI/OpenBCI_Processing/tree/master/libraries/gwoptics/library

    Swap that gwoptics.jar with the one you are currently using, and everything should be good to go!

Sign In or Register to comment.