列车显示调整

This commit is contained in:
fan 2023-08-10 11:11:58 +08:00
parent 4f115f4f58
commit b2521653c8
3 changed files with 8 additions and 15 deletions

View File

@ -111,7 +111,7 @@ enum statusTextColor {
}
const deviceTypeString = new Map();
deviceTypeString.set(state.DeviceType.TRACK, LogicSection.Type);
deviceTypeString.set(state.DeviceType.SWITCH, Turnout.Type);
deviceTypeString.set(state.DeviceType.SWITCH_TRACK, Section.Type);
export const trainConsts = {
codeWidth: 120,
@ -402,7 +402,7 @@ export class Train extends JlGraphic {
}
setPosition(): void {
if (deviceTypeString.get(this.states.devType)) {
const dev = this.queryStore.queryByCodeAndType<LogicSection | Turnout>(
const dev = this.queryStore.queryByCodeAndType<LogicSection | Section>(
this.states.devName,
deviceTypeString.get(this.states.devType)
);
@ -410,17 +410,9 @@ export class Train extends JlGraphic {
return;
}
let window = null;
if (dev.type === Turnout.Type) {
const sectionRelations = dev.queryRelationByType(Section.Type);
const sectionRel = sectionRelations.find((relation) => {
const sec = relation.getOtherGraphic<Section>(dev);
return sec.datas.children.includes(dev.datas.id);
});
const section = sectionRel?.getOtherGraphic<Section>(dev);
if (section) {
const windowRelations = section.queryRelationByType(TrainWindow.Type);
window = windowRelations[0]?.getOtherGraphic<TrainWindow>(section);
}
if (dev.type === Section.Type) {
const windowRelations = dev.queryRelationByType(TrainWindow.Type);
window = windowRelations[0]?.getOtherGraphic<TrainWindow>(dev);
} else {
const windowRelations = dev.queryRelationByType(TrainWindow.Type);
window = windowRelations[0]?.getOtherGraphic<TrainWindow>(dev);

View File

@ -17,7 +17,8 @@ export namespace state {
SCADA = 9,
WATERPROOF_DOOR = 11,
WORK_AREA = 12,
GAMA = 13
GAMA = 13,
SWITCH_TRACK = 14
}
export class Rtu extends pb_1.Message {
#one_of_decls: number[][] = [];

@ -1 +1 @@
Subproject commit 13927cc464f0a602381032fd45308308df02eab9
Subproject commit 464d12188c06e2f92d3879fb06ac56c1d4042e27