Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiancetai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈家乐
jiancetai
Commits
8f7e2b24
Commit
8f7e2b24
authored
Jun 17, 2025
by
huangguoqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:修复切换界面BUG
parent
a265a6b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
122 deletions
+18
-122
Display_Info.c
YueJin_test_bench/source/Appliciation/Display_Info.c
+13
-115
Display_Info.h
YueJin_test_bench/source/Appliciation/Display_Info.h
+0
-2
Key.h
YueJin_test_bench/source/Appliciation/Key.h
+2
-2
Key_user.c
YueJin_test_bench/source/Appliciation/Key_user.c
+3
-3
No files found.
YueJin_test_bench/source/Appliciation/Display_Info.c
View file @
8f7e2b24
...
...
@@ -50,7 +50,7 @@ uint8_t can_car_return_Data[8];
static
uint32_t
VoltageADC_CH_9_value_
=
0
;
static
uint32_t
VoltageADC_CH_9_value
=
0
;
uint16_t
count_electric_current
=
0
;
uint32_t
text5
[
5
];
uint32_t
Quiescent_Current
[
5
];
...
...
@@ -4506,6 +4506,7 @@ void Display_Chaka_Model(void)
{
if
(
Require_card_flag
==
1
)
{
Display_Num
(
0
,
0
,
can_car_return_Data
[
6
],
1
);
Display_buffer_ID
(
20
,
150
);
...
...
@@ -4522,7 +4523,6 @@ void Display_Chaka_Model(void)
else
if
(
can_car_return_Data
[
1
]
==
2
)
{
Display_buffer_Data
(
can_car_return_Data
,
60
,
170
);
}
else
if
(
can_car_return_Data
[
1
]
==
3
)
{
...
...
@@ -4605,38 +4605,11 @@ void Display_interface_learning_card(uint16_t X,uint8_t Y)
//0101EF87FFCB02FF//屏幕显示
void
Display_buffer_Data
(
uint8_t
buffer
[]
,
uint16_t
X
,
uint8_t
Y
)
{
// uint8_t high[8] = {};
// uint8_t low[8] = {};
// uint8_t x_offset = 10;
// for (uint8_t i = 0; i < 8; i++)
// {
// high[i] = (buffer[i] >> 4) & 0x0F;
// low[i] = buffer[i] & 0x0F;
// TFT_LCD_Draw_Box(X, Y, (X + i * 20), Y+2, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR);
// if ( high[i] >= 10 && high[i] <= 36 )
// {
// TFT_LCD_Draw_Bmp(X + i * 20, Y, (uint8_t *)FONT_TABLE_15[high[i]+1]);
// }
// if( low[i] >= 10 && low[i] <= 36 )
// {
// TFT_LCD_Draw_Bmp((X+10) + i * 20, Y, (uint8_t *)FONT_TABLE_15[low[i]+1]);
// }
// if( high[i] >= 0 && high[i] <=9 )
// {
// TFT_LCD_Draw_Bmp((X+2) + i * 20, (Y+2), (uint8_t *)FONT_TABLE_15[high[i]]);
// }
// if( low[i] >= 0 && low [i] <=9 )
// {
// TFT_LCD_Draw_Bmp((X+12) + i * 20, (Y+2), (uint8_t *)FONT_TABLE_15[low[i]]);
// }
// }
uint8_t
high
[
8
]
=
{};
uint8_t
low
[
8
]
=
{};
uint16_t
start_x
=
X
;
// 保存起始X坐标
for
(
uint8_t
i
=
0
;
i
<
8
;
i
++
)
for
(
uint8_t
i
=
0
;
i
<
8
;
i
++
)
{
high
[
i
]
=
(
buffer
[
i
]
>>
4
)
&
0x0F
;
low
[
i
]
=
buffer
[
i
]
&
0x0F
;
...
...
@@ -4664,86 +4637,11 @@ void Display_buffer_Data(uint8_t buffer[] , uint16_t X,uint8_t Y)
TFT_LCD_Draw_Bmp
(
start_x
+
i
*
20
+
10
,
Y
+
1
,
(
uint8_t
*
)
FONT_TABLE_15
[
low
[
i
]]);
}
}
// uint8_t high[8] = {};
// uint8_t low[8] = {};
// uint16_t start_x = X; // 保存起始X坐标
// uint8_t letter_width = 9; // 假设一个字母的宽度为9像素
// for (uint8_t i = 0; i < 8; i++)
// {
// high[i] = (buffer[i] >> 4) & 0x0F;
// low[i] = buffer[i] & 0x0F;
// // 计算当前字节的X坐标,在第0个和第6个字节之间增加间隔
// uint16_t current_x = start_x + i * 20;
// if (i > 0) {
// current_x += (i - 1) / 6 * letter_width; // 在第0和第6字节之间增加间隔
// }
// // 绘制背景框
// TFT_LCD_Draw_Box(current_x, Y, current_x + 18, Y + 18, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR);
// // 绘制高4位
// if (high[i] >= 10 && high[i] <= 36)
// {
// TFT_LCD_Draw_Bmp(current_x + 1, Y + 1, (uint8_t *)FONT_TABLE_15[high[i] + 1]);
// }
// else if (high[i] >= 0 && high[i] <= 9)
// {
// TFT_LCD_Draw_Bmp(current_x + 1, Y + 1, (uint8_t *)FONT_TABLE_15[high[i]]);
// }
// // 绘制低4位
// if (low[i] >= 10 && low[i] <= 36)
// {
// TFT_LCD_Draw_Bmp(current_x + 10, Y + 1, (uint8_t *)FONT_TABLE_15[low[i] + 1]);
// }
// else if (low[i] >= 0 && low[i] <= 9)
// {
// TFT_LCD_Draw_Bmp(current_x + 10, Y + 1, (uint8_t *)FONT_TABLE_15[low[i]]);
// }
// }
}
//测试用
void
Display_Can_Data
(
uint8_t
Data
,
uint16_t
X
,
uint8_t
Y
)
{
uint8_t
high
=
0
;
uint8_t
low
=
0
;
uint8_t
x_offset
=
10
;
for
(
uint8_t
i
=
0
;
i
<
8
;
i
++
)
{
high
=
(
Data
>>
4
)
&
0x0F
;
low
=
Data
&
0x0F
;
TFT_LCD_Draw_Box
(
X
,
Y
,
(
X
+
i
*
20
),
Y
+
2
,
TFT_LCD_FILL_FULL
,
TFT_LCD_TYPE_CLR
);
if
(
high
>=
10
&&
high
<=
36
)
{
TFT_LCD_Draw_Bmp
(
X
+
i
*
20
,
Y
,
(
uint8_t
*
)
FONT_TABLE_15
[
high
+
1
]);
}
if
(
low
>=
10
&&
low
<=
36
)
{
TFT_LCD_Draw_Bmp
((
X
+
10
)
+
i
*
20
,
Y
,
(
uint8_t
*
)
FONT_TABLE_15
[
low
+
1
]);
}
if
(
high
>=
0
&&
high
<=
9
)
{
TFT_LCD_Draw_Bmp
((
X
+
2
)
+
i
*
20
,
(
Y
+
2
),
(
uint8_t
*
)
FONT_TABLE_15
[
high
]);
}
if
(
low
>=
0
&&
low
<=
9
)
{
TFT_LCD_Draw_Bmp
((
X
+
12
)
+
i
*
20
,
(
Y
+
2
),
(
uint8_t
*
)
FONT_TABLE_15
[
low
]);
}
}
}
const
uint16_t
CurrentDigitNum15PosX_1
[]
=
{
75
};
const
uint16_t
CurrentDigitNum15PosX_2
[]
=
{
108
,
98
};
uint8_t
banbenhao
[
5
]
=
{
0x56
,
0x31
,
0x30
,
0x32
,
0xff
};
const
uint16_t
CurrentDigitNum15PosX_1
[]
=
{
75
};
const
uint16_t
CurrentDigitNum15PosX_2
[]
=
{
108
,
98
};
uint8_t
Detecting_Set_Version
[
5
]
=
{
0x56
,
0x31
,
0x30
,
0x32
,
0xff
};
void
Display_Can_Receive_Data
(
uint16_t
X
,
uint8_t
Y
)
{
if
(
canData3
[
9
]
==
0XFF
&&
canData2
[
13
]
==
0XFF
&&
All_Flag
.
u8flag
[
8
]
==
1
)
...
...
@@ -4751,9 +4649,9 @@ void Display_Can_Receive_Data(uint16_t X,uint8_t Y)
General_Number_Disp
(
canData2
,
X
+
70
,
Y
);
General_Number_Disp
(
canData3
,
X
+
70
,
Y
+
50
);
GUI_General_Digit_Display
(
text5
[
0
],
Num_15
,
1
,
0
,
CurrentDigitNum15PosX_1
,
200
);
TFT_LCD_Draw_Bmp
(
85
,
195
,
(
uint8_t
*
)
FONT_TABLE
[
37
]
);
/*.*/
GUI_General_Digit_Display
(
text5
[
1
],
Num_15
,
2
,
0
,
CurrentDigitNum15PosX_2
,
200
);
GUI_General_Digit_Display
(
Quiescent_Current
[
0
],
Num_15
,
1
,
0
,
CurrentDigitNum15PosX_1
,
200
);
TFT_LCD_Draw_Bmp
(
85
,
195
,
(
uint8_t
*
)
FONT_TABLE
[
37
]
);
/*.*/
GUI_General_Digit_Display
(
Quiescent_Current
[
1
],
Num_15
,
2
,
0
,
CurrentDigitNum15PosX_2
,
200
);
}
}
...
...
@@ -4773,10 +4671,10 @@ void Obtain_The_Static_Current(void)
if
(
count_electric_current
==
1999
)
{
VoltageADC_CH_9_value
=
VoltageADC_CH_9_value_
/
2000
;
text5
[
0
]
=
VoltageADC_CH_9_value
/
100
;
text5
[
1
]
=
VoltageADC_CH_9_value
%
100
;
//
text5
[0]=VoltageADC_CH_9_value;
//
text5
[1]=0Xff;
Quiescent_Current
[
0
]
=
VoltageADC_CH_9_value
/
100
;
Quiescent_Current
[
1
]
=
VoltageADC_CH_9_value
%
100
;
//
Quiescent_Current
[0]=VoltageADC_CH_9_value;
//
Quiescent_Current
[1]=0Xff;
VoltageADC_CH_9_value_
=
0
;
count_electric_current
=
0
;
...
...
YueJin_test_bench/source/Appliciation/Display_Info.h
View file @
8f7e2b24
...
...
@@ -71,7 +71,6 @@ void Display_Send_ODO(uint8_t fuel);
void
Display_flag
(
uint8_t
Check_Steps
);
void
Display_buffer_Data
(
uint8_t
buffer
[]
,
uint16_t
X
,
uint8_t
Y
);
void
Display_Can_Data
(
uint8_t
Data
,
uint16_t
X
,
uint8_t
Y
);
void
Display_buffer_ID
(
uint16_t
X
,
uint8_t
Y
);
extern
void
Display_Chaka_Model
(
void
);
extern
void
Display_interface_learning_card
(
uint16_t
X
,
uint8_t
Y
);
...
...
@@ -80,7 +79,6 @@ void Display_Can_Receive_Data(uint16_t X,uint8_t Y);
void
Page_Num_Display
(
uint8_t
page
);
/*显示界面重构*/
void
Display_Set_Buff
(
void
);
extern
void
Send_Init
(
void
);
void
Buzzer_Start
(
void
);
void
Buzzer_Stop
(
void
);
extern
void
Buzzer_Init
(
void
);
...
...
YueJin_test_bench/source/Appliciation/Key.h
View file @
8f7e2b24
...
...
@@ -146,8 +146,8 @@ extern uint8_t canData2[14];
extern
uint8_t
canData3
[
10
];
extern
uint8_t
canData4
[
8
];
extern
uint32_t
text5
[
5
];
extern
uint8_t
banbenhao
[
5
];
extern
uint32_t
Quiescent_Current
[
5
];
extern
uint8_t
Detecting_Set_Version
[
5
];
extern
uint8_t
can_car_Data
[
8
];
extern
const
unsigned
char
gImage_Dyy_words_1X6_Y16
[];
...
...
YueJin_test_bench/source/Appliciation/Key_user.c
View file @
8f7e2b24
...
...
@@ -175,8 +175,8 @@ void Key_Operation_SW7(Key_Event_en_t enKeyEvent)
Study_Flag
=
0
;
Query_Card_can_command
=
1
;
Require_card_flag
=
1
;
//
Display_TFT_Clear();
//
界面学卡
:
Display_TFT_Clear
();
//
Display_Chaka_Model();//查卡模式
:
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
...
...
@@ -209,7 +209,7 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent)
TFT_LCD_Draw_Bmp
(
5
,
100
,
(
uint8_t
*
)
gImage_Dyy_words_2X6_Y46
);
//硬件版本号
TFT_LCD_Draw_Bmp
(
5
,
200
,
(
uint8_t
*
)
gImage_Dyy_words_5X6_Y137
);
//静态电流
TFT_LCD_Draw_Bmp
(
0
,
220
,
(
uint8_t
*
)
gImage_titlex0_y0
);
General_Number_Disp
(
banbenhao
,
90
,
230
);
/*显示检测台版本号*/
General_Number_Disp
(
Detecting_Set_Version
,
90
,
230
);
/*显示检测台版本号*/
//Display_Can_Receive_Data(5,50);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment