zmc
2023-11-02 6f28997aa8d9f62e0c54838490a473041f709742
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.flightfeather.monitor.analysis.dust
 
import com.flightfeather.monitor.domain.ds1.entity.DustExceptionData
import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting
import com.flightfeather.monitor.domain.ds1.entity.DustSiteData
import com.flightfeather.monitor.enumration.dust.ExceptionType
 
/**
 * 数据超低异常分析
 */
class ExceptionDataLowValue(config: DustExceptionSetting) : BaseExceptionContinuous(config) {
 
    override fun getExceptionType(): ExceptionType = ExceptionType.TYPE1
 
    override fun judgeException(p: DustSiteData?, n: DustSiteData): Boolean {
        return n.dustValue <= config.dataLow
    }
 
    override fun judgeDuration(sIndex: Int, eIndex: Int): Boolean {
        return true
    }
 
    override fun newResult(p: DustSiteData, n: DustSiteData?): DustExceptionData {
        val eType = getExceptionType()
        return DustExceptionData().apply {
            mnCode = p.mnCode
            exception = eType.des
            exceptionType = eType.value
            region = config.region
            beginTime = n?.lst
            endTime = n?.lst
        }
    }
}