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 ( var (
DevicePlacingOverhaulCardTag = ecs.NewTag() //设备置牌:检修 DevicePlacingOverhaulCardTag = ecs.NewTag() //设备置牌:检修
DevicePlacingLandingCardTag = ecs.NewTag() //设备置牌:接地 DevicePlacingLandingCardTag = ecs.NewTag() //设备置牌:接地
DevicePlacingHandTag = ecs.NewTag() //设备置牌:就地(手型牌)
DevicePlacingOtherCardTag = ecs.NewTag() //设备置牌:其他 DevicePlacingOtherCardTag = ecs.NewTag() //设备置牌:其他
) )

View File

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