The MP3car.com Store  

Welcome to the MP3Car.com forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Coders Corner

Reply
 
Thread Tools Display Modes
Old 05-26-2007, 07:12 PM   #1
Low Bitrate
 
Thelgord's Avatar
 
Join Date: Jan 2007
Posts: 57
My Photos: (0)
LCD Simulator

I got the idea from here.

So I decided to write my own. Still isn't finished, but the hardest parts are complete, just the tedious parts remain. So far I can render text in stringvar up to 30 characters (I will work on that limitation later), but so far only the lower case letters a-m are supported. I should be finished with the text rendering by monday. So far only one font size(9px x 13px), and no built in animation, but you can code your own just by changing control.text property. I should also have the color pallet adjustable by then.

The main reason I did this is that I need one for a front end I am working on for a friend, and I really couldn't see spending $30-80 on something like this.

Is anyone interested in testing this out? It will probably be ready around wendsday or so.
__________________


CarPuter
----------------------------
Planning....[||||||||||]60%
Parts.......[||||||||||]20%
Construction[||||||||||]0%
Software....[||||||||||]0%

Thelgord is offline   Reply With Quote
Sponsored Links
Old 05-28-2007, 05:13 AM   #2
Low Bitrate
MOnline's CarPC Specs
 
MOnline's Avatar
 
Join Date: Apr 2007
Location: Holland, Poeldijk (Near The Hague)
Vehicle: 1997 Ford Escort GHIA
Posts: 77
My Photos: (3)
I would definitly like to try it out. I have created a simple one a while ago but it just didn't work good enough. It was far to processor intensive.

With kind regards,

FG van Zeelst

PS. It might be usefull to specify what programming language you are using .
MOnline is offline   Reply With Quote
Old 05-28-2007, 11:17 AM   #3
Low Bitrate
 
Thelgord's Avatar
 
Join Date: Jan 2007
Posts: 57
My Photos: (0)
I am having the same problem. It looks alright, but the text updates are not fast enough and if you get a string of text more than 20 characters it visably slows down a lot and CPU usage jumps way to high while it's running.

I am using VB.net btw

I think I need to learn DirectX. My first try was to use a series of images but that created way to much HD access, but it did run a lot faster and you lost the ability chage it's colors.

Perhaps I can make a series of icons and embed them into the control but again, you would only get the color scheme that was there. ::
__________________


CarPuter
----------------------------
Planning....[||||||||||]60%
Parts.......[||||||||||]20%
Construction[||||||||||]0%
Software....[||||||||||]0%

Thelgord is offline   Reply With Quote
Old 05-28-2007, 02:55 PM   #4
Low Bitrate
MOnline's CarPC Specs
 
MOnline's Avatar
 
Join Date: Apr 2007
Location: Holland, Poeldijk (Near The Hague)
Vehicle: 1997 Ford Escort GHIA
Posts: 77
My Photos: (3)
Yeah indeed speed is always a problem. Just did a search of pscode and found a piece of code that could help you. I am not that good using vb more a c++ but check it out I think it could help you.

With Kind Regards,

FG van Zeelst
Attached Files
File Type: zip LCD_Contro58627312002.zip (38.4 KB, 87 views)
MOnline is offline   Reply With Quote
Old 05-28-2007, 05:23 PM   #5
Low Bitrate
 
Thelgord's Avatar
 
Join Date: Jan 2007
Posts: 57
My Photos: (0)
Wow thanks much

It helps a lot
__________________


CarPuter
----------------------------
Planning....[||||||||||]60%
Parts.......[||||||||||]20%
Construction[||||||||||]0%
Software....[||||||||||]0%

Thelgord is offline   Reply With Quote
Old 05-29-2007, 10:08 AM   #6
Low Bitrate
MOnline's CarPC Specs
 
MOnline's Avatar
 
Join Date: Apr 2007
Location: Holland, Poeldijk (Near The Hague)
Vehicle: 1997 Ford Escort GHIA
Posts: 77
My Photos: (3)
No problem, cant wait to see how it turns out.
MOnline is offline   Reply With Quote
Old 05-29-2007, 12:22 PM   #7
Low Bitrate
 
Thelgord's Avatar
 
Join Date: Jan 2007
Posts: 57
My Photos: (0)
What I have learned so far:

The source you proved was in VB6(Maybe vb5, the comments are unclear on this) so I can't directly compile it as I no longer have vb6. However I know vb6 well enough to be able to follow the code.

The author built a custom wrapper for the gdi.dll. This is now called GDI+ and is included with the DirectX SDK. Under .Net its accessed "normally" by creating a gaphics object (vb.net: Dim g as Graphics)

I am already using that method but apperently not to its fullest potential. In VB.Net there are 3 basics types of graphics. 1) Is what is held in the PictureBox control 2) The Image control (Dim i as New Image) and 3) The Graphics control.

The problem is the data they use are not easily trasferable between the types. The path I took was to use "Image" controls and then use "Graphics" to manipulate them (change pixel colors). This was a disaster. With an 11x16 picture you have 176 pixels, and thus upto 176 seperate instructions. With a possability of 30 (A string of 30 characters)such images you have a max of 5280 commands to preform every time you want the text to change. That doesn't include what windows is doing in the background.

What they did in the source you provided to bypass just about everything and access the gdi.dll directly, giving them much more control on what happend and when. I don't know how well it worked, but it had to be faster.

