LCDInfo.com

http://www.lcdinfo.com
It is currently Thu Apr 18, 2024 8:54

All times are UTC + 2 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Tue Feb 18, 2003 13:48 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
DarkElf wrote:
the bar samtech proposed shouldn't be implemented as graphic, it will be kicker to calculate it and to put 3 sprites: one at start, one a end and one position. It would permit to make them of the size we want.

If you have some algorithms for this / would like to work on one let me know of your ideas. Any help would definately speed up the process. :D


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 18, 2003 20:55 
Offline

Joined: Thu Oct 24, 2002 2:24
Posts: 64
Location: Lisboa , Portugal
XNDR° wrote:
GoldServe wrote:
A little too expensive....shipping from states is more than enough...shipping europe is even more! ={

The company is Dutch, I'm running it together with someone else...
Where do you live?


Well , im from portugal i i would also like very much of one of those bauties !!!! in blue stile , but still thnk them as a bit expensive for the portuguese pocket's :( but in case ill oder one , how would it be the sipping cost for Portugal , Lisbon ??

Has for the grafical bars spite idea , you should be right about that (i think ) , bu i dont' realy know much abou programing :(

Samtech

_________________
The Power is Within your Hands ,use it wisely...
Image
XP 2000+
A7N8X Dlx
256 Mb DDR PC3200 OCZ
GF 4 Ti 4200 128 DDR
180 Gb
Studio PCTV Pro


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 19, 2003 15:04 
Offline

Joined: Tue Feb 18, 2003 12:33
Posts: 118
Location: Angers, France
Well, I have done this progress bar in full line command (no bmp):
the first one:
_____________
|###________|
the second one:
| \/ |
|----+----------------|
| |
Here is is alpha num, but its continous pixels in my funcs.

Code:
void Graphic_LCD::Graphbar1(int x, int yb, int value , int lenth )
{
   int i,limit,y,cs;

   y = yb>>3;                                          // y divided by 8
   
   i = x;
   limit = x + value;                                    // calc limit between full & empty
   // **** [ part ****
//_ This part of code is a quicker way to configure the right chip where we need
// |
   if ((x) < 64) {
      cs = LCD_CS1;
      SendLCDCommand(DISPLAY_COLUMN_SET | (x&63), LCD_CS1);
      SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS1);}
   else {
      cs = LCD_CS2;
      SendLCDCommand(DISPLAY_COLUMN_SET | ((x-64)&63), LCD_CS2);
      SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS2);}
//_|
   LCDInfo->DLPortIO1->PortW[CONTROL] = cs;               // cs, rs=1, e=1
   Delay();
   LCDInfo->DLPortIO1->PortW[DATA] = 0x7C;                  // send 0111 1100 <=> |
   Delay();
   LCDInfo->DLPortIO1->PortW[CONTROL] = LCD_ENABLE | cs;      // cs, rs=1, e=0
   Delay();
   // **** first part / full part ****
   while (++i<=limit) {
      if (i < 64) {
         cs = LCD_CS1;
         SendLCDCommand(DISPLAY_COLUMN_SET | (i&63), LCD_CS1);
         SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS1);}
      else {
         cs = LCD_CS2;
         SendLCDCommand(DISPLAY_COLUMN_SET | ((i-64)&63), LCD_CS2);
         SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS2);}
      LCDInfo->DLPortIO1->PortW[CONTROL] = cs;               // cs, rs=1, e=1
      Delay();
      LCDInfo->DLPortIO1->PortW[DATA] = 0x7C;                  // send 0111 1100 <=> |
      Delay();
      LCDInfo->DLPortIO1->PortW[CONTROL] = LCD_ENABLE | cs;      // cs, rs=1, e=0
      Delay();
   }
   // **** second part / empty part ****
   while (++i<=(lenth-1))
      if (i < 64) {
         cs = LCD_CS1;
         SendLCDCommand(DISPLAY_COLUMN_SET | (i&63), LCD_CS1);
         SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS1);}
      else {
         cs = LCD_CS2;
         SendLCDCommand(DISPLAY_COLUMN_SET | ((i-64)&63), LCD_CS2);
         SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS2);}
      LCDInfo->DLPortIO1->PortW[CONTROL] = cs;               // cs, rs=1, e=1
      Delay();
      LCDInfo->DLPortIO1->PortW[DATA] = 0x44;                  // send 0100 0100 <=> :
      Delay();
      LCDInfo->DLPortIO1->PortW[CONTROL] = LCD_ENABLE | cs;      // cs, rs=1, e=0
      Delay();
   }
   // **** ] part ****
   if ((x+lenth) < 64) {
      cs = LCD_CS1;
      SendLCDCommand(DISPLAY_COLUMN_SET | ((x+lenth)&63), LCD_CS1);
      SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS1);}
   else {
      cs = LCD_CS2;
      SendLCDCommand(DISPLAY_COLUMN_SET | ((x+lenth-64)&63), LCD_CS2);
      SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS2);}
   LCDInfo->DLPortIO1->PortW[CONTROL] = cs;               // cs, rs=1, e=1
   Delay();
   LCDInfo->DLPortIO1->PortW[DATA] = 0x7C;                  // send 0111 1100 <=> |
   Delay();
   LCDInfo->DLPortIO1->PortW[CONTROL] = LCD_ENABLE | cs;      // cs, rs=1, e=0
   Delay();
}

