📄 lcd_screen.c
字号:
if(Parameter_Setup.Hv_Channels == 0) //表示单通道
{
Account_resistance(Hv_Data_buf[temp_x][temp_y]);
LCD_WR_string_8x8(1, (Data_0_addr_x1 + temp_x * 10), (Data_0_addr_y1 + temp_y * 10), 9, (Uchar8 *)&Disp_buf[0]); //显示第一列
}
else
{
Account_resistance(Hv_Data_buf[temp_x][0]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x1, (Data_0_addr_y1 + temp_x * 10), 9, (Uchar8 *)&Disp_buf[0]); //显示第一列
Account_resistance(Hv_Data_buf[temp_x][1]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x2, (Data_0_addr_y1 + temp_x * 10), 9, (Uchar8 *)&Disp_buf[0]); //显示第二列
Account_resistance(Hv_Data_buf[temp_x][2]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x3, (Data_0_addr_y1 + temp_x * 10), 9, (Uchar8 *)&Disp_buf[0]); //显示第三列
if((Hv_Data_buf[temp_x][0] != 0xffffffff) && (Hv_Data_buf[temp_x][1] != 0xffffffff) && (Hv_Data_buf[temp_x][2]!= 0xffffffff))
{
Hv_Data_buf[temp_x][3] = Account_rate(Hv_Data_buf[temp_x][0], Hv_Data_buf[temp_x][1], Hv_Data_buf[temp_x][2]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x4, (Data_0_addr_y1 + temp_x * 10), 5, (Uchar8 *)&Disp_buf[0]); //显示比例
}
}
}
else //表示低压侧
{
if(Parameter_Setup.Hv_tap_num < 19) //计算低压侧的数据显示位置,中间空了一行
{
Account_y = ((Parameter_Setup.Hv_tap_num + temp_x + 2) * 9) + Data_0_addr_y1;
}
else
{
Account_y = ((Parameter_Setup.Hv_tap_num + temp_x + 1) * 9) + Data_0_addr_y1;
}
if(Parameter_Setup.Lv_Channels == 0) //表示单通道
{
Account_resistance(Lv_Data_buf[temp_x][temp_y]);
LCD_WR_string_8x8(T_tpey, (Data_0_addr_x1 + temp_x * 10), Account_y, 9, (Uchar8 *)&Disp_buf[0]); //显示第一列
}
else
{
Account_resistance(Lv_Data_buf[temp_x][0]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x1, Account_y, 9, (Uchar8 *)&Disp_buf[0]); //显示第一列
Account_resistance(Lv_Data_buf[temp_x][1]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x2, Account_y, 9, (Uchar8 *)&Disp_buf[0]); //显示第二列
Account_resistance(Lv_Data_buf[temp_x][2]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x3, Account_y, 9, (Uchar8 *)&Disp_buf[0]); //显示第三列
if((Lv_Data_buf[temp_x][0] != 0xffffffff) && (Lv_Data_buf[temp_x][1] != 0xffffffff) && (Lv_Data_buf[temp_x][2]!= 0xffffffff))
{
Lv_Data_buf[temp_x][3] = Account_rate(Lv_Data_buf[temp_x][0], Lv_Data_buf[temp_x][1], Lv_Data_buf[temp_x][2]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x4, Account_y, 5, (Uchar8 *)&Disp_buf[0]); //显示比例
}
}
}
break;
}
}
/*********************************************************************************************************
** 函数名称:void Test_DisSetUp_Data(void)
** 输 入:
** 输 出:
** 全局变量: 无
** 调用模块: 无
** 作 者: 邱志城
** 日 期: 2008_08_21
** 功能描述: 显示设置项的内容
********************************************************************************************************/
void Data_Project(Uchar8 T_tpey, Uchar8 temp_Data, Uchar8 temp_Data2, Ushort16 T_Cursor)
{
Uchar8 temp_x, temp_y, temp_v, Account_y;
temp_v = (T_Cursor& 0x8000) >> 8; //记算是 HV还是LV;
temp_x = (T_Cursor >> 8) & 0x7f; //记算X的位置
temp_y = T_Cursor & 0x00ff; //记算y的位置
if(temp_x > 19) temp_x = 19;
if(temp_y > 2) temp_y = 2;
switch(temp_Data)
{
case 0: //设备编号
LCD_WR_string_16x16(1, SheBeiBianHao_16x16_addr_x, SheBeiBianHao_16x16_addr_y, 5, (Uchar8 *)&SheBeiBianHao_code_16[0][0]); //显示“设备编号”
break;
case 1:
LCD_WR_string_16x16(1, FanHuiScreen_16x16_addr_x, FanHuiScreen_16x16_addr_y, 8, (Uchar8 *)&FanHuiScreen_code_16[0][0]); //显示“《返回设置界面》”
break;
default:
if(temp_v == 0x80) //表示高压侧
{
if(Parameter_Setup.Hv_Channels == 0) //表示单通道
{
Account_resistance(Hv_Data_buf[temp_x][temp_y]);
LCD_WR_string_8x8(T_tpey, (Data_0_addr_x1 + temp_y * 10), (Data_0_addr_y1 + temp_x * 9), 9, (Uchar8 *)&Disp_buf[0]); //显示第一列
}
else
{
Account_resistance(Hv_Data_buf[temp_x][temp_y]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x1, (Data_0_addr_y1 + temp_x * 9), 9, (Uchar8 *)&Disp_buf[0]); //显示第一列
Account_resistance(Hv_Data_buf[temp_x][1]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x2, (Data_0_addr_y1 + temp_x * 9), 9, (Uchar8 *)&Disp_buf[0]); //显示第二列
Account_resistance(Hv_Data_buf[temp_x][2]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x3, (Data_0_addr_y1 + temp_x * 9), 9, (Uchar8 *)&Disp_buf[0]); //显示第三列
}
}
else //表示低压侧
{
if(Parameter_Setup.Hv_tap_num < 19) //计算低压侧的数据显示位置,中间空了一行
{
Account_y = ((Parameter_Setup.Hv_tap_num + temp_x + 2) * 9) + Data_0_addr_y1;
}
else
{
Account_y = ((Parameter_Setup.Hv_tap_num + temp_x + 1) * 9) + Data_0_addr_y1;
}
if(Parameter_Setup.Lv_Channels == 0) //表示单通道
{
Account_resistance(Lv_Data_buf[temp_x][temp_y]);
LCD_WR_string_8x8(T_tpey, (Data_0_addr_x1 + temp_y * 10), Account_y, 9, (Uchar8 *)&Disp_buf[0]); //显示第一列
}
else
{
Account_resistance(Lv_Data_buf[temp_x][0]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x1, Account_y, 9, (Uchar8 *)&Disp_buf[0]); //显示第一列
Account_resistance(Lv_Data_buf[temp_x][1]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x2, Account_y, 9, (Uchar8 *)&Disp_buf[0]); //显示第二列
Account_resistance(Lv_Data_buf[temp_x][2]);
LCD_WR_string_8x8(T_tpey, Data_0_addr_x3, Account_y, 9, (Uchar8 *)&Disp_buf[0]); //显示第三列
}
}
break;
}
}
/*********************************************************************************************************
** 函数名称:void Dis_Lcd_Start(void)
** 输 入:
T_Type显示类型 0表示8*8的字体,1表示16*8的字体
Date_time显示的温度.
** 输 出:
** 全局变量: 无
** 调用模块: 无
** 作 者: 邱志城
** 日 期: 2008_08_21
** 功能描述: 写温度16*8
********************************************************************************************************/
void Deal_Lcd_Data(void)
{
Uchar8 temp_Project, temp_Vaule, change_data, T_Select, Setup_Vaule, Bak_Setup_Vaule, Code_Vaule;
Ushort16 Cursor_data;
temp_Vaule = 0;
change_data = 0;
Code_Vaule = 0;
T_Select = 0;
Data_Disp(); //显示设置值
Dis_Lcd_Data(0); //重新画一次
if(Scan_num == 0) //表示第一次进入此界面
{
temp_Project = 0;
LCD_WR_string_16x16(1, SheBeiBianHao_16x16_addr_x, SheBeiBianHao_16x16_addr_y, 5, (Uchar8 *)&SheBeiBianHao_code_16[0][0]); //显示“设备编号”
temp_Project = 0;
}
else
{
Dis_Lcd_Data_Wr(Cursor_num, Testing_Data_buf[0]); //显示测试的数据
if(Cursor_num & 0x8000)
{
temp_Project = ((Cursor_num & 0x7f00) >> 8) + 2;
}
else
{
temp_Project = ((Cursor_num & 0x7f00) >> 8) + 2 + Parameter_Setup.Hv_tap_num;
}
Cursor_data = Cursor_num;
temp_Vaule = Cursor_num & 0x00ff;
Data_Project(1, temp_Project, T_Select, Cursor_data); //显示选中的项目
}
while((Screen_num == 3) && (temp_Project != 25))
{
Key_Code = Key_Num(Key_Normal_code);
switch(Key_Code)
{
case 6: //表示向上键
if(Code_Vaule == 0)
{
if(temp_Project == 0)
{
temp_Project = Parameter_Setup.Hv_tap_num + Parameter_Setup.Lv_tap_num + 2;
}
temp_Project--;
change_data = 1;
}
break;
case 4: //表示向下键
if(Code_Vaule == 0)
{
temp_Project++;
if(temp_Project == 1)
{
temp_Project++;
}
else if(temp_Project >= (Parameter_Setup.Hv_tap_num + Parameter_Setup.Lv_tap_num + 2))
{
temp_Project = 1;
}
else if(temp_Project == 2)
{
temp_Project = 0;
}
change_data = 1;
}
break;
case 8: //表示左移键
if((temp_Project == 0) && (Code_Vaule == 1)) //选中设备编号
{
Setup_Vaule = EquipmentName_buf[(T_Select - 1)];
if(Setup_Vaule == 0) Setup_Vaule = 0;
else if(Setup_Vaule == 65) Setup_Vaule = 35;
else Setup_Vaule--;
EquipmentName_buf[(T_Select - 1)]= Setup_Vaule;
change_data = 2;
}
else if(((Parameter_Setup.Hv_Channels == 0) || (Parameter_Setup.Lv_Channels == 0)) && (temp_Project >= 2)) //表示单通道
{
if(temp_Vaule > 0) //没有进入设置值
{
temp_Vaule--;
}
else
{
temp_Vaule = 0;
}
change_data = 1;
}
break;
case 2: //表示右移键
if((temp_Project == 0) && (Code_Vaule == 1)) //选中设备编号
{
Setup_Vaule = EquipmentName_buf[(T_Select - 1)];
if(Setup_Vaule == 65) Setup_Vaule = 65;
else
{
Setup_Vaule++;
if(Setup_Vaule > 35) Setup_Vaule = 65;
}
EquipmentName_buf[(T_Select - 1)]= Setup_Vaule;
change_data = 2;
}
else if(((Parameter_Setup.Hv_Channels == 0) || (Parameter_Setup.Lv_Channels == 0)) && (temp_Project >= 2)) //表示单通道
{
temp_Vaule++;
if(temp_Vaule >= 3)
{
temp_Vaule = 2;
}
change_data = 1;
}
break;
case 7: //表示按确定键
switch(temp_Project)
{
case 0: //表示修改设备编号
Code_Vaule = 1; //没有进入设置值
if(T_Select > 0)
{
Setup_Vaule = EquipmentName_buf[(T_Select - 1)];
if(Setup_Vaule != 65)
{
T_Select++;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -