diff --git a/entities/switch_entity.go b/entities/switch_entity.go index 3c9e4c1..829ab7d 100644 --- a/entities/switch_entity.go +++ b/entities/switch_entity.go @@ -10,13 +10,11 @@ import ( func CreateSwitch2jzdj9Entity(w ecs.World, switchId string) *ecs.Entry { e := w.Create(system.EntityIdentityComponent, system.Switch2jZdj9StateComponent, - system.Switch2jZdj9CjStateComponent, system.MovableObject1Component, system.MovableObject2Component) system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: switchId}) //电路 system.Switch2jZdj9StateComponent.Set(e, system.NewSwitch2jZdj9State()) - system.Switch2jZdj9CjStateComponent.Set(e, system.NewSwitch2jZdj9CjState()) //J1 j1 := system.NewMovableObject() j1.Value = system.J1Range diff --git a/system/switch_2jzdj9_system.go b/system/switch_2jzdj9_system.go index 3cb9ed9..209760f 100644 --- a/system/switch_2jzdj9_system.go +++ b/system/switch_2jzdj9_system.go @@ -10,24 +10,6 @@ import ( "joylink.club/rtsssimulation/umi" ) -// --------联锁采集--------------- - -// Switch2jZdj9CjState 双机ZDJ9联锁采集电路状态 -type Switch2jZdj9CjState struct { - ZdbjQ bool //采集总定表继电器前接点 - ZfbjQ bool //采集总反表继电器前接点 - YcjQ bool //采集允许操作继电器前接点 - ZdbjHAndZfbjH bool //失表采集:采集总定表继电器后接点和总反表继电器后接点,结果与处理 - J1DbjQ bool //采集j1定表继电器前接点 - J1FbjQ bool //采集j1反表继电器前接点 - J2DbjQ bool //采集j2定表继电器前接点 - J2FbjQ bool //采集j2反表继电器前接点 -} - -func NewSwitch2jZdj9CjState() *Switch2jZdj9CjState { - return &Switch2jZdj9CjState{} -} - // --------联锁驱动----------------- // Switch2jZdj9DriveYc 联锁驱动YCJ @@ -239,9 +221,6 @@ const ( // Switch2jZdj9StateComponent 道岔ZDJ9电路状态组件 var Switch2jZdj9StateComponent = ecs.NewComponentType[Switch2jZdj9State]() -// Switch2jZdj9CjStateComponent 双机ZDJ9联锁采集电路状态组件 -var Switch2jZdj9CjStateComponent = ecs.NewComponentType[Switch2jZdj9CjState]() - // zdj9查询 var zdj9Query = ecs.NewQuery(filter.Contains(EntityIdentityComponent, Switch2jZdj9StateComponent)) @@ -286,8 +265,6 @@ func (me *Switch2jZdj9System) Update(w ecs.World) { me.calculateMotor(w, e, zdj9State) me.calculateMove(w, e, zdj9State) me.calculateK9K10(w, e, zdj9State) - //联锁采集电路 - me.calculateLscj(w, e, zdj9State) }) } @@ -412,19 +389,6 @@ func (me *Switch2jZdj9System) publishRelayNeedChangeEvent(w ecs.World, switchEnt sysEvent.RelayNeedChangeEventBus.Publish(w, &sysEvent.RelayNeedChangeEvent{Id: relayModel.(umi.IDeviceModel).GetId(), Xh: needXh}) } -// 联锁采集电路运算 -func (me *Switch2jZdj9System) calculateLscj(w ecs.World, switchEntry *ecs.Entry, state *Switch2jZdj9State) { - cjState := Switch2jZdj9CjStateComponent.Get(switchEntry) - cjState.ZdbjQ = state.ZDBJ - cjState.ZfbjQ = state.ZFBJ - cjState.YcjQ = state.YCJ - cjState.ZdbjHAndZfbjH = !state.ZDBJ && !state.ZFBJ - cjState.J1DbjQ = state.J1_DBJ - cjState.J1FbjQ = state.J1_FBJ - cjState.J2DbjQ = state.J2_DBJ - cjState.J2FbjQ = state.J2_FBJ -} - // 断相保护电路运算 func (me *Switch2jZdj9System) calculateDBQ(w ecs.World, switchEntry *ecs.Entry, state *Switch2jZdj9State) { if state.J1_DBQ.LimitedTime > 0 {