case 4: //
{
string_disp (0x80,10,page41);
string_disp (0x88,10,page42);
if(SPEEDTP《9999)
{
BEW1 = SPEEDTP/1000;
BEW2 = (SPEEDTP%1000)/100; //温度十位
BEW3 = ((SPEEDTP%1000)%100)/10; //温度个位
BEW4 = ((SPEEDTP%1000)%100)%10;
if(!BEW1) //灭零处理
{
BEW1 = 10;
}
string_disp (0x95,6,run4);
number_disp (0x94,1,TAB[BEW3],TAB[BEW4]);
number_disp (0x93,1,TAB[BEW2],0x2E);
number_disp (0x92,1,0x20,TAB[BEW1]);
}
else
{
string_disp (0x92,8,run6);
}
if(SPEEDNY《9999)
{
BEW1 = SPEEDNY/1000;
BEW2 = (SPEEDNY%1000)/100; //温度十位
BEW3 = ((SPEEDNY%1000)%100)/10; //温度个位
BEW4 = ((SPEEDNY%1000)%100)%10;
if(!BEW1) //灭零处理
{
BEW1 = 10;
}
string_disp (0x9d,4,run5);
number_disp (0x9C,1,TAB[BEW3],TAB[BEW4]);
number_disp (0x9B,1,TAB[BEW2],0x2E);
number_disp (0x9A,1,0x20,TAB[BEW1]);
}
else
{
string_disp (0x9a,8,run6);
}
Page1=Page;
}break;
case 5: //显示定位信息
{
string_disp (0x80,14,page6);
string_disp (0x98,6,tab10);
number_disp (0x9b,1,WD[0],WD[1]);
number_disp (0x9c,1,WD[2],WD[3]);
number_disp (0x9d,1,WD[4],WD[5]);
number_disp (0x9e,1,WD[6],WD[7]);
number_disp (0x9f,1,WD[8],WD[9]);
string_disp (0x88,6,tab11);
number_disp (0x8B,1,JD[0],JD[1]);
number_disp (0x8C,1,JD[2],JD[3]);
number_disp (0x8D,1,JD[4],JD[5]);
number_disp (0x8E,1,JD[6],JD[7]);
number_disp (0x8F,1,JD[8],JD[9]);
//string_disp (0x98,6,tab12);
//number_disp (0x9B,1,HIGH[0],HIGH[1]);
//number_disp (0x9C,1,HIGH[2],HIGH[3]);
//number_disp (0x9D,1,HIGH[4],HIGH[5]);
Page1=Page;
}break;
case 6: //传感器标定 厚度显示
{
string_disp (0x80,8,page51);
BEW1 = TPHD1/100;
if(!BEW1) //灭零处理
{
BEW1 = 10;
}
BEW2 = (TPHD1%100)/10;
BEW3 = (TPHD1%100)%10;
number_disp (0x85,1,TAB[BEW1],TAB[BEW2]);
number_disp (0x86,1,0x2E,TAB[BEW3]);
number_disp (0x87,1,0x43,0x4d);
string_disp (0x90,9,page52);
BEW1 = TPHD2/100;
if(!BEW1) //灭零处理
{
BEW1 = 10;
}
BEW2 = (TPHD2%100)/10;
BEW3 = (TPHD2%100)%10;
number_disp (0x95,1,TAB[BEW1],TAB[BEW2]);
number_disp (0x96,1,0x2E,TAB[BEW3]);
number_disp (0x97,1,0x43,0x4d);
string_disp (0x88,13,page5);
if (TPHD1》TPHD2)
{
TPHD = TPHD1 - TPHD2;
}
else
{
TPHD = 0;
}
BEW1 = TPHD/100;
if(!BEW1) //灭零处理
{
BEW1 = 10;
}
//if(BEW1》3) //超过3,异常数,则清零
//{
// BEW1 = 10;
// }
BEW2 = (TPHD%100)/10;
BEW3 = (TPHD%100)%10;
number_disp (0x9d,1,TAB[BEW1],TAB[BEW2]);
number_disp (0x9e,1,0x2E,TAB[BEW3]);
number_disp (0x9f,1,0x43,0x4d);
Page1=Page;
}break;
case 7: //修改时间
{
if(!(set==2)) //没有按SET键
{
string_disp (0x80,10,page7);
number_disp (0x89,1,0x32,0x30); //数字20
number_disp (0x8b,1,0xc4,0xea); //年
number_disp (0x8d,1,0xd4,0xc2); //月
number_disp (0x8f,1,0xc8,0xd5); //日
number_disp (0x9b,1,0xca,0xb1); //时
number_disp (0x9d,1,0xb7,0xd6); //分
number_disp (0x9f,1,0xc3,0xeb); //秒
TH = time_buf1[1]/10; //年
TL = time_buf1[1]%10;
number_disp (0x8a,1,TAB[TH],TAB[TL]);
TH = time_buf1[2]/10; //月
TL = time_buf1[2]%10;
number_disp (0x8C,1,TAB[TH],TAB[TL]);
TH = time_buf1[3]/10; //日
TL = time_buf1[3]%10;
number_disp (0x8E,1,TAB[TH],TAB[TL]);
TH = time_buf1[4]/10; //时
TL = time_buf1[4]%10;
number_disp (0x9A,1,TAB[TH],TAB[TL]);
TH = time_buf1[5]/10; //分
TL = time_buf1[5]%10;
number_disp (0x9C,1,TAB[TH],TAB[TL]);
TH = time_buf1[6]/10; //秒
TL = time_buf1[6]%10;
number_disp (0x9E,1,TAB[TH],TAB[TL]);
for (j = 0;j《6;j++)
{
keybuffer[j] = time_buf1[j+1];
}
}
Page1=Page; //保存当前页面值
}break;
case 0: //显示故障状态
{
if(!(set==1)) //没有按SET键
{
number_disp (0x82,1,0xb2,0xce); //参
number_disp (0x83,1,0xca,0xfd); //数
number_disp (0x84,1,0xc9,0xe8); //设
number_disp (0x85,1,0xd6,0xc3); //置
string_disp (0x90,8,tab13);
string_disp (0x88,10,tab14);
string_disp (0x98,10,tab15);
number_disp (0x95,1,TAB[SZH2],TAB[SZL2]);
number_disp (0x96,1,TAB[SZH1],TAB[SZL1]);
number_disp (0x97,1,TAB[SZH0],TAB[SZL0]); //把前面的显示了
number_disp (0x8f,1,TAB[SZH3],TAB[SZL3]);
number_disp (0x8e,1,TAB[SZH4],TAB[SZL4]);
number_disp (0x9f,1,TAB[SZH5],TAB[SZL5]);
number_disp (0x9e,1,TAB[SZH6],TAB[SZL6]);
}
Page1=Page; //保存当前页面值
}break;
default:break;
}
if(sendc)
{
sendc = 0;
Uart0_SendData(0x7f); //首字符串
Uart0_SendData(0x00); //数据包长度
Uart0_SendData(0x38); //56个字节
switch(Between[2]) //协议类型,0X0a摊铺 0X14碾压
{
case 0x0a:
Uart0_SendData(0x0a); //摊铺
break;
case 0x14:
Uart0_SendData(0x14); //压实
break;
default:
Uart0_SendData(0x0a); //默认0X0a
break;
}
Uart0_SendData(0x00); //预留字节
Uart0_SendData(0x00);
Uart0_SendData(Between[2]); //ID
Uart0_SendData(Between[1]);
Uart0_SendData(Between[0]);
Uart0_SendData(0x14);
Uart0_SendData(time_buf1[1]); //时间年月日时分秒
Uart0_SendData(time_buf1[2]);
Uart0_SendData(time_buf1[3]);
Uart0_SendData(time_buf1[4]);
Uart0_SendData(time_buf1[5]);
Uart0_SendData(time_buf1[6]);
for(i=0;i《12;i++) //经度
{
Uart0_SendData(JD[i]);
}
for(i=0;i《11;i++) //纬度
{
Uart0_SendData(WD[i]);
}
Uart0_SendData(TPHD/100); //摊铺厚度
Uart0_SendData(TPHD%100);
switch(Between[2])
{
case 0x10:
Uart0_SendData(SPEEDTP/100); //摊铺速度
Uart0_SendData(SPEEDTP%100);
break;
case 0x20:
Uart0_SendData(SPEEDNY/100); //压实速度
Uart0_SendData(SPEEDNY%100);
break;
default:
Uart0_SendData(0x00); //压实速度
Uart0_SendData(0x00);
break;
}
Uart0_SendData(TEMP1/100); //料温
Uart0_SendData(TEMP1%100);
Uart0_SendData(TEMP2/100);
Uart0_SendData(TEMP2%100);
Uart0_SendData(TEMP3/100);
Uart0_SendData(TEMP3%100);
Uart0_SendData(TEMP4/100);
Uart0_SendData(TEMP4%100);
Uart0_SendData(HT/100); //环境温度湿度横坡度
Uart0_SendData(HT%100);
Uart0_SendData(HR/100);
Uart0_SendData(HR%100);
Uart0_SendData(HP/100);
Uart0_SendData(HP%100);
Uart0_SendData(TPrange/100);
Uart0_SendData(TPrange%100);
Uart0_SendData(0xa3); //结束符
//Uart0_SendData(0xa5);
//Uart0_SendData(0xa6);
}
}
}
评论
查看更多