Rather than set it up as images, they manipulated the way a font (or even a picture) was drawn on to (from what I can tell) the form, or at last whatever they used for a container. I didn't spend to much time at the code for the form except to find out what subs/function to look at.

While they could learn something about documenting code, all in all, its very a nice piece of work. Thanks again for sharing
__________________


CarPuter
----------------------------
Planning....[||||||||||]60%
Parts.......[||||||||||]20%
Construction[||||||||||]0%
Software....[||||||||||]0%

Thelgord is offline   Reply With Quote
Old 05-29-2007, 04:38 PM   #8
Low Bitrate
MOnline's CarPC Specs
 
MOnline's Avatar
 
Join Date: Apr 2007
Location: Holland, Poeldijk (Near The Hague)
Vehicle: 1997 Ford Escort GHIA
Posts: 77
My Photos: (3)
Hi,

Thanks for explaining. Sorry I did not see it was a vb6 code. Have them both on my pc and was pretty tired when i wrote the message (had a rough day ).

But still as far as I can see it was usefull to you. Try searching http://www.pscode.com/ maybe there is a better example. It was just a quick search .

With kind regards,

FG van Zeelst
MOnline is offline   Reply With Quote
Old 05-29-2007, 08:31 PM   #9
Low Bitrate
 
Thelgord's Avatar
 
Join Date: Jan 2007
Posts: 57
My Photos: (0)
Thanks again
__________________


CarPuter
----------------------------
Planning....[||||||||||]60%
Parts.......[||||||||||]20%
Construction[||||||||||]0%
Software....[||||||||||]0%

Thelgord is offline   Reply With Quote
Old 06-08-2007, 05:25 PM   #10
Low Bitrate
MOnline's CarPC Specs
 
MOnline's Avatar
 
Join Date: Apr 2007
Location: Holland, Poeldijk (Near The Hague)
Vehicle: 1997 Ford Escort GHIA
Posts: 77
My Photos: (3)
He Thelgord how is the project comming. Can't wait to see the result .

With kind regards,

FG van Zeelst
__________________
Check out My Custom Frontend
MOnline is offline   Reply With Quote
Sponsored Links
Old 07-08-2007, 10:17 AM   #11
Low Bitrate
 
Thelgord's Avatar
 
Join Date: Jan 2007
Posts: 57
My Photos: (0)
Sorry about the long delay in this thread, I'm in the army and have been very busy with that. However, I am back on track and have just a couple more bugs to work out before opening it up for testing. If everything goes right I should be posting my dll for testers to try later today.

[Begin Edit]
I decided it would be better to edit than double post

Ok, here is what I have, a user control that simulates an LCD screen. (links later in the post) I would like it if others could test it out and let me knwo what they think.

Known Issues:
Recoloring - Changing a color takes longer than expected. To see color changes you must clear the display. I left that up to the user so they can decide when they are done with the colors.

You can have an array of LCD Cells up to 255x255 (bounds are stored in byte values).

Properties:
Color1 - Cell BackGround Color
Color2 - Inactive "dots"
Color3 - Active "dots"
Color4 - Highlight color for active "dots"
Lines - Number of lines of cells
Chars - Number of columns
Note: Each "Cell" is 11px wide by 15px high. The control will auto resize based on Lines x Chars.

Functions:
In VB, function do not "have" to return a value so you can call them like a sub (ie. function(params)). Or you can get a value back:
Dim RetVal As Byte
RetVal = Function(Params)

RetVal will equal error codes (more on that later)

InsertText(CellX,CellY,User Text) - Iserts a string of text
SetCell(CellX,CellY,String Text, IsExtended As Boolean) - Set the text of a single cell
ClearLCD() - Clears all text
ClearLine(CellX) - Clears all text on a single line (To clear a signle cell, just SetCell(Blank Space))

Error Codes:
0 = Success, no error
1 = Invalid Line Number
2 = Invalid Column Number
3 = Invalid Character

Special Characters:
Special Characters are just that, special. To access special characters (this works with SetCell as well) use Chr(139) (‹) followed by the character for the special text. It should be notes that if you have a Chr(139) character and send text that does not corispond to a special character, it will be evaluated as a normal character. So to get a special character you will ne to send Chr(139) &
"A" = Copyright Logo
"B" = Rights Reserved Logo
"C" = BarGraph Level 1
"D" = BarGraph Level 2
"E" = BarGraph Level 3
"F" = BarGraph Level 4
"G" = BarGraph Level 5
"H" = BarGraph Level 6
"I" = BarGraph Level 7
"J" = Key Symbol
"K" = BlueTooth Symbol
"L" = Wifi Symbol (I am not real happy with the way this looks, I will probably end up remaking it)
"M" = Cell Service Symbol
"N" = GPS Symbol (Again, not happy with the way this one looks)

Files:
Screen Shot of the app used to test its functions:

The Dll:
http://www.mediafire.com/?3zdejzgojy7

Please let me know what you think.
__________________


CarPuter
----------------------------
Planning....[||||||||||]60%
Parts.......[||||||||||]20%
Construction[||||||||||]0%
Software....[||||||||||]0%


Last edited by Thelgord : 07-08-2007 at 12:56 PM.
Thelgord is offline   Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lcd grounding issue, can't get rid of flickering diskey LCD/Display 4 05-23-2006 03:16 PM


All times are GMT -5. The time now is 11:22 AM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics