Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
ZHHT-IRN-BD-ANALYSIS
Project
Overview
Details
Activity
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
李凯旋
ZHHT-IRN-BD-ANALYSIS
Commits
8c718acb
Commit
8c718acb
authored
Nov 02, 2022
by
黄准
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxb
parent
3fe1e1b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
LaneNormJob.java
...treaming/src/main/java/com/zhht/irn/flow/LaneNormJob.java
+4
-5
No files found.
realtime/hologram-streaming/src/main/java/com/zhht/irn/flow/LaneNormJob.java
View file @
8c718acb
...
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.zhht.irn.entity.Car
;
import
com.zhht.irn.entity.Car
;
import
com.zhht.irn.entity.Cycle
;
import
com.zhht.irn.entity.Cycle
;
import
com.zhht.irn.entity.LaneNorm
;
import
com.zhht.irn.entity.LaneNorm
;
import
com.zhht.irn.entity.
Phas
e
;
import
com.zhht.irn.entity.
Stag
e
;
import
com.zhht.irn.sink.LXBSink
;
import
com.zhht.irn.sink.LXBSink
;
import
com.zhht.irn.sink.LaneNormSink
;
import
com.zhht.irn.sink.LaneNormSink
;
import
com.zhht.irn.source.CarSource
;
import
com.zhht.irn.source.CarSource
;
...
@@ -55,7 +55,7 @@ public class LaneNormJob {
...
@@ -55,7 +55,7 @@ public class LaneNormJob {
//根据corssid 分组 保证同一路口的数据进行一个进程
//根据corssid 分组 保证同一路口的数据进行一个进程
DataStream
<
Cycle
>
cycleDataStreamSource
=
env
.
addSource
(
new
CirlceSource
()).
DataStream
<
Cycle
>
cycleDataStreamSource
=
env
.
addSource
(
new
CirlceSource
()).
assignTimestampsAndWatermarks
(
WatermarkStrategy
.<
Cycle
>
forBoundedOutOfOrderness
((
Duration
.
ofSeconds
(
3
))).
withTimestampAssigner
((
cycle
,
timestamp
)
->
DateUtils
.
dateToStamp
(
cycle
.
getEndTime
())))
assignTimestampsAndWatermarks
(
WatermarkStrategy
.<
Cycle
>
forBoundedOutOfOrderness
((
Duration
.
ofSeconds
(
3
))).
withTimestampAssigner
((
cycle
,
timestamp
)
->
DateUtils
.
dateToStamp
(
cycle
.
getEnd
Date
Time
())))
.
keyBy
(
new
KeySelector
<
Cycle
,
String
>()
{
.
keyBy
(
new
KeySelector
<
Cycle
,
String
>()
{
@Override
@Override
public
String
getKey
(
Cycle
cycle
)
throws
Exception
{
public
String
getKey
(
Cycle
cycle
)
throws
Exception
{
...
@@ -144,8 +144,8 @@ public class LaneNormJob {
...
@@ -144,8 +144,8 @@ public class LaneNormJob {
double
cycleGreenRatio
=
0
;
double
cycleGreenRatio
=
0
;
//周期有效绿灯时间
//周期有效绿灯时间
double
cycleVaildGreen
=
0
;
double
cycleVaildGreen
=
0
;
List
<
Phase
>
phaseList
=
cycle
.
getPhas
eList
();
List
<
Stage
>
phaseList
=
cycle
.
getStag
eList
();
for
(
Phas
e
phase
:
phaseList
)
{
for
(
Stag
e
phase
:
phaseList
)
{
//相位号
//相位号
String
phaseValue
=
phase
.
getPhaseValue
();
String
phaseValue
=
phase
.
getPhaseValue
();
// 绿灯时间
// 绿灯时间
...
@@ -175,7 +175,6 @@ public class LaneNormJob {
...
@@ -175,7 +175,6 @@ public class LaneNormJob {
// 组装周期绿信比
// 组装周期绿信比
cycle
.
setGreenRatio
(
cycleGreenRatio
);
cycle
.
setGreenRatio
(
cycleGreenRatio
);
//组装周期绿灯有效时间
//组装周期绿灯有效时间
cycle
.
setVaildGreen
(
cycleVaildGreen
);
return
cycle
;
return
cycle
;
}
}
}
}
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