-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Adding plotting functionality to the editor #2177
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
Conversation
This sounds like an intriguing, if not very specific feature. Any chance you could add a screenshot and some examples of the corresponding strings sent through serial? I'm curious :-)
Here's a screenshot:
plottingscreenshot
I went for the most simplistic option with this: everything coming in on the serial port is split with every new line, whitespace is trimmed and the left over string is parsed as a double. This assumes there's only one value being send and that it is send as a string. Of course this could be extended to, e.g., use the raw byte values, allow users to specify separators, show multiple graphs, etc. Again: I first tried to get the basic thing in there.
Please Merge this! This would be an awesome feature. Just like Processing has a Color Picker under the "Tools" bar, so should Arduino have this specific "Graph" feature.
P.S. Your proposed Graphing Icon is really awesome!
q2dg
commented
Mar 31, 2015
+1 !!
57dcf07
to
5a68e34
Compare
@henningpohl can you please rebase/merge your PR with the current master? It doesn't merge any more
So, my PR now is quite old and a lot of things seem to have changed in the codebase. Also around SerialMonitor. If I update my code, should the plotter also extend AbstractMonitor? Conceptually that would make sense. However, AbstractMonitor isn't really that abstract. There are already a whole bunch of UI components in there which would not be needed for plotting. That could be moved to an AbstractTextualMonitor or something like that. But that would be a larger change. Any thoughts?
Well it's abstract as far as serial and network monitors are concerned. Sure a plotter monitor requires more abstraction, or a totally independent code. I would do the minimum for making it viable and still be, if not proud, at least convinced of the quality of the code.
b3beda7
to
9a606c0
Compare
Alright, I got everything to compile and work again. It would be great if somebody more familiar with the codebase could have a look. I mostly tried to go by what was in place in SerialMonitor and AbstractMonitor, but might have misunderstood some intentions here or there.
@ArduinoBot build this please
👍 !!!
Only one problem: it doesn't close the serial port when closing the plot window, so the serial monitor can't open anymore (pretty annoying) -> saw on Linux x64 with a Leonardo
9a606c0
to
617a940
Compare
Hmm... I tested this on Ubuntu 14.04 (64 bit) in a VM and on Windows 8 (64 bit) and the serial port closed on both. I think I did find the problem though: if one tries to open the serial monitor/plotter while the other window is open, that fails but puts the application in a state where opening will also fail in the future even if the other window is closed. I added a check for that and switching between both windows should now work.
The better solution would be to have the serial connection somewhere central in the editor and allow any number of subscriptions to incoming data elsewhere. But that probably would be a larger change on its own.
74028a8
to
fc3e295
Compare
@ArduinoBot build this please
PedroLopes
commented
May 28, 2015
Awesome pull request, definitively a feature I want to have in the IDE!
(if possible in the future something in the lines of https://code.google.com/p/arduinoscope/ would be even better, but this is a fantastic start!)
This is a really nice feature, and it works really well. I can see many ways it can be expanded into a super useful tool while keeping the interface as basic as possible.
Wish I had the opportunity to test this but I'm happy to see this feature come!! 👏👏👏
@Mixania you still have it: code still needs to be merged
fc3e295
to
0f5eaac
Compare
@ArduinoBot build this please
0f5eaac
to
32f66ca
Compare
@ArduinoBot build this please
Build successful. Please test this code using one of the following:
http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-2177-BUILD-317-linux32.tar.xz
http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-2177-BUILD-317-linux64.tar.xz
http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-2177-BUILD-317-windows.zip
http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-2177-BUILD-317-macosx.zip
q2dg
commented
Jun 15, 2015
Serial plotter is available in BUILD 317 but it is not in 1.6.5. Why?
Thanks
@henningpohl after some consideration, we would like to merge this feature. However we are puzzled by the added button next serial monitor one: we think either it won't get noticed or it will confuse users. Is removing the button and leaving the menu entry under Tools
ok for you?
Restoring previous versions of EditorToolbar.java and buttons.git should suffice
Great! I'd be fine with removing the button. Would it be an option to leave the image in buttons.gif though? While adding a button to the interface is an easy change, recreating an icon is a bit more work. There might be a button in the future, or the icon might be used in the window title. I could alternatively also make removal a dedicated commit, keeping the larger buttons.gif in the history.
I'm also out of office right now, so can't properly test changes. I will update this and get it ready early next week.
The changed image is already in the history. If you prefer, it's ok to edit buttons.gif in a dedicated commit
32f66ca
to
4bd62de
Compare
Adding plotting functionality to the editor
Thanks!
q2dg
commented
Sep 28, 2015
Could it be possible to add to Serial Plotter the ability of recognize several serial streams to be able to paint several graphs accordingly?? I mean...I'd like to see on Serial Plotter the evolution of data got by two different analog sensors at the same time, in two different coloured graphs.
Thanks.
I found debugging Arduino projects with, e.g., time-varying capacitive sensor values rather tedious with the serial monitor. I added a graph view that makes it easier to observe such changes.