/* * LCD_128.c * * Created on: 2015-8-28 * Author: Administrator */ #include "math.h" #include "RTC.h" #include "LCD.h" #include "devicegpioinit.h" #include "mem_warning_sizhu_log.h" #include "state_fun_init.h" #include "para.h" #include "menu.h" #include "valveControl.h" #include "third_telecom_manage.h" #include "calculate.h" #include "powermanage.h" #include "third_telecom_interface.h" //u8 LCD_number_overrun_flag = 0; u8 LCD_Buffer[LCD_BUFFER_LENGTH] = {0}; //u8 LCD_Read_buffer[34] = {0}; u8 k1 =0 ,k2 =0; void LCD_IIC_Start(void) { LCD_SDA_OUT(); LCD_IIC_SCL=1; LCD_IIC_SDA=1; delay_us(10); LCD_IIC_SDA=0; delay_us(10); LCD_IIC_SCL=0; delay_us(10); } void LCD_IIC_Stop(void) { u8 i; LCD_SDA_OUT();//sda??? LCD_IIC_SDA=0; delay_us(10); LCD_IIC_SCL=1; delay_us(10); LCD_IIC_SDA=1; for(i=0;i<5;i++) { delay_us(10); } } u8 LCD_IIC_Wait_Ack(void) { u8 ucErrTime=0; LCD_SDA_IN(); //SDA????? delay_us(10); delay_us(10); while(LCD_READ_SDA) { ucErrTime++; if(ucErrTime>250) { LCD_IIC_Stop(); return 1; } } LCD_IIC_SCL=0;//????0 return 0; } void LCD_IIC_Ack(void) { LCD_SDA_OUT(); LCD_IIC_SDA=0;; delay_us(10); LCD_IIC_SCL=1; delay_us(10); LCD_IIC_SCL=0; delay_us(10); } void LCD_IIC_NAck(void) { LCD_SDA_OUT(); LCD_IIC_SDA=1;; delay_us(10); LCD_IIC_SCL=1; delay_us(10); LCD_IIC_SCL=0; delay_us(10); } void LCD_IIC_Send_Byte(u8 txd) { u8 i; LCD_SDA_OUT(); for(i=0;i<8;i++) { if(txd & 0x80) LCD_IIC_SDA=1; else LCD_IIC_SDA=0; txd <<= 1; delay_us(10); LCD_IIC_SCL=1; delay_us(10); LCD_IIC_SCL=0; } delay_us(10); LCD_IIC_SCL=1; delay_us(10); LCD_IIC_SCL=0; } u8 LCD_IIC_Read_Byte(unsigned char ack) { u8 i,receive=0; LCD_SDA_IN();//SDA????? for(i=0;i<8;i++) { LCD_IIC_SCL=1; delay_us(10); receive <<=1; if(LCD_READ_SDA) receive |= 0x01; LCD_IIC_SCL=0; delay_us(10); } LCD_SDA_OUT(); return receive; } void LCD_Read(u8 sadd, u8 *buf, u8 len) { u8 i; LCD_IIC_Start(); LCD_IIC_Send_Byte(LCD_ADDR_WRITE); LCD_IIC_Send_Byte(sadd); LCD_IIC_Start(); LCD_IIC_Send_Byte(LCD_ADDR_READ); for(i=0;i= getLCDNumberOverrunLevel(signflag,pointnum)) { if(system_alarm_ctrl_word_g.alarm_ctl_word .lcd_up == SYSTEM_SINGLE_BIT_SET1) { if(menu_data.LCD_number_overrun_flag !=1) { menu_data.LCD_number_overrun_flag =1; system_alarm_log_data_handle(ALARM_CLASS_LCD, ALARM_HAPPEN + ALARM_ID_LCD_NUMBER_OVERRUN); if(alarm_report_para_g.lcd_number_overrun_cnt 9999999) { pointnum = POINT_1; } break; case 1: if(number_div > 999999) { pointnum = POINT_1; } break; } digitnum -= pointnum; break; case POINT_3://ÕûÊý²¿·Ö´óÓÚÒºÏÔ×î´óÖµ Çл»Îª2λСÊý switch(signflag) { case 0: if(number_div > 9999999)//Èç¹ûÊý¾Ý´«½øÀ´Ìرð´óµÄ»°Çл»Îª1λСÊý ÏÖ { pointnum = POINT_1; } else if(number_div > 999999) { pointnum = POINT_2; } break; case 1: if(number_div > 999999)//Èç¹ûÊý¾Ý´«½øÀ´Ìرð´óµÄ»°Çл»Îª1λСÊý ÀíÂÛÉϲ»»á³öÏÖ { pointnum = POINT_1; } else if(number_div > 99999) { pointnum = POINT_2; } break; } digitnum -= pointnum; break; default: digitnum -= 2;//ĬÈÏ2λ break; } switch(pointnum)//¸ù¾ÝСÊýλÊýÏÔʾСÊýµãλÖà { case POINT_1: LCD_DisplaySeg(_LCD_POINT16_23A); break; case POINT_2: LCD_DisplaySeg(_LCD_POINT14_23A); break; case POINT_3://ÕûÊý²¿·Ö´óÓÚÒºÏÔ×î´óÖµ Çл»Îª2λСÊý LCD_DisplaySeg(_LCD_POINT12_23A); break; default: LCD_DisplaySeg(_LCD_POINT14_23A);//ĬÈÏ2λ break; } //Èç¹û³¤¶È³¬ÏÞ ½Øµô¸ßλ Ö÷ÒªÓÃÓÚ1λСÊýµÄʱºò ¸ù¾ÝÊý¾Ý¸öÊý Çó³ö³¬ÏÞÖµ while((number_div - pow(10,digitnum))>=0) { number_div = number_div-pow(10,digitnum); } /*ÕûÊý²¿·Ö¼ÆËã*/ yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { //digitnum - 1 Êý×éÖÐÕûÊýÊý¾ÝµÄ×î´óϱê array[digitnum - 1 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[digitnum - 1 - num_array] = yu_temp; num_array ++; /*СÊý²¿·Ö¼ÆËã*/ // p = (char*)strstr(double2string ,point); // for(i = 0; i< pointnum;i++) // { // array[digitnum + i] =(u8)(p[i + 1] - 0x30); // } number_div = numberTemp/pow(10,2); for(i = 0; i< pointnum;i++) { yu_temp = number_div % 10; number_div = number_div / 10; array[digitnum + pointnum - 1- i ] = yu_temp; } /*ÕûÊý²»×ãǰ±ßÇå³ýһϠdigitnum - num_arrayÕûÊý×ܸöÊý¼õȥʵ¼Ê¸öÊý*/ for(i = 0; i < (digitnum - num_array); i ++) { LCD_ClearDigit((i+DigitPosition)); } if(signflag == 1) { signPosition = digitnum - num_array; DigitNumIN -= 1; switch(signPosition) { case 0: LCD_DisplaySeg(_LCD_5G_23A); break; case 1: LCD_DisplaySeg(_LCD_6G_23A); break; case 2: LCD_DisplaySeg(_LCD_7G_23A); break; case 3: LCD_DisplaySeg(_LCD_8G_23A); break; case 4: LCD_DisplaySeg(_LCD_9G_23A); break; case 5: LCD_DisplaySeg(_LCD_10G_23A); break; case 6: LCD_DisplaySeg(_LCD_11G_23A); break; default: LCD_DisplaySeg(_LCD_5G_23A); break; } /*digitnum - num_arrayÕûÊý×ܸöÊý¼õȥʵ¼Ê¸öÊý signPosition+1 µÚ¼¸¸ö¸ººÅµÄλÖÃ*/ // if(signPosition == 0) // { for(i = signPosition; i < DigitNumIN; i ++) { LCD_DisplayDigit((i+DigitPosition+1),array[i]); } // } // else // { // for(i = signPosition; i < DigitNumIN; i ++) // { // LCD_DisplayDigit((i+DigitPosition+signPosition),array[i]); // } // } } else { /*digitnum - num_arrayÕûÊý×ܸöÊý¼õȥʵ¼Ê¸öÊý*/ for(i = (digitnum- num_array); i < DigitNumIN; i ++) { LCD_DisplayDigit((i+DigitPosition),array[i]); } } } void LCD_DisplaysecondLineNew(u8 pointnum,double number,u8 DigitNumIN,u8 DigitPosition) { long long number_div; u8 array[10] = {0x00}; // u8 double2string[20] = {0x00}; u8 yu_temp; u8 num_array; u8 i; char *p,*point = "."; u8 signflag = 0; u8 digitnum = DigitNumIN; u8 signPosition;//·ûºÅÎ»Æ«ÒÆÁ¿ double temp; long long numberTemp; if(number < 0) { signflag = 1; number = 0 - number; } num_array = 0; numberTemp = (long long)(number*(pow(10,pointnum+2))); if(numberTemp%100 == 99) { numberTemp = numberTemp + 1; } number_div = numberTemp/pow(10,pointnum+2); // sprintf((char*)double2string,"%f",number); //´Ë´¦ÊÇÇóÔÚ²»Í¬Ð¡ÊýµãÇé¿öÏÂÕûÊý²¿·ÖÕ¼ÏÔʾÆÁµÄ×ܸöÊý if(signflag == 1) { digitnum -= 1;//ÏȼõÈ¥¸ººÅµÄλÖà } switch(pointnum) { case POINT_1: digitnum -= pointnum; break; case POINT_2://ÕûÊý²¿·Ö´óÓÚÒºÏÔ×î´óÖµ Çл»Îª1λСÊý switch(signflag) { case 0: if(number_div > 99999) { pointnum = POINT_1; } break; case 1: if(number_div > 9999) { pointnum = POINT_1; } break; } digitnum -= pointnum; break; case POINT_3://ÕûÊý²¿·Ö´óÓÚÒºÏÔ×î´óÖµ Çл»Îª2λСÊý switch(signflag) { case 0: if(number_div > 99999)//Èç¹ûÊý¾Ý´«½øÀ´Ìرð´óµÄ»°Çл»Îª1λСÊý ÏÖ { pointnum = POINT_1; } else if(number_div > 9999) { pointnum = POINT_2; } break; case 1: if(number_div > 9999)//Èç¹ûÊý¾Ý´«½øÀ´Ìرð´óµÄ»°Çл»Îª1λСÊý ÀíÂÛÉϲ»»á³öÏÖ { pointnum = POINT_1; } else if(number_div > 999) { pointnum = POINT_2; } break; } digitnum -= pointnum; break; default: digitnum -= 2;//ĬÈÏ2λ break; } switch(pointnum)//¸ù¾ÝСÊýλÊýÏÔʾСÊýµãλÖà { case POINT_1: LCD_DisplaySeg(_LCD_POINT28_23A); break; case POINT_2: LCD_DisplaySeg(_LCD_POINT26_23A); break; case POINT_3://ÕûÊý²¿·Ö´óÓÚÒºÏÔ×î´óÖµ Çл»Îª2λСÊý LCD_DisplaySeg(_LCD_POINT24_23A); break; default: LCD_DisplaySeg(_LCD_POINT26_23A);//ĬÈÏ2λ break; } //Èç¹û³¤¶È³¬ÏÞ ½Øµô¸ßλ Ö÷ÒªÓÃÓÚ1λСÊýµÄʱºò ¸ù¾ÝÊý¾Ý¸öÊý Çó³ö³¬ÏÞÖµ while((number_div - pow(10,digitnum))>=0) { number_div = number_div-pow(10,digitnum); } /*ÕûÊý²¿·Ö¼ÆËã*/ yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { //digitnum - 1 Êý×éÖÐÕûÊýÊý¾ÝµÄ×î´óϱê array[digitnum - 1 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[digitnum - 1 - num_array] = yu_temp; num_array ++; /*СÊý²¿·Ö¼ÆËã*/ // p = (char*)strstr(double2string ,point); // for(i = 0; i< pointnum;i++) // { // array[digitnum + i] =(u8)(p[i + 1] - 0x30); // } number_div = numberTemp/pow(10,2); for(i = 0; i< pointnum;i++) { yu_temp = number_div % 10; number_div = number_div / 10; array[digitnum + pointnum - 1- i ] = yu_temp; } /*ÕûÊý²»×ãǰ±ßÇå³ýһϠdigitnum - num_arrayÕûÊý×ܸöÊý¼õȥʵ¼Ê¸öÊý*/ for(i = 0; i < (digitnum - num_array); i ++) { LCD_ClearDigit((i+DigitPosition)); } if(signflag == 1) { signPosition = digitnum - num_array; DigitNumIN -= 1; switch(signPosition) { case 0: LCD_DisplaySeg(_LCD_14G_23A); break; case 1: LCD_DisplaySeg(_LCD_15G_23A); break; case 2: LCD_DisplaySeg(_LCD_16G_23A); break; case 3: LCD_DisplaySeg(_LCD_17G_23A); break; default: LCD_DisplaySeg(_LCD_14G_23A); break; } /*digitnum - num_arrayÕûÊý×ܸöÊý¼õȥʵ¼Ê¸öÊý signPosition+1 µÚ¼¸¸ö¸ººÅµÄλÖÃ*/ // if(signPosition == 0) // { for(i = signPosition; i < DigitNumIN; i ++) { LCD_DisplayDigit((i+DigitPosition+1),array[i]); } // } // else // { // for(i = signPosition; i < DigitNumIN; i ++) // { // LCD_DisplayDigit((i+DigitPosition+signPosition),array[i]); // } // } } else { /*digitnum - num_arrayÕûÊý×ܸöÊý¼õȥʵ¼Ê¸öÊý*/ for(i = (digitnum- num_array); i < DigitNumIN; i ++) { LCD_DisplayDigit((i+DigitPosition),array[i]); } } } void LCD_DisplayfisrtLine(u8 pointnum,double number) { long long number_div; u8 array[10]; u8 yu_temp; u8 num_array; u8 i; u8 signflag = 0; if(number < 0) { signflag = 1; number = 0 - number; } if(pointnum == 0) { if(signflag == 0) { if(number_div >= 9000000)//±ÈÉÏÒ»¿éÆÁÈ¥µôÒ»¸ö0 { if(system_alarm_ctrl_word_g.alarm_ctl_word.lcd_up == SYSTEM_SINGLE_BIT_SET1) { if(menu_data.LCD_number_overrun_flag !=1) { menu_data.LCD_number_overrun_flag =1; system_alarm_log_data_handle(ALARM_CLASS_LCD, ALARM_HAPPEN + ALARM_ID_LCD_NUMBER_OVERRUN); if(system_alarm_ctrl_word_g.alarm_ctl_word.lcd_up == SYSTEM_SINGLE_BIT_SET1) { if(alarm_report_para_g.lcd_number_overrun_cnt= 10000000) // { // number_div = number_div-10000000; // }else // { // } while((number_div - 10000000)>0) { number_div = number_div-10000000; } /*ÕûÊý²¿·Ö¼ÆËã*/ yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[6 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[6 - num_array] = yu_temp; num_array ++; /*СÊý²¿·Ö¼ÆËã*/ number_div = (number * 10); array[7] =(u8) (number_div % 10); number_div = (number * 100); array[8] =(u8) (number_div % 10); /*ÕûÊý²»×ãǰ±ß²¹Áã*/ for(i = 0; i < (7 - num_array); i ++) { LCD_ClearDigit((i+4)); } for(i = (7- num_array); i < 9; i ++) { // if(i<7) // { LCD_DisplayDigit((i+4),array[i]); // }else // { // LCD_DisplayDigit((i+5),array[i]); // } } } else { LCD_DisplaySeg(_LCD_4G_23A); // if(number_div >= 1000000) // { // number_div = number_div-1000000; // }else // { // } while((number_div-1000000)>0) { number_div = number_div-1000000; } /*ÕûÊý²¿·Ö¼ÆËã*/ yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[5 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[5 - num_array] = yu_temp; num_array ++; /*СÊý²¿·Ö¼ÆËã*/ number_div = (number * 10); array[6] =(u8) (number_div % 10); number_div = (number * 100); array[7] =(u8) (number_div % 10); /*ÕûÊý²»×ãǰ±ß²¹Áã*/ for(i = 0; i < (6 - num_array); i ++) { LCD_ClearDigit((i+5)); } for(i = (6- num_array); i < 8; i ++) { // if(i<7) // { LCD_DisplayDigit((i+5),array[i]); // }else // { // LCD_DisplayDigit((i+5),array[i]); // } } } LCD_DisplaySeg(_LCD_POINT14_23A); } else { if(signflag == 0) { if(number_div >= 900000)//±ÈÉÏÒ»¿éÆÁÈ¥µôÒ»¸ö0 { if(system_alarm_ctrl_word_g.alarm_ctl_word.lcd_up == 1) { if(menu_data.LCD_number_overrun_flag !=1) { menu_data.LCD_number_overrun_flag =1; system_alarm_log_data_handle(ALARM_CLASS_LCD, ALARM_HAPPEN + ALARM_ID_LCD_NUMBER_OVERRUN); if(system_alarm_ctrl_word_g.alarm_ctl_word.lcd_up == 1) { if(alarm_report_para_g.lcd_number_overrun_cnt= 1000000) // { // number_div = number_div-1000000; // }else // { // } while((number_div-1000000)>0) { number_div = number_div-1000000; } /*ÕûÊý²¿·Ö¼ÆËã*/ yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[5 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[5 - num_array] = yu_temp; num_array ++; /*СÊý²¿·Ö¼ÆËã*/ number_div = (number * 10); array[6] =(u8) (number_div % 10); number_div = (number * 100); array[7] =(u8) (number_div % 10); number_div = (number * 1000); array[8] =(u8) (number_div % 10); /*ÕûÊý²»×ãǰ±ß²¹Áã*/ for(i = 0; i < (6 - num_array); i ++) { LCD_ClearDigit((i+4)); } for(i = (6- num_array); i < 9; i ++) { LCD_DisplayDigit((i+4),array[i]); } } else { //¸ººÅ LCD_DisplaySeg(_LCD_4G_23A); // if(number_div >= 100000) // { // number_div = number_div-100000; // }else // { // } while((number_div-100000)>0) { number_div = number_div-100000; } /*ÕûÊý²¿·Ö¼ÆËã*/ yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[4 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[4 - num_array] = yu_temp; num_array ++; /*СÊý²¿·Ö¼ÆËã*/ number_div = (number * 10); array[5] =(u8) (number_div % 10); number_div = (number * 100); array[6] =(u8) (number_div % 10); number_div = (number * 1000); array[7] =(u8) (number_div % 10); /*ÕûÊý²»×ãǰ±ß²¹Áã*/ for(i = 0; i < (5 - num_array); i ++) { LCD_ClearDigit((i+5)); } for(i = (5- num_array); i < 8; i ++) { LCD_DisplayDigit((i+5),array[i]); } } LCD_DisplaySeg(_LCD_POINT12_23A); } } //*show_type : Á÷Á¿ÏÔʾÀàÐÍ 0-3 Õý·´¼ì´í±ê¿ö 4-7 Õý·´¼ì´í¹¤¿ö void LCD_DisplaysecondLine(u8 pointnum,double number) { long long number_div; u8 array[8]; u8 yu_temp; u8 num_array; u8 i; long data; num_array = 0; number_div = (long long) number; if(pointnum == POINT_2) { // if(number_div > 10000) // { // number_div = number_div - 10000 ; // }else // { // } while((number_div - 10000)>0) { number_div = number_div - 10000; } /*ÕûÊý²¿·Ö¼ÆËã*/ yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[3 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[3 - num_array] = yu_temp; num_array ++; /*СÊý²¿·Ö¼ÆËã*/ number_div = (number * 10); array[4] =(u8) (number_div % 10); number_div = ((number * 1000)/10); array[5] =(u8) (number_div % 10); /**/ for(i = 0; i < (4 - num_array); i ++) { LCD_ClearDigit((i+13)); } for(i = (4- num_array); i < 6; i ++) { LCD_DisplayDigit((i+13),array[i]); } LCD_DisplaySeg(_LCD_POINT24_23A); } else { // if(number_div > 1000) // { // number_div = number_div - 1000 ; // }else // { // } while((number_div - 1000)>0) { number_div = number_div - 1000; } /*ÕûÊý²¿·Ö¼ÆËã*/ yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[2 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[2 - num_array] = yu_temp; num_array ++; /*СÊý²¿·Ö¼ÆËã*/ number_div = (number * 10); array[3] =(u8) (number_div % 10); number_div = ((number * 1000)/10); array[4] =(u8) (number_div % 10); number_div = ((number * 10000)/10); array[5] =(u8) (number_div % 10); /**/ for(i = 0; i < (3 - num_array); i ++) { LCD_ClearDigit((i+13)); } for(i = (3- num_array); i < 6; i ++) { LCD_DisplayDigit((i+13),array[i]); } LCD_DisplaySeg(_LCD_POINT22_23A); } } void LCD_DisplayfisrtLine_Look(u8 show_type,u8* showdata) { u8 count_i = 0,count_j = 0,yu_temp,num_array = 0; long number_div; u8 array[8] = {0}; switch(show_type) { case SV_HV_MENU: LCD_DisplayDigit(5,5); LCD_DisplaySeg(_LCD_POINT1_23A); LCD_DisplaySeg(_LCD_POINT2_23A); LCD_DisplaySeg(_LCD_POINT6_23A); LCD_DisplaySeg(_LCD_POINT10_23A); LCD_DisplaySeg(_LCD_POINT14_23A); for(count_i = 0;count_i<4;count_i++) { LCD_DisplayDigit(6 + 2*count_i,(showdata[count_i]&0xf0)>>4); LCD_DisplayDigit(7 + 2*count_i,showdata[count_i]&0x0f); } break; case DT_TM_MENU: LCD_DisplaySeg(_LCD_8G_23A); LCD_DisplaySeg(_LCD_11G_23A); for(count_i = 0;count_i<3;count_i++) { LCD_DisplayDigit(6 + 3*count_i,(showdata[count_i]&0xf0)>>4); LCD_DisplayDigit(7 + 3*count_i,showdata[count_i]&0x0f); } break; case IP_MENU_SZ: case IP_MENU_THR: // I P LCD_DisplaySeg(_LCD_5B_23A); LCD_DisplaySeg(_LCD_5C_23A); LCD_DisplaySeg(_LCD_6A_23A); LCD_DisplaySeg(_LCD_6B_23A); LCD_DisplaySeg(_LCD_6E_23A); LCD_DisplaySeg(_LCD_6F_23A); LCD_DisplaySeg(_LCD_6G_23A); LCD_DisplaySeg(_LCD_POINT3_23A); LCD_DisplaySeg(_LCD_POINT4_23A); LCD_DisplaySeg(_LCD_POINT10_23A); for(count_i = 0; count_i <2; count_i++)//λÖà { number_div = showdata[count_i]; yu_temp = number_div % 10; number_div = number_div / 10; num_array = 0; while(number_div > 0) { array[2 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[2 - num_array] = yu_temp; num_array ++; switch(num_array) { case 1: array[1] = 0; case 2: array[0] = 0; break; default: break; } /**/ // for(count_j = 0; count_j < (3 - num_array); count_j ++)//Êý¾Ý // { // LCD_ClearDigit((count_j + 6 + 3*count_i)); // } // for(count_j = (3- num_array); count_j < 3; count_j ++) for(count_j = 0; count_j < 3; count_j ++) { LCD_DisplayDigit((count_j + 7 + 3*count_i),array[count_j]); } } break; case PT_MENU_SZ: case PT_MENU_THR: //P LCD_DisplaySeg(_LCD_5A_23A); LCD_DisplaySeg(_LCD_5B_23A); LCD_DisplaySeg(_LCD_5E_23A); LCD_DisplaySeg(_LCD_5F_23A); LCD_DisplaySeg(_LCD_5G_23A); //: LCD_DisplaySeg(_LCD_POINT1_23A); LCD_DisplaySeg(_LCD_POINT2_23A); number_div = showdata[0] + showdata[1]*256; yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[4 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[4 - num_array] = yu_temp; num_array ++; switch(num_array) { case 1: array[3] = 0; case 2: array[2] = 0; case 3: array[1] = 0; case 4: array[0] = 0; break; default: break; } /**/ // for(count_j = 0; count_j < (5 - num_array); count_j ++) // { // LCD_ClearDigit(count_j + 5); // } for(count_j = (5- num_array); count_j < 5; count_j ++) { LCD_DisplayDigit((count_j + 6 ),array[count_j]); } break; case BH_MENU_SZ: case BH_MENU_THR: // LCD_DisplaySeg(_LCD_POINT4_23A); // LCD_DisplaySeg(_LCD_POINT8_23A); // LCD_DisplaySeg(_LCD_POINT10_23A); // LCD_DisplaySeg(_LCD_POINT12_23A); LCD_DisplayDigit(5,showdata[0]&0x0f); for(count_i = 0; count_i<4;count_i++) { LCD_DisplayDigit(6 + 2*count_i,(showdata[1 + count_i]&0xf0)>>4); LCD_DisplayDigit(7 + 2*count_i,showdata[1 + count_i]&0x0f); } break; case BPS_AD_MENU: //B LCD_DisplayDigit(5,8); //P LCD_DisplaySeg(_LCD_6A_23A); LCD_DisplaySeg(_LCD_6B_23A); LCD_DisplaySeg(_LCD_6E_23A); LCD_DisplaySeg(_LCD_6F_23A); LCD_DisplaySeg(_LCD_6G_23A); //S LCD_DisplayDigit(7,5); LCD_DisplaySeg(_LCD_POINT5_23A); LCD_DisplaySeg(_LCD_POINT6_23A); //data number_div = (showdata[3]<<24)|(showdata[2]<<16)|(showdata[1]<<8)|showdata[0]; yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[5 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[5 - num_array] = yu_temp; num_array ++; // switch(num_array) // { // case 1: // array[3] = 0; // case 2: // array[2] = 0; // case 3: // array[1] = 0; // case 4: // array[0] = 0; // break; // default: // break; // } /**/ // for(count_j = 0; count_j < (5 - num_array); count_j ++) // { // LCD_ClearDigit(count_j + 5); // } for(count_j = (6- num_array); count_j < 6; count_j ++) { LCD_DisplayDigit((count_j + 8 ),array[count_j]); } break; } } void LCD_DisplaysecondLine_Look(u8 show_type,u8* showdata) { u8 count_i = 0,count_j = 0,yu_temp,num_array = 0; long number_div; u8 array[8] = {0}; switch(show_type) { case SV_HV_MENU: LCD_DisplaySeg(_LCD_14B_23A); LCD_DisplaySeg(_LCD_14C_23A); LCD_DisplaySeg(_LCD_14E_23A); LCD_DisplaySeg(_LCD_14F_23A); LCD_DisplaySeg(_LCD_14G_23A); LCD_DisplaySeg(_LCD_POINT17_23A); LCD_DisplaySeg(_LCD_POINT18_23A); LCD_DisplaySeg(_LCD_POINT22_23A); for(count_i = 0;count_i<2;count_i++) { LCD_DisplayDigit(15 + 2*count_i,(showdata[count_i]&0xf0)>>4); LCD_DisplayDigit(16 + 2*count_i,showdata[count_i]&0x0f); } LCD_DisplayDigit(19,(showdata[count_i]&0xf0)>>4); break; case DT_TM_MENU: LCD_DisplaySeg(_LCD_POINT19_23A); LCD_DisplaySeg(_LCD_POINT20_23A); LCD_DisplaySeg(_LCD_POINT23_23A); LCD_DisplaySeg(_LCD_POINT24_23A); for(count_i = 0;count_i<3;count_i++) { LCD_DisplayDigit(14 + 2*count_i,(showdata[count_i]&0xf0)>>4); LCD_DisplayDigit(15 + 2*count_i,showdata[count_i]&0x0f); } break; case IP_MENU_SZ: case IP_MENU_THR: // I P LCD_DisplaySeg(_LCD_POINT22_23A); for(count_i = 0; count_i <2; count_i++) { number_div = showdata[count_i]; yu_temp = number_div % 10; number_div = number_div / 10; num_array = 0; while(number_div > 0) { array[2 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[2 - num_array] = yu_temp; num_array ++; switch(num_array) { case 1: array[1] = 0; case 2: array[0] = 0; break; default: break; } /**/ // for(count_j = 0; count_j < (3 - num_array); count_j ++) // { // LCD_ClearDigit((count_j + 13 + 3*count_i)); // } // for(count_j = (3- num_array); count_j < 3; count_j ++) for(count_j = 0; count_j < 3; count_j ++) { LCD_DisplayDigit((count_j + 14 + 3*count_i),array[count_j]); } } break; case PT_MENU_SZ: case PT_MENU_THR: break; case BH_MENU_SZ: case BH_MENU_THR: // LCD_DisplaySeg(_LCD_POINT18_23A); for(count_i = 0; count_i<4;count_i++) { LCD_DisplayDigit(14 + 2*count_i,(showdata[count_i]&0xf0)>>4); LCD_DisplayDigit(15 + 2*count_i,showdata[count_i]&0x0f); } break; case BPS_AD_MENU: //S LCD_DisplayDigit(14,5); LCD_DisplaySeg(_LCD_POINT17_23A); LCD_DisplaySeg(_LCD_POINT18_23A); //data number_div = showdata[0]; yu_temp = number_div % 10; number_div = number_div / 10; while(number_div > 0) { array[2 - num_array] = yu_temp; num_array ++; yu_temp = number_div % 10; number_div = number_div / 10; } array[2 - num_array] = yu_temp; num_array ++; switch(num_array) { case 1: array[1] = 0; case 2: array[0] = 0; break; default: break; } /**/ // for(count_j = 0; count_j < (5 - num_array); count_j ++) // { // LCD_ClearDigit(count_j + 5); // } // for(count_j = (3- num_array); count_j < 3; count_j ++) for(count_j = 0; count_j < 3; count_j ++) { LCD_DisplayDigit((count_j + 15 ),array[count_j]); } break; } } void LCD_show_tem(double number) { long long number_div; u8 array[3]; u8 yu_temp; u8 num_array; u8 i; num_array = 0; } void LCD_show_pre(double number) { long long number_div; u8 array[5]; u8 yu_temp; u8 num_array; u8 i; } void show_valvecloseid(u16 valvecloseid) { // u8 div_temp,yu_temp; u8 array[2]; u8 i; if(valvecloseid <= 0x99) { if(valvecloseid == 0) { for(i = 0; i < 2; i ++) { LCD_ClearDigit(i+1); } }else { array[1] = valvecloseid & 0x000f; array[0] = valvecloseid >>4; for(i = 0; i < 2; i ++) { LCD_DisplayDigit((i+1),array[i]); } } } } void show_error(u8 error) { // u8 div_temp,yu_temp; u8 array[2]; u8 i; if(error == 0) { for(i = 0; i < 2; i ++) { LCD_ClearDigit(i+2); } }else { array[1] = error & 0x0f; array[0] = error >>4; for(i = 0; i < 2; i ++) { LCD_DisplayDigit((i+3),array[i]); } } } void show_error_sym(u8 sym_index) { switch(sym_index) { case SIZHULOG: LCD_DisplaySeg(_LCD_SIZHULOG_23A); break; case NET_SIG: LCD_DisplaySeg(_LCD_WIFI_23A); break; case POWER_CONNECT: // LCD_DisplaySeg(_LCD_DISCONNECT); break; case WARNING_SYM: LCD_DisplaySeg(_LCD_WARNING_23A); break; default: break; } } void clear_error_sym(u8 sym_index) { switch(sym_index) { case SIZHULOG: LCD_ClearSeg(_LCD_SIZHULOG_23A); break; case NET_SIG: LCD_ClearSeg(_LCD_WIFI_23A); break; case POWER_CONNECT: // LCD_ClearSeg(_LCD_DISCONNECT_23A); break; case WARNING_SYM: LCD_ClearSeg(_LCD_WARNING_23A); break; default: break; } } void LCD_DisplaySignal(u8 signal) //µ¥×Ö·ûÏÔʾ { LCD_DisplaySeg(signal); LCD_Display(LCD_Buffer); } u16 kkk = 300; void LCD_DisplayAll(void) //µ¥×Ö·ûÏÔʾ { u16 i; // double num; // u8 data = 8; // num = 123.45; for(i = 0; i < LCD_BUFFER_LENGTH; i++) LCD_Buffer[i] = 0xff; LCD_Display(LCD_Buffer); // while(1); // LCD_DisplayfisrtLine(0,123456789.89); // LCD_DisplaysecondLine(0,12345.67); // LCD_show_tem(15.6); // LCD_show_pre(5678.2); // show_time(12,23); // show_error(0); // // show_error_sym(SIZHULOG); // show_error_sym(NET_SIG); // show_error_sym(POWER_CONNECT); // show_error_sym(WARNING_SYM); // // show_bat_sym(BAT_CAP_2); // // for(i = 0; i < 42; i++) // // LCD_Buffer[i] = 0xFF; // // // LCD_DisplaySeg(_LCD_9A); // // LCD_DisplaySeg(_LCD_9B); // // LCD_DisplaySeg(_LCD_9C); // // LCD_DisplaySeg(_LCD_9D); // // LCD_DisplaySeg(_LCD_9E); // // LCD_DisplaySeg(_LCD_9F); // // LCD_DisplaySeg(_LCD_9G); // // LCD_DisplaySeg(_LCD_11A); // // LCD_DisplaySeg(_LCD_11B); // // LCD_DisplaySeg(_LCD_11C); // // LCD_DisplaySeg(_LCD_11D); // // LCD_DisplaySeg(_LCD_11E); // // LCD_DisplaySeg(_LCD_11F); // // LCD_DisplaySeg(_LCD_11G); // // // insert_blank(); // // // // LCD_DisplaySeg( kkk); // // kkk ++; // // if(kkk>335) // // kkk = 320; // LCD_Display(LCD_Buffer); // LCD_Display_other(LCD_Buffer); // LCD_READ_REG(LCD_Read_buffer,0,10); } void LCD_ClearSignal(u8 signal) { LCD_ClearSeg(signal); LCD_Display(LCD_Buffer); } void LCD_DisplayDefault(void) { u8 count_i = 0; //LOGO LCD_DisplaySeg(_LCD_SIZHULOG_23A); //ˮƽÏß LCD_DisplaySeg(_LCD_HORIZONTALLINE_1_23A); LCD_DisplaySeg(_LCD_HORIZONTALLINE_2_23A); //¼Æ·Ñģʽ LCD_DisplaySeg(_LCD_SINGLEBILL_23A); if(v20_system_para_g.medium_status == 1) { LCD_DisplaySeg(_LCD_K_23A); } else if(v20_system_para_g.medium_status == 2) { LCD_DisplaySeg(_LCD_T_23A); } if(cal_gas_para_g.calibration_mode) { LCD_DisplaySeg(_LCD_CHECK_23A); } //³ö³§ #ifdef THIRD_TELECOM_OPEN if(IOT_Parameter.ExitFlag == 1) { LCD_DisplaySeg(_LCD_ACCOUNT_23A); } if(IOT_Parameter.BalanceSaveType == 1) { LCD_DisplaySeg(_LCD_BILLBACK_23A); } else { LCD_ClearSeg(_LCD_BILLBACK_23A); } #else if(system_function_ctrl_word_g.fun_ctrl_word.account_open == 1) { LCD_DisplaySeg(_LCD_ACCOUNT_23A); } if(system_function_ctrl_word_g.fun_ctrl_word.billing_mode == SFCW_BILLING_TYPE_CENTER) { LCD_DisplaySeg(_LCD_BILLBACK_23A); } // if((system_function_ctrl_word_g.ctrl_word4 & SFCW41_ACCOUNT_OPEN) == SFCW41_ACCOUNT_OPEN) #endif if(v20_system_para_g.system_extern_power_connect_flag == ACTIVE) { LCD_DisplaySeg(_LCD_CHARGE_23A); } else { LCD_ClearSeg(_LCD_CHARGE_23A); } if(v20_system_para_g.system_ble_connect == 1) { LCD_DisplaySeg(_LCD_BOOTTOOTH_23A); } else { LCD_ClearSeg(_LCD_BOOTTOOTH_23A); } //BAT if((menu_data.lcd_refresh_cnt & 0x04) == 0x04) { LCD_DisplaySeg(_LCD_METER_23A); } else { LCD_DisplaySeg(_LCD_SIGNAL_COMMUNICATION_23A); } LCD_DisplaySeg(_LCD_BATTERY_SHELL_23A); //ûÓеÍѹ£¬Ôò°´Ê±¼äÏÔʾ¸ñÊý if(v20_system_para_g.system_bat_power_percent > BAT_PERSENT_LCD_4) { LCD_DisplaySeg(_LCD_BATTERY_1_23A); LCD_DisplaySeg(_LCD_BATTERY_2_23A); LCD_DisplaySeg(_LCD_BATTERY_3_23A); LCD_DisplaySeg(_LCD_BATTERY_4_23A); }else if(v20_system_para_g.system_bat_power_percent > BAT_PERSENT_LCD_3) { LCD_DisplaySeg(_LCD_BATTERY_1_23A); LCD_DisplaySeg(_LCD_BATTERY_2_23A); LCD_DisplaySeg(_LCD_BATTERY_3_23A); }else if(v20_system_para_g.system_bat_power_percent > BAT_PERSENT_LCD_2) { LCD_DisplaySeg(_LCD_BATTERY_1_23A); LCD_DisplaySeg(_LCD_BATTERY_2_23A); }else if(v20_system_para_g.system_bat_power_percent > BAT_PERSENT_LCD_1) { LCD_DisplaySeg(_LCD_BATTERY_1_23A); }else { } #ifdef THIRD_TELECOM_OPEN //valve if(IOT_Parameter.ExitFlag == 1 && Valve_control_parm.OpenValveAuthorizeFLAG == 0) { LCD_DisplaySeg(_LCD_LOCK_23A); } #else if(Valve_control_parm.OpenValveAuthorizeFLAG == 0) { LCD_DisplaySeg(_LCD_LOCK_23A); } #endif switch(Valve_control_parm.Valve_Status) { case VALVE_OP: LCD_DisplaySeg(_LCD_VALVE_M_23A); LCD_DisplaySeg(_LCD_OPEN_23A); break; case VALVE_CL: LCD_DisplaySeg(_LCD_VALVE_M_23A); LCD_DisplaySeg(_LCD_CLOSE_23A); show_valvecloseid(Valve_control_parm.ValveCloseClass); break; case VALVE_OPENING: LCD_DisplaySeg(_LCD_VALVE_M_23A); if((menu_data.lcd_refresh_cnt & 0x01) == 0x01) { LCD_DisplaySeg(_LCD_OPEN_23A); } else { LCD_ClearSeg(_LCD_OPEN_23A); } break; case VALVE_CLOSING: LCD_DisplaySeg(_LCD_VALVE_M_23A); if((menu_data.lcd_refresh_cnt & 0x01) == 0x01) { LCD_DisplaySeg(_LCD_CLOSE_23A); } else { LCD_ClearSeg(_LCD_CLOSE_23A); } break; case VALVE_ERROR: if((menu_data.lcd_refresh_cnt & 0x02) == 0x02) { LCD_DisplaySeg(_LCD_VALVE_M_23A); } else { LCD_ClearSeg(_LCD_VALVE_M_23A); } break; case VALVE_MISSING: if((menu_data.lcd_refresh_cnt & 0x04) == 0x04) { LCD_DisplaySeg(_LCD_VALVE_M_23A); } else { LCD_ClearSeg(_LCD_VALVE_M_23A); } break; default: break; } //±¨¾¯ if(menu_data.alarm_show_addr < ERROR_LCD_NUM) { for(count_i=0;count_i=ERROR_LCD_NUM) { menu_data.alarm_show_addr =0; } } } if((menu_data.lcd_refresh_cnt % 2)==0) { menu_data.alarm_show_addr ++; if(menu_data.alarm_show_addr>=ERROR_LCD_NUM) { menu_data.alarm_show_addr =0; } } }else { menu_data.alarm_show_addr = 0; if(v20_system_para_g.system_error[0] != 0) { LCD_DisplaySeg(_LCD_WARNING_23A); show_error(v20_system_para_g.system_error[0]); } } //GPRS LCD_DisplaySeg(_LCD_4G_Flag_23A); if(VariaDlg.netgrade > 25) { LCD_DisplaySeg(_LCD_4G_1_23A); LCD_DisplaySeg(_LCD_4G_2_23A); LCD_DisplaySeg(_LCD_4G_3_23A); LCD_DisplaySeg(_LCD_4G_4_23A); LCD_DisplaySeg(_LCD_4G_5_23A); } else if(VariaDlg.netgrade >= 21 && VariaDlg.netgrade <= 25) { LCD_DisplaySeg(_LCD_4G_1_23A); LCD_DisplaySeg(_LCD_4G_2_23A); LCD_DisplaySeg(_LCD_4G_3_23A); LCD_DisplaySeg(_LCD_4G_4_23A); } else if(VariaDlg.netgrade >= 16 && VariaDlg.netgrade <= 20) { LCD_DisplaySeg(_LCD_4G_1_23A); LCD_DisplaySeg(_LCD_4G_2_23A); LCD_DisplaySeg(_LCD_4G_3_23A); } else if(VariaDlg.netgrade >= 11 && VariaDlg.netgrade <= 15) { LCD_DisplaySeg(_LCD_4G_1_23A); LCD_DisplaySeg(_LCD_4G_2_23A); } else if(VariaDlg.netgrade > 0 && VariaDlg.netgrade < 11) { LCD_DisplaySeg(_LCD_4G_1_23A); } else { } #ifdef THIRD_TELECOM_OPEN if(third_telecom_interface_para_g.in_com==1) { //ͨѶÖÐ1ÃëÉÁ˸ if( (calendar.sec&0x01)==0x01) { LCD_DisplaySeg(_LCD_WIFI_23A); } else { LCD_ClearSeg(_LCD_WIFI_23A); } } else { //ͨѶ³É¹¦³¤ÁÁ£¬Í¨Ñ¶Ê§°Ü³¤°µ if(third_telecom_interface_para_g.Data_Send_failed_time == 0) { LCD_DisplaySeg(_LCD_WIFI_23A); }else { LCD_ClearSeg(_LCD_WIFI_23A); } } #else if(v20_system_para_g.system_gprs_connect==1) { //ͨѶÖÐ1ÃëÉÁ˸ if( (calendar.sec&0x01)==0x01) { LCD_DisplaySeg(_LCD_WIFI_23A); } else { LCD_ClearSeg(_LCD_WIFI_23A); } } else { //ͨѶ³É¹¦³¤ÁÁ£¬Í¨Ñ¶Ê§°Ü³¤°µ if(v20_system_para_g.Data_Send_failed_time == 0) { LCD_DisplaySeg(_LCD_WIFI_23A); }else { LCD_ClearSeg(_LCD_WIFI_23A); } } #endif } //Õý³£Ä£Ê½ void LCD_Display_Normal_Mode(u8 showtype) { switch(showtype) { case YE_DJ_MENU: if(system_function_ctrl_word_g.fun_ctrl_word.show_balance == 0) { //SIGN1LINE LCD_DisplaySeg(_LCD_SURPLUSE_23A); LCD_DisplaySeg(_LCD_YUAN_1_23A); //DATA LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.residual_amount,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } if(system_function_ctrl_word_g.fun_ctrl_word.show_price == 0) { //SIGN2LINE // LCD_DisplaySeg(_LCD_NOW_23A); LCD_DisplaySeg(_LCD_UNIT_PRICE_23A); LCD_DisplaySeg(_LCD_YUAN_2_23A); LCD_DisplaySeg(_LCD_YUAN_M3_23A); LCD_DisplaysecondLineNew(POINT_3,(double)(cal_gas_para_g.unit_price/10000.0),SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); } // LCD_DisplayfisrtLineNew(POINT_3,-456789.9876,9,FIRST_LINE_DIGIT_POSIGITION); // LCD_DisplaysecondLineNew(POINT_3,-56.4567,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); break; case BK_SH_MENU : //SIGN1LINE LCD_DisplaySeg(_LCD_STAND_CONDITION_23A); LCD_DisplaySeg(_LCD_TOTAL_23A); LCD_DisplaySeg(_LCD_N_1_23A); LCD_DisplaySeg(_LCD_M3_1_23A); //SIGN2LINE LCD_DisplaySeg(_LCD_N_2_23A); LCD_DisplaySeg(_LCD_M3_2_23A); LCD_DisplaySeg(_LCD_h_23A); //DATA if(cal_gas_para_g.calibration_mode == 0) { LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.ctotal,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } else { LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.calibration_ctotal,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } LCD_DisplaysecondLineNew(POINT_2,cal_gas_para_g.cvol_m3h,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); // LCD_DisplayfisrtLineNew(POINT_2,123456.987,9,FIRST_LINE_DIGIT_POSIGITION); // LCD_DisplaysecondLineNew(POINT_2,123456.456,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); break; case BK_WD_MENU: //SIGN1LINE LCD_DisplaySeg(_LCD_STAND_CONDITION_23A); LCD_DisplaySeg(_LCD_TOTAL_23A); LCD_DisplaySeg(_LCD_N_1_23A); LCD_DisplaySeg(_LCD_M3_1_23A); //SIGN2LINE LCD_DisplaySeg(_LCD_oC_23A); //DATA if(cal_gas_para_g.calibration_mode == 0) { LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.ctotal,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } else { LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.calibration_ctotal,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } LCD_DisplaysecondLineNew(POINT_2,cal_gas_para_g.corrected_medium_tem,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); // LCD_DisplayfisrtLineNew(POINT_2,12345678.987,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); // LCD_DisplaysecondLineNew(POINT_2,123456.456,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); break; case BK_YL_MENU: //SIGN1LINE LCD_DisplaySeg(_LCD_STAND_CONDITION_23A); LCD_DisplaySeg(_LCD_TOTAL_23A); LCD_DisplaySeg(_LCD_N_1_23A); LCD_DisplaySeg(_LCD_M3_1_23A); //SIGN2LINE LCD_DisplaySeg(_LCD_kPa_23A); //DATA if(cal_gas_para_g.calibration_mode == 0) { LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.ctotal,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } else { LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.calibration_ctotal,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } LCD_DisplaysecondLineNew(POINT_2,cal_gas_para_g.corrected_medium_pre,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); // LCD_DisplayfisrtLineNew(POINT_2,1234567.987,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); // LCD_DisplaysecondLineNew(POINT_2,123456.456,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); break; case GK_SH_MENU: //SIGN1LINE LCD_DisplaySeg(_LCD_WORK_CONDITION_23A); LCD_DisplaySeg(_LCD_TOTAL_23A); LCD_DisplaySeg(_LCD_M3_1_23A); //SIGN2LINE LCD_DisplaySeg(_LCD_M3_2_23A); LCD_DisplaySeg(_LCD_h_23A); //DATA if(cal_gas_para_g.calibration_mode == 0) { LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.utotal,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } else { LCD_DisplayfisrtLineNew(POINT_2,cal_gas_para_g.calibration_utotal,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); } LCD_DisplaysecondLineNew(POINT_2,cal_gas_para_g.uvol_m3h,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); // LCD_DisplayfisrtLineNew(POINT_2,123456.789,FIRST_LINE_DIGIT_NUM,FIRST_LINE_DIGIT_POSIGITION); // LCD_DisplaysecondLineNew(POINT_2,123456.456,SECOND_LINE_DIGIT_NUM,SECOND_LINE_DIGIT_POSIGITION); break; default: break; } } //²éѯģʽ void LCD_Display_Look_Mode(u8 showtype) { u8 array[8]; u8 count_i; LCD_DisplaySeg(_LCD_LOOKUP_23A); switch(showtype) { case SV_HV_MENU: LCD_DisplayfisrtLine_Look(SV_HV_MENU,(u8*)main_equipment_hardware_software_inf_g.soft_serial_number); LCD_DisplaysecondLine_Look(SV_HV_MENU,(u8*)main_equipment_hardware_software_inf_g.hard_serial_number); // LCD_DisplayfisrtLine(BK_FORWARD_MENU,11111111.11); // LCD_DisplaysecondLine(BK_FORWARD_MENU,11111.11); break; case DT_TM_MENU : LCD_DisplayfisrtLine_Look(DT_TM_MENU,(u8*)&Time_BCD_g.year); LCD_DisplaysecondLine_Look(DT_TM_MENU,(u8*)&Time_BCD_g.hour); break; case IP_MENU_SZ: LCD_DisplayfisrtLine_Look(IP_MENU_SZ,(u8 * )&network_com_para_g.company_ip1[0]); LCD_DisplaysecondLine_Look(IP_MENU_SZ,(u8 * )&network_com_para_g.company_ip1[2]); break; case IP_MENU_THR: if(IOT_Parameter.ExitFlag == 1) { LCD_DisplayfisrtLine_Look(IP_MENU_THR,(u8 * )&IOT_ip_para_g.XAServerIP1[0]); LCD_DisplaysecondLine_Look(IP_MENU_THR,(u8 * )&IOT_ip_para_g.XAServerIP1[2]); } else { LCD_DisplayfisrtLine_Look(IP_MENU_THR,(u8 * )&IOT_ip_para_g.XAServerIP_Test1[0]); LCD_DisplaysecondLine_Look(IP_MENU_THR,(u8 * )&IOT_ip_para_g.XAServerIP_Test1[2]); } break; case PT_MENU_SZ: LCD_DisplayfisrtLine_Look(PT_MENU_SZ,(u8 * )&network_com_para_g.company_ip_port1); break; case PT_MENU_THR: if(IOT_Parameter.ExitFlag == 1) { LCD_DisplayfisrtLine_Look(PT_MENU_THR,(u8 * )&IOT_ip_para_g.XAServerPort1); } else { LCD_DisplayfisrtLine_Look(PT_MENU_THR,(u8 * )&IOT_ip_para_g.XAServerPort_Test1); } break; case BH_MENU_SZ: LCD_DisplayfisrtLine_Look(BH_MENU_SZ,(u8*)&equipment_basic_inf_g.serial_number[0]); LCD_DisplaysecondLine_Look(BH_MENU_SZ,(u8*)&equipment_basic_inf_g.serial_number[5]); break; case BH_MENU_THR: array[0] = equipment_basic_inf_g.xinao_serial_number[2] - 0x30; for(count_i=0;count_i<7;count_i++) { array[1 + count_i] = ((equipment_basic_inf_g.xinao_serial_number[3 + 2*count_i] - 0x30)<<4) + (equipment_basic_inf_g.xinao_serial_number[4 + 2*count_i] - 0x30); } LCD_DisplayfisrtLine_Look(BH_MENU_THR,(u8*)&array[0]); LCD_DisplaysecondLine_Look(BH_MENU_THR,(u8*)&array[5]); break; case BPS_AD_MENU: LCD_DisplayfisrtLine_Look(BPS_AD_MENU,(u8*)&flow_device_modbus_g.set_modbus_rate); LCD_DisplaysecondLine_Look(BPS_AD_MENU,(u8*)&flow_device_modbus_g.set_modbus_addr); break; default: break; } }