Merge branch 'master' of https://git.code.tencent.com/jl-framework/rtss_simulation
This commit is contained in:
commit
1d3c82825e
@ -31,6 +31,7 @@ var (
|
|||||||
TurnoutFaultJcType = ecs.NewComponentType[component_proto.TurnoutFaultJc]()
|
TurnoutFaultJcType = ecs.NewComponentType[component_proto.TurnoutFaultJc]()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 根据道岔故障枚举获取道岔故障组件类型
|
||||||
func GetTurnoutFaultType(fault component_proto.Turnout_Fault) ecs.IComponentType {
|
func GetTurnoutFaultType(fault component_proto.Turnout_Fault) ecs.IComponentType {
|
||||||
switch fault {
|
switch fault {
|
||||||
case component_proto.Turnout_SB:
|
case component_proto.Turnout_SB:
|
||||||
|
@ -30,7 +30,7 @@ func SetTurnoutFault(w ecs.World, id string, fault component_proto.Turnout_Fault
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 取消道岔故障
|
// 取消道岔故障
|
||||||
func CancleTurnoutFault(w ecs.World, id string, fault component_proto.Turnout_Fault) error {
|
func CancelTurnoutFault(w ecs.World, id string, fault component_proto.Turnout_Fault) error {
|
||||||
result := <-ecs.Request[ecs.EmptyType](w, func() ecs.Result[ecs.EmptyType] {
|
result := <-ecs.Request[ecs.EmptyType](w, func() ecs.Result[ecs.EmptyType] {
|
||||||
wd := entity.GetWorldData(w)
|
wd := entity.GetWorldData(w)
|
||||||
entry, ok := wd.EntityMap[id]
|
entry, ok := wd.EntityMap[id]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package circuit_sys
|
package circuit_sys
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"joylink.club/ecs"
|
"joylink.club/ecs"
|
||||||
@ -262,21 +263,21 @@ func (zdj9 *ZDJ9TwoDragSys) exciteDBQ(i int, _1dqj *component.BitState, _1dqjf *
|
|||||||
!(_1dqj.Val && _1dqjf.Val && zzj.JD34 && _2dqj.Val) { // 断开
|
!(_1dqj.Val && _1dqjf.Val && zzj.JD34 && _2dqj.Val) { // 断开
|
||||||
dbq.Td = false
|
dbq.Td = false
|
||||||
zzj.Td = false
|
zzj.Td = false
|
||||||
slog.Debug("转辙机%v断电\n", i)
|
slog.Debug(fmt.Sprintf("转辙机%v断电", i))
|
||||||
} else { // 处理正反转
|
} else { // 处理正反转
|
||||||
if zzj.Dw && !_2dqj.Val {
|
if zzj.Dw && !_2dqj.Val {
|
||||||
zzj.Dw = false
|
zzj.Dw = false
|
||||||
slog.Debug("转辙机%v转到反位\n", i)
|
slog.Debug(fmt.Sprintf("转辙机%v转到反位", i))
|
||||||
} else if !zzj.Dw && _2dqj.Val {
|
} else if !zzj.Dw && _2dqj.Val {
|
||||||
zzj.Dw = true
|
zzj.Dw = true
|
||||||
slog.Debug("转辙机%v转到定位\n", i)
|
slog.Debug(fmt.Sprintf("转辙机%v转到定位", i))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // 未通电
|
} else { // 未通电
|
||||||
if _1dqj.Val && _1dqjf.Val && ((!zzj.JD12 && !_2dqj.Val) || (zzj.JD34 && _2dqj.Val)) { // 通电
|
if _1dqj.Val && _1dqjf.Val && ((!zzj.JD12 && !_2dqj.Val) || (zzj.JD34 && _2dqj.Val)) { // 通电
|
||||||
dbq.Td = true
|
dbq.Td = true
|
||||||
zzj.Td = true
|
zzj.Td = true
|
||||||
slog.Debug("转辙机%v通电\n", i)
|
slog.Debug(fmt.Sprintf("转辙机%v通电", i))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -407,24 +408,24 @@ func (zdj9 *ZDJ9TwoDragSys) excite2DQJ(i int, _1dqjf *component.BitState, dcj *c
|
|||||||
if drive.Td { // 通电
|
if drive.Td { // 通电
|
||||||
if !drive.Xq && _1dqjf.Val && dcj.Val {
|
if !drive.Xq && _1dqjf.Val && dcj.Val {
|
||||||
drive.Xq = true
|
drive.Xq = true
|
||||||
slog.Debug("TDFJ%v_2DQJ到定位\n", i)
|
slog.Debug(fmt.Sprintf("TDFJ%v_2DQJ到定位", i))
|
||||||
} else if drive.Xq && _1dqjf.Val && fcj.Val {
|
} else if drive.Xq && _1dqjf.Val && fcj.Val {
|
||||||
drive.Xq = false
|
drive.Xq = false
|
||||||
slog.Debug("TDFJ%v_2DQJ到反位\n", i)
|
slog.Debug(fmt.Sprintf("TDFJ%v_2DQJ到反位", i))
|
||||||
} else if !(_1dqjf.Val && (dcj.Val || fcj.Val)) { // 断电
|
} else if !(_1dqjf.Val && (dcj.Val || fcj.Val)) { // 断电
|
||||||
drive.Td = false
|
drive.Td = false
|
||||||
slog.Debug("TDFJ%v_2DQJ断电\n", i)
|
slog.Debug(fmt.Sprintf("TDFJ%v_2DQJ断电", i))
|
||||||
}
|
}
|
||||||
} else { // 未通电
|
} else { // 未通电
|
||||||
if _1dqjf.Val {
|
if _1dqjf.Val {
|
||||||
if dcj.Val { // 通电,到吸起位
|
if dcj.Val { // 通电,到吸起位
|
||||||
drive.Td = true
|
drive.Td = true
|
||||||
drive.Xq = true
|
drive.Xq = true
|
||||||
slog.Debug("TDFJ%v_2DQJ通电,到吸起位\n", i)
|
slog.Debug(fmt.Sprintf("TDFJ%v_2DQJ通电,到吸起位", i))
|
||||||
} else if fcj.Val { // 通电,到落下位
|
} else if fcj.Val { // 通电,到落下位
|
||||||
drive.Td = true
|
drive.Td = true
|
||||||
drive.Xq = false
|
drive.Xq = false
|
||||||
slog.Debug("TDFJ%v_2DQJ通电,到落下位\n", i)
|
slog.Debug(fmt.Sprintf("TDFJ%v_2DQJ通电,到落下位", i))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user