openatc-components 0.4.31 → 0.4.33

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.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.4.31",
3
+ "version": "0.4.33",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -441,8 +441,12 @@ export default {
441
441
  this.curPhase = val.current_phase
442
442
  this.curStage = val.current_stage
443
443
  this.isHasPhase = true
444
- this.createPhaseStatusMap()
445
- this.createOverlapPhaseStatusMap()
444
+ if (val.phase) {
445
+ this.createPhaseStatusMap()
446
+ }
447
+ if (val.overlap) {
448
+ this.createOverlapPhaseStatusMap()
449
+ }
446
450
  // 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
447
451
  this.getPhaseStatus()
448
452
  this.getOverlapPhaseStatus()
@@ -1185,6 +1185,7 @@ export default {
1185
1185
  let minLength = Math.min(...ringlength)
1186
1186
  let resultArrs = [] // 环1分组
1187
1187
  let resultArr = [] // 环2分组
1188
+ let resultArrThree = [] // 环3分组
1188
1189
  for (let j = 0; j < ringsequence[0].length; j += minLength) {
1189
1190
  resultArrs.push(ringsequence[0].slice(j, j + minLength))
1190
1191
  if (ringsequence[0].length === minLength) {
@@ -1195,6 +1196,9 @@ export default {
1195
1196
  for (let i = 0; i < ringsequence[1].length; i += minLength) {
1196
1197
  resultArr.push(ringsequence[1].slice(i, i + minLength))
1197
1198
  }
1199
+ for (let k = 0; k < ringsequence[2].length; k += minLength) {
1200
+ resultArrThree.push(ringsequence[2].slice(k, k + minLength))
1201
+ }
1198
1202
  }
1199
1203
  this.patternInfo = []
1200
1204
  this.barrierList = []
@@ -1220,9 +1224,10 @@ export default {
1220
1224
  }
1221
1225
  if (currentArr.length !== 0) {
1222
1226
  let newCurrent = this.tranform(currentArr)
1223
- // 取没个环与环关系的并集
1227
+ // 取每个环与环关系的并集
1224
1228
  let barrierRing1 = []
1225
1229
  let barrierRing2 = []
1230
+ let barrierRing3 = []
1226
1231
  let ring1 = [] // 环1与关系1的并集
1227
1232
  for (let h = 0; h < newCurrent.length; h++) {
1228
1233
  let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
@@ -1247,8 +1252,20 @@ export default {
1247
1252
  ring2.push(add)
1248
1253
  }
1249
1254
  barrierRing2.push(...ring2, ...ring2s)
1255
+ // 环3
1256
+ let ring3s = [] // 环3与关系1的并集
1257
+ for (let h = 0; h < newCurrent.length; h++) {
1258
+ let addRing2 = [...new Set(resultArrThree[1])].filter(item => newCurrent[h].includes(item))
1259
+ ring3s.push(addRing2)
1260
+ }
1261
+ let ring3 = [] // 环3与关系1的并集
1262
+ for (let h = 0; h < newCurrent.length; h++) {
1263
+ let add = [...new Set(resultArrThree[0])].filter(item => newCurrent[h].includes(item))
1264
+ ring3.push(add)
1265
+ }
1266
+ barrierRing3.push(...ring3, ...ring3s)
1250
1267
  for (let k = 0; k < barrierRing1.length; k++) {
1251
- resultList.push(barrierRing1[k].concat(barrierRing2[k]))
1268
+ resultList.push(barrierRing1[k].concat(barrierRing2[k]).concat(barrierRing3[k]))
1252
1269
  }
1253
1270
  }
1254
1271
  let resultLists = resultList.filter(item => item.length !== 0)