add constants varibale of power system events

This commit is contained in:
douxu 2026-02-12 17:09:08 +08:00
parent 1c385ee60d
commit 56b9999d6b
2 changed files with 72 additions and 22 deletions

View File

@ -1,31 +1,50 @@
// Package constants define constant variable // Package constants define constant variable
package constants package constants
const ( // EvenvtType define event type
// TIBreachTriggerType define out of bounds type constant type EvenvtType int
TIBreachTriggerType = "trigger"
)
const ( const (
// TelemetryUpLimit define telemetry upper limit // EventGeneralHard define gereral hard event type
TelemetryUpLimit = "up" EventGeneralHard EvenvtType = iota
// TelemetryUpUpLimit define telemetry upper upper limit // EventGeneralPlatformSoft define gereral platform soft event type
TelemetryUpUpLimit = "upup" EventGeneralPlatformSoft
// EventGeneralApplicationSoft define gereral application soft event type
// TelemetryDownLimit define telemetry limit EventGeneralApplicationSoft
TelemetryDownLimit = "down" // EventWarnHard define warn hard event type
// TelemetryDownDownLimit define telemetry lower lower limit EventWarnHard
TelemetryDownDownLimit = "downdown" // EventWarnPlatformSoft define warn platform soft event type
EventWarnPlatformSoft
// EventWarnApplicationSoft define warn application soft event type
EventWarnApplicationSoft
// EventCriticalHard define critical hard event type
EventCriticalHard
// EventCriticalPlatformSoft define critical platform soft event type
EventCriticalPlatformSoft
// EventCriticalApplicationSoft define critical application soft event type
EventCriticalApplicationSoft
) )
// IsGeneral define fucn to check event type is general
func IsGeneral(eventType EvenvtType) bool {
return eventType < 3
}
// IsWarning define fucn to check event type is warn
func IsWarning(eventType EvenvtType) bool {
return eventType >= 3 && eventType <= 5
}
// IsCritical define fucn to check event type is critical
func IsCritical(eventType EvenvtType) bool {
return eventType >= 6
}
const ( const (
// TelesignalRaising define telesignal raising edge // EventFromStation define event from station type
TelesignalRaising = "raising" EventFromStation = "station"
// TelesignalFalling define telesignal falling edge // EventFromPlatform define event from platform type
TelesignalFalling = "falling" EventFromPlatform = "platform"
) // EventFromOthers define event from others type
EventFromOthers = "others"
const (
// MinBreachCount define min breach count of real time data
MinBreachCount = 10
) )

View File

@ -0,0 +1,31 @@
// Package constants define constant variable
package constants
const (
// TIBreachTriggerType define out of bounds type constant
TIBreachTriggerType = "trigger"
)
const (
// TelemetryUpLimit define telemetry upper limit
TelemetryUpLimit = "up"
// TelemetryUpUpLimit define telemetry upper upper limit
TelemetryUpUpLimit = "upup"
// TelemetryDownLimit define telemetry limit
TelemetryDownLimit = "down"
// TelemetryDownDownLimit define telemetry lower lower limit
TelemetryDownDownLimit = "downdown"
)
const (
// TelesignalRaising define telesignal raising edge
TelesignalRaising = "raising"
// TelesignalFalling define telesignal falling edge
TelesignalFalling = "falling"
)
const (
// MinBreachCount define min breach count of real time data
MinBreachCount = 10
)