#include #include #include #include #include #include #include #include "lcd.h" #include "IseT23A.h" #include "drv_base.h" #include "../../shared/debug.h" #include "../../shared/str.h" /* WARNING! This file is a "quick-hacked" version of the MtxOrb driver! Some thing probably don't work or something. :-) (Like vbar/hbars) Edwin Eefting edwin@lazypeople.net Instructions: 1. Apply +5v power to the display: Use the 3 pin's connector: pin 1 = +5v pin 3 = gnd 2. Connect you comport to the display. This is a little tricky, the serial input of the display should be applied to pin 2 (of the 3 pins connector) HOWEVER: the comports +12 and -12 signals should be inverted to a 0v and 5v signal. I used the following: +5v | # 10k pullup res. C _______|__________________display pin 2 diode / TxD ----->|- -|/ BC 547 npn transistor B|\ Gnd \E ________________|_________________________display Gnd So you should be a little bit handy. :-) The +5v power must be started "quickly" or the display won't startup correctly. (so if it doesn't work, power it off and on again) 3. Jumper settings You also may have to change the "jumpers": (solderings) J0,1,2,3 OPEN J4,JA CLOSED Goodluck, and be carefull with the glass!! */ static int custom=0; // TODO: Remove this custom_type if not in use anymore. typedef enum { hbar = 1, vbar = 2, bign = 4, beat = 8 } custom_type; // TODO: This is my ugglyest piece of code. typedef enum { baru1 = 0, baru2 = 1, baru3 = 2, baru4 = 3, baru5 = 4, baru6 = 5, baru7 = 6, bard1 = 7, bard2 = 8, bard3 = 9, bard4 = 10, bard5 = 11, bard6 = 12, bard7 = 13, barr1 = 14, barr2 = 15, barr3 = 16, barr4 = 17, barl1 = 18, barl2 = 19, barl3 = 20, barl4 = 21, barw = 32, barb = 255} bar_type; static int fd; static int clear=1; static int def[9]={-1,-1,-1,-1,-1,-1,-1,-1,-1}; static int use[9]={1,0,0,0,0,0,0,0,0}; //static void IseT23A_linewrap(int on); static void IseT23A_autoscroll(int on); static void IseT23A_cursorblink(int on); // TODO: Get rid of this variable? lcd_logical_driver *IseT23A; // TODO: Get the frame buffers working right ///////////////////////////////////////////////////////////////// // Opens com port and sets baud correctly... // int IseT23A_init(lcd_logical_driver *driver, char *args) { char *argv[64]; int argc; struct termios portset; int i; int tmp; char test[1]; char blah[]="Display driver by EH.Eefting..."; int contrast=140; char device[256] = "/dev/lcd"; int speed=B19200; IseT23A = driver; //debug("IseT23A_init: Args(all): %s\n", args); argc = get_args(argv, args, 64); /* for(i=0; i argc) { fprintf(stderr, "IseT23A_init: %s requires an argument\n", argv[i]); return -1; } strcpy(device, argv[++i]); } else if(0 == strcmp(argv[i], "-c") || 0 == strcmp(argv[i], "--contrast")) { if(i + 1 > argc) { fprintf(stderr, "IseT23A_init: %s requires an argument\n", argv[i]); return -1; } tmp = atoi(argv[++i]); if((tmp < 0) || (tmp > 255)){ fprintf(stderr, "IseT23A_init: %s argument must between 0 and 255. Ussing default value.\n", argv[i]); } else contrast = tmp; } else if(0 == strcmp(argv[i], "-s") || 0 == strcmp(argv[i], "--speed")) { if(i + 1 > argc) { fprintf(stderr, "IseT23A_init: %s requires an argument\n", argv[i]); return -1; } tmp = atoi(argv[++i]); if(tmp==1200) speed=B1200; else if(tmp==2400) speed=B2400; else if(tmp==9600) speed=B9600; else if(tmp==19200) speed=B19200; else { fprintf(stderr, "IseT23A_init: %s argument must be 1200, 2400, 9600 or 19200. Ussing default value.\n", argv[i]); } } else if(0 == strcmp(argv[i], "-h") || 0 == strcmp(argv[i], "--help")) { printf("LCDproc ISE CU20045SCPB-T23A Vfd driver (C)2001 E.H.Eefting - GPL license\n" "\t-d\t--device\tSelect the output device to use [/dev/lcd]\n" "\t-t\t--type\t\tSelect the LCD type (size) [20x4]\n" "\t-c\t--contrast\tSet the initial contrast [140]\n" "\t-s\t--speed\t\tSet the communication speed [19200]\n" "\t-h\t--help\t\tShow this help information\n"); return -1; } else { printf("Invalid parameter: %s\n", argv[i]); } } // Set up io port correctly, and open it... fd = open(device, O_RDWR | O_NOCTTY | O_NDELAY); if (fd == -1) { fprintf(stderr, "IseT23A_init: failed (%s)\n", strerror(errno)); return -1; } //else fprintf(stderr, "IseT23A_init: opened device %s\n", device); tcgetattr(fd, &portset); // This is necessary in Linux, but does not exist in irix. #ifndef IRIX cfmakeraw(&portset); #endif cfsetospeed(&portset, speed); cfsetispeed(&portset, speed); tcsetattr(fd, TCSANOW, &portset); if(!driver->framebuf) { fprintf(stderr, "IseT23A_init: No frame buffer.\n"); driver->close(); return -1; } // Set the functions the driver supports... // driver->clear = (void *)-1; driver->clear = IseT23A_clear; driver->string = (void *)-1; // driver->chr = IseT23A_chr; driver->chr = (void *)-1; driver->vbar = IseT23A_vbar; driver->init_vbar = IseT23A_init_vbar; // driver->init_vbar = (void *)-1; driver->hbar = IseT23A_hbar; driver->init_hbar = IseT23A_init_hbar; // driver->init_hbar = (void *)-1; driver->num = IseT23A_num; driver->init_num = IseT23A_init_num; driver->init = IseT23A_init; driver->close = IseT23A_close; driver->flush = IseT23A_flush; driver->flush_box = IseT23A_flush_box; driver->contrast = IseT23A_contrast; driver->backlight = NULL; driver->output = NULL;//IseT23A_output; driver->set_char = NULL; //DON'T!!! IseT23A_set_char; driver->icon = IseT23A_icon; driver->draw_frame = IseT23A_draw_frame; driver->getkey = IseT23A_getkey; IseT23A_contrast(0xff); // IseT23A_displaymode(1); hmm...sucks :-) /* for (i=0;i<5;i++) { IseT23A_set_known_char(i, i); test[0]=i; write(fd,test,1); sleep(1); }*/ write(fd,"\x01b\x049",3); //reset usleep(100000); //time to let the display initialize.. /* write(fd,"\x018\x0f6",2); sleep(1); write(fd,"\x019\x0f6",2); sleep(1); */ //Very important code, don't remove! :-) IseT23A_cursorblink(1); for (i=0;iframebuf) free(IseT23A->framebuf); IseT23A->framebuf = NULL; } void IseT23A_flush() { IseT23A_draw_frame(lcd.framebuf); } //### draw_frame is much more optimized, so this function is obsolete now?? void IseT23A_flush_box(int lft, int top, int rgt, int bot) { // int y; //char out[LCD_MAX_WIDTH]; IseT23A_draw_frame(lcd.framebuf); /* // printf("Flush (%i,%i)-(%i,%i)\n", lft, top, rgt, bot); for(y=top; y<=bot; y++) { sprintf(out, "\x01B\x048%c", (20*(y-1))+lft-1); write(fd, out, 3); write(fd, lcd.framebuf+(y*lcd.wid)+lft, rgt-lft+1); } */ } ///////////////////////////////////////////////////////////////// // Prints a character on the lcd display, at position (x,y). The // upper-left is (1,1), and the lower right should be (20,4). // void IseT23A_chr(int x, int y, char c) { y--; x--; lcd.framebuf[(y*lcd.wid) + x] = c; } ///////////////////////////////////////////////////////////////// // Sets output port on or off /* void IseT23A_output(int on) { char out[4]; if(on) { sprintf(out, "%cW", 254); write(fd, out, 2); } else { sprintf(out, "%cV", 254); write(fd, out, 2); } } */ int IseT23A_contrast(int contrast) { char out[3]="\x01B\x04C."; out[2]=contrast; write(fd, out,sizeof(out)); return contrast; } ///////////////////////////////////////////////////////////////// // Toggle the built-in linewrapping feature // /*static void IseT23A_linewrap(int on) { char out[4]; if(on) sprintf(out, "%cC", 254); else sprintf(out, "%cD", 254); write(fd, out, 2); } */ ///////////////////////////////////////////////////////////////// // Toggle the built-in automatic scrolling feature // static void IseT23A_autoscroll(int on) { if(on) write(fd, "\x012", 1); else write(fd, "\x011", 1); } // TODO: make sure this doesn't mess up non-VFD displays ///////////////////////////////////////////////////////////////// // Toggle cursor blink on/off // static void IseT23A_cursorblink(int on) { if(on) write(fd, "\x015", 1); else write(fd, "\x014", 1); } //// TODO: Might not be needed anymore... ///////////////////////////////////////////////////////////////// // Sets up for vertical bars. Call before lcd.vbar() // void IseT23A_init_vbar() { // IseT23A_init_all(vbar); char icons[2][5*7] = { { 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, }, { 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, } }; static int onetime=0; if (!onetime) { IseT23A_set_char(0,icons[0]); IseT23A_set_char(1,icons[1]); onetime=1; } } // TODO: Might not be needed anymore... ///////////////////////////////////////////////////////////////// // Inits horizontal bars... // void IseT23A_init_hbar() { // IseT23A_init_all(hbar); } ///////////////////////////////////////////////////////////////// // Sets a custom character from 0-7... // // For input, values > 0 mean "on" and values <= 0 are "off". // // The input is just an array of characters... // void IseT23A_set_char(int n, char *dat) { char out[3]="\x01B\x043L"; int row, col; int letter; int bitnr; int pixnr; // if(n < 0 || n > 7) return; if(!dat) return; //return; out[2]=n; write(fd, out, sizeof(out)); //screw around with the bits and write some bytes :-) //the T23a is using a clumsy system for this.. bitnr=0; letter = 0; for(pixnr=0;pixnr>= 1; letter |= (dat[pixnr] > 0)*0x80; bitnr++; if (bitnr==8) { write(fd, &letter, 1); letter=0; bitnr=0; } } //fillup the "leftovers" letter >>=5; write(fd, &letter, 1); } // TODO: Finish the support for bar growing reverse way. // TODO: Need a "y" as input also !!! ///////////////////////////////////////////////////////////////// // Draws a vertical bar... // This is the new version ussing dynamic icon alocation // #define V_FILL 0xf8 void IseT23A_vbar(int x, int len) { // 1 2 3 4 5 6 7 unsigned char mapu[8]={32,0,0,1,1,V_FILL,V_FILL}; unsigned char mapd[9]={barw,bard1,bard2,bard3,bard4,bard5,bard6,bard7,barb}; int y; // TODO: REMOVE THE NEXT LINE FOR TESTING ONLY... // len=-len; // TODO: REMOVE THE PREVIOUS LINE FOR TESTING ONLY... //return; if(len>0){ for(y=lcd.hgt; y > 0 && len>0; y--) { if(len >= lcd.cellhgt) IseT23A_chr(x, y, V_FILL); else IseT23A_chr(x, y, mapu[len]); len -= lcd.cellhgt; } }/*else{ len=-len; for(y=2; y <= lcd.hgt && len>0; y++) { if(len >= lcd.cellhgt) IseT23A_chr(x, y, 255); else IseT23A_chr(x, y, IseT23A_ask_bar(mapd[len])); len -= lcd.cellhgt; }*/ //} } // TODO: Finish the support for bar growing reverse way. ///////////////////////////////////////////////////////////////// // Draws a horizontal bar to the right. // This is the new version ussing dynamic icon alocation // void IseT23A_hbar(int x, int y, int len) { unsigned char mapr[6]={32,0xf0,0xf1,0xf2,0xf3}; unsigned char mapl[6]={32,0xf4,0xf5,0xf6,0xf7}; if(len>0) { for(; x<=lcd.wid && len>0; x++) { if(len >= lcd.cellwid) IseT23A_chr(x,y,0xf8); else IseT23A_chr(x, y, mapr[len]); len -= lcd.cellwid; } } else { len=-len; for(; x>0 && len>0; x--) { if(len >= lcd.cellwid) IseT23A_chr(x,y,0xf8); else IseT23A_chr(x, y, mapl[len]); len -= lcd.cellwid; } } } // TODO: Might not work, bignum is untested... an untested with dynamic bar. ///////////////////////////////////////////////////////////////// // Sets up for big numbers. // void IseT23A_init_num() { char out[3]; return; if(custom!=bign) { sprintf(out, "%cn", 254); write(fd, out, 2); custom=bign; } } // TODO: Might not work, bignum is untested... an untested with dynamic bar. ///////////////////////////////////////////////////////////////// // Writes a big number. // void IseT23A_num(int x, int num) { char out[5]; return; sprintf(out, "%c#%c%c", 254, x, num); write(fd, out, 4); } // TODO: This could be higly optimised if data where to be pre-computed. void IseT23A_icon(int which, char dest) { char icons[3][5*7] = { { 1,1,1,1,1, // Empty Heart 1,1,1,1,1, 1,0,1,0,1, 1,0,0,0,1, 1,1,0,1,1, 1,1,1,1,1, 1,1,1,1,1, }, { 1,1,1,1,1, // Filled Heart 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, }, { 0,0,0,0,0, // Ellipsis 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, }, }; if(custom==bign) custom=beat; //IseT23A_set_char(dest, &icons[which][0]); } ///////////////////////////////////////////////////////////// // Blasts a single frame onscreen, to the lcd... // // Input is a character array, sized lcd.wid*lcd.hgt // void IseT23A_draw_frame(char *dat) { static char prev[20*4]; static int firsttime=1; int cursorok=0; char setpos[3]="\x01b\x048\x000"; int cmp; if (firsttime){ write(fd,dat,20*4); firsttime=0; } //comparing with prev. frame give performance increase, and flicker reduction for (cmp=0;cmp < 20*4;cmp++) { //char is different, or special? if ((dat[cmp]!=prev[cmp])/* || ((unsigned char)dat[cmp]<8)*/) { //change cursor location? if (!cursorok) { setpos[2]=cmp; write (fd,setpos,3); cursorok=1; } //write char write (fd,dat+cmp,1); } else { cursorok=0; } } memcpy(prev,dat,20*4); } ///////////////////////////////////////////////////////////// // returns one character from the keypad... // (A-Z) on success, 0 on failure... // char IseT23A_getkey() { // char in = 0; // read(fd, &in, 1); return 0; } ///////////////////////////////////////////////////////////////// // Ask for dynamic allocation of a custom caracter to be // a well none bar graphic. The function is suppose to // return a value between 0 and 7 but 0 is reserver for // heart beat. // This function manadge a cache of graphical caracter in use. // I really hope it is working and bug-less because it is not // completely tested, just a quick hack. // int IseT23A_ask_bar(int type) { int i; int last_not_in_use; int pos; // 0 is icon, 1 to 7 are free, 8 is not found. // TODO: Reuse graphic caracter 0 if heartbeat is not in use. // REMOVE: fprintf(stderr, "GLU: IseT23A_ask_bar(%d).\n", type); // Check if the screen was clear. if (clear){ // If the screen was clear then graphic caracter are not in use. //REMOVE: fprintf(stderr, "GLU: IseT23A_ask_bar| clear was set.\n"); use[0]=1; // Heartbeat is always in use (not true but it help). for(pos=1; pos<8; pos++){ use[pos]=0; // Other are not in use. } clear=0; // We made the special treatement. }else{ // Nothing special if some caracter a curently in use (...) ? } // Search for a match with caracter already defined. pos=8; // Not found. last_not_in_use=8; // No empty slot to reuse. for(i=1; i<8; i++){ // For all but first (heartbeat). if(!use[i]) last_not_in_use=i; // New empty slot. if(def[i]==type) pos=i; // Founded (should break now). } if (pos==8){ // REMOVE: fprintf(stderr, "GLU: IseT23A_ask_bar| not found.\n"); pos=last_not_in_use; // TODO: Best match/deep search is no more graphic caracter are available. } if (pos!=8){ // A caracter is found (Best match could solve our problem). // REMOVE: fprintf(stderr, "GLU: IseT23A_ask_bar| found at %d.\n", pos); if(def[pos]!=type){ IseT23A_set_known_char(pos, type); // Define a new graphic caracter. def[pos]=type; // Remember that now the caracter is available. } if (!use[pos]){ // If the caracter is no yet in use (but defined). use[pos]=1; // Remember it is in use (so protect it from re-use). } } if (pos==8) // TODO: Choose a character to approximate the graph { //pos=65; // ("A")? switch(type) { case baru1: pos='_'; break; case baru2: pos='.'; break; case baru3: pos=','; break; case baru4: pos='o'; break; case baru5: pos='o'; break; case baru6: pos='O'; break; case baru7: pos='8'; break; case bard1: pos='\''; break; case bard2: pos='"'; break; case bard3: pos='^'; break; case bard4: pos='^'; break; case bard5: pos='*'; break; case bard6: pos='O'; break; case bard7: pos='8'; break; case barr1: pos='-'; break; case barr2: pos='-'; break; case barr3: pos='='; break; case barr4: pos='='; break; case barl1: pos='-'; break; case barl2: pos='-'; break; case barl3: pos='='; break; case barl4: pos='='; break; case barw: pos=' '; break; case barb: pos=255; break; default: pos='?'; break; } } return(pos); } ///////////////////////////////////////////////////////////////// // Sets up a well known character for use. // void IseT23A_set_known_char(int car, int type) { char all_bar[25][5*7] = { { 0,0,0,0,0, // char u1[] = 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1, },{ 0,0,0,0,0, // char u2[] = 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, },{ 0,0,0,0,0, // char u3[] = 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, },{ 0,0,0,0,0, // char u4[] = 0,0,0,0,0, 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, },{ 0,0,0,0,0, // char u5[] = 0,0,0,0,0, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, },{ 0,0,0,0,0, // char u6[] = 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, },{ 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, },{ 1,1,1,1,1, // char d1[] = 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, },{ 1,1,1,1,1, // char d2[] = 1,1,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, },{ 1,1,1,1,1, // char d3[] = 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, },{ 1,1,1,1,1, // char d4[] = 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, },{ 1,1,1,1,1, // char d5[] = 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, 0,0,0,0,0, },{ 1,1,1,1,1, // char d6[] = 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0,0,0,0,0, },{ 1,1,1,1,1, // char d7[] = 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, },{ 1,0,0,0,0, // char r1[] = 1,0,0,0,0, 1,0,0,0,0, 1,0,0,0,0, 1,0,0,0,0, 1,0,0,0,0, 1,0,0,0,0, },{ 1,1,0,0,0, // char r2[] = 1,1,0,0,0, 1,1,0,0,0, 1,1,0,0,0, 1,1,0,0,0, 1,1,0,0,0, 1,1,0,0,0, },{ 1,1,1,0,0, // char r3[] = 1,1,1,0,0, 1,1,1,0,0, 1,1,1,0,0, 1,1,1,0,0, 1,1,1,0,0, 1,1,1,0,0, },{ 1,1,1,1,0, // char r4[] = 1,1,1,1,0, 1,1,1,1,0, 1,1,1,1,0, 1,1,1,1,0, 1,1,1,1,0, 1,1,1,1,0, },{ 0,0,0,0,1, // char l1[] = 0,0,0,0,1, 0,0,0,0,1, 0,0,0,0,1, 0,0,0,0,1, 0,0,0,0,1, 0,0,0,0,1, },{ 0,0,0,1,1, // char l2[] = 0,0,0,1,1, 0,0,0,1,1, 0,0,0,1,1, 0,0,0,1,1, 0,0,0,1,1, 0,0,0,1,1, },{ 0,0,1,1,1, // char l3[] = 0,0,1,1,1, 0,0,1,1,1, 0,0,1,1,1, 0,0,1,1,1, 0,0,1,1,1, 0,0,1,1,1, },{ 0,1,1,1,1, // char l4[] = 0,1,1,1,1, 0,1,1,1,1, 0,1,1,1,1, 0,1,1,1,1, 0,1,1,1,1, 0,1,1,1,1, },{ 1,1,1,1,1, // Empty Heart 1,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,0,0,1, 1,1,0,1,1, },{ 1,1,1,1,1, // Filled Heart 1,0,1,0,1, 0,1,0,1,0, 0,1,1,1,0, 0,1,1,1,0, 1,0,1,0,1, 1,1,0,1,1, },{ 0,0,0,0,0, // Ellipsis 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1,0,1,0,1, } }; //IseT23A_set_char(car, &all_bar[type][0]); } /////////////////STOP READING --- TRASH IS AT THE END//////////////// // TODO: Remove this code wich was use for developpement. // PS: There might be reference to this code left, so keep it for some time. void IseT23A_init_all(int type) { } // TODO: Remove this code wich was use for developpement. // PS: That was the code to define unidirectionnal [h|v]bar. /* if(type==hbar){ if(custom!=hbar) { IseT23A_set_known_char(1, barr1); IseT23A_set_known_char(2, barr2); IseT23A_set_known_char(3, barr3); IseT23A_set_known_char(4, barr4); custom=hbar; } } if(type==vbar){ if(custom!=vbar) { IseT23A_set_known_char(1, baru1); IseT23A_set_known_char(2, baru2); IseT23A_set_known_char(3, baru3); IseT23A_set_known_char(4, baru4); IseT23A_set_known_char(5, baru5); IseT23A_set_known_char(6, baru6); IseT23A_set_known_char(7, baru7); custom=vbar; } } */ // TODO: Remove this code wich was use for developpement. // PS: It was a good idea, but not working (fixing take to much time). /* void IseT23A_icon(int which, char dest) { if(custom==bign) custom=beat; IseT23A_set_known_char(dest, which+21); } */ // TODO: Remove this code wich was use for developpement. // PS: Temporary code used durring developpement of dynamic bar. /* if(type==barr1)return(1); if(type==barr2)return(2); if(type==barr3)return(3); if(type==barr4)return(4); if(type==baru1)return(1); if(type==baru2)return(2); if(type==baru3)return(3); if(type==baru4)return(4); if(type==baru5)return(5); if(type==baru6)return(6); if(type==baru7)return(7); */