Community
Participate
Working Groups
Currently the scope has one channel. More channels on the same scope would be nice.
Any progress on this? I'm thinking in using this for my Arduino eclipse plugin. I need multiple channels (at least 10) Can you share your planning on this?
Created attachment 221374 [details] showing text overlay Hi Jan, Yes, that would be nice wouldn't it. Let me take a look at this. Any chance that you can contribute in some way? I am also thinking of simplifying the API a little bit. Do you have any ideas on this. What about text overlay? Please see attachment for an idea. Can you give me a short user story on the multiple channels?
Wim I have not been able to look at the API yet. Some history of what made me request this feature. I have been working on a project that involves hardware and software. For ease of talking lets call it an arduino project (www.arduino.cc) I had some "unexpected behavior" (or call it bugs) in my arduino code; then I bumped into simplot (http://www.negtronics.com/simplot) and I had my problems fixed in next to no time. I'm developing an arduino eclipse plugin (eclipse.baeyens.it) and I would love to add this functionality to my eclipse plugin. Therefore I was looking for a widget that could take the visuals from me and I could simply send the data. That is how I found your widget. As the examples only showed one channel (and I'm old enough to make me suspicious) I keep looking and found this bug/feature request. I hope to install the widget later today and look at the API. The use case is basically "monitoring of variables of remotely running systems" Each variable would map on a channel. As to the example you provided: I would have all channels use the same x axis as in simplot. I mean: for me the x axis needs to be shared as this is the values of the program at a given point in time. Because the code compares these values it is easier to have them on the same x axes. It may be advantages to be able to change the y axis range by channel but I would call this advanced usage. Text overlay would be great. I'm thinking about showing the name of the variable monitored (legend). More advanced could be to show state names. I'm willing to help out. Where could I help out with? Beta testing API description (I've defined my first commercially used api in 1993 ;-) ) Maybe coding (I need to look at the current code to see whether my Java knowledge is good enough for this -am an old C/C++ programmer; Productive java development is relative new to me) Best regards Jantje
I have implemented the multichannel scope. It would be nice if you could try it out. there is a snippet in the same package that you can use as a base. pushed to master: http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/commit/?id=8a2ed9cbe1df3481d9e00884db3ca3cbae037cff
I have simplified the API a little. Please take a look at the 3 snippets in the multichannel package. Not yet finished. Look at Snippet3_ScopeWithDataandProgression for a real-time example. pushed to master http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/commit/?id=ce5279a8ad614302fd903c3bac4980be0427b5e2
Wim I got the samples to work. Played a little bit with it to get a feel how it works. I added lines; changed colors. It all worked great. It looks really promising. I need to think now on how I can integrate it in my plugin. 2 things are a bit of a worry right now 1) All samples are with a pull from the scope. I need a push to the scope. 2) It is indeed getting slow with multiple lines (I tried 6) Best regards Jantje
(In reply to comment #6) > changed colors. It all worked great. Nice! Good to hear. > 1) All samples are with a pull from the scope. I need a push to the scope. Sure, let's think about that for a minute. If you have hooked up some sort of hardware device then it is possible that it delivers values at a rate that cannot be handled by the scope. This is of course not important because the scope can only show a sample of the data. Correct me if i'm wrong. There is this constant stream of data and the scope just takes a bite out of it whenever it runs out of values (using the stack listener). What I believe that you are asking is to just hook the output of the device to the input of the scope and forcefully push that data into the scope. Correct? The scope is using something that I have called an IntegerFiFoCircularStack[1] which enables you to do push values into the scope. Whatever the scope cannot handle will be overwritten. You can write values by calling setValue or setValues method of the scope. > 2) It is indeed getting slow with multiple lines (I tried 6) Can you attach you code so that I can take a look? [1] Which I naively believed I had invented ;)
Please take a look at the latest code and in particular snippet6. Please note that the longer the line is, the mode power is needed to draw. I would suggest that you only allow 500 pixels maximum for the width of the scope. As you can see from Snippet 6, it has no problems drawing 10 channels in this mode. You can see in the console output how many time it takes to draw all channels (around 30 ms on my machine for 10 channels) The real pain is in the paintControl method. It takes a whopping 0.6 ms to draw one line so 10 channels would be drawn in around 6 ms. This means that only drawing lines takes 6 ms and therefore 24 ms are wasted on calculations. I bet this can be improved a bit. Please run snippet6 in the multichannel package.
Wim Sorry for the delays. However I can't guarantee quicker response times. I attached the code I used you requested at the bottom. I'm still trying to find my way around github to get the latest code. To see what you did. I will do some more work the coming days but time is very limited right now. Please find below my point of view on your remarks on push and pull *** If you have hooked up some sort of hardware device then it is possible that it delivers values at a rate that cannot be handled by the scope. In my setup the hardware sends information over the serial port. The stream can not be constant. An extreme example is a setup I have where the hardware sleeps for 8 seconds if there is nothing to do. In this case 1 set of values is send every 8 seconds. As soon as the "event" has arrived the the hardware will send messages more frequently but the timing between 2 messages is guaranteed not to be constant. ***This is of course not important because the scope can only show a sample of the data. Correct me if i'm wrong. In the Arduino world we know we can overflow the serial monitor. So we typically put in a delay for testing. So yes it is possible to overflow the serial monitor (and as such the scope) but as the user is in control of the push he can lower the push rate by simply adding a delay or only sending data every N loops. ***There is this constant stream of data and the scope just takes a bite out of it whenever it runs out of values (using the stack listener). There is no constant stream (see first remark)in the setup as I see it. I would prefer the scope to bite when he gets fed. This because that makes the serial monitor (which is visible next to the scope) contain data consistent with data on the scope. This means that in my 8 seconds example the scope would not be moving for 8 seconds. If it would be moving it should show that it did not receive any data. ***The scope is using something that I have called an integerFiFoCircularStack[1] which enables you to do push values into the scope. Whatever the scope cannot handle will be overwritten. You can write values by calling setValue or setValues method of the scope. I'll have a look at IntegerFiFoCircularStack in the coming days. Best regards jantje protected static void createContents() { shell = new Shell(); shell.setText("Nebula Oscilloscope"); shell.setLayout(new FillLayout()); // Create a single channel scope Oscilloscope scope = new Oscilloscope(6,null,shell, SWT.NONE); scope.setForeground(0, scope.getDisplay().getSystemColor( SWT.COLOR_GREEN)); scope.setForeground(1, scope.getDisplay().getSystemColor( SWT.COLOR_CYAN)); scope.setForeground(2, scope.getDisplay().getSystemColor( SWT.COLOR_DARK_RED)); scope.setForeground(3, scope.getDisplay().getSystemColor( SWT.COLOR_DARK_YELLOW)); scope.setForeground(4, scope.getDisplay().getSystemColor( SWT.COLOR_GRAY)); scope.setForeground(5, scope.getDisplay().getSystemColor( SWT.COLOR_BLUE)); scope.addStackListener(0, new OscilloscopeStackAdapter() { @Override public void stackEmpty(Oscilloscope scope) { scope.setValue(0, 25 - new Random().nextInt(50)); scope.setValue(1, 75 - new Random().nextInt(50)); scope.setValue(2, 0 - new Random().nextInt(50)); scope.setValue(3, 100); scope.setValue(4, -80 - new Random().nextInt(20)); scope.setValue(5, 100 - new Random().nextInt(100)); } }); // scope.addStackListener(1, new OscilloscopeStackAdapter() { // @Override // public void stackEmpty(Oscilloscope scope) { // // } // }); scope.getDispatcher(0).dispatch(); } }
Wim The sample I gave is only the adopted method "createContents" from "Snippet2_ScopeWithData" Best regards Jantje
Wim I'm still fighting conversion from serial stream to integers. But the rest works. I will still need to tune some stuff. I got the push to work with the code below The dispatcher class no with overidden dispatch OscilloscopeDispatcher dsp = new OscilloscopeDispatcher(0) { @Override public void dispatch() { init(); } @Override public int getDelayLoop() { return 30; } @Override public boolean getFade() { return false; } @Override public int getTailSize() { return Oscilloscope.TAILSIZE_MAX; } }; And then the method I call when I have data set to the osciloscope with the myScope.setValue method public void AddValuesToOsciloscope() { if (myScope.isDisposed())return; myScope.getDispatcher(0).hookPulse(myScope, 1); myScope.redraw(); } Works like a charm. Best regards Jantje
Wim For me this bug can be closed Txs Jantje
thanks for testing Jantje? Did it work out ok in the end?
yes it works great (even zooming) but I havn't been able to publish the code nor extend the plugin because of the complexity of resizing in eclipse (or my lack of understanding the simplicity) and my personal health. It is a shame as it is a real cool tool. Best regards Jantje
(In reply to jan baeyens from comment #14) > yes it works great (even zooming) but I havn't been able to publish the code > nor extend the plugin because of the complexity of resizing in eclipse (or > my lack of understanding the simplicity) and my personal health. > It is a shame as it is a real cool tool. > Best regards > Jantje Jan is your code on Github somewhere? I have bought an Arduino and I wanted to see how your code works together with it. Maybe I can help get you with your eclipse problems.