openatc-components 0.3.18 → 0.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +26 -7
- package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +85 -81
- package/package/kissui.min.js +1 -1
- package/package.json +1 -1
- package/src/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +26 -7
- package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +85 -81
- package/src/views/intersection.vue +71 -2
package/package.json
CHANGED
package/src/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue
CHANGED
|
@@ -19,12 +19,15 @@
|
|
|
19
19
|
:crossStatusData="crossStatusData"
|
|
20
20
|
:agentId="agentId"
|
|
21
21
|
:graphicMode="true"
|
|
22
|
-
:roadDirection="roadDirection"
|
|
22
|
+
:roadDirection="roadDirection"
|
|
23
|
+
:isThirdSignal="isThirdSignal"/>
|
|
23
24
|
</div>
|
|
24
25
|
</template>
|
|
25
26
|
|
|
26
27
|
<script>
|
|
27
28
|
import IntersectionMap from '../IntersectionMap/intersectionmap'
|
|
29
|
+
import { queryDevice } from '../../../api/control.js'
|
|
30
|
+
import { getMessageByCode } from '../../../utils/responseMessage.js'
|
|
28
31
|
|
|
29
32
|
export default {
|
|
30
33
|
name: 'channel-realtime-intersection',
|
|
@@ -77,19 +80,35 @@ export default {
|
|
|
77
80
|
data () {
|
|
78
81
|
return {
|
|
79
82
|
reset: true,
|
|
80
|
-
crossStatusData: {}
|
|
83
|
+
crossStatusData: {},
|
|
84
|
+
isThirdSignal: false
|
|
81
85
|
}
|
|
82
86
|
},
|
|
83
87
|
methods: {
|
|
84
|
-
|
|
88
|
+
getPlatform () {
|
|
89
|
+
queryDevice(this.agentId).then(res => {
|
|
90
|
+
if (!res.data.success) {
|
|
91
|
+
let commomMsg = this.$t('openatc.overview.signalID') + ': ' + this.AgentId
|
|
92
|
+
this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale) + ' - ' + commomMsg)
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
this.platform = res.data.data.platform
|
|
96
|
+
console.log(this.platform)
|
|
97
|
+
if (this.platform !== '' && this.platform !== 'OpenATC') {
|
|
98
|
+
this.isThirdSignal = true
|
|
99
|
+
} else {
|
|
100
|
+
this.isThirdSignal = false
|
|
101
|
+
}
|
|
102
|
+
if (this.thirdSignal) {
|
|
103
|
+
this.isThirdSignal = this.thirdSignal
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}
|
|
85
107
|
},
|
|
86
108
|
created () {
|
|
87
109
|
},
|
|
88
110
|
mounted () {
|
|
89
|
-
|
|
90
|
-
// 模拟
|
|
91
|
-
// this.crossStatusData = JSON.parse(JSON.stringify(this.channelRealtimeStatusData))
|
|
92
|
-
// }, 3000)
|
|
111
|
+
this.getPlatform()
|
|
93
112
|
this.crossStatusData = JSON.parse(JSON.stringify(this.channelRealtimeStatusData))
|
|
94
113
|
},
|
|
95
114
|
destroyed () {
|
|
@@ -287,64 +287,15 @@ export default {
|
|
|
287
287
|
this.statusData = JSON.parse(JSON.stringify(val))
|
|
288
288
|
// 默认显示相位数据(包括黄闪、全红、关灯状态下,或者匝道,均不做比对跟随相位的处理)
|
|
289
289
|
this.drawDefaultPhaseIcon()
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
// 通道路口图状态数据
|
|
290
|
+
if (this.channelType && !this.isThirdSignal) {
|
|
291
|
+
// 通道路口图状态数据(实时通道展示排除第三方信号机,第三方信号机还是按模版路口一样展示相位状态)
|
|
293
292
|
this.channelStatusList = val.channellamp
|
|
294
293
|
this.createChannelStatusMap()
|
|
295
294
|
this.getChannelPhaseStatus()
|
|
296
295
|
this.getChannelPedStatus()
|
|
297
296
|
return
|
|
298
297
|
}
|
|
299
|
-
|
|
300
|
-
// 模版路口图状态数据
|
|
301
|
-
this.phaseStatusList = val.phase
|
|
302
|
-
this.overlapStatusList = val.overlap
|
|
303
|
-
if (val.control === 1 || val.control === 2 || val.control === 3) {
|
|
304
|
-
// 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
|
|
305
|
-
if (val.control === 1) {
|
|
306
|
-
this.getYellowFlashColor()
|
|
307
|
-
} else {
|
|
308
|
-
this.SpecialControl(val)
|
|
309
|
-
}
|
|
310
|
-
this.isHasPhase = false
|
|
311
|
-
return
|
|
312
|
-
}
|
|
313
|
-
if (!val.phase && !this.overlapStatusList) {
|
|
314
|
-
// 非特殊控制,相位和跟随相位不存在的情况下,灯色恢复默认
|
|
315
|
-
this.handleSpecialControlStatus('默认')
|
|
316
|
-
this.isHasPhase = false
|
|
317
|
-
return
|
|
318
|
-
}
|
|
319
|
-
if (val.control === 16) {
|
|
320
|
-
// 方向锁定时,相位状态显示与通道无关,显示接口返回的红灯会有歧义,此处特殊处理显示默认白色
|
|
321
|
-
this.handleSpecialControlStatus('方向锁定')
|
|
322
|
-
this.isHasPhase = false
|
|
323
|
-
return
|
|
324
|
-
}
|
|
325
|
-
this.curPhase = val.current_phase
|
|
326
|
-
this.isHasPhase = true
|
|
327
|
-
this.createPhaseStatusMap()
|
|
328
|
-
// 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
|
|
329
|
-
this.getPhaseStatus()
|
|
330
|
-
this.getOverlapPhaseStatus()
|
|
331
|
-
this.getCurPhaseCountdown()
|
|
332
|
-
this.getBusPhaseStatus()
|
|
333
|
-
if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
|
|
334
|
-
// 城市道路和路段行人过街才显示人行道状态
|
|
335
|
-
this.getpedStatus()
|
|
336
|
-
this.getOverlapPedStatus()
|
|
337
|
-
// 算法对比行人相位与行人跟随相位的状态
|
|
338
|
-
this.comparePedStatus()
|
|
339
|
-
// 算法对比车道相位与车道跟随相位的状态
|
|
340
|
-
this.comparePhaseStatus()
|
|
341
|
-
}
|
|
342
|
-
// console.log('this.phaseStatusMap 相位状态映射', this.phaseStatusMap)
|
|
343
|
-
// console.log('LanePhaseData 车道相位', this.LanePhaseData)
|
|
344
|
-
// console.log('sidewalkPhaseData 行人相位', this.sidewalkPhaseData)
|
|
345
|
-
// console.log('overlapPhaseStatusMap 跟随相位状态映射', this.overlapPhaseStatusMap)
|
|
346
|
-
// console.log('overlapLanePhaseData 车道跟随相位', this.overlapLanePhaseData)
|
|
347
|
-
// console.log('this.overlapsidewalkPhaseData 行人跟随相位', this.overlapsidewalkPhaseData)
|
|
298
|
+
this.handleTempCrossStatus(val)
|
|
348
299
|
},
|
|
349
300
|
// 深度观察监听
|
|
350
301
|
deep: true
|
|
@@ -414,6 +365,56 @@ export default {
|
|
|
414
365
|
}
|
|
415
366
|
},
|
|
416
367
|
methods: {
|
|
368
|
+
handleTempCrossStatus (val) {
|
|
369
|
+
// 模版路口图状态数据
|
|
370
|
+
this.phaseStatusList = val.phase
|
|
371
|
+
this.overlapStatusList = val.overlap
|
|
372
|
+
if (val.control === 1 || val.control === 2 || val.control === 3) {
|
|
373
|
+
// 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
|
|
374
|
+
if (val.control === 1) {
|
|
375
|
+
this.getYellowFlashColor()
|
|
376
|
+
} else {
|
|
377
|
+
this.SpecialControl(val)
|
|
378
|
+
}
|
|
379
|
+
this.isHasPhase = false
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
if (!val.phase && !this.overlapStatusList) {
|
|
383
|
+
// 非特殊控制,相位和跟随相位不存在的情况下,灯色恢复默认
|
|
384
|
+
this.handleSpecialControlStatus('默认')
|
|
385
|
+
this.isHasPhase = false
|
|
386
|
+
return
|
|
387
|
+
}
|
|
388
|
+
if (val.control === 16) {
|
|
389
|
+
// 方向锁定时,相位状态显示与通道无关,显示接口返回的红灯会有歧义,此处特殊处理显示默认白色
|
|
390
|
+
this.handleSpecialControlStatus('方向锁定')
|
|
391
|
+
this.isHasPhase = false
|
|
392
|
+
return
|
|
393
|
+
}
|
|
394
|
+
this.curPhase = val.current_phase
|
|
395
|
+
this.isHasPhase = true
|
|
396
|
+
this.createPhaseStatusMap()
|
|
397
|
+
// 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
|
|
398
|
+
this.getPhaseStatus()
|
|
399
|
+
this.getOverlapPhaseStatus()
|
|
400
|
+
this.getCurPhaseCountdown()
|
|
401
|
+
this.getBusPhaseStatus()
|
|
402
|
+
if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
|
|
403
|
+
// 城市道路和路段行人过街才显示人行道状态
|
|
404
|
+
this.getpedStatus()
|
|
405
|
+
this.getOverlapPedStatus()
|
|
406
|
+
// 算法对比行人相位与行人跟随相位的状态
|
|
407
|
+
this.comparePedStatus()
|
|
408
|
+
// 算法对比车道相位与车道跟随相位的状态
|
|
409
|
+
this.comparePhaseStatus()
|
|
410
|
+
}
|
|
411
|
+
// console.log('this.phaseStatusMap 相位状态映射', this.phaseStatusMap)
|
|
412
|
+
// console.log('LanePhaseData 车道相位', this.LanePhaseData)
|
|
413
|
+
// console.log('sidewalkPhaseData 行人相位', this.sidewalkPhaseData)
|
|
414
|
+
// console.log('overlapPhaseStatusMap 跟随相位状态映射', this.overlapPhaseStatusMap)
|
|
415
|
+
// console.log('overlapLanePhaseData 车道跟随相位', this.overlapLanePhaseData)
|
|
416
|
+
// console.log('this.overlapsidewalkPhaseData 行人跟随相位', this.overlapsidewalkPhaseData)
|
|
417
|
+
},
|
|
417
418
|
init () {
|
|
418
419
|
this.CrossDiagramMgr = new CrossDiagramMgr()
|
|
419
420
|
this.getRoadDirection()
|
|
@@ -729,40 +730,43 @@ export default {
|
|
|
729
730
|
this.getChannelInfo()
|
|
730
731
|
return
|
|
731
732
|
}
|
|
732
|
-
if (this.channelType) {
|
|
733
|
+
if (this.channelType && !this.isThirdSignal) {
|
|
733
734
|
this.getChannelInfo()
|
|
734
735
|
return
|
|
735
736
|
}
|
|
736
|
-
this.
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
if (!this.isVipRoute && this.mainType === '103') {
|
|
749
|
-
// 获取匝道道路的主路和支路的相位坐标
|
|
750
|
-
this.getRampPhasePos()
|
|
751
|
-
}
|
|
737
|
+
this.getTempCrossInfo(res)
|
|
738
|
+
})
|
|
739
|
+
},
|
|
740
|
+
getTempCrossInfo (res) {
|
|
741
|
+
this.crossInfo = res.data.data.param
|
|
742
|
+
this.crossInfo.phaseList.forEach(cross => this.phaseDirMap.set(cross.id, {direction: cross.direction, peddirection: cross.peddirection}))
|
|
743
|
+
if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
|
|
744
|
+
// 城市道路加载车道相位坐标和人行道坐标
|
|
745
|
+
this.getPhasePos()
|
|
746
|
+
this.getOverlapPhasePos()
|
|
747
|
+
this.getPedPhasePos()
|
|
748
|
+
this.getOverlapPedPhasePos()
|
|
752
749
|
if (!this.isVipRoute) {
|
|
753
|
-
this.
|
|
750
|
+
this.getBusPos()
|
|
754
751
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
752
|
+
}
|
|
753
|
+
if (!this.isVipRoute && this.mainType === '103') {
|
|
754
|
+
// 获取匝道道路的主路和支路的相位坐标
|
|
755
|
+
this.getRampPhasePos()
|
|
756
|
+
}
|
|
757
|
+
if (!this.isVipRoute) {
|
|
758
|
+
this.drawDefaultPhaseIcon()
|
|
759
|
+
}
|
|
760
|
+
if (this.isVipRoute && this.isThirdSignal) {
|
|
761
|
+
this.LanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')
|
|
762
|
+
// console.log(this.LanePhaseData)
|
|
763
|
+
this.sidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')
|
|
764
|
+
let allDir = this.LanePhaseData.map(ele => ele.id)
|
|
765
|
+
let allPedDir = this.sidewalkPhaseData.map(ele => ele.id)
|
|
766
|
+
this.inneChoosedDirection = this.choosedDirection.filter(dir => allDir.indexOf(dir) !== -1)
|
|
767
|
+
this.inneChoosedPedDirection = this.choosedPedDirection.filter(dir => allPedDir.indexOf(dir) !== -1)
|
|
768
|
+
this.drawPhaseIcon()
|
|
769
|
+
}
|
|
766
770
|
},
|
|
767
771
|
getBusPos () {
|
|
768
772
|
// 公交相位信息
|
|
@@ -161,12 +161,12 @@ export default {
|
|
|
161
161
|
return {
|
|
162
162
|
roadDirection: 'right',
|
|
163
163
|
// reqUrl: 'http://192.168.13.103:10003/openatc',
|
|
164
|
-
agentId: '
|
|
164
|
+
agentId: '12008_ticp',
|
|
165
165
|
// agentId: '13013',
|
|
166
166
|
// agentId: '12007_390',
|
|
167
167
|
// agentId: '12014',
|
|
168
168
|
reqUrl: 'http://192.168.13.103:10003/openatc',
|
|
169
|
-
Token: '
|
|
169
|
+
Token: 'eyJraWQiOiIxNzIxOTcwMTEzMTMwIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcyMTk3MzcxMywiaWF0IjoxNzIxOTY2NTEzfQ.aT14xZel09fHji-SrPMDTPAxISEUS8Y6KF30BWjCGKY',
|
|
170
170
|
// agentId: '30003-352',
|
|
171
171
|
// reqUrl: 'https://kints-dev.devdolphin.com/openatc',
|
|
172
172
|
// Token: 'eyJraWQiOiIxNjUwNTA5MDI2ODk2IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJ4aWFvbWluZyIsImV4cCI6MTczNjkwOTAyNiwiaWF0IjoxNjUwNTA5MDI2fQ.-s4T-uMRmB2zf9yer87USKQXLY1a12Zq5lCOnqjNmfA',
|
|
@@ -209,6 +209,72 @@ export default {
|
|
|
209
209
|
}
|
|
210
210
|
],
|
|
211
211
|
crossStatusData: {},
|
|
212
|
+
crossStatusDataMock:
|
|
213
|
+
{
|
|
214
|
+
'agentid': '12008_ticp',
|
|
215
|
+
'operation': 'get-request',
|
|
216
|
+
'infotype': 'status/pattern',
|
|
217
|
+
'data': {
|
|
218
|
+
'phase': [
|
|
219
|
+
{
|
|
220
|
+
'id': 1,
|
|
221
|
+
'type': 1,
|
|
222
|
+
'pedtype': 1
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
'id': 3,
|
|
226
|
+
'type': 1,
|
|
227
|
+
'pedtype': 1
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
'id': 4,
|
|
231
|
+
'type': 1,
|
|
232
|
+
'pedtype': 1
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
'id': 6,
|
|
236
|
+
'type': 3,
|
|
237
|
+
'pedtype': 3
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
'mode': 0,
|
|
241
|
+
'control': 5,
|
|
242
|
+
'patternid': 2,
|
|
243
|
+
'cycle': 141,
|
|
244
|
+
'stages': [
|
|
245
|
+
[
|
|
246
|
+
1
|
|
247
|
+
],
|
|
248
|
+
[
|
|
249
|
+
4,
|
|
250
|
+
3
|
|
251
|
+
],
|
|
252
|
+
[
|
|
253
|
+
6
|
|
254
|
+
]
|
|
255
|
+
],
|
|
256
|
+
'stages_len': [
|
|
257
|
+
70,
|
|
258
|
+
25,
|
|
259
|
+
46
|
|
260
|
+
],
|
|
261
|
+
'stages_seq': [
|
|
262
|
+
1,
|
|
263
|
+
2,
|
|
264
|
+
3
|
|
265
|
+
],
|
|
266
|
+
'current_stage': 3,
|
|
267
|
+
'current_stagecd': 15,
|
|
268
|
+
'offset': 0,
|
|
269
|
+
'current_phase': [
|
|
270
|
+
6
|
|
271
|
+
],
|
|
272
|
+
'next_phase': [
|
|
273
|
+
1
|
|
274
|
+
],
|
|
275
|
+
'curTime': 127
|
|
276
|
+
}
|
|
277
|
+
},
|
|
212
278
|
channelRealtimeStatusData: {
|
|
213
279
|
'channellamp': [
|
|
214
280
|
{
|
|
@@ -402,6 +468,9 @@ export default {
|
|
|
402
468
|
}
|
|
403
469
|
this.getTscControlData()
|
|
404
470
|
this.getCurPhaseDirection()
|
|
471
|
+
// setTimeout(() => {
|
|
472
|
+
// this.crossStatusData = this.crossStatusDataMock.data
|
|
473
|
+
// }, 1000)
|
|
405
474
|
},
|
|
406
475
|
destroyed () {
|
|
407
476
|
}
|