运行线调整

This commit is contained in:
fan 2023-10-25 13:14:17 +08:00
parent f769d1148f
commit 37fa4b17e4
8 changed files with 423 additions and 4 deletions

View File

@ -68,6 +68,30 @@
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
<q-input
outlined
v-model="runLineModel.lineColor"
@blur="onUpdate"
label="线路背景色"
lazy-rules
:rules="[(val) => (val && val.length > 0) || '线路背景色不能为空']"
>
<template v-slot:append>
<q-icon name="colorize" class="cursor-pointer">
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
<q-color
v-model="runLineModel.lineColor"
@change="
(val) => {
runLineModel.lineColor = val;
onUpdate();
}
"
/>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
<template :key="item" v-for="(item, index) in runLineModel.points"> <template :key="item" v-for="(item, index) in runLineModel.points">
<div style="display: flex; margin-top: 5px"> <div style="display: flex; margin-top: 5px">
<q-input <q-input

View File

@ -97,6 +97,12 @@ export class RunLineData extends GraphicDataBase implements IRunLineData {
set grayPointIndexs(v: number[]) { set grayPointIndexs(v: number[]) {
this.data.grayPointIndexs = v; this.data.grayPointIndexs = v;
} }
get lineColor(): string {
return this.data.lineColor;
}
set lineColor(v: string) {
this.data.lineColor = v;
}
clone(): RunLineData { clone(): RunLineData {
return new RunLineData(this.data.cloneMessage()); return new RunLineData(this.data.cloneMessage());
} }

View File

@ -35,6 +35,8 @@ export interface IRunLineData extends GraphicData {
set dashPointIndexs(v: number[]); set dashPointIndexs(v: number[]);
get grayPointIndexs(): number[]; get grayPointIndexs(): number[];
set grayPointIndexs(v: number[]); set grayPointIndexs(v: number[]);
get lineColor(): string;
set lineColor(v: string);
clone(): IRunLineData; clone(): IRunLineData;
copyFrom(data: IRunLineData): void; copyFrom(data: IRunLineData): void;
@ -43,7 +45,7 @@ export interface IRunLineData extends GraphicData {
export enum RunLineColorEnum { export enum RunLineColorEnum {
runLineColor = '0XC1F467', runLineColor = '0XC1F467',
grayLineColor = '0XCCCCCC', grayLineColor = '0xD5D5D5',
} }
export const runLineConsts = { export const runLineConsts = {
@ -84,7 +86,7 @@ export class RunLine extends JlGraphic {
this.lineBody.clear(); this.lineBody.clear();
this.lineBody.lineStyle({ this.lineBody.lineStyle({
width: runLineConsts.runLineWidth, width: runLineConsts.runLineWidth,
color: RunLineColorEnum.runLineColor, color: this.datas.lineColor || RunLineColorEnum.runLineColor,
join: LINE_JOIN.ROUND, join: LINE_JOIN.ROUND,
}); });
const start = this.getStartPoint(); const start = this.getStartPoint();

View File

@ -82,6 +82,8 @@ export class RunLineDraw extends GraphicDrawAssistant<
} }
prepareData(data: IRunLineData): boolean { prepareData(data: IRunLineData): boolean {
data.points = this.points; data.points = this.points;
const template = this.graphicTemplate;
data.lineColor = template.runLineColor;
return true; return true;
} }
} }

View File

@ -31,6 +31,17 @@ export namespace alert {
AXLE_LED_ORANGE_MOST = 16, AXLE_LED_ORANGE_MOST = 16,
SWITCH_LOST_MOST = 17, SWITCH_LOST_MOST = 17,
TRAIN_EB_ATP = 18, TRAIN_EB_ATP = 18,
ALL_LINE_BLUE_DISPLAY = 19 ALL_LINE_BLUE_DISPLAY = 19,
AXLE_LED_RED_INTERLOCK_AREA = 20,
AXLE_LED_ORANGE_INTERLOCK_AREA = 21,
SWITCH_LOST_INTERLOCK_AREA = 22,
INTERLOCK_LEVEL_ONE = 23
}
export enum TipTimeConfig {
HOLIDAYS_MORN_PEAK = 0,
HOLIDAYS_EVENING_PEAK = 1,
MORN_PEAK = 2,
EVENING_PEARK = 3,
NORMAL_UNPEARK = 4
} }
} }

