Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
TianYing_ty100
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
TY
TianYing_ty100
Commits
e13f36f0
Commit
e13f36f0
authored
Aug 17, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:更改水温数显格显同步问题
parent
6b2142f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
13 deletions
+49
-13
Data_Coolant.c
Firmware/Source/Application/Data_Coolant/Data_Coolant.c
+49
-13
No files found.
Firmware/Source/Application/Data_Coolant/Data_Coolant.c
View file @
e13f36f0
...
...
@@ -50,28 +50,29 @@ typedef struct
}
HYS_Seg_Table_st_t
;
const
HYS_Seg_Table_st_t
stHYSSegTableTemp
[
7
]
=
{
{
0U
,
470U
},
// 0
{
500
U
,
59
0U
},
// 1
{
620
U
,
77
0U
},
// 2
{
800
U
,
95
0U
},
// 3
{
980
U
,
112
0U
},
// 4
{
1150
U
,
199
0U
},
// 5
{
1990
U
,
2
000U
},
// 6
{
0U
,
470
0
U
},
// 0
{
500
0U
,
590
0U
},
// 1
{
620
0U
,
770
0U
},
// 2
{
800
0U
,
950
0U
},
// 3
{
980
0U
,
1120
0U
},
// 4
{
1150
0U
,
1990
0U
},
// 5
{
1990
0U
,
20
000U
},
// 6
};
uint32_t
u32CoolantDataTimeCount
=
0UL
;
uint32_t
u32ColCurNum
=
0UL
;
/*阻尼数显*/
uint32_t
u32CoolantNum
=
0UL
;
/*当前实际数据,与显示数值不完全一致*/
/*
u32CoolantDir:0:下行,1:上行 2:无变化
*/
uint32_t
Data_Coolant_Cal_Num
(
uint32_t
u32CoolantCurSeg
,
uint32_t
u32CoolantDir
,
uint32_t
u32CoolantRemTime
,
uint32_t
u32CoolantCurNum
,
uint32_t
u32CoolantDesNum
)
{
uint32_t
u32CoolantNum
=
u32CoolantCurNum
;
uint32_t
u32CoolantNumMax
=
0UL
;
uint32_t
u32CoolantNumMin
=
0UL
;
uint32_t
u32CoolantSegDesNum
=
0UL
;
uint32_t
u32CoolantCalBuf
=
0UL
;
uint32_t
u32CoolantCalBuf1
=
0UL
;
uint32_t
u32CoolantCalResult
=
u32CoolantCurNum
;
/*计算当前格对应的目标数值*/
/*当前格数对应的数值范围,目标数值是否在这个范围内,如果在就直接用目标值。如果不在就根据上下行选择该范围内的极大和极小值。*/
...
...
@@ -138,17 +139,52 @@ uint32_t Data_Coolant_Cal_Num(uint32_t u32CoolantCurSeg, uint32_t u32CoolantDir,
u32CoolantNum
=
u32CoolantSegDesNum
;
}
}
u32CoolantCalResult
=
u32CoolantNum
;
if
(
u32CoolantDir
==
0
)
// down
{
// uint32_t u32CoolantCalBuf2 = 0UL;
// if (u32CoolantNum>u32CoolantCurNum)
// {
// u32CoolantCalBuf2 = u32CoolantNum-u32CoolantCurNum;
// }
// else
// {
// u32CoolantCalBuf2 = u32CoolantCurNum-u32CoolantNum;
// }
// if (u32CoolantCalBuf2>=100)
// {
// u32CoolantNum+=99UL;
// }
if
((
u32CoolantNum
+
99
)
>=
u32CoolantCurNum
)
{
u32CoolantCalResult
=
u32CoolantCurNum
;
}
else
{
u32CoolantCalResult
=
((
u32CoolantNum
+
99
)
/
100
*
100
);
}
}
}
else
// 0
{
u32CoolantNum
=
u32CoolantSegDesNum
;
u32CoolantCalResult
=
u32CoolantNum
;
}
}
/*根据目标数值计算每个变化周期内数值变化的大小,*/
/*根据目标数值以及剩余时间,修改当前显示值*/
return
u32CoolantNum
;
// return u32CoolantNum;
return
u32CoolantCalResult
;
}
void
Data_Coolant_Temp_Processing_Service
(
void
)
...
...
@@ -278,7 +314,7 @@ void Data_Coolant_Temp_Display ( void )
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
>
DataCoolantTemp_Dis
.
u8_DestSeg
)
{
u32ColCurNum
=
Data_Coolant_Cal_Num
(
DataCoolantTemp_Dis
.
u8_CurSeg
,
0
,
(
DataCoolantTemp_Dis
.
u8_Downtimer
-
DataCoolantTemp_Dis
.
u8_DownFlashtimer
),
u32ColCurNum
,
DataCoolantTemp
.
Value
*
10
);
u32ColCurNum
=
Data_Coolant_Cal_Num
(
DataCoolantTemp_Dis
.
u8_CurSeg
,
0
,
(
DataCoolantTemp_Dis
.
u8_Downtimer
-
DataCoolantTemp_Dis
.
u8_DownFlashtimer
),
u32ColCurNum
,
DataCoolantTemp
.
Value
*
10
0
);
DataCoolantTemp_Dis
.
u8_UpFlashtimer
=
0
;
DataCoolantTemp_Dis
.
u8_Holdtimer
=
0
;
DataCoolantTemp_Dis
.
u8_DownFlashtimer
++
;
...
...
@@ -290,7 +326,7 @@ void Data_Coolant_Temp_Display ( void )
}
else
if
(
DataCoolantTemp_Dis
.
u8_CurSeg
<
DataCoolantTemp_Dis
.
u8_DestSeg
)
{
u32ColCurNum
=
Data_Coolant_Cal_Num
(
DataCoolantTemp_Dis
.
u8_CurSeg
,
1
,
(
DataCoolantTemp_Dis
.
u8_Uptimer
-
DataCoolantTemp_Dis
.
u8_UpFlashtimer
),
u32ColCurNum
,
DataCoolantTemp
.
Value
*
10
);
u32ColCurNum
=
Data_Coolant_Cal_Num
(
DataCoolantTemp_Dis
.
u8_CurSeg
,
1
,
(
DataCoolantTemp_Dis
.
u8_Uptimer
-
DataCoolantTemp_Dis
.
u8_UpFlashtimer
),
u32ColCurNum
,
DataCoolantTemp
.
Value
*
10
0
);
DataCoolantTemp_Dis
.
u8_DownFlashtimer
=
0
;
DataCoolantTemp_Dis
.
u8_Holdtimer
=
0
;
DataCoolantTemp_Dis
.
u8_UpFlashtimer
++
;
...
...
@@ -311,7 +347,7 @@ void Data_Coolant_Temp_Display ( void )
}
/*目标格和当前格一致时,数显如何处理*/
/*5S后更新为目标数值*/
u32ColCurNum
=
Data_Coolant_Cal_Num
(
DataCoolantTemp_Dis
.
u8_CurSeg
,
2
,
(
CoolantFlashtimer
-
DataCoolantTemp_Dis
.
u8_Holdtimer
),
u32ColCurNum
,
DataCoolantTemp
.
Value
*
10
);
u32ColCurNum
=
Data_Coolant_Cal_Num
(
DataCoolantTemp_Dis
.
u8_CurSeg
,
2
,
(
CoolantFlashtimer
-
DataCoolantTemp_Dis
.
u8_Holdtimer
),
u32ColCurNum
,
DataCoolantTemp
.
Value
*
10
0
);
}
// warning
...
...
@@ -462,7 +498,7 @@ uint16_t GET_DataCoolantTempValueDisp(void)
}
uint16_t
GET_DataCoolantSegValue
(
void
)
{
return
u32ColCurNum
/
1
0
;
return
(
u32ColCurNum
)
/
10
0
;
}
uint8_t
GET_DataCollantTempValueValid
(
void
)
{
...
...
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