修改屏蔽门MGJ闪烁问题
This commit is contained in:
parent
8cd0f61fb0
commit
f90563f821
@ -31,16 +31,16 @@ func (p *PsdSys) Update(world ecs.World) {
|
|||||||
psdCircuit := component.PsdCircuitType.Get(entry)
|
psdCircuit := component.PsdCircuitType.Get(entry)
|
||||||
//屏蔽门驱动
|
//屏蔽门驱动
|
||||||
if psdCircuit.GMJ != nil {
|
if psdCircuit.GMJ != nil {
|
||||||
p.exciteGMJ(worldData, psdCircuit)
|
p.driveGMJ(worldData, psdCircuit)
|
||||||
psc.InterlockGM = component.BitStateType.Get(psdCircuit.GMJ).Val
|
psc.InterlockGM = component.BitStateType.Get(psdCircuit.GMJ).Val
|
||||||
}
|
}
|
||||||
for group, kmj := range psdCircuit.KMJMap {
|
for group, kmj := range psdCircuit.KMJMap {
|
||||||
p.exciteKMJ(worldData, psdCircuit, kmj)
|
p.driveKMJ(worldData, psdCircuit, kmj)
|
||||||
psc.InterlockKmGroup[group] = component.BitStateType.Get(kmj).Val
|
psc.InterlockKmGroup[group] = component.BitStateType.Get(kmj).Val
|
||||||
}
|
}
|
||||||
|
|
||||||
if psdCircuit.MGJ != nil {
|
if psdCircuit.MGJ != nil {
|
||||||
p.exciteMGJ(psdCircuit, asdList)
|
p.driveMGJ(psdCircuit, asdList)
|
||||||
psdState.Close = component.BitStateType.Get(psdCircuit.MGJ).Val
|
psdState.Close = component.BitStateType.Get(psdCircuit.MGJ).Val
|
||||||
}
|
}
|
||||||
if psdCircuit.MPLJ != nil {
|
if psdCircuit.MPLJ != nil {
|
||||||
@ -136,7 +136,7 @@ func (p *PsdSys) gm(asdList *component.AsdList) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PsdSys) exciteGMJ(data *component.WorldData, circuit *component.PsdCircuit) {
|
func (p *PsdSys) driveGMJ(data *component.WorldData, circuit *component.PsdCircuit) {
|
||||||
bit, err := data.QueryQdBit(component.UidType.Get(circuit.GMJ).Id)
|
bit, err := data.QueryQdBit(component.UidType.Get(circuit.GMJ).Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -155,7 +155,7 @@ func (p *PsdSys) exciteGMJ(data *component.WorldData, circuit *component.PsdCirc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PsdSys) exciteKMJ(data *component.WorldData, circuit *component.PsdCircuit, kmj *ecs.Entry) {
|
func (p *PsdSys) driveKMJ(data *component.WorldData, circuit *component.PsdCircuit, kmj *ecs.Entry) {
|
||||||
bit, err := data.QueryQdBit(component.UidType.Get(kmj).Id)
|
bit, err := data.QueryQdBit(component.UidType.Get(kmj).Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -178,8 +178,8 @@ func (p *PsdSys) exciteKMJ(data *component.WorldData, circuit *component.PsdCirc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PsdSys) exciteMGJ(psdCircuit *component.PsdCircuit, asdList *component.AsdList) {
|
func (p *PsdSys) driveMGJ(psdCircuit *component.PsdCircuit, asdList *component.AsdList) {
|
||||||
component.BitStateType.Get(psdCircuit.MGJ).Val = p.isAllAsdMotorClosed(asdList)
|
component.RelayDriveType.Get(psdCircuit.MGJ).Td = p.isAllAsdMotorClosed(asdList)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否所有滑动门电机都是关闭状态(继电器表示)
|
// 是否所有滑动门电机都是关闭状态(继电器表示)
|
||||||
|
Loading…
Reference in New Issue
Block a user