📄 display.c
字号:
uint8 position_x,position_y;
for(i=0;i<6;i++)
{
num_sam[i]=st[dat][i];
if(num_sam[i]==0x2e){num_sam[i]=10;} //小数点
else if(num_sam[i]==0x2d){num_sam[i]=11;} //负数
else
{
num_sam[i]= num_sam[i]-0x30; //ASCII码转成十进制数
}
}
position_y=y_row;
switch(x_row)
{
case 0:
{
position_x=0;
} break;
case 1:
{
position_x=16;
} break;
case 2:
{
position_x=32;
} break;
case 3:
{
position_x=48;
} break;
default: break;
}
show_picture(number1[num_sam[0]],position_x,position_y,8,16);
show_picture(number1[num_sam[1]],position_x,position_y+8,8,16);
show_picture(number1[num_sam[2]],position_x,position_y+16,8,16);
show_picture(number1[num_sam[3]],position_x,position_y+24,8,16);
show_picture(number1[num_sam[4]],position_x,position_y+32,8,16);
show_picture(number1[num_sam[5]],position_x,position_y+40,8,16);
// show_picture(number1[num_sam[6]],position_x,position_y+48,8,16);
// show_picture(number1[num_sam[7]],position_x,position_y+56,8,16);
}
//-------------------------------------------------------------------------------
//show_picture(guzhang, 8,8,32,32); -----0---------0----------0----------
//show_picture(yxkz, 48,8,32,32); | | |
// show_picture(dhkz, 88,8,32,32); -----8,8-------48,8-------88,8-------
// | | |
void display_process(void)
{
switch (current_screen)
{
case START_SCREEN: //开始屏,系统启动时显示
{
if(0==Bclear_LCD_screen)
{
Bclear_LCD_screen=0;
clr_LCD_screen();
course_position=0;
// show_delay=450;
// course_delay=18;
}
show_picture(ldm_100,0,30,56,16);//LDM-100
show_picture(jgfcjcxt,16,0,128,16);
show_picture(fangkuang,48,32,64,8);
// if(!course_delay)
// {
// course_delay=18;
// if(course_position>=4)
// course_position=0;
// else
// course_position++;
// }
// show_picture(fangkuai,34+course_position*12,48,12,8);
// if(course_position==0)
// show_picture(fangkuai0,34+4*12,48,12,8);
// else
// show_picture(fangkuai0,34+(course_position-1)*12,48,12,8);
DelayNS(200);
//-------------------------------------------------------
// if (!show_delay)
// {
current_screen=DEFAULT_SCREEN;
show_ID=0;
Bclear_LCD_screen=1;
// }
}
break;
case DEFAULT_SCREEN: //默认屏,系统大部分时间显示这一屏
{
if(Bclear_LCD_screen)
{
Bclear_LCD_screen=0;
clr_LCD_screen();
show_ID=0;
show_picture(ldm_100,0,30,56,16);//LDM-100,,;
// show_picture(xiao_guan_du, 16,0,48,16); //消光度
// show_picture(fencheng_nondu,32,0,48,16); show_picture(baifenhao,32,108,8,16);//粉尘浓度 %
// show_picture(touguo_li, 48,0,48,16); show_picture(mgm3, 48,94,34,16);//透过率 mg/m3
}
//------------------------------------------------
show_ASCII_SAMPLE(lasertemp, 1,0); show_ASCII_SAMPLE(Vref_liten, 1,64);
show_ASCII_SAMPLE(stylebook_liten ,2,0); show_ASCII_SAMPLE(permeate, 2,64);
show_ASCII_SAMPLE(compar_extinction, 3,0); show_ASCII_SAMPLE(soot_chroma, 3,64);
//激光器温度 参考光强度
//样本光强度 透过率
//相对消光度 烟尘浓度
if((IO0PIN & 0x001D0000 ) !=0x001D0000)
{
current_screen=MAIN_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
break;
case MAIN_SCREEN: //主屏
{
if(Bclear_LCD_screen)
{
Bclear_LCD_screen=0;
clr_LCD_screen();
show_ID=0;
show_picture(ldm_100, 0,30,56,16);//LDM-100
show_picture(yiqi_tiaoshi, 16,0,64,16);//仪器调试
show_picture_n(yiqi_shezhi, 32,0,64,16);//仪器设置
show_picture(baojin_shezhi, 48,0,64,16);//报警设置
}
if((IO0PIN & DOWN)==0)
{
delay(200);
if((IO0PIN & DOWN)==0)
{
while((IO0PIN & DOWN)==0);
show_ID++;
if (show_ID>5)
show_ID=0;
}
}
else if( (IO0PIN & UP ) == 0)
{
delay(200);
if((IO0PIN & UP)==0)
{
while((IO0PIN & UP)==0);
show_ID--;
if (show_ID>5)
{
show_ID=5;
}
}
}
// UART0_SendByte(show_ID);
switch (show_ID)
{
case 0: //仪器设置
{
show_picture(ldm_100,0,30,56,16);
show_picture(yiqi_tiaoshi,16,0,64,16);
show_picture_n(yiqi_shezhi,32,0,64,16);
show_picture(baojin_shezhi,48,0,64,16);
//-------------------------------------
if((IO0PIN & ENTER)==0)
{
delay(200);
if((IO0PIN & ENTER)==0)
{
while((IO0PIN & ENTER)==0);
current_screen=SETTING_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
else if( (IO0PIN & CANCEL ) == 0)
{
delay(200);
if((IO0PIN & CANCEL)==0)
{
while((IO0PIN & CANCEL)==0);
current_screen=DEFAULT_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
} break;
case 1: //报警设置
{
show_picture(ldm_100,0,30,56,16);
show_picture(yiqi_shezhi,16,0,64,16);
show_picture_n(baojin_shezhi,32,0,64,16);
show_picture(jiekou_shezhi,48,0,64,16);
//-------------------------------------
if((IO0PIN & ENTER)==0)
{
delay(200);
if((IO0PIN & ENTER)==0)
{
while((IO0PIN & ENTER)==0);
current_screen=WARNING_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
else if( (IO0PIN & CANCEL ) == 0)
{
delay(200);
if((IO0PIN & CANCEL)==0)
{
while((IO0PIN & CANCEL)==0);
current_screen=DEFAULT_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
} break;
case 2: //接口设置
{
show_picture(ldm_100,0,30,56,16);
show_picture(baojin_shezhi,16,0,64,16);
show_picture_n(jiekou_shezhi,32,0,64,16);
show_picture(shizhong_shezhi,48,0,64,16);
//-------------------------------------
if((IO0PIN & ENTER)==0)
{
delay(200);
if((IO0PIN & ENTER)==0)
{
while((IO0PIN & ENTER)==0);
current_screen=CONNECT_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
else if( (IO0PIN & CANCEL ) == 0)
{
delay(200);
if((IO0PIN & CANCEL)==0)
{
while((IO0PIN & CANCEL)==0);
current_screen=DEFAULT_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
}break;
case 3: //时钟设置
{
show_picture(ldm_100,0,30,56,16);
show_picture(jiekou_shezhi,16,0,64,16);
show_picture_n(shizhong_shezhi,32,0,64,16);
show_picture(ranjian_xingxi,48,0,64,16);
//-------------------------------------
if((IO0PIN & ENTER)==0)
{
delay(200);
if((IO0PIN & ENTER)==0)
{
while((IO0PIN & ENTER)==0);
current_screen=CLOCK_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
else if( (IO0PIN & CANCEL ) == 0)
{
delay(200);
if((IO0PIN & CANCEL)==0)
{
while((IO0PIN & CANCEL)==0);
current_screen=DEFAULT_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
}break;
case 4: //软件信息
{
show_picture(ldm_100,0,30,56,16);
show_picture(shizhong_shezhi,16,0,64,16);
show_picture_n(ranjian_xingxi,32,0,64,16);
show_picture(yiqi_tiaoshi,48,0,64,16);
//-------------------------------------
if((IO0PIN & ENTER)==0)
{
delay(200);
if((IO0PIN & ENTER)==0)
{
while((IO0PIN & ENTER)==0);
current_screen=VERSION_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
else if( (IO0PIN & CANCEL ) == 0)
{
delay(200);
if((IO0PIN & CANCEL)==0)
{
while((IO0PIN & CANCEL)==0);
current_screen=DEFAULT_SCREEN;
Bclear_LCD_screen=1;
show_ID=0;
}
}
}break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -