| | |
| | | } |
| | | // 判断相邻数据是否连续并且是否满足异常判断 |
| | | if (!isContinue || needCut(it)) { |
| | | checkResult(s) |
| | | // 数据不连续时,记录异常情况 |
| | | if (it.eIndex - it.sIndex >= durationCount) { |
| | | it.refreshAfterCheckResult(data) |
| | | } |
| | | recordException(s, it, data) |
| | | // checkResult(s) |
| | | // if (it.eIndex - it.sIndex >= durationCount) { |
| | | // it.refreshAfterCheckResult(data) |
| | | // } |
| | | } else { |
| | | if (hasException[f] == true) { |
| | | it.existException = true |
| | | it.exceptionData.add(data) |
| | | } else { |
| | | // 异常不再重复出现时,记录异常情况 |
| | | checkResult(s) |
| | | if (it.eIndex - it.sIndex >= durationCount) { |
| | | it.refreshAfterCheckResult(data) |
| | | } |
| | | recordException(s, it, data) |
| | | // checkResult(s) |
| | | // if (it.eIndex - it.sIndex >= durationCount) { |
| | | // it.refreshAfterCheckResult(data) |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | checkResult() |
| | | } |
| | | |
| | | fun recordException(factor: FactorFilter.SelectedFactor, tag: Tag, data: BaseRealTimeData) { |
| | | checkResult(factor) |
| | | if (tag.eIndex - tag.sIndex >= durationCount) { |
| | | tag.refreshAfterCheckResult(data) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 检查连续异常结束时,是否符合异常存储条件 |
| | | */ |
| | |
| | | if (factor != null && tag != null) { |
| | | if (tag.existException && judgeExceptionCount(tag)) { |
| | | onNewException(tag, factor) |
| | | // tag.startData?.let { |
| | | // resultList.add(newResult(it, lastData, factor, tag.exceptionData)) |
| | | // } |
| | | // tag.existException = false |
| | | } |
| | | } else { |
| | | config.factorFilter.selectedList.forEach { f -> |
| | | val tag1 = tagMap[f.main] ?: return@forEach |
| | | if (tag1.existException && judgeExceptionCount(tag1)) { |
| | | onNewException(tag1, f) |
| | | // tag1.startData?.let { |
| | | // resultList.add(newResult(it, lastData, f, tag1.exceptionData)) |
| | | // } |
| | | // tag1.existException = false |
| | | } |
| | | } |
| | | } |