Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
signal
traffic-signal-platform
Commits
096311f7
Commit
096311f7
authored
Nov 10, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 优化倒计时行人
parent
07fb7658
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
HisensePhaseCountDownTask.java
...net/wanji/utc/hisense/task/HisensePhaseCountDownTask.java
+25
-4
No files found.
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/task/HisensePhaseCountDownTask.java
View file @
096311f7
...
@@ -122,9 +122,12 @@ public class HisensePhaseCountDownTask {
...
@@ -122,9 +122,12 @@ public class HisensePhaseCountDownTask {
}
}
Integer
type
=
lightsPOS
.
get
(
0
).
getType
();
Integer
type
=
lightsPOS
.
get
(
0
).
getType
();
redCountDown
=
changePhaseTime
-
runtime
-
phaseTime
;
redCountDown
=
changePhaseTime
-
runtime
-
phaseTime
;
if
(
redCountDown
<
0
)
{
if
(
redCountDown
<
=
0
)
{
redCountDown
=
cycleLen
-
runtime
;
redCountDown
=
cycleLen
-
runtime
;
}
}
//if (redCountDown <= 0) {
// redCountDown = 1;
//}
if
(
type
==
2
)
{
// 圆饼灯
if
(
type
==
2
)
{
// 圆饼灯
List
<
Integer
>
dirList
=
Arrays
.
asList
(
1
,
2
,
3
);
List
<
Integer
>
dirList
=
Arrays
.
asList
(
1
,
2
,
3
);
for
(
Integer
commonTurn
:
dirList
)
{
for
(
Integer
commonTurn
:
dirList
)
{
...
@@ -143,7 +146,7 @@ public class HisensePhaseCountDownTask {
...
@@ -143,7 +146,7 @@ public class HisensePhaseCountDownTask {
}
}
}
}
}
}
phaseMap
.
put
(
String
.
valueOf
(
dir
)
,
turnCountDown
);
setPhaseMap
(
phaseMap
,
dir
,
turnCountDown
);
}
}
}
else
{
}
else
{
Integer
cyclePhaseCountDown
=
lightsStatusVO
.
getCyclePhaseCountDown
();
Integer
cyclePhaseCountDown
=
lightsStatusVO
.
getCyclePhaseCountDown
();
...
@@ -178,7 +181,7 @@ public class HisensePhaseCountDownTask {
...
@@ -178,7 +181,7 @@ public class HisensePhaseCountDownTask {
}
}
}
}
}
}
phaseMap
.
put
(
String
.
valueOf
(
dir
)
,
turnCountDown
);
setPhaseMap
(
phaseMap
,
dir
,
turnCountDown
);
}
}
}
}
}
}
...
@@ -189,6 +192,23 @@ public class HisensePhaseCountDownTask {
...
@@ -189,6 +192,23 @@ public class HisensePhaseCountDownTask {
lightsStatusVO
.
setPhaseMap
(
phaseMap
);
lightsStatusVO
.
setPhaseMap
(
phaseMap
);
}
}
/**
* 统一方向转向倒计时
* @param phaseMap
* @param dir
* @param turnCountDown
*/
private
static
void
setPhaseMap
(
Map
<
String
,
Object
>
phaseMap
,
Integer
dir
,
Map
<
Integer
,
Integer
>
turnCountDown
)
{
String
dirStr
=
String
.
valueOf
(
dir
);
if
(!
phaseMap
.
isEmpty
()
&&
Objects
.
nonNull
(
phaseMap
.
get
(
dirStr
)))
{
Map
<
Integer
,
Integer
>
turnCountDownCahce
=
(
Map
<
Integer
,
Integer
>)
phaseMap
.
get
(
dirStr
);
turnCountDownCahce
.
putAll
(
turnCountDown
);
phaseMap
.
put
(
String
.
valueOf
(
dir
),
turnCountDown
);
}
else
{
phaseMap
.
put
(
String
.
valueOf
(
dir
),
turnCountDown
);
}
}
/**
/**
* @param crossId
* @param crossId
* @param lightsStatusVO
* @param lightsStatusVO
...
@@ -200,6 +220,7 @@ public class HisensePhaseCountDownTask {
...
@@ -200,6 +220,7 @@ public class HisensePhaseCountDownTask {
List
<
CrossPhasePO
>
nextSchemePhaseList
=
crossPhaseMapper
.
selectByCrossIdAndPlanId
(
crossId
,
String
.
valueOf
(
crossSchemePO
.
getId
()));
List
<
CrossPhasePO
>
nextSchemePhaseList
=
crossPhaseMapper
.
selectByCrossIdAndPlanId
(
crossId
,
String
.
valueOf
(
crossSchemePO
.
getId
()));
Integer
phaseTime
=
0
;
Integer
phaseTime
=
0
;
String
phaseId
=
null
;
String
phaseId
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
nextSchemePhaseList
))
{
if
(!
CollectionUtils
.
isEmpty
(
nextSchemePhaseList
))
{
for
(
CrossPhasePO
crossPhasePO
:
nextSchemePhaseList
)
{
for
(
CrossPhasePO
crossPhasePO
:
nextSchemePhaseList
)
{
if
(
Objects
.
equals
(
1
,
crossPhasePO
.
getSort
()))
{
if
(
Objects
.
equals
(
1
,
crossPhasePO
.
getSort
()))
{
...
@@ -357,7 +378,7 @@ public class HisensePhaseCountDownTask {
...
@@ -357,7 +378,7 @@ public class HisensePhaseCountDownTask {
turnColor
.
put
(
turn
,
"red"
);
turnColor
.
put
(
turn
,
"red"
);
}
}
}
}
if
(
cyclePhaseCountDown
<
redTime
)
{
if
(
cyclePhaseCountDown
<
=
redTime
)
{
color
=
"red"
;
color
=
"red"
;
if
(
turn
==
20
)
{
if
(
turn
==
20
)
{
turnColor
.
put
(
turn
,
"green"
);
turnColor
.
put
(
turn
,
"green"
);
...
...
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