| | |
| | | |
| | | // 新增一条污染线索 |
| | | fun addClue(pollutedClue: PollutedClue) { |
| | | clueList.add(pollutedClue) |
| | | // 当溯源未找到风险源时,此次溯源信息不作为线索统计项 |
| | | if (pollutedClue.pollutedSource?.sceneList?.isNotEmpty() == true) |
| | | clueList.add(pollutedClue) |
| | | // realTimeSummary() |
| | | analysisOnClueCount() |
| | | } |
| | | |
| | | // 新增一条污染线索 |
| | | fun addClueList(pollutedClues: List<PollutedClue>) { |
| | | clueList.addAll(pollutedClues) |
| | | analysisOnClueCount() |
| | | pollutedClues.forEach { addClue(it) } |
| | | } |
| | | |
| | | // 刷新当前最新的走航监测数据 |
| | |
| | | |
| | | // 当前的走航数据的定位和污染源距离是否是逐渐接近,若走航远离了主要污染源,提示用户调整走航路线 |
| | | if (!result.sortedSceneList.isNullOrEmpty()) { |
| | | val sT = DateUtil.instance.dateToString(clueList.first().pollutedData?.startTime, DateUtil.DateStyle.HH_MM_SS) |
| | | val sT = |
| | | DateUtil.instance.dateToString(clueList.first().pollutedData?.startTime, DateUtil.DateStyle.HH_MM_SS) |
| | | val eT = DateUtil.instance.dateToString(clueList.last().pollutedData?.endTime, DateUtil.DateStyle.HH_MM_SS) |
| | | val closetScene = result.sortedSceneList?.first() |
| | | // 走航路线调整建议 |
| | |
| | | val origin = MapUtil.wgs84ToGcj02(lastP.longitude!!.toDouble() to lastP.latitude!!.toDouble()) |
| | | val destination = closetScene.first!!.longitude.toDouble() to closetScene.first!!.latitude.toDouble() |
| | | |
| | | // 建议的走航路线 |
| | | result.direction = AMapService.directionDriving(origin, destination) |
| | | if (config.isSearchAddress) { |
| | | // 建议的走航路线 |
| | | result.direction = AMapService.directionDriving(origin, destination) |
| | | } |
| | | } |
| | | // 线索分析完成后,移动至历史线索列表 |
| | | historyClueList.addAll(clueList) |