void Graphic_LCD::Graphbar2(int x, int yb, int value , int lenth )
{
   int i,y,cs;

   y = yb>>3;                                          // y divided by 8
   
   i = x;
   // **** [ part ****
//_ This part of code is a quicker way to configure the right chip where we need
// |
   if ((x) < 64) {
      cs = LCD_CS1;
      SendLCDCommand(DISPLAY_COLUMN_SET | (x&63), LCD_CS1);
      SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS1);}
   else {
      cs = LCD_CS2;
      SendLCDCommand(DISPLAY_COLUMN_SET | ((x-64)&63), LCD_CS2);
      SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS2);}
//_|
   LCDInfo->DLPortIO1->PortW[CONTROL] = cs;               // cs, rs=1, e=1
   Delay();
   LCDInfo->DLPortIO1->PortW[DATA] = 0x7C;                  // send 0111 1100 <=> |
   Delay();
   LCDInfo->DLPortIO1->PortW[CONTROL] = LCD_ENABLE | cs;      // cs, rs=1, e=0
   Delay();
   // **** line part ****
   while (++i<=(lenth-1))
      if (i < 64) {
         cs = LCD_CS1;
         SendLCDCommand(DISPLAY_COLUMN_SET | (i&63), LCD_CS1);
         SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS1);}
      else {
         cs = LCD_CS2;
         SendLCDCommand(DISPLAY_COLUMN_SET | ((i-64)&63), LCD_CS2);
         SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS2);}
      LCDInfo->DLPortIO1->PortW[CONTROL] = cs;               // cs, rs=1, e=1
      Delay();
      if ( (i==(value-1)) || (i==(value+1)) )
         LCDInfo->DLPortIO1->PortW[DATA] = 0x40;               // send 0100 0000 <=> _\/_
      if (i==value)
         LCDInfo->DLPortIO1->PortW[DATA] = 0x70;               // send 0111 0000 <=> _|_
      else
         LCDInfo->DLPortIO1->PortW[DATA] = 0x40;               // send 0001 0000 <=> ___
      Delay();
      LCDInfo->DLPortIO1->PortW[CONTROL] = LCD_ENABLE | cs;      // cs, rs=1, e=0
      Delay();
   }
   // **** ] part ****
   if ((x+lenth) < 64) {
      cs = LCD_CS1;
      SendLCDCommand(DISPLAY_COLUMN_SET | ((x+lenth)&63), LCD_CS1);
      SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS1);}
   else {
      cs = LCD_CS2;
      SendLCDCommand(DISPLAY_COLUMN_SET | ((x+lenth-64)&63), LCD_CS2);
      SendLCDCommand(DISPLAY_PAGE_SET | y, LCD_CS2);}
   LCDInfo->DLPortIO1->PortW[CONTROL] = cs;               // cs, rs=1, e=1
   Delay();
   LCDInfo->DLPortIO1->PortW[DATA] = 0x7C;                  // send 0111 1100 <=> |
   Delay();
   LCDInfo->DLPortIO1->PortW[CONTROL] = LCD_ENABLE | cs;      // cs, rs=1, e=0
   Delay();
}

It is optimized for speed &
It could have some bugs... (because I have done this yesterday night while watching the TV QI-Test program)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 19, 2003 15:46 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
I'll have a look at the code :D


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 20, 2003 4:26 
Offline

Joined: Thu Oct 24, 2002 2:24
Posts: 64
Location: Lisboa , Portugal
Well , what can i say !!

Great Work , now let's hope it works ;-)

SAmtech

_________________
The Power is Within your Hands ,use it wisely...
Image
XP 2000+
A7N8X Dlx
256 Mb DDR PC3200 OCZ
GF 4 Ti 4200 128 DDR
180 Gb
Studio PCTV Pro


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 20, 2003 12:10 
There is some errors...
after the while () I have forgotten some {...

I just wrote my first WMP plugin, it work fine for a two hour work :D


Top
  
 
 Post subject:
PostPosted: Thu Feb 20, 2003 13:26 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
Anonymous wrote:
I just wrote my first WMP plugin, it work fine for a two hour work :D

Sounds good... :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group