View File

@ -3285,6 +3285,7 @@ export namespace graphicData {
lineId?: string; lineId?: string;
dashPointIndexs?: number[]; dashPointIndexs?: number[];
grayPointIndexs?: number[]; grayPointIndexs?: number[];
lineColor?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 8, 9, 11, 12], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 8, 9, 11, 12], this.#one_of_decls);
@ -3319,6 +3320,9 @@ export namespace graphicData {
if ("grayPointIndexs" in data && data.grayPointIndexs != undefined) { if ("grayPointIndexs" in data && data.grayPointIndexs != undefined) {
this.grayPointIndexs = data.grayPointIndexs; this.grayPointIndexs = data.grayPointIndexs;
} }
if ("lineColor" in data && data.lineColor != undefined) {
this.lineColor = data.lineColor;
}
} }
} }
get common() { get common() {
@ -3384,6 +3388,12 @@ export namespace graphicData {
set grayPointIndexs(value: number[]) { set grayPointIndexs(value: number[]) {
pb_1.Message.setField(this, 12, value); pb_1.Message.setField(this, 12, value);
} }
get lineColor() {
return pb_1.Message.getFieldWithDefault(this, 13, "") as string;
}
set lineColor(value: string) {
pb_1.Message.setField(this, 13, value);
}
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
@ -3395,6 +3405,7 @@ export namespace graphicData {
lineId?: string; lineId?: string;
dashPointIndexs?: number[]; dashPointIndexs?: number[];
grayPointIndexs?: number[]; grayPointIndexs?: number[];
lineColor?: string;
}): RunLine { }): RunLine {
const message = new RunLine({}); const message = new RunLine({});
if (data.common != null) { if (data.common != null) {
@ -3427,6 +3438,9 @@ export namespace graphicData {
if (data.grayPointIndexs != null) { if (data.grayPointIndexs != null) {
message.grayPointIndexs = data.grayPointIndexs; message.grayPointIndexs = data.grayPointIndexs;
} }
if (data.lineColor != null) {
message.lineColor = data.lineColor;
}
return message; return message;
} }
toObject() { toObject() {
@ -3441,6 +3455,7 @@ export namespace graphicData {
lineId?: string; lineId?: string;
dashPointIndexs?: number[]; dashPointIndexs?: number[];
grayPointIndexs?: number[]; grayPointIndexs?: number[];
lineColor?: string;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -3472,6 +3487,9 @@ export namespace graphicData {
if (this.grayPointIndexs != null) { if (this.grayPointIndexs != null) {
data.grayPointIndexs = this.grayPointIndexs; data.grayPointIndexs = this.grayPointIndexs;
} }
if (this.lineColor != null) {
data.lineColor = this.lineColor;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -3498,6 +3516,8 @@ export namespace graphicData {
writer.writePackedInt32(11, this.dashPointIndexs); writer.writePackedInt32(11, this.dashPointIndexs);
if (this.grayPointIndexs.length) if (this.grayPointIndexs.length)
writer.writePackedInt32(12, this.grayPointIndexs); writer.writePackedInt32(12, this.grayPointIndexs);
if (this.lineColor.length)
writer.writeString(13, this.lineColor);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -3537,6 +3557,9 @@ export namespace graphicData {
case 12: case 12:
message.grayPointIndexs = reader.readPackedInt32(); message.grayPointIndexs = reader.readPackedInt32();
break; break;
case 13:
message.lineColor = reader.readString();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }

351
src/protos/trainShedule.ts Normal file
View File

@ -0,0 +1,351 @@
/**
* Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.23.1
* source: trainShedule.proto
* git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf";
export namespace alert {
export class Plan extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
lineId?: number;
date?: number;
actionId?: number;
trainId?: string;
globalId?: string;
stationId?: number;
platformId?: number;
aTime?: number;
dTime?: number;
upWay?: boolean;
timestamp?: number;
receiveTime?: number;
flag?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("lineId" in data && data.lineId != undefined) {
this.lineId = data.lineId;
}
if ("date" in data && data.date != undefined) {
this.date = data.date;
}
if ("actionId" in data && data.actionId != undefined) {
this.actionId = data.actionId;
}
if ("trainId" in data && data.trainId != undefined) {
this.trainId = data.trainId;
}
if ("globalId" in data && data.globalId != undefined) {
this.globalId = data.globalId;
}
if ("stationId" in data && data.stationId != undefined) {
this.stationId = data.stationId;
}
if ("platformId" in data && data.platformId != undefined) {
this.platformId = data.platformId;
}
if ("aTime" in data && data.aTime != undefined) {
this.aTime = data.aTime;
}
if ("dTime" in data && data.dTime != undefined) {
this.dTime = data.dTime;
}
if ("upWay" in data && data.upWay != undefined) {
this.upWay = data.upWay;
}
if ("timestamp" in data && data.timestamp != undefined) {
this.timestamp = data.timestamp;
}
if ("receiveTime" in data && data.receiveTime != undefined) {
this.receiveTime = data.receiveTime;
}
if ("flag" in data && data.flag != undefined) {
this.flag = data.flag;
}
}
}
get lineId() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set lineId(value: number) {
pb_1.Message.setField(this, 1, value);
}
get date() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set date(value: number) {
pb_1.Message.setField(this, 2, value);
}
get actionId() {
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set actionId(value: number) {
pb_1.Message.setField(this, 3, value);
}
get trainId() {
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
}
set trainId(value: string) {
pb_1.Message.setField(this, 4, value);
}
get globalId() {
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
}
set globalId(value: string) {
pb_1.Message.setField(this, 5, value);
}
get stationId() {
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
}
set stationId(value: number) {
pb_1.Message.setField(this, 6, value);
}
get platformId() {
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
}
set platformId(value: number) {
pb_1.Message.setField(this, 7, value);
}
get aTime() {
return pb_1.Message.getFieldWithDefault(this, 8, 0) as number;
}
set aTime(value: number) {
pb_1.Message.setField(this, 8, value);
}
get dTime() {
return pb_1.Message.getFieldWithDefault(this, 9, 0) as number;
}
set dTime(value: number) {
pb_1.Message.setField(this, 9, value);
}
get upWay() {
return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean;
}
set upWay(value: boolean) {
pb_1.Message.setField(this, 10, value);
}
get timestamp() {
return pb_1.Message.getFieldWithDefault(this, 11, 0) as number;
}
set timestamp(value: number) {
pb_1.Message.setField(this, 11, value);
}
get receiveTime() {
return pb_1.Message.getFieldWithDefault(this, 12, 0) as number;
}
set receiveTime(value: number) {
pb_1.Message.setField(this, 12, value);
}
get flag() {
return pb_1.Message.getFieldWithDefault(this, 13, 0) as number;
}
set flag(value: number) {
pb_1.Message.setField(this, 13, value);
}
static fromObject(data: {
lineId?: number;
date?: number;
actionId?: number;
trainId?: string;
globalId?: string;
stationId?: number;
platformId?: number;
aTime?: number;
dTime?: number;
upWay?: boolean;
timestamp?: number;
receiveTime?: number;
flag?: number;
}): Plan {
const message = new Plan({});
if (data.lineId != null) {
message.lineId = data.lineId;
}
if (data.date != null) {
message.date = data.date;
}
if (data.actionId != null) {
message.actionId = data.actionId;
}
if (data.trainId != null) {
message.trainId = data.trainId;
}
if (data.globalId != null) {
message.globalId = data.globalId;
}
if (data.stationId != null) {
message.stationId = data.stationId;
}
if (data.platformId != null) {
message.platformId = data.platformId;
}
if (data.aTime != null) {
message.aTime = data.aTime;
}
if (data.dTime != null) {
message.dTime = data.dTime;
}
if (data.upWay != null) {
message.upWay = data.upWay;
}
if (data.timestamp != null) {
message.timestamp = data.timestamp;
}
if (data.receiveTime != null) {
message.receiveTime = data.receiveTime;
}
if (data.flag != null) {
message.flag = data.flag;
}
return message;
}
toObject() {
const data: {
lineId?: number;
date?: number;
actionId?: number;
trainId?: string;
globalId?: string;
stationId?: number;
platformId?: number;
aTime?: number;
dTime?: number;
upWay?: boolean;
timestamp?: number;
receiveTime?: number;
flag?: number;
} = {};
if (this.lineId != null) {
data.lineId = this.lineId;
}
if (this.date != null) {
data.date = this.date;
}
if (this.actionId != null) {
data.actionId = this.actionId;
}
if (this.trainId != null) {
data.trainId = this.trainId;
}
if (this.globalId != null) {
data.globalId = this.globalId;
}
if (this.stationId != null) {
data.stationId = this.stationId;
}
if (this.platformId != null) {
data.platformId = this.platformId;
}
if (this.aTime != null) {
data.aTime = this.aTime;
}
if (this.dTime != null) {
data.dTime = this.dTime;
}
if (this.upWay != null) {
data.upWay = this.upWay;
}
if (this.timestamp != null) {
data.timestamp = this.timestamp;
}
if (this.receiveTime != null) {
data.receiveTime = this.receiveTime;
}
if (this.flag != null) {
data.flag = this.flag;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.lineId != 0)
writer.writeInt32(1, this.lineId);
if (this.date != 0)
writer.writeInt64(2, this.date);
if (this.actionId != 0)
writer.writeInt32(3, this.actionId);
if (this.trainId.length)
writer.writeString(4, this.trainId);
if (this.globalId.length)
writer.writeString(5, this.globalId);
if (this.stationId != 0)
writer.writeInt32(6, this.stationId);
if (this.platformId != 0)
writer.writeInt32(7, this.platformId);
if (this.aTime != 0)
writer.writeInt64(8, this.aTime);
if (this.dTime != 0)
writer.writeInt64(9, this.dTime);
if (this.upWay != false)
writer.writeBool(10, this.upWay);
if (this.timestamp != 0)
writer.writeInt64(11, this.timestamp);
if (this.receiveTime != 0)
writer.writeInt64(12, this.receiveTime);
if (this.flag != 0)
writer.writeInt32(13, this.flag);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Plan {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Plan();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.lineId = reader.readInt32();
break;
case 2:
message.date = reader.readInt64();
break;
case 3:
message.actionId = reader.readInt32();
break;
case 4:
message.trainId = reader.readString();
break;
case 5:
message.globalId = reader.readString();
break;
case 6:
message.stationId = reader.readInt32();
break;
case 7:
message.platformId = reader.readInt32();
break;
case 8:
message.aTime = reader.readInt64();
break;
case 9:
message.dTime = reader.readInt64();
break;
case 10:
message.upWay = reader.readBool();
break;
case 11:
message.timestamp = reader.readInt64();
break;
case 12:
message.receiveTime = reader.readInt64();
break;
case 13:
message.flag = reader.readInt32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): Plan {
return Plan.deserialize(bytes);
}
}
}

@ -1 +1 @@
Subproject commit fc47b23c360355c00dc42d7a6d5bae1fe0aeb417 Subproject commit 226023c351e10e7e07cc7c48e1dbde661091b6b5