| | |
| | | var exceptionData = mutableListOf<BaseRealTimeData>() |
| | | |
| | | // 是否存在异常 |
| | | var existException = false |
| | | var exceptionExisted = false |
| | | |
| | | fun refreshAfterCheckResult(data: BaseRealTimeData) { |
| | | // 判断并更新起始点位置 |
| | |
| | | if (tempDataList.size == config.changeTrendGroup) { |
| | | calAvg(f, tempDataList) |
| | | if (checkSlideAvg(f)) { |
| | | it.existException = true |
| | | it.exceptionExisted = true |
| | | it.exceptionData.add(data) |
| | | } else { |
| | | checkResult(s) |
| | |
| | | private fun checkResult(factor: FactorFilter.SelectedFactor? = null) { |
| | | val tag = tagMap[factor?.main] |
| | | if (factor != null && tag != null) { |
| | | if (tag.existException) { |
| | | if (tag.exceptionExisted) { |
| | | tag.startData?.let { |
| | | resultList.add(newResult(it, lastData, factor, tag.exceptionData)) |
| | | } |
| | | tag.existException = false |
| | | tag.exceptionExisted = false |
| | | } |
| | | } else { |
| | | config.factorFilter.selectedList.forEach { f -> |
| | | val tag1 = tagMap[f.main] ?: return@forEach |
| | | if (tag1.existException) { |
| | | if (tag1.exceptionExisted) { |
| | | tag1.startData?.let { |
| | | resultList.add(newResult(it, lastData, f, tag1.exceptionData)) |
| | | } |
| | | tag1.existException = false |
| | | tag1.exceptionExisted = false |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | fun newResult( |
| | | override fun newResult( |
| | | start: BaseRealTimeData, |
| | | end: BaseRealTimeData?, |
| | | factor: FactorFilter.SelectedFactor, |