道岔占用显示调整 && 区段状态展示
This commit is contained in:
parent
91984105e5
commit
5e58b5c87e
@ -43,13 +43,24 @@
|
||||
/>
|
||||
</q-form>
|
||||
<q-list dense bordered padding class="rounded-borders q-my-sm">
|
||||
<q-item>
|
||||
<q-item-section>
|
||||
<q-checkbox
|
||||
dense
|
||||
v-model="sectionState.occupied"
|
||||
outlined
|
||||
label="是否占用"
|
||||
:disable="true"
|
||||
/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item>
|
||||
<q-item-section>
|
||||
<q-checkbox
|
||||
dense
|
||||
v-model="sectionState.axleFault"
|
||||
outlined
|
||||
label="是否故障占用"
|
||||
label="是否计轴故障"
|
||||
:disable="true"
|
||||
/>
|
||||
</q-item-section>
|
||||
@ -70,7 +81,13 @@ import { SectionStates } from 'src/drawApp/graphics/SectionInteraction';
|
||||
|
||||
const $q = useQuasar();
|
||||
const lineStore = useLineStore();
|
||||
const sectionState = ref({ id: '', index: 0, code: '', axleFault: false });
|
||||
const sectionState = ref({
|
||||
id: '',
|
||||
index: 0,
|
||||
code: '',
|
||||
axleFault: false,
|
||||
occupied: false,
|
||||
});
|
||||
|
||||
watch(
|
||||
() => lineStore.selectedGraphics,
|
||||
@ -83,6 +100,7 @@ watch(
|
||||
index: 0,
|
||||
code: '',
|
||||
axleFault: false,
|
||||
occupied: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -97,6 +115,7 @@ function setSectionState(section: Section) {
|
||||
index: section.datas.index,
|
||||
code: section.datas.code,
|
||||
axleFault: section.states.axleFault ?? false,
|
||||
occupied: section.states.occupied ?? false,
|
||||
};
|
||||
}
|
||||
|
||||
@ -168,6 +187,7 @@ watch(
|
||||
id: find.id,
|
||||
code: find.code,
|
||||
axleFault: find.axleFault,
|
||||
occupied: find.occupied,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -126,9 +126,16 @@ export class TurnoutSection extends Graphics {
|
||||
break;
|
||||
}
|
||||
const gap = this.port === TurnoutPort.A ? 0 : TurnoutConsts.forkLenth;
|
||||
const color = this.turnout.states.occupied
|
||||
? TurnoutConsts.occupiedColor
|
||||
: TurnoutConsts.lineColor;
|
||||
let color = TurnoutConsts.lineColor;
|
||||
if (this.turnout.states.occupied) {
|
||||
if (
|
||||
this.port === TurnoutPort.A ||
|
||||
(this.turnout.states.dw && this.port === TurnoutPort.B) ||
|
||||
(this.turnout.states.fw && this.port === TurnoutPort.C)
|
||||
) {
|
||||
color = TurnoutConsts.occupiedColor;
|
||||
}
|
||||
}
|
||||
const start = getForkPoint(gap, pList[0]);
|
||||
this.clear()
|
||||
.lineStyle(TurnoutConsts.lineWidth, color)
|
||||
@ -212,30 +219,24 @@ export class Turnout extends JlGraphic {
|
||||
}
|
||||
|
||||
doRepaint(): void {
|
||||
// console.log(this.states);
|
||||
const { pointB, pointC } = this.datas;
|
||||
if (this.states.dw) {
|
||||
this.graphics.fork.paint(pointB[0]);
|
||||
this.graphics.label.style.stroke = TurnoutConsts.normalLabelColor;
|
||||
this.graphics.fork.visible = true;
|
||||
} else if (this.states.fw) {
|
||||
this.graphics.fork.paint(pointC[0]);
|
||||
this.graphics.label.style.stroke = TurnoutConsts.reverseLabelColor;
|
||||
this.graphics.fork.visible = true;
|
||||
}
|
||||
this.graphics.label.text = this.datas.code;
|
||||
|
||||
this.graphics.sections.forEach((sectionGraphic) => sectionGraphic.paint());
|
||||
|
||||
this.graphics.label.text = this.datas.code;
|
||||
if (!this.states.dw && !this.states.fw) {
|
||||
// 失表
|
||||
this.graphics.fork.visible = false;
|
||||
} else {
|
||||
this.graphics.fork.visible = true;
|
||||
}
|
||||
// if (this.states.split) {
|
||||
// this.initTurnoutSplit();
|
||||
// } else {
|
||||
// this.stopTurnoutSplit();
|
||||
// }
|
||||
}
|
||||
initTurnoutSplit() {
|
||||
// 道岔失表
|
||||
|
@ -1015,7 +1015,6 @@ export namespace state {
|
||||
vobcState?: TrainVobcState;
|
||||
trainKilometer?: number;
|
||||
controlDelayTime?: number;
|
||||
wheelDiameter?: number;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@ -1065,9 +1064,6 @@ export namespace state {
|
||||
if ("controlDelayTime" in data && data.controlDelayTime != undefined) {
|
||||
this.controlDelayTime = data.controlDelayTime;
|
||||
}
|
||||
if ("wheelDiameter" in data && data.wheelDiameter != undefined) {
|
||||
this.wheelDiameter = data.wheelDiameter;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
@ -1166,12 +1162,6 @@ export namespace state {
|
||||
set controlDelayTime(value: number) {
|
||||
pb_1.Message.setField(this, 15, value);
|
||||
}
|
||||
get wheelDiameter() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 16, 0) as number;
|
||||
}
|
||||
set wheelDiameter(value: number) {
|
||||
pb_1.Message.setField(this, 16, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
up?: boolean;
|
||||
@ -1188,7 +1178,6 @@ export namespace state {
|
||||
vobcState?: ReturnType<typeof TrainVobcState.prototype.toObject>;
|
||||
trainKilometer?: number;
|
||||
controlDelayTime?: number;
|
||||
wheelDiameter?: number;
|
||||
}): TrainState {
|
||||
const message = new TrainState({});
|
||||
if (data.id != null) {
|
||||
@ -1236,9 +1225,6 @@ export namespace state {
|
||||
if (data.controlDelayTime != null) {
|
||||
message.controlDelayTime = data.controlDelayTime;
|
||||
}
|
||||
if (data.wheelDiameter != null) {
|
||||
message.wheelDiameter = data.wheelDiameter;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -1258,7 +1244,6 @@ export namespace state {
|
||||
vobcState?: ReturnType<typeof TrainVobcState.prototype.toObject>;
|
||||
trainKilometer?: number;
|
||||
controlDelayTime?: number;
|
||||
wheelDiameter?: number;
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
@ -1305,9 +1290,6 @@ export namespace state {
|
||||
if (this.controlDelayTime != null) {
|
||||
data.controlDelayTime = this.controlDelayTime;
|
||||
}
|
||||
if (this.wheelDiameter != null) {
|
||||
data.wheelDiameter = this.wheelDiameter;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -1344,8 +1326,6 @@ export namespace state {
|
||||
writer.writeInt64(14, this.trainKilometer);
|
||||
if (this.controlDelayTime != 0)
|
||||
writer.writeInt64(15, this.controlDelayTime);
|
||||
if (this.wheelDiameter != 0)
|
||||
writer.writeInt32(16, this.wheelDiameter);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -1400,9 +1380,6 @@ export namespace state {
|
||||
case 15:
|
||||
message.controlDelayTime = reader.readInt64();
|
||||
break;
|
||||
case 16:
|
||||
message.wheelDiameter = reader.readInt32();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user