列车显示调整

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

View File

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

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