Merge branch 'master' of https://git.code.tencent.com/jl-framework/rtss_simulation
This commit is contained in:
commit
8688c7b371
@ -2,19 +2,25 @@ package component
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"joylink.club/ecs"
|
"joylink.club/ecs"
|
||||||
|
"joylink.club/rtsssimulation/component/component_data"
|
||||||
"joylink.club/rtsssimulation/component/component_proto"
|
"joylink.club/rtsssimulation/component/component_proto"
|
||||||
"joylink.club/rtsssimulation/consts"
|
"joylink.club/rtsssimulation/consts"
|
||||||
)
|
)
|
||||||
|
|
||||||
var BitType = ecs.NewComponentType[bool]()
|
var (
|
||||||
|
UidType = ecs.NewComponentType[Uid]()
|
||||||
|
// 固定位置转换组件类型
|
||||||
|
FixedPositionTransformType = ecs.NewComponentType[FixedPositionTransform]()
|
||||||
|
// 电机状态组件类型
|
||||||
|
MotorStateType = ecs.NewComponentType[component_data.Motor]()
|
||||||
|
BitStateType = ecs.NewComponentType[BitState]()
|
||||||
|
)
|
||||||
|
|
||||||
// 唯一ID组件
|
// 唯一ID组件
|
||||||
type Uid struct {
|
type Uid struct {
|
||||||
Id string
|
Id string
|
||||||
}
|
}
|
||||||
|
|
||||||
var UidType = ecs.NewComponentType[Uid]()
|
|
||||||
|
|
||||||
// 两个稳态位置转换组件
|
// 两个稳态位置转换组件
|
||||||
// type TwoPositionTransform struct {
|
// type TwoPositionTransform struct {
|
||||||
// Pos int // 当前位置百分比,[0, 10000],两位小数
|
// Pos int // 当前位置百分比,[0, 10000],两位小数
|
||||||
@ -30,11 +36,9 @@ func (tp *FixedPositionTransform) Percentage() float32 {
|
|||||||
return float32(tp.Pos) / consts.TwoPosMax
|
return float32(tp.Pos) / consts.TwoPosMax
|
||||||
}
|
}
|
||||||
|
|
||||||
// 固定位置转换组件类型
|
|
||||||
var FixedPositionTransformType = ecs.NewComponentType[FixedPositionTransform]()
|
|
||||||
|
|
||||||
// 计算两位置动作的平均速度
|
// 计算两位置动作的平均速度
|
||||||
// 总时间t和tick的单位都应该是ms
|
// 总时间t和tick的单位都应该是ms
|
||||||
|
// t - 总时间,tick - 执行间隔
|
||||||
func CalculateTwoPositionAvgSpeed(t int, tick int) int32 {
|
func CalculateTwoPositionAvgSpeed(t int, tick int) int32 {
|
||||||
return int32(consts.TwoPosMax / (t / tick))
|
return int32(consts.TwoPosMax / (t / tick))
|
||||||
}
|
}
|
||||||
@ -44,8 +48,6 @@ type BitState struct {
|
|||||||
Val bool
|
Val bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var BitStateType = ecs.NewComponentType[BitState]()
|
|
||||||
|
|
||||||
// 倒数/倒计时组件
|
// 倒数/倒计时组件
|
||||||
type CounterDown struct {
|
type CounterDown struct {
|
||||||
Val int // 当前值
|
Val int // 当前值
|
||||||
|
22
component/points.go
Normal file
22
component/points.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package component
|
||||||
|
|
||||||
|
import (
|
||||||
|
"joylink.club/ecs"
|
||||||
|
"joylink.club/rtsssimulation/component/component_data"
|
||||||
|
"joylink.club/rtsssimulation/component/relation"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// 道岔标签
|
||||||
|
PointsTag = ecs.NewTag()
|
||||||
|
// 道岔模型数据引用组件类型
|
||||||
|
PointsModelRelaType = relation.PointsModelRelaType
|
||||||
|
// 道岔转辙机关系组件类型
|
||||||
|
PointsZzjRelaType = relation.PointsZzjRelaType
|
||||||
|
// 道岔ZDJ9双机电路元器件组件类型
|
||||||
|
Zdj9TwoElectronicType = relation.Zdj9TwoElectronicType
|
||||||
|
// 道岔转辙机自动开闭器状态组件类型
|
||||||
|
PointsZzjKbqStateType = ecs.NewComponentType[component_data.PointsZzjKbqState]()
|
||||||
|
// 道岔位置组件类型
|
||||||
|
PointsPositionType = ecs.NewComponentType[component_data.PointsPosition]()
|
||||||
|
)
|
@ -16,10 +16,10 @@ var (
|
|||||||
|
|
||||||
// 道岔模型数据引用
|
// 道岔模型数据引用
|
||||||
type PointsModelRela struct {
|
type PointsModelRela struct {
|
||||||
M model.Turnout
|
M model.Points
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPointsModelRela(m model.Turnout) *PointsModelRela {
|
func NewPointsModelRela(m model.Points) *PointsModelRela {
|
||||||
return &PointsModelRela{
|
return &PointsModelRela{
|
||||||
M: m,
|
M: m,
|
||||||
}
|
}
|
||||||
@ -27,14 +27,14 @@ func NewPointsModelRela(m model.Turnout) *PointsModelRela {
|
|||||||
|
|
||||||
// 道岔转辙机关系组件
|
// 道岔转辙机关系组件
|
||||||
type PointsZzjRela struct {
|
type PointsZzjRela struct {
|
||||||
Turnout *ecs.Entry
|
Points *ecs.Entry
|
||||||
Zzjs []*ecs.Entry
|
Zzjs []*ecs.Entry
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPointsZzjRela(t *ecs.Entry, zzjs ...*ecs.Entry) *PointsZzjRela {
|
func NewPointsZzjRela(t *ecs.Entry, zzjs ...*ecs.Entry) *PointsZzjRela {
|
||||||
return &PointsZzjRela{
|
return &PointsZzjRela{
|
||||||
Turnout: t,
|
Points: t,
|
||||||
Zzjs: zzjs,
|
Zzjs: zzjs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,12 +208,12 @@ func (te *Zdj9TwoElectronic) HasNilReference() bool {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// ZDJ9双机电路元器件组件类型
|
// ZDJ9双机电路元器件组件类型
|
||||||
Zdj9TwoElectronicType = ecs.NewComponentType[Zdj9TwoElectronic]()
|
// Zdj9TwoElectronicType = ecs.NewComponentType[Zdj9TwoElectronic]()
|
||||||
// // ZDJ9双机驱动状态组件类型
|
// // ZDJ9双机驱动状态组件类型
|
||||||
// Zdj9TwoDriveType = ecs.NewComponentType[Zdj9TwoDrive]()
|
// Zdj9TwoDriveType = ecs.NewComponentType[Zdj9TwoDrive]()
|
||||||
// // ZDJ9双机采集状态组件类型
|
// // ZDJ9双机采集状态组件类型
|
||||||
// Zdj9TwoCollectType = ecs.NewComponentType[Zdj9TwoCollect]()
|
// Zdj9TwoCollectType = ecs.NewComponentType[Zdj9TwoCollect]()
|
||||||
)
|
)
|
||||||
|
|
||||||
// 转辙机状态
|
// 转辙机状态
|
||||||
|
@ -17,6 +17,11 @@ func Loading(w ecs.World, repo modelrepo.Repo) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadTurnouts(w ecs.World, turnout []model.Turnout) {
|
func loadTurnouts(w ecs.World, points []model.Points) {
|
||||||
panic("unimplemented")
|
for _, p := range points {
|
||||||
|
switch p.GetTractionType() {
|
||||||
|
case model.PTT_ZDJ9_2:
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
36
entity/points.go
Normal file
36
entity/points.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package entity
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"joylink.club/ecs"
|
||||||
|
"joylink.club/rtsssimulation/component"
|
||||||
|
"joylink.club/rtsssimulation/component/relation"
|
||||||
|
"joylink.club/rtsssimulation/modelrepo/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewPoints(w ecs.World, p model.Points) *ecs.Entry {
|
||||||
|
id := p.Uid().Id()
|
||||||
|
// 创建道岔实体
|
||||||
|
e := w.Entry(w.Create(component.UidType, component.TurnoutTag, component.PointsModelRelaType, component.PointsZzjRelaType,
|
||||||
|
component.PointsPositionType))
|
||||||
|
c := p.GetZzjCount()
|
||||||
|
if c <= 0 {
|
||||||
|
panic(fmt.Errorf("道岔转辙机数量必须大于0。id=%s, zzjCount=%d", id, c))
|
||||||
|
}
|
||||||
|
// 创建转辙机实体
|
||||||
|
entities := w.CreateMany(c, component.PointsZzjRelaType, component.PointsZzjKbqStateType, component.FixedPositionTransformType)
|
||||||
|
pzr := &relation.PointsZzjRela{
|
||||||
|
Points: e,
|
||||||
|
}
|
||||||
|
// 关系状态初始化
|
||||||
|
component.UidType.Set(e, &component.Uid{Id: id})
|
||||||
|
component.PointsModelRelaType.Set(e, &relation.PointsModelRela{M: p})
|
||||||
|
component.PointsZzjRelaType.Set(e, pzr)
|
||||||
|
for _, ez := range entities {
|
||||||
|
zzj := w.Entry(ez)
|
||||||
|
pzr.Zzjs = append(pzr.Zzjs, zzj)
|
||||||
|
component.PointsZzjRelaType.Set(zzj, pzr)
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
}
|
@ -16,13 +16,13 @@ type Link interface {
|
|||||||
// Link总长度
|
// Link总长度
|
||||||
GetLength() int64
|
GetLength() int64
|
||||||
// 获取端口A关联的道岔
|
// 获取端口A关联的道岔
|
||||||
GetPaTurnout() Turnout
|
GetPaTurnout() Points
|
||||||
// 获取端口B关联的道岔
|
// 获取端口B关联的道岔
|
||||||
GetPbTurnout() Turnout
|
GetPbTurnout() Points
|
||||||
// 下一个link及端口
|
// 下一个link及端口
|
||||||
// port - 当前link端口
|
// port - 当前link端口
|
||||||
// tpos - 当前道岔位置
|
// tpos - 当前道岔位置
|
||||||
Next(port Link_Port, tpos TurnoutPosition) *LinkPort
|
Next(port Link_Port, tpos PointsPosition) *LinkPort
|
||||||
}
|
}
|
||||||
|
|
||||||
type LinkPort struct {
|
type LinkPort struct {
|
||||||
|
@ -15,7 +15,7 @@ type Station interface {
|
|||||||
type EcStation interface {
|
type EcStation interface {
|
||||||
Station
|
Station
|
||||||
// 获取所有道岔
|
// 获取所有道岔
|
||||||
GetTurnouts() []Turnout
|
GetTurnouts() []Points
|
||||||
// 获取所有信号机
|
// 获取所有信号机
|
||||||
GetSignals() []Signal
|
GetSignals() []Signal
|
||||||
// 获取所有站台屏蔽门
|
// 获取所有站台屏蔽门
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
// 道岔位置
|
// 道岔位置
|
||||||
type TurnoutPosition int
|
type PointsPosition int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// 失表
|
// 失表
|
||||||
TPos_Lost TurnoutPosition = 0
|
TPos_Lost PointsPosition = 0
|
||||||
// 定位
|
// 定位
|
||||||
TPos_DW TurnoutPosition = 1
|
TPos_DW PointsPosition = 1
|
||||||
// 反位
|
// 反位
|
||||||
TPos_FW TurnoutPosition = 2
|
TPos_FW PointsPosition = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
// 道岔端口
|
// 道岔端口
|
||||||
@ -22,17 +22,17 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// 道岔牵引类型
|
// 道岔牵引类型
|
||||||
type TurnoutTractionType int
|
type PointsTractionType int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// ZDJ9单机牵引
|
// ZDJ9单机牵引
|
||||||
TTT_ZDJ9_1 TurnoutTractionType = 1
|
PTT_ZDJ9_1 PointsTractionType = 1
|
||||||
// ZDJ9双机牵引
|
// ZDJ9双机牵引
|
||||||
TTT_ZDJ9_2 TurnoutTractionType = 2
|
PTT_ZDJ9_2 PointsTractionType = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
// 道岔
|
// 道岔
|
||||||
type Turnout interface {
|
type Points interface {
|
||||||
Model
|
Model
|
||||||
// 获取A方向连接的link端口
|
// 获取A方向连接的link端口
|
||||||
GetALinkPort() *LinkPort
|
GetALinkPort() *LinkPort
|
||||||
@ -41,5 +41,7 @@ type Turnout interface {
|
|||||||
// 获取C方向连接的link端口
|
// 获取C方向连接的link端口
|
||||||
GetCLinkPort() *LinkPort
|
GetCLinkPort() *LinkPort
|
||||||
// 获取牵引类型
|
// 获取牵引类型
|
||||||
GetTractionType() TurnoutTractionType
|
GetTractionType() PointsTractionType
|
||||||
|
// 获取转辙机数量
|
||||||
|
GetZzjCount() int
|
||||||
}
|
}
|
||||||
|
@ -30,17 +30,17 @@ func (l *Link) GetLength() int64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetPaTurnout implements model.Link.
|
// GetPaTurnout implements model.Link.
|
||||||
func (l *Link) GetPaTurnout() model.Turnout {
|
func (l *Link) GetPaTurnout() model.Points {
|
||||||
return l.PaTurnout
|
return l.PaTurnout
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPbTurnout implements model.Link.
|
// GetPbTurnout implements model.Link.
|
||||||
func (l *Link) GetPbTurnout() model.Turnout {
|
func (l *Link) GetPbTurnout() model.Points {
|
||||||
return l.PbTurnout
|
return l.PbTurnout
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next implements model.Link.
|
// Next implements model.Link.
|
||||||
func (*Link) Next(port model.Link_Port, tpos model.TurnoutPosition) *model.LinkPort {
|
func (*Link) Next(port model.Link_Port, tpos model.PointsPosition) *model.LinkPort {
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ package modelimpl
|
|||||||
|
|
||||||
import "joylink.club/rtsssimulation/modelrepo/model"
|
import "joylink.club/rtsssimulation/modelrepo/model"
|
||||||
|
|
||||||
var _turnout model.Turnout = (*Turnout)(nil)
|
var _turnout model.Points = (*Turnout)(nil)
|
||||||
|
|
||||||
type Turnout struct {
|
type Turnout struct {
|
||||||
uid string
|
uid string
|
||||||
@ -23,8 +23,13 @@ type Turnout struct {
|
|||||||
cdLink *Link
|
cdLink *Link
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetZzjCount implements model.Points.
|
||||||
|
func (*Turnout) GetZzjCount() int {
|
||||||
|
panic("unimplemented")
|
||||||
|
}
|
||||||
|
|
||||||
// GetTractionType implements model.Turnout.
|
// GetTractionType implements model.Turnout.
|
||||||
func (t *Turnout) GetTractionType() model.TurnoutTractionType {
|
func (t *Turnout) GetTractionType() model.PointsTractionType {
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ type Repo interface {
|
|||||||
// 获取所有设备集中站
|
// 获取所有设备集中站
|
||||||
GetEcses() []model.EcStation
|
GetEcses() []model.EcStation
|
||||||
// 获取所有道岔
|
// 获取所有道岔
|
||||||
GetTurnouts() []model.Turnout
|
GetTurnouts() []model.Points
|
||||||
// 获取所有信号机
|
// 获取所有信号机
|
||||||
GetSignals() []model.Signal
|
GetSignals() []model.Signal
|
||||||
// 获取所有站台屏蔽门
|
// 获取所有站台屏蔽门
|
||||||
|
@ -5,16 +5,38 @@ package component;
|
|||||||
option go_package = "./component/component_data";
|
option go_package = "./component/component_data";
|
||||||
|
|
||||||
// 电机
|
// 电机
|
||||||
message Motor {
|
message MotorState {
|
||||||
// 是否通电
|
// 是否通电
|
||||||
bool powerUp = 1;
|
bool powerUp = 1;
|
||||||
// 是否正转
|
// 是否正转
|
||||||
bool forward = 2;
|
bool forward = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 无极继电器和偏极继电器稳态为落下,也就是后接点(8组采集接点中的1,3接点,1为中接点),吸气为前接点(1,2接点)
|
||||||
|
// 有极继电器是定位反位双稳态(有永久磁钢),前接点为定位,后接点为反位
|
||||||
|
// 有极继电器(对于道岔中的2DQJ),励磁接点1,2接通为反位;3,4接通为定位
|
||||||
|
// 定义继电器状态时,false表示落下/反位/后接点,true表示吸起/定位/前接点
|
||||||
|
// 缓动继电器:指从通电或断电起,至接点转接止所需时间在0.3s以上的继电器。可分为缓放继电器(如无极缓放继电器等)和缓吸继电器(如热力继电器和时间继电器等)。
|
||||||
|
// 偏极继电器:只有通过规定方向的电流时,才吸起
|
||||||
|
// 继电器状态
|
||||||
|
message RelayState {
|
||||||
|
// 是否通电
|
||||||
|
bool powerUp = 1;
|
||||||
|
// 是否励磁到前接点
|
||||||
|
bool qq = 2;
|
||||||
|
// 是否在前接点位置
|
||||||
|
bool q = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开关类设备状态
|
||||||
|
message SwitchState {
|
||||||
|
// 是否按下(按钮式开关true表示按下,旋钮开关true非常态位)
|
||||||
|
bool pressed = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// 固定位置转换组件
|
// 固定位置转换组件
|
||||||
message FixedPositionTransform {
|
message FixedPositionTransform {
|
||||||
int32 pos = 1; // 当前位置百分比,[0, 10000],两位小数
|
int32 pos = 1; // 当前位置百分比,[0, 100]
|
||||||
int32 speed = 2;
|
int32 speed = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"joylink.club/ecs"
|
"joylink.club/ecs"
|
||||||
"joylink.club/ecs/filter"
|
"joylink.club/ecs/filter"
|
||||||
"joylink.club/rtsssimulation/component"
|
"joylink.club/rtsssimulation/component"
|
||||||
|
"joylink.club/rtsssimulation/component/relation"
|
||||||
"joylink.club/rtsssimulation/consts"
|
"joylink.club/rtsssimulation/consts"
|
||||||
"joylink.club/rtsssimulation/entity"
|
"joylink.club/rtsssimulation/entity"
|
||||||
)
|
)
|
||||||
@ -82,7 +83,7 @@ func (zdj9 *ZDJ9TwoDragSys) handleCiQdRelay(entry *ecs.Entry, wd *component.Worl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 处理驱动电路励磁相关继电器
|
// 处理驱动电路励磁相关继电器
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteDriveElectronic(entry *ecs.Entry, elec *component.Zdj9TwoElectronic, wd *component.WorldData) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteDriveElectronic(entry *ecs.Entry, elec *relation.Zdj9TwoElectronic, wd *component.WorldData) {
|
||||||
if entry.HasComponent(component.TurnoutFaultCiqdType) { // 联锁驱动失效
|
if entry.HasComponent(component.TurnoutFaultCiqdType) { // 联锁驱动失效
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -92,7 +93,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteDriveElectronic(entry *ecs.Entry, elec *compon
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 总定表、反表继电器控制
|
// 总定表、反表继电器控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteZDFBJ(entry *ecs.Entry, elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteZDFBJ(entry *ecs.Entry, elec *relation.Zdj9TwoElectronic) {
|
||||||
tdfj1_dbj := component.BitStateType.Get(elec.TDFJ1_DBJ)
|
tdfj1_dbj := component.BitStateType.Get(elec.TDFJ1_DBJ)
|
||||||
tdfj2_dbj := component.BitStateType.Get(elec.TDFJ2_DBJ)
|
tdfj2_dbj := component.BitStateType.Get(elec.TDFJ2_DBJ)
|
||||||
tdfj1_fbj := component.BitStateType.Get(elec.TDFJ1_FBJ)
|
tdfj1_fbj := component.BitStateType.Get(elec.TDFJ1_FBJ)
|
||||||
@ -137,7 +138,7 @@ func isZfbjDrive(entry *ecs.Entry, tdfj1_fbj *component.BitState, tdfj2_fbj *com
|
|||||||
|
|
||||||
// 二极管整流电路为继电器励磁电路提供半波整流电源
|
// 二极管整流电路为继电器励磁电路提供半波整流电源
|
||||||
// 转辙机一定表/反表继电器控制
|
// 转辙机一定表/反表继电器控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ1_DFBJ(entry *ecs.Entry, elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ1_DFBJ(entry *ecs.Entry, elec *relation.Zdj9TwoElectronic) {
|
||||||
_1dqj := component.BitStateType.Get(elec.TDFJ1_1DQJ)
|
_1dqj := component.BitStateType.Get(elec.TDFJ1_1DQJ)
|
||||||
_2dqj := component.BitStateType.Get(elec.TDFJ1_2DQJ)
|
_2dqj := component.BitStateType.Get(elec.TDFJ1_2DQJ)
|
||||||
zzj := component.GetTurnoutZzj1State(entry)
|
zzj := component.GetTurnoutZzj1State(entry)
|
||||||
@ -147,7 +148,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ1_DFBJ(entry *ecs.Entry, elec *componen
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机二定表/反表继电器控制
|
// 转辙机二定表/反表继电器控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ1_DFBJ(entry *ecs.Entry, elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ1_DFBJ(entry *ecs.Entry, elec *relation.Zdj9TwoElectronic) {
|
||||||
_1dqj := component.BitStateType.Get(elec.TDFJ2_1DQJ)
|
_1dqj := component.BitStateType.Get(elec.TDFJ2_1DQJ)
|
||||||
_2dqj := component.BitStateType.Get(elec.TDFJ2_2DQJ)
|
_2dqj := component.BitStateType.Get(elec.TDFJ2_2DQJ)
|
||||||
zzj := component.GetTurnoutZzj2State(entry)
|
zzj := component.GetTurnoutZzj2State(entry)
|
||||||
@ -181,7 +182,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteDFBJ(_1dqj *component.BitState, _2dqj *compone
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 切断继电器控制
|
// 切断继电器控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_QDJ(w ecs.World, entry *ecs.Entry, elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_QDJ(w ecs.World, entry *ecs.Entry, elec *relation.Zdj9TwoElectronic) {
|
||||||
tdfj1_bhj := component.BitStateType.Get(elec.TDFJ1_BHJ)
|
tdfj1_bhj := component.BitStateType.Get(elec.TDFJ1_BHJ)
|
||||||
tdfj2_bhj := component.BitStateType.Get(elec.TDFJ2_BHJ)
|
tdfj2_bhj := component.BitStateType.Get(elec.TDFJ2_BHJ)
|
||||||
tdfj1_zbhj := component.BitStateType.Get(elec.TDFJ1_ZBHJ)
|
tdfj1_zbhj := component.BitStateType.Get(elec.TDFJ1_ZBHJ)
|
||||||
@ -211,7 +212,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_QDJ(w ecs.World, entry *ecs.Entry, ele
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 总保护继电器控制
|
// 总保护继电器控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_ZBHJ(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_ZBHJ(elec *relation.Zdj9TwoElectronic) {
|
||||||
tdfj1_bhj := component.BitStateType.Get(elec.TDFJ1_BHJ)
|
tdfj1_bhj := component.BitStateType.Get(elec.TDFJ1_BHJ)
|
||||||
tdfj2_bhj := component.BitStateType.Get(elec.TDFJ2_BHJ)
|
tdfj2_bhj := component.BitStateType.Get(elec.TDFJ2_BHJ)
|
||||||
tdfj1_zbhj := component.RelayDriveType.Get(elec.TDFJ1_ZBHJ)
|
tdfj1_zbhj := component.RelayDriveType.Get(elec.TDFJ1_ZBHJ)
|
||||||
@ -227,7 +228,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_ZBHJ(elec *component.Zdj9TwoElectronic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机一断相保护器控制
|
// 转辙机一断相保护器控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_DBQ(w ecs.World, entry *ecs.Entry, elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_DBQ(w ecs.World, entry *ecs.Entry, elec *relation.Zdj9TwoElectronic) {
|
||||||
_1dqj := component.BitStateType.Get(elec.TDFJ1_1DQJ)
|
_1dqj := component.BitStateType.Get(elec.TDFJ1_1DQJ)
|
||||||
_1dqjf := component.BitStateType.Get(elec.TDFJ1_1DQJF)
|
_1dqjf := component.BitStateType.Get(elec.TDFJ1_1DQJF)
|
||||||
_2dqj := component.BitStateType.Get(elec.TDFJ1_2DQJ)
|
_2dqj := component.BitStateType.Get(elec.TDFJ1_2DQJ)
|
||||||
@ -237,7 +238,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_DBQ(w ecs.World, entry *ecs.Entry, ele
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机二断相保护器控制
|
// 转辙机二断相保护器控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_DBQ(w ecs.World, entry *ecs.Entry, elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_DBQ(w ecs.World, entry *ecs.Entry, elec *relation.Zdj9TwoElectronic) {
|
||||||
_1dqj := component.BitStateType.Get(elec.TDFJ2_1DQJ)
|
_1dqj := component.BitStateType.Get(elec.TDFJ2_1DQJ)
|
||||||
_1dqjf := component.BitStateType.Get(elec.TDFJ2_1DQJF)
|
_1dqjf := component.BitStateType.Get(elec.TDFJ2_1DQJF)
|
||||||
_2dqj := component.BitStateType.Get(elec.TDFJ2_2DQJ)
|
_2dqj := component.BitStateType.Get(elec.TDFJ2_2DQJ)
|
||||||
@ -275,14 +276,14 @@ func (zdj9 *ZDJ9TwoDragSys) exciteDBQ(i int, _1dqj *component.BitState, _1dqjf *
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机一TDFJ_BHJ保护继电器励磁状态控制
|
// 转辙机一TDFJ_BHJ保护继电器励磁状态控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_BHJ(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_BHJ(elec *relation.Zdj9TwoElectronic) {
|
||||||
dbq := component.DBQStateType.Get(elec.TDFJ1_DBQ)
|
dbq := component.DBQStateType.Get(elec.TDFJ1_DBQ)
|
||||||
bhj := component.RelayDriveType.Get(elec.TDFJ1_BHJ)
|
bhj := component.RelayDriveType.Get(elec.TDFJ1_BHJ)
|
||||||
zdj9.exciteBHJ(dbq, bhj)
|
zdj9.exciteBHJ(dbq, bhj)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机二TDFJ_BHJ保护继电器励磁状态控制
|
// 转辙机二TDFJ_BHJ保护继电器励磁状态控制
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_BHJ(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_BHJ(elec *relation.Zdj9TwoElectronic) {
|
||||||
dbq := component.DBQStateType.Get(elec.TDFJ2_DBQ)
|
dbq := component.DBQStateType.Get(elec.TDFJ2_DBQ)
|
||||||
bhj := component.RelayDriveType.Get(elec.TDFJ2_BHJ)
|
bhj := component.RelayDriveType.Get(elec.TDFJ2_BHJ)
|
||||||
zdj9.exciteBHJ(dbq, bhj)
|
zdj9.exciteBHJ(dbq, bhj)
|
||||||
@ -298,14 +299,14 @@ func (zdj9 *ZDJ9TwoDragSys) exciteBHJ(dbq *component.DBQState, bhj *component.Re
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机一TDFJ_1DQJF励磁电路逻辑
|
// 转辙机一TDFJ_1DQJF励磁电路逻辑
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_1DQJF(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_1DQJF(elec *relation.Zdj9TwoElectronic) {
|
||||||
tdfj_1dqj := component.BitStateType.Get(elec.TDFJ1_1DQJ)
|
tdfj_1dqj := component.BitStateType.Get(elec.TDFJ1_1DQJ)
|
||||||
tdfj_1dqjf_drive := component.RelayDriveType.Get(elec.TDFJ1_1DQJF)
|
tdfj_1dqjf_drive := component.RelayDriveType.Get(elec.TDFJ1_1DQJF)
|
||||||
zdj9.excite1DQJF(tdfj_1dqj, tdfj_1dqjf_drive)
|
zdj9.excite1DQJF(tdfj_1dqj, tdfj_1dqjf_drive)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机二TDFJ_1DQJF励磁电路逻辑
|
// 转辙机二TDFJ_1DQJF励磁电路逻辑
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_1DQJF(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_1DQJF(elec *relation.Zdj9TwoElectronic) {
|
||||||
tdfj_1dqj := component.BitStateType.Get(elec.TDFJ2_1DQJ)
|
tdfj_1dqj := component.BitStateType.Get(elec.TDFJ2_1DQJ)
|
||||||
tdfj_1dqjf_drive := component.RelayDriveType.Get(elec.TDFJ2_1DQJF)
|
tdfj_1dqjf_drive := component.RelayDriveType.Get(elec.TDFJ2_1DQJF)
|
||||||
zdj9.excite1DQJF(tdfj_1dqj, tdfj_1dqjf_drive)
|
zdj9.excite1DQJF(tdfj_1dqj, tdfj_1dqjf_drive)
|
||||||
@ -325,7 +326,7 @@ func (zdj9 *ZDJ9TwoDragSys) excite1DQJF(_1dqj *component.BitState, _1dqjf_drive
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机一TDFJ_1DQJ励磁电路逻辑
|
// 转辙机一TDFJ_1DQJ励磁电路逻辑
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_1DQJ(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_1DQJ(elec *relation.Zdj9TwoElectronic) {
|
||||||
// 暂时先实现非应急按钮操作
|
// 暂时先实现非应急按钮操作
|
||||||
ycj := component.BitStateType.Get(elec.TDC_YCJ)
|
ycj := component.BitStateType.Get(elec.TDC_YCJ)
|
||||||
dcj := component.BitStateType.Get(elec.TDC_DCJ)
|
dcj := component.BitStateType.Get(elec.TDC_DCJ)
|
||||||
@ -351,7 +352,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_1DQJ(elec *component.Zdj9TwoElectronic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机二TDFJ_1DQJ励磁电路逻辑
|
// 转辙机二TDFJ_1DQJ励磁电路逻辑
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_1DQJ(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_1DQJ(elec *relation.Zdj9TwoElectronic) {
|
||||||
// 暂时先实现非应急按钮操作
|
// 暂时先实现非应急按钮操作
|
||||||
ycj := component.BitStateType.Get(elec.TDC_YCJ)
|
ycj := component.BitStateType.Get(elec.TDC_YCJ)
|
||||||
dcj := component.BitStateType.Get(elec.TDC_DCJ)
|
dcj := component.BitStateType.Get(elec.TDC_DCJ)
|
||||||
@ -376,7 +377,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_1DQJ(elec *component.Zdj9TwoElectronic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机一TDFJ_2DQJ励磁电路逻辑(暂时未考虑应急盘操作按钮电路)
|
// 转辙机一TDFJ_2DQJ励磁电路逻辑(暂时未考虑应急盘操作按钮电路)
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_2DQJ(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_2DQJ(elec *relation.Zdj9TwoElectronic) {
|
||||||
_1dqjf := component.BitStateType.Get(elec.TDFJ1_1DQJF)
|
_1dqjf := component.BitStateType.Get(elec.TDFJ1_1DQJF)
|
||||||
dcj := component.BitStateType.Get(elec.TDC_DCJ)
|
dcj := component.BitStateType.Get(elec.TDC_DCJ)
|
||||||
fcj := component.BitStateType.Get(elec.TDC_FCJ)
|
fcj := component.BitStateType.Get(elec.TDC_FCJ)
|
||||||
@ -385,7 +386,7 @@ func (zdj9 *ZDJ9TwoDragSys) exciteM1_TDFJ_2DQJ(elec *component.Zdj9TwoElectronic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转辙机二TDFJ_2DQJ励磁电路逻辑(暂时未考虑应急盘操作按钮电路)
|
// 转辙机二TDFJ_2DQJ励磁电路逻辑(暂时未考虑应急盘操作按钮电路)
|
||||||
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_2DQJ(elec *component.Zdj9TwoElectronic) {
|
func (zdj9 *ZDJ9TwoDragSys) exciteM2_TDFJ_2DQJ(elec *relation.Zdj9TwoElectronic) {
|
||||||
_1dqjf := component.BitStateType.Get(elec.TDFJ2_1DQJF)
|
_1dqjf := component.BitStateType.Get(elec.TDFJ2_1DQJF)
|
||||||
dcj := component.BitStateType.Get(elec.TDC_DCJ)
|
dcj := component.BitStateType.Get(elec.TDC_DCJ)
|
||||||
fcj := component.BitStateType.Get(elec.TDC_FCJ)
|
fcj := component.BitStateType.Get(elec.TDC_FCJ)
|
||||||
|
Loading…
Reference in New Issue
Block a user