ISCS环境与设备监控系统ecs定义
This commit is contained in:
parent
1d183dfa12
commit
914cb25599
@ -32,6 +32,10 @@ func (s *ChillerUnitSystem) Update(w ecs.World) {
|
||||
if entry.HasComponent(component.DeviceCommunicationInterruptTag) {
|
||||
device.Exception = consts.DeviceCommunicationInterrupt
|
||||
}
|
||||
//异常停止运行
|
||||
if device.Exception != consts.DeviceExceptionNon {
|
||||
device.Running = false
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"joylink.club/rtsssimulation/consts"
|
||||
)
|
||||
|
||||
// PurificationDeviceSystem 净化装置
|
||||
type PurificationDeviceSystem struct {
|
||||
query *ecs.Query
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ func NewWaterClosedContainerSystem() *WaterClosedContainerSystem {
|
||||
func (s *WaterClosedContainerSystem) Update(w ecs.World) {
|
||||
s.query.Each(w, func(entry *ecs.Entry) {
|
||||
container := component.WaterClosedContainerType.Get(entry)
|
||||
//
|
||||
container.Exception = consts.DeviceExceptionNon
|
||||
if entry.HasComponent(component.DeviceFaultTag) {
|
||||
container.Exception = consts.DeviceFault
|
||||
@ -30,5 +31,9 @@ func (s *WaterClosedContainerSystem) Update(w ecs.World) {
|
||||
if entry.HasComponent(component.DeviceCommunicationInterruptTag) {
|
||||
container.Exception = consts.DeviceCommunicationInterrupt
|
||||
}
|
||||
//异常停止运行
|
||||
if container.Exception != consts.DeviceExceptionNon {
|
||||
container.Running = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -38,5 +38,9 @@ func (s *WaterPumpSystem) Update(w ecs.World) {
|
||||
if entry.HasComponent(component.DeviceCommunicationInterruptTag) {
|
||||
pump.Exception = consts.DeviceCommunicationInterrupt
|
||||
}
|
||||
//异常停止运行
|
||||
if pump.Exception != consts.DeviceExceptionNon {
|
||||
pump.Running = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user