diff --git a/sys/iscs_sys/iscs_bas_chiller.go b/sys/iscs_sys/iscs_bas_chiller.go index d93a8d4..66ff065 100644 --- a/sys/iscs_sys/iscs_bas_chiller.go +++ b/sys/iscs_sys/iscs_bas_chiller.go @@ -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 + } }) } diff --git a/sys/iscs_sys/iscs_bas_purification_device.go b/sys/iscs_sys/iscs_bas_purification_device.go index ee029bf..0e012b2 100644 --- a/sys/iscs_sys/iscs_bas_purification_device.go +++ b/sys/iscs_sys/iscs_bas_purification_device.go @@ -7,6 +7,7 @@ import ( "joylink.club/rtsssimulation/consts" ) +// PurificationDeviceSystem 净化装置 type PurificationDeviceSystem struct { query *ecs.Query } diff --git a/sys/iscs_sys/iscs_bas_water_closed_container.go b/sys/iscs_sys/iscs_bas_water_closed_container.go index b5b805b..aff4a65 100644 --- a/sys/iscs_sys/iscs_bas_water_closed_container.go +++ b/sys/iscs_sys/iscs_bas_water_closed_container.go @@ -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 + } }) } diff --git a/sys/iscs_sys/iscs_bas_water_pump.go b/sys/iscs_sys/iscs_bas_water_pump.go index 6d396ac..69b76b4 100644 --- a/sys/iscs_sys/iscs_bas_water_pump.go +++ b/sys/iscs_sys/iscs_bas_water_pump.go @@ -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 + } }) }