|
|
@@ -105,7 +105,7 @@ function _camerasToArmTypes(cameras) {
|
|
|
|
|
|
function _makeIntersectionConfig(id, name, { fixedNsGreen } = {}) {
|
|
|
const phases = ['南北直行', '东西直行', '北单放', '东单放']
|
|
|
- const nsGreen = fixedNsGreen !== undefined ? fixedNsGreen : true
|
|
|
+ const nsGreen = fixedNsGreen !== undefined ? fixedNsGreen : false
|
|
|
const countdown = 10 + Math.floor(Math.random() * 50)
|
|
|
const seed = id ? Array.from(id).reduce((s, c, i) => s + c.charCodeAt(0) * (i + 1), 0) : 0
|
|
|
|
|
|
@@ -324,7 +324,7 @@ export async function apiGetIntersectionData(id, { fixedNsGreen } = {}) {
|
|
|
const nowSec = Math.floor(Date.now() / 1000)
|
|
|
const cycle = 140
|
|
|
const elapsed = nowSec % cycle
|
|
|
- const nsGreenVal = fixedNsGreen !== undefined ? fixedNsGreen : true
|
|
|
+ const nsGreenVal = fixedNsGreen !== undefined ? fixedNsGreen : false
|
|
|
const nsGreen = nsGreenVal
|
|
|
|
|
|
const config = base ? {
|
|
|
@@ -742,7 +742,7 @@ export async function apiGetSpecialTaskMonitorData(id, { fixedNsGreen } = {}) {
|
|
|
const jncSeed = Array.from(jnc.id).reduce((s, c, idx) => s + c.charCodeAt(0) * (idx + 1), 0)
|
|
|
const cycle = [100, 120, 130, 140, 150][jncSeed % 5]
|
|
|
const elapsed = nowSec % cycle
|
|
|
- const nsGreen = fixedNsGreen !== undefined ? fixedNsGreen : true
|
|
|
+ const nsGreen = fixedNsGreen !== undefined ? fixedNsGreen : false
|
|
|
const countdown = Math.max(1, cycle - elapsed)
|
|
|
const laneSet = lanePresets[jncSeed % lanePresets.length]
|
|
|
|
|
|
@@ -786,7 +786,7 @@ export async function apiGetSpecialTaskMonitorData(id, { fixedNsGreen } = {}) {
|
|
|
export async function apiGetCrossingPanelData(id) {
|
|
|
await delay(300)
|
|
|
const point = DB.points.find(p => p.id === id)
|
|
|
- const config = DB.intersectionConfigs[id] || _makeIntersectionConfig(id, null, { fixedNsGreen: true })
|
|
|
+ const config = DB.intersectionConfigs[id] || _makeIntersectionConfig(id, null, { fixedNsGreen: false })
|
|
|
const seed = id ? id.charCodeAt(id.length - 1) : 0
|
|
|
|
|
|
const preset = DB.signalTimings[id]
|
|
|
@@ -813,7 +813,7 @@ export async function apiGetCrossingPanelData(id) {
|
|
|
export async function apiGetCrossingDetailData(id) {
|
|
|
await delay(350)
|
|
|
const point = DB.points.find(p => p.id === id)
|
|
|
- const config = DB.intersectionConfigs[id] || _makeIntersectionConfig(id, null, { fixedNsGreen: true })
|
|
|
+ const config = DB.intersectionConfigs[id] || _makeIntersectionConfig(id, null, { fixedNsGreen: false })
|
|
|
|
|
|
// 用 id 的全部字符生成稳定 seed(加权位置避免 charCode 总和碰撞)
|
|
|
const seed = id ? Array.from(id).reduce((s, c, i) => s + c.charCodeAt(0) * (i + 1), 0) : 0
|