-
March 28th, 2012, 10:23 AM
#16
Re: Displaying data graphically (Ultrasonic radar)
Hi GremlinSA, thanks to your explanations and article I finally understood the concept of double buffering (or at least I think so ).
However I the program is still running slow :/
I have tried your method of drawing as you wrote on your last post but the scan line went really funny and the speed was the same as it was before.
Do you mind having a look at my code and see if I missing something? I'd really appreciate that!
Thanks in advance!
Last edited by Alex83UK; April 12th, 2012 at 08:44 AM.
-
March 31st, 2012, 11:06 AM
#17
Re: Displaying data graphically (Ultrasonic radar)
Do me a Favor ...
Zip the entire project directory, Delete the Debug and Release folders from the zip (as those are recreated each time you debug or build)..
Post it here (use the advanced posting page and use the Manage Attachments button lower down to attach the zip...) and i will download it and go through it...
Only problem is that i dont have the Serial Device, but i'll try a serial loop to pump the data through...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
April 4th, 2012, 04:17 PM
#18
Re: Displaying data graphically (Ultrasonic radar)
Hi GremlinSA, I have fixed the problem which was slowing my system down - I was reading one character at a time, invoking the GUI, coming back, reading another character, invoking the GUI thread, etc. So it was taking a fair amount of time switching threads back and forth for every character.
My system now is (almost) fully working, but I have another question for you though. I am now trying to display the detected objects (little circles or squares).
I can display them fine, however I can only display one at each angle (the current position). How can I draw, let's say, 5 dots and then only after 5 the last one gets erased?
To draw them I just added e.Graphics.FillEllipse(Brushes.Red, 0, radius, 5, 5) to the end of PictureBox1_Paint subroutine.
Thanks in advance!
-
April 4th, 2012, 08:52 PM
#19
Re: Displaying data graphically (Ultrasonic radar)
Add another vector, in the inverse color, to erase the one BEFORE the current one. Erase one, then draw the next, in the same cycle
-
April 5th, 2012, 12:50 AM
#20
Re: Displaying data graphically (Ultrasonic radar)
This is where layering images comes to play.. If you look at the next article in the series it describes simply how to overlap images.. (you may need to read the linked VB6 article to understand the process better)
So in this case you have your base image that is the Sonar Grid.. This image remains static and is drawn onto the buffer at the start of each frame..
Next you store the last 10 (or how ever many you like) scans and redraw all of them onto a new image.. set the transparency, and then draw it onto the buffer..
if you want you could even draw each previous dot in a lighter colour giving it that same Diminishing effect from real radars..
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
April 12th, 2012, 08:41 AM
#21
Re: Displaying data graphically (Ultrasonic radar)
Hi all,
Just passing by to say that I've finished my project.
Thank you very much for your help
-
March 21st, 2013, 02:37 AM
#22
Re: Displaying data graphically (Ultrasonic radar)
Originally Posted by Alex83UK
Hi all,
Just passing by to say that I've finished my project.
Thank you very much for your help
Dear Alex83UK, Could you share the source code for reference?
my email: dominhson.vtv@gmail.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|