
const historyed = ref(false) // 历史数据生成状态
const isMocking = ref(false) // 展现模式
const direct = ref(0) // 隧道方向
const scene = ref('section')
const traffic = ref(null)
const flows = ref([]) // 回溯车流
const running = ref(false)

const startFlows = () => {

  if (!traffic.value) return

  if (isMocking.value) {
    running.value = true
    traffic.value.startMook(flows.value)
  } else {
    // traffic.value.startTraffic()
  }
  
}

const flashClean = () => {

  traffic.value && traffic.value.cleanRoad()

  historyed.value = false
  isMocking.value = false
  direct.value = 0
  scene.value = 'section'
  traffic.value = null
  flows.value = []
  running.value = false

}

export {
  historyed,
  isMocking,
  direct,
  scene,
  ensign,
  flows,
  traffic,
  running,
  startFlows,
  flashClean
}