From f0433ef8382fff88cedb08472de78e5b0c78436c Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Thu, 21 Dec 2023 18:10:51 +0800 Subject: [PATCH] =?UTF-8?q?iscs=20=20pscada=20=E4=B8=80=E6=AC=A1=E5=9B=BE?= =?UTF-8?q?=20=E7=94=B5=E5=8A=9B=E4=BC=A0=E9=80=92=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys/iscs_sys/iscs_pscada_circuit_breaker.go | 2 +- sys/iscs_sys/iscs_pscada_disconnector.go | 2 +- sys/iscs_sys/iscs_pscada_handcart.go | 2 +- sys/iscs_sys/iscs_pscada_rectifier.go | 11 ++++++++++- sys/iscs_sys/iscs_pscada_three_position_switch.go | 2 +- sys/iscs_sys/iscs_pscada_voltage_transformer.go | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sys/iscs_sys/iscs_pscada_circuit_breaker.go b/sys/iscs_sys/iscs_pscada_circuit_breaker.go index f468522..f1ff49e 100644 --- a/sys/iscs_sys/iscs_pscada_circuit_breaker.go +++ b/sys/iscs_sys/iscs_pscada_circuit_breaker.go @@ -14,7 +14,7 @@ type CircuitBreakerSystem struct { func NewCircuitBreakerSystem() *CircuitBreakerSystem { return &CircuitBreakerSystem{ - query: ecs.NewQuery(filter.Contains(component.UidType, component.CircuitBreakerType)), + query: ecs.NewQuery(filter.Contains(component.UidType, component.CircuitBreakerType, component.DeviceExceptionType)), } } func (s *CircuitBreakerSystem) Update(w ecs.World) { diff --git a/sys/iscs_sys/iscs_pscada_disconnector.go b/sys/iscs_sys/iscs_pscada_disconnector.go index 46d5967..609d8f0 100644 --- a/sys/iscs_sys/iscs_pscada_disconnector.go +++ b/sys/iscs_sys/iscs_pscada_disconnector.go @@ -14,7 +14,7 @@ type DisconnectorSystem struct { func NewDisconnectorSystem() *DisconnectorSystem { return &DisconnectorSystem{ - query: ecs.NewQuery(filter.Contains(component.UidType, component.DisconnectorType)), + query: ecs.NewQuery(filter.Contains(component.UidType, component.DisconnectorType, component.DeviceExceptionType)), } } func (s *DisconnectorSystem) Update(w ecs.World) { diff --git a/sys/iscs_sys/iscs_pscada_handcart.go b/sys/iscs_sys/iscs_pscada_handcart.go index ed4e273..2ddd23c 100644 --- a/sys/iscs_sys/iscs_pscada_handcart.go +++ b/sys/iscs_sys/iscs_pscada_handcart.go @@ -14,7 +14,7 @@ type HandcartSystem struct { func NewHandcartSystem() *HandcartSystem { return &HandcartSystem{ - query: ecs.NewQuery(filter.Contains(component.UidType, component.HandcartSwitchType)), + query: ecs.NewQuery(filter.Contains(component.UidType, component.HandcartSwitchType, component.DeviceExceptionType)), } } func (s *HandcartSystem) Update(w ecs.World) { diff --git a/sys/iscs_sys/iscs_pscada_rectifier.go b/sys/iscs_sys/iscs_pscada_rectifier.go index f275247..91473cf 100644 --- a/sys/iscs_sys/iscs_pscada_rectifier.go +++ b/sys/iscs_sys/iscs_pscada_rectifier.go @@ -4,6 +4,7 @@ import ( "joylink.club/ecs" "joylink.club/ecs/filter" "joylink.club/rtsssimulation/component" + "joylink.club/rtsssimulation/consts" "joylink.club/rtsssimulation/entity" "joylink.club/rtsssimulation/repository" ) @@ -14,10 +15,18 @@ type RectifierSystem struct { func NewRectifierSystem() *RectifierSystem { return &RectifierSystem{ - query: ecs.NewQuery(filter.Contains(component.UidType, component.RectifierType)), + query: ecs.NewQuery(filter.Contains(component.UidType, component.RectifierType, component.DeviceExceptionType)), } } func (s *RectifierSystem) Update(w ecs.World) { + s.query.Each(w, func(entry *ecs.Entry) { + rectifier := component.RectifierType.Get(entry) + exception := component.DeviceExceptionType.Get(entry) + // + rectifier.Normal = exception.Exception == consts.DeviceExceptionNon + + }) + // s.rectifierTransPower(w) } diff --git a/sys/iscs_sys/iscs_pscada_three_position_switch.go b/sys/iscs_sys/iscs_pscada_three_position_switch.go index db76c85..7864253 100644 --- a/sys/iscs_sys/iscs_pscada_three_position_switch.go +++ b/sys/iscs_sys/iscs_pscada_three_position_switch.go @@ -14,7 +14,7 @@ type ThreePositionSwitchSystem struct { func NewThreePositionSwitchSystem() *ThreePositionSwitchSystem { return &ThreePositionSwitchSystem{ - query: ecs.NewQuery(filter.Contains(component.UidType, component.ThreePositionSwitchType)), + query: ecs.NewQuery(filter.Contains(component.UidType, component.ThreePositionSwitchType, component.DeviceExceptionType)), } } diff --git a/sys/iscs_sys/iscs_pscada_voltage_transformer.go b/sys/iscs_sys/iscs_pscada_voltage_transformer.go index b1fa7a2..0c948c0 100644 --- a/sys/iscs_sys/iscs_pscada_voltage_transformer.go +++ b/sys/iscs_sys/iscs_pscada_voltage_transformer.go @@ -14,7 +14,7 @@ type VoltageTransformerSystem struct { func NewVoltageTransformerSystem() *VoltageTransformerSystem { return &VoltageTransformerSystem{ - query: ecs.NewQuery(filter.Contains(component.UidType, component.VoltageTransformerType)), + query: ecs.NewQuery(filter.Contains(component.UidType, component.VoltageTransformerType, component.DeviceExceptionType)), } } func (s *VoltageTransformerSystem) Update(w ecs.World) {