ISCS环境与设备监控系统ecs定义

This commit is contained in:
xzb 2023-12-13 17:54:23 +08:00
parent e27ccfd184
commit 1d183dfa12
2 changed files with 6 additions and 0 deletions

View File

@ -171,6 +171,7 @@ var (
var (
DevicePlacingOverhaulCardTag = ecs.NewTag() //设备置牌:检修
DevicePlacingLandingCardTag = ecs.NewTag() //设备置牌:接地
DevicePlacingHandTag = ecs.NewTag() //设备置牌:就地(手型牌)
DevicePlacingOtherCardTag = ecs.NewTag() //设备置牌:其他
)

View File

@ -15,6 +15,7 @@ const (
PlacingNonCard PlacingCardOptEnum = iota
PlacingOverhaulCard
PlacingLandingCard
PlacingHandCard
PlacingOtherCard
)
@ -30,6 +31,7 @@ func DevicePlacingCardOperate(w ecs.World, deviceId string, placingCard PlacingC
deviceEntry.RemoveComponent(component.DevicePlacingLandingCardTag)
deviceEntry.RemoveComponent(component.DevicePlacingOverhaulCardTag)
deviceEntry.RemoveComponent(component.DevicePlacingOtherCardTag)
deviceEntry.RemoveComponent(component.DevicePlacingHandTag)
}
switch placingCard {
case PlacingLandingCard:
@ -41,6 +43,9 @@ func DevicePlacingCardOperate(w ecs.World, deviceId string, placingCard PlacingC
case PlacingOtherCard:
clearAllPlacingTags(deviceEntry)
deviceEntry.AddComponent(component.DevicePlacingOtherCardTag)
case PlacingHandCard:
clearAllPlacingTags(deviceEntry)
deviceEntry.AddComponent(component.DevicePlacingHandTag)
default:
clearAllPlacingTags(deviceEntry)
}