Merge branch 'master' of git.code.tencent.com:xian-ncc-da/xian-ncc-da-client

This commit is contained in:
Yuan 2023-06-30 17:05:05 +08:00
commit b19d06cf8c
18 changed files with 394 additions and 272 deletions

@ -1 +1 @@
Subproject commit 6626ad51140f611fa8583895c27c6a788fca1d7f Subproject commit 7e4eaed0cf06d68c75cb51c30329eff5fe4d1e3f

View File

@ -1,8 +1,20 @@
<template> <template>
<q-form> <q-form>
<q-input outlined readonly v-model="runLineModel.id" label="id" hint="" /> <q-input outlined readonly v-model="runLineModel.id" label="id" hint="" />
<q-select
outlined
style="margin-top: 10px"
v-model="runLineModel.lineId"
:options="lineList"
:map-options="true"
:emit-value="true"
@update:model-value="onUpdate"
label="关联线路"
>
</q-select>
<q-input <q-input
outlined outlined
style="margin-top: 10px"
v-model="runLineModel.code" v-model="runLineModel.code"
@blur="onUpdate" @blur="onUpdate"
label="名称" label="名称"
@ -10,6 +22,7 @@
<q-input <q-input
outlined outlined
v-model="runLineModel.nameColor" v-model="runLineModel.nameColor"
style="margin-top: 10px"
@blur="onUpdate" @blur="onUpdate"
label="名称颜色" label="名称颜色"
lazy-rules lazy-rules
@ -108,16 +121,18 @@
import { RunLineData } from 'src/drawApp/graphics/RunLineInteraction'; import { RunLineData } from 'src/drawApp/graphics/RunLineInteraction';
import { RunLine } from 'src/graphics/runLine/RunLine'; import { RunLine } from 'src/graphics/runLine/RunLine';
import { useDrawStore } from 'src/stores/draw-store'; import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive, watch } from 'vue'; import { onMounted, reactive, watch, ref } from 'vue';
import { Point } from 'pixi.js'; import { Point } from 'pixi.js';
import { import {
IStationLineData, IStationLineData,
StationLine, StationLine,
} from 'src/graphics/stationLine/StationLine'; } from 'src/graphics/stationLine/StationLine';
import { getLineList } from 'src/api/LineInfoApi';
const drawStore = useDrawStore(); const drawStore = useDrawStore();
const runLineModel = reactive(new RunLineData()); const runLineModel = reactive(new RunLineData());
const stationLines: IStationLineData[] = reactive([]); const stationLines: IStationLineData[] = reactive([]);
const lineList: { label: string; value: string }[] = reactive([]);
drawStore.$subscribe; drawStore.$subscribe;
watch( watch(
@ -130,6 +145,15 @@ watch(
); );
onMounted(() => { onMounted(() => {
getLineList()
.then((res) => {
res.forEach((item) => {
lineList.push({ value: item.lineId + '', label: item.name });
});
})
.catch((err) => {
console.error('获取线路列表失败:' + err.message);
});
const runLine = drawStore.selectedGraphic as RunLine; const runLine = drawStore.selectedGraphic as RunLine;
const stations = drawStore const stations = drawStore
.getDrawApp() .getDrawApp()

View File

@ -130,33 +130,24 @@ export abstract class GraphicDataBase implements GraphicData {
return pb_1.Message.equals(this._data, other._data); return pb_1.Message.equals(this._data, other._data);
} }
} }
export interface IProtoGraphicState extends pb_1.Message {
id: string;
}
export abstract class GraphicStateBase implements GraphicState { export abstract class GraphicStateBase implements GraphicState {
_graphicType: string; _graphicType: string;
_state: IProtoGraphicState; _state: pb_1.Message;
constructor(state: IProtoGraphicState, graphicType: string) { constructor(state: pb_1.Message, graphicType: string) {
this._state = state; this._state = state;
this._graphicType = graphicType; this._graphicType = graphicType;
} }
getState<S extends IProtoGraphicState>(): S { abstract get code(): string;
abstract copyFrom(data: GraphicState): void;
abstract eq(data: GraphicState): boolean;
getState<S extends pb_1.Message>(): S {
return this._state as S; return this._state as S;
} }
get code(): string {
return this._state.id;
}
get graphicType(): string { get graphicType(): string {
return this._graphicType; return this._graphicType;
} }
clone(): GraphicState { clone(): GraphicState {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }
copyFrom(data: GraphicStateBase): void {
pb_1.Message.copyInto(data._state, this._state);
}
eq(data: GraphicStateBase): boolean {
return pb_1.Message.equals(this._state, data._state);
}
} }

View File

@ -64,24 +64,24 @@ export class RunLineData extends GraphicDataBase implements IRunLineData {
set nameBgColor(v: string) { set nameBgColor(v: string) {
this.data.nameBgColor = v; this.data.nameBgColor = v;
} }
get upPathLineId(): string {
return this.data.upPathLineId;
}
set upPathLineId(v: string) {
this.data.upPathLineId = v;
}
get downPathLineId(): string {
return this.data.downPathLineId;
}
set downPathLineId(v: string) {
this.data.downPathLineId = v;
}
get containSta(): string[] { get containSta(): string[] {
return this.data.containSta; return this.data.containSta;
} }
set containSta(v: string[]) { set containSta(v: string[]) {
this.data.containSta = v; this.data.containSta = v;
} }
get linkPathLines(): string[] {
return this.data.linkPathLines;
}
set linkPathLines(v: string[]) {
this.data.linkPathLines = v;
}
get lineId(): string {
return this.data.lineId;
}
set lineId(v: string) {
this.data.lineId = v;
}
clone(): RunLineData { clone(): RunLineData {
return new RunLineData(this.data.cloneMessage()); return new RunLineData(this.data.cloneMessage());
} }

View File

@ -71,7 +71,9 @@ export class SignalState extends GraphicStateBase implements ISignalState {
} }
super(states, Signal.Type); super(states, Signal.Type);
} }
get code(): string {
return this.states.id;
}
get redOpen(): boolean { get redOpen(): boolean {
return this.states.redOpen; return this.states.redOpen;
} }
@ -214,10 +216,15 @@ export class SignalState extends GraphicStateBase implements ISignalState {
get states(): state.Signal { get states(): state.Signal {
return this.getState<state.Signal>(); return this.getState<state.Signal>();
} }
clone(): SignalState { clone(): SignalState {
return new SignalState(this.states.cloneMessage()); return new SignalState(this.states.cloneMessage());
} }
copyFrom(data: GraphicStateBase): void {
pb_1.Message.copyInto(data._state, this._state);
}
eq(data: GraphicStateBase): boolean {
return pb_1.Message.equals(this._state, data._state);
}
} }
const mirrorFlipConfig: MenuItemOptions = { const mirrorFlipConfig: MenuItemOptions = {

View File

@ -1,7 +1,12 @@
import * as pb_1 from 'google-protobuf'; import * as pb_1 from 'google-protobuf';
import { ITrainLineData, TrainLine } from 'src/graphics/trainLine/TrainLine'; import {
ITrainLineData,
TrainLine,
ITrainLineState,
} from 'src/graphics/trainLine/TrainLine';
import { graphicData } from 'src/protos/stationLayoutGraphics'; import { graphicData } from 'src/protos/stationLayoutGraphics';
import { GraphicDataBase } from './GraphicDataBase'; import { GraphicDataBase, GraphicStateBase } from './GraphicDataBase';
import { state } from 'src/protos/ws_message';
export class TrainLineData extends GraphicDataBase implements ITrainLineData { export class TrainLineData extends GraphicDataBase implements ITrainLineData {
constructor(data?: graphicData.TrainLine) { constructor(data?: graphicData.TrainLine) {
@ -36,3 +41,70 @@ export class TrainLineData extends GraphicDataBase implements ITrainLineData {
return pb_1.Message.equals(this.data, other.data); return pb_1.Message.equals(this.data, other.data);
} }
} }
export class TrainLineState
extends GraphicStateBase
implements ITrainLineState
{
constructor(proto?: state.WsLineNetTrainOffsetMessage) {
let states;
if (proto) {
states = proto;
} else {
states = new state.WsLineNetTrainOffsetMessage();
}
super(states, TrainLine.Type);
}
get code(): string {
return this.states.groupId;
}
get lineId(): number {
return this.states.lineId;
}
set lineId(v: number) {
this.states.lineId = v;
}
get trainIndex(): string {
return this.states.trainIndex;
}
set trainIndex(v: string) {
this.states.trainIndex = v;
}
get groupId(): string {
return this.states.groupId;
}
set groupId(v: string) {
this.states.groupId = v;
}
get show(): boolean {
return this.states.show;
}
set show(v: boolean) {
this.states.show = v;
}
get kilometerCode(): number {
return this.states.kilometerCode;
}
set kilometerCode(v: number) {
this.states.kilometerCode = v;
}
get dir(): number {
return this.states.dir;
}
set dir(v: number) {
this.states.dir = v;
}
get states(): state.WsLineNetTrainOffsetMessage {
return this.getState<state.WsLineNetTrainOffsetMessage>();
}
clone(): TrainLineState {
return new TrainLineState(this.states.cloneMessage());
}
copyFrom(data: GraphicStateBase): void {
pb_1.Message.copyInto(data._state, this._state);
}
eq(data: GraphicStateBase): boolean {
return pb_1.Message.equals(this._state, data._state);
}
}

View File

@ -22,7 +22,7 @@ import {
} from 'src/graphics/stationLine/StationLine'; } from 'src/graphics/stationLine/StationLine';
import { StationLineData } from './graphics/StationLineInteraction'; import { StationLineData } from './graphics/StationLineInteraction';
import { ItrainLineTemplate } from 'src/graphics/trainLine/TrainLine'; import { ItrainLineTemplate } from 'src/graphics/trainLine/TrainLine';
import { TrainLineData } from './graphics/TrainLineInteraction'; import { TrainLineData, TrainLineState } from './graphics/TrainLineInteraction';
import { RectTemplate } from 'src/graphics/rect/Rect'; import { RectTemplate } from 'src/graphics/rect/Rect';
import { RectData } from './graphics/RectInteraction'; import { RectData } from './graphics/RectInteraction';
@ -32,6 +32,7 @@ import { getWebsocketUrl } from 'src/configs/UrlManage';
import { getJwtToken } from 'src/configs/TokenManage'; import { getJwtToken } from 'src/configs/TokenManage';
let lineNetApp: GraphicApp | null = null; let lineNetApp: GraphicApp | null = null;
let msgBroker: AppWsMsgBroker | null = null;
export function getLineNetApp(): GraphicApp | null { export function getLineNetApp(): GraphicApp | null {
return lineNetApp; return lineNetApp;
@ -42,6 +43,9 @@ export function destroyLineNetApp(): void {
lineNetApp.destroy(); lineNetApp.destroy();
lineNetApp = null; lineNetApp = null;
} }
if (msgBroker) {
msgBroker.close();
}
} }
export function initLineNetApp(dom: HTMLElement): GraphicApp { export function initLineNetApp(dom: HTMLElement): GraphicApp {
@ -50,7 +54,7 @@ export function initLineNetApp(dom: HTMLElement): GraphicApp {
new RunLineTemplate(new RunLineData()), new RunLineTemplate(new RunLineData()),
new PathLineTemplate(new PathLineData()), new PathLineTemplate(new PathLineData()),
new StationLineTemplate(new StationLineData()), new StationLineTemplate(new StationLineData()),
new ItrainLineTemplate(new TrainLineData()), new ItrainLineTemplate(new TrainLineData(), new TrainLineState()),
new RectTemplate(new RectData()), new RectTemplate(new RectData()),
]; ];
lineNetApp.registerGraphicTemplates(...graphicTemplate); lineNetApp.registerGraphicTemplates(...graphicTemplate);
@ -79,8 +83,8 @@ export async function loadLineNetDatas(app: GraphicApp) {
console.log('加载数据', storage); console.log('加载数据', storage);
app.updateCanvas(storage.canvas); app.updateCanvas(storage.canvas);
const datas: GraphicData[] = []; const datas: GraphicData[] = [];
storage.runLines.forEach((runLines) => { storage.runLines.forEach((runLine) => {
const g = new RunLineData(runLines); const g = new RunLineData(runLine);
datas.push(g); datas.push(g);
}); });
storage.pathLines.forEach((pathLine) => { storage.pathLines.forEach((pathLine) => {
@ -105,20 +109,23 @@ export async function loadLineNetDatas(app: GraphicApp) {
pathLine.visible = false; pathLine.visible = false;
}); });
// StompCli.new({ StompCli.new({
// wsUrl: `${getWebsocketUrl()}`, wsUrl: `${getWebsocketUrl()}`,
// token: getJwtToken() as string, token: getJwtToken() as string,
// }); });
// // export type MessageConverter = (message: Uint8Array) => GraphicState[]; msgBroker = new AppWsMsgBroker(app);
// const msgBroker = new AppWsMsgBroker(app); const states: GraphicState[] = [];
// const states: GraphicState[] = []; msgBroker.subscribe({
// msgBroker.subscribe({ destination: '/queue/lineNet',
// destination: '/queue/lineNet', messageConverter: (message: Uint8Array) => {
// messageConverter: (message: Uint8Array) => { const storage = state.WsLineNetMessage.deserialize(message);
// const storage = state.WsLineNetMessage.deserialize(message); console.log(storage, 'storage');
// storage.offset.forEach((item) => {}); storage.offset.forEach((item) => {
// }, states.push(new TrainLineState(item));
// }); });
return states;
},
});
} else { } else {
app.loadGraphic([]); app.loadGraphic([]);
} }

View File

@ -15,7 +15,7 @@ import {
AxleCountingTemplate, AxleCountingTemplate,
AxleCountingConsts, AxleCountingConsts,
} from './AxleCounting'; } from './AxleCounting';
import { Section, SectionPort } from '../section/Section'; import { Section, SectionPort, SectionType } from '../section/Section';
import { Turnout, TurnoutPort } from '../turnout/Turnout'; import { Turnout, TurnoutPort } from '../turnout/Turnout';
import { IRelatedRefData, createRelatedRefProto } from '../CommonGraphics'; import { IRelatedRefData, createRelatedRefProto } from '../CommonGraphics';
@ -185,6 +185,12 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
if (axleCountingPs.y > height.y) { if (axleCountingPs.y > height.y) {
direction = -1; direction = -1;
} }
if (
section.datas.sectionType === SectionType.Logic ||
section.datas.children.includes(refDevice.id)
) {
return;
}
if (refDevice.type == Section.Type || refDevice.type == Turnout.Type) if (refDevice.type == Section.Type || refDevice.type == Turnout.Type)
this.draw( this.draw(
axleCountingPs, axleCountingPs,

View File

@ -81,11 +81,11 @@ export class PathLine extends JlGraphic {
if (!app) return; if (!app) return;
const runLineList = app.queryStore.queryByType(RunLine.Type) as RunLine[]; const runLineList = app.queryStore.queryByType(RunLine.Type) as RunLine[];
runLineList.find((runLine) => { runLineList.find((runLine) => {
if (runLine.datas.downPathLineId === pathLineId) { if (runLine.datas.linkPathLines.includes(pathLineId)) {
runLine.datas.downPathLineId = ''; const list = [...runLine.datas.linkPathLines];
return true; const index = list.findIndex((item) => item === pathLineId);
} else if (runLine.datas.upPathLineId === pathLineId) { list.splice(index, 1);
runLine.datas.upPathLineId = ''; runLine.datas.linkPathLines = list;
return true; return true;
} }
}); });

View File

@ -24,12 +24,12 @@ export interface IRunLineData extends GraphicData {
set nameColor(v: string); set nameColor(v: string);
get nameBgColor(): string; get nameBgColor(): string;
set nameBgColor(v: string); set nameBgColor(v: string);
get upPathLineId(): string;
set upPathLineId(v: string);
get downPathLineId(): string;
set downPathLineId(v: string);
get containSta(): string[]; get containSta(): string[];
set containSta(v: string[]); set containSta(v: string[]);
get linkPathLines(): string[];
set linkPathLines(v: string[]);
get lineId(): string;
set lineId(v: string);
clone(): IRunLineData; clone(): IRunLineData;
copyFrom(data: IRunLineData): void; copyFrom(data: IRunLineData): void;
@ -200,22 +200,17 @@ export class RunLine extends JlGraphic {
const pathLineDrawAssistant = app.getDrawAssistant( const pathLineDrawAssistant = app.getDrawAssistant(
PathLine.Type PathLine.Type
) as PathLineDraw; ) as PathLineDraw;
if (this.datas.upPathLineId) { if (this.datas.linkPathLines.length) {
const oldUp = app.queryStore.queryById(this.datas.upPathLineId); }
this.datas.linkPathLines.forEach((item) => {
const oldUp = app.queryStore.queryById(item);
if (oldUp) { if (oldUp) {
app.deleteGraphics(oldUp); app.deleteGraphics(oldUp);
} }
} });
if (this.datas.downPathLineId) {
const oldDown = app.queryStore.queryById(this.datas.downPathLineId);
if (oldDown) {
app.deleteGraphics(oldDown);
}
}
const pathLineUp = pathLineDrawAssistant.quickCreate(pointsUp); const pathLineUp = pathLineDrawAssistant.quickCreate(pointsUp);
const pathLineDown = pathLineDrawAssistant.quickCreate(pointsDown); const pathLineDown = pathLineDrawAssistant.quickCreate(pointsDown);
this.datas.upPathLineId = pathLineUp?.id || ''; this.datas.linkPathLines = [pathLineUp?.id || '', pathLineDown?.id || ''];
this.datas.downPathLineId = pathLineDown?.id || '';
this.generatePathLineKilometerPoints(); this.generatePathLineKilometerPoints();
} }
@ -229,18 +224,12 @@ export class RunLine extends JlGraphic {
super.onDelete(); super.onDelete();
const app = getDrawApp(); const app = getDrawApp();
if (!app) return; if (!app) return;
if (this.datas.upPathLineId) { this.datas.linkPathLines.forEach((item) => {
const oldUp = app.queryStore.queryById(this.datas.upPathLineId); const oldUp = app.queryStore.queryById(item);
if (oldUp) { if (oldUp) {
app.deleteGraphics(oldUp); app.deleteGraphics(oldUp);
} }
} });
if (this.datas.downPathLineId) {
const oldDown = app.queryStore.queryById(this.datas.downPathLineId);
if (oldDown) {
app.deleteGraphics(oldDown);
}
}
} }
generateContainSta(): void { generateContainSta(): void {
const app = getDrawApp(); const app = getDrawApp();
@ -276,18 +265,10 @@ export class RunLine extends JlGraphic {
generatePathLineKilometerPoints(): void { generatePathLineKilometerPoints(): void {
const app = getDrawApp(); const app = getDrawApp();
if (!app) return; if (!app) return;
if (this.datas.upPathLineId) { this.datas.linkPathLines.forEach((item) => {
const pathLine = app.queryStore.queryById( const pathLine = app.queryStore.queryById(item) as PathLine;
this.datas.upPathLineId
) as PathLine;
pathLine.generatePathLineKilometerPoints(this.datas.containSta); pathLine.generatePathLineKilometerPoints(this.datas.containSta);
} });
if (this.datas.downPathLineId) {
const pathLine = app.queryStore.queryById(
this.datas.downPathLineId
) as PathLine;
pathLine.generatePathLineKilometerPoints(this.datas.containSta);
}
} }
} }

View File

@ -8,7 +8,7 @@ import {
JlGraphic, JlGraphic,
linePoint, linePoint,
} from 'src/jl-graphic'; } from 'src/jl-graphic';
import { Section } from '../section/Section'; import { Section, SectionType } from '../section/Section';
import { import {
ISeparatorData, ISeparatorData,
Separator, Separator,
@ -73,14 +73,21 @@ export class SeparatorDraw extends GraphicDrawAssistant<
const port: string[] = []; const port: string[] = [];
allR.forEach((relation, index) => { allR.forEach((relation, index) => {
const r = relation.getRelationParam(section); const r = relation.getRelationParam(section);
port.push(r.param);
const other = relation.getOtherRelationParam(section); const other = relation.getOtherRelationParam(section);
if (!section.datas.children.includes(other.g.id)) {
// 排除物理区段和自身逻辑区段的关联关系
port.push(r.param);
}
if (!rMap.has(setKey(r))) { if (!rMap.has(setKey(r))) {
rMap.set(setKey(r), { ...r }); rMap.set(setKey(r), { ...r });
} }
if (!rMap.has(setKey(other))) { if (!rMap.has(setKey(other))) {
rMap.set(setKey(other), { ...other, repetition: true }); rMap.set(setKey(other), { ...other, repetition: true });
} }
if (section.datas.sectionType === SectionType.Logic) {
// 逻辑区段没有断路分隔符
return;
}
if (index == allR.length - 1) { if (index == allR.length - 1) {
if (!port.includes('A')) { if (!port.includes('A')) {
rMap.set(`${section.id}_A`, { rMap.set(`${section.id}_A`, {

View File

@ -1,4 +1,10 @@
import { GraphicData, JlGraphic, JlGraphicTemplate } from 'src/jl-graphic'; import {
GraphicData,
GraphicState,
GraphicIdGenerator,
JlGraphic,
JlGraphicTemplate,
} from 'src/jl-graphic';
import trainLineSprites from './trainLineSprites.png'; import trainLineSprites from './trainLineSprites.png';
import { Assets, Sprite, Texture } from 'pixi.js'; import { Assets, Sprite, Texture } from 'pixi.js';
@ -8,6 +14,21 @@ export interface ITrainLineData extends GraphicData {
set code(v: string); set code(v: string);
} }
export interface ITrainLineState extends GraphicState {
get lineId(): number;
set lineId(v: number);
get trainIndex(): string;
set trainIndex(v: string);
get groupId(): string;
set groupId(v: string);
get show(): boolean;
set show(v: boolean);
get kilometerCode(): number;
set kilometerCode(v: number);
get dir(): number;
set dir(v: number);
}
export class TrainLine extends JlGraphic { export class TrainLine extends JlGraphic {
static Type = 'TrainLine'; static Type = 'TrainLine';
train: Sprite; train: Sprite;
@ -22,21 +43,34 @@ export class TrainLine extends JlGraphic {
this.train.scale.set(0.02, 0.02); this.train.scale.set(0.02, 0.02);
this.addChild(this.train); this.addChild(this.train);
} }
get states(): ITrainLineState {
return this.getStates<ITrainLineState>();
}
doRepaint(): void { doRepaint(): void {
this.train.texture = this.trainTextures; this.train.texture = this.trainTextures;
console.log(this.states, '****');
this.train.position.set(100, 100);
const runLine = this.queryStore.queryById(this.states.lineId + '');
} }
} }
export class ItrainLineTemplate extends JlGraphicTemplate<TrainLine> { export class ItrainLineTemplate extends JlGraphicTemplate<TrainLine> {
trainTextures?: Texture; trainTextures?: Texture;
constructor(dataTemplate: ITrainLineData) { constructor(dataTemplate: ITrainLineData, stateTemplate: ITrainLineState) {
super(TrainLine.Type, { super(TrainLine.Type, {
dataTemplate, dataTemplate,
stateTemplate,
}); });
} }
new(): TrainLine { new(): TrainLine {
if (this.trainTextures) { if (this.trainTextures) {
return new TrainLine(this.trainTextures); const data = this.datas as GraphicData;
data.id = GraphicIdGenerator.next();
data.graphicType = this.type;
const g = new TrainLine(this.trainTextures);
g.loadData(data);
g.loadState(this.states);
return g;
} }
throw new Error('资源未加载/加载失败'); throw new Error('资源未加载/加载失败');
} }

View File

@ -4,9 +4,10 @@ import {
GraphicRelationParam, GraphicRelationParam,
JlGraphic, JlGraphic,
JlGraphicTemplate, JlGraphicTemplate,
distance2,
getRectangleCenter, getRectangleCenter,
} from 'src/jl-graphic'; } from 'src/jl-graphic';
import { Section } from '../section/Section'; import { Section, SectionType } from '../section/Section';
export interface ITrainWindowData extends GraphicData { export interface ITrainWindowData extends GraphicData {
get code(): string; // 编号 get code(): string; // 编号
@ -37,24 +38,21 @@ export class TrainWindow extends JlGraphic {
return this.getDatas<ITrainWindowData>(); return this.getDatas<ITrainWindowData>();
} }
doRepaint(): void { doRepaint(): void {
const section = this.queryStore.queryById<Section>(this.datas.sectionId);
let width = TrainWindowConsts.width;
if (section.datas.sectionType == SectionType.Logic) {
const ps = section.getStartPoint();
const pe = section.getEndPoint();
width = distance2(ps, pe);
}
const rectGraphic = this.rectGraphic; const rectGraphic = this.rectGraphic;
rectGraphic.clear(); rectGraphic.clear();
rectGraphic.lineStyle( rectGraphic.lineStyle(
TrainWindowConsts.lineWidth, TrainWindowConsts.lineWidth,
new Color(TrainWindowConsts.lineColor) new Color(TrainWindowConsts.lineColor)
); );
rectGraphic.drawRect( rectGraphic.drawRect(0, 0, width, TrainWindowConsts.height);
0, const rectP = new Rectangle(0, 0, width, TrainWindowConsts.height);
0,
TrainWindowConsts.width,
TrainWindowConsts.height
);
const rectP = new Rectangle(
0,
0,
TrainWindowConsts.width,
TrainWindowConsts.height
);
rectGraphic.pivot = getRectangleCenter(rectP); rectGraphic.pivot = getRectangleCenter(rectP);
} }
loadRelations(): void { loadRelations(): void {

View File

@ -1,4 +1,4 @@
import { FederatedPointerEvent, IHitArea, IPointData, Point } from 'pixi.js'; import { FederatedPointerEvent, IHitArea, Point } from 'pixi.js';
import { import {
AbsorbableLine, AbsorbableLine,
AbsorbablePosition, AbsorbablePosition,
@ -7,6 +7,7 @@ import {
GraphicInteractionPlugin, GraphicInteractionPlugin,
JlDrawApp, JlDrawApp,
JlGraphic, JlGraphic,
distance2,
linePoint, linePoint,
} from 'src/jl-graphic'; } from 'src/jl-graphic';
@ -16,7 +17,7 @@ import {
TrainWindowTemplate, TrainWindowTemplate,
TrainWindowConsts, TrainWindowConsts,
} from './TrainWindow'; } from './TrainWindow';
import { Section } from '../section/Section'; import { Section, SectionType } from '../section/Section';
export interface ITrainWindowDrawOptions { export interface ITrainWindowDrawOptions {
newData: () => ITrainWindowData; newData: () => ITrainWindowData;
@ -94,6 +95,18 @@ export class TrainWindowDraw extends GraphicDrawAssistant<
} }
this.storeGraphic(...trainWindows); this.storeGraphic(...trainWindows);
} }
draw(x: number, ps: Point, direction: number, section: Section) {
const trainWindow = new TrainWindow();
trainWindow.loadData(this.graphicTemplate.datas);
trainWindow.position.set(
x,
ps.y - direction * TrainWindowConsts.offsetSection
);
trainWindow.id = GraphicIdGenerator.next();
trainWindow.datas.sectionId = section.id;
this.storeGraphic(trainWindow);
trainWindow.loadRelations();
}
oneGenerates(height: Point) { oneGenerates(height: Point) {
const sections = this.app.queryStore.queryByType<Section>(Section.Type); const sections = this.app.queryStore.queryByType<Section>(Section.Type);
const trainWindowAll = this.app.queryStore.queryByType<TrainWindow>( const trainWindowAll = this.app.queryStore.queryByType<TrainWindow>(
@ -101,28 +114,22 @@ export class TrainWindowDraw extends GraphicDrawAssistant<
); );
this.app.deleteGraphics(...trainWindowAll); this.app.deleteGraphics(...trainWindowAll);
sections.forEach((section) => { sections.forEach((section) => {
const points = section.datas.points; const ps = section.localToCanvasPoint(section.getStartPoint());
const transPos = section.datas.transform.position; const pe = section.localToCanvasPoint(section.getEndPoint());
const ps: IPointData[] = [];
points.forEach((point: IPointData) => {
ps.push(new Point(point.x + transPos.x, point.y + transPos.y));
});
let direction = 1; let direction = 1;
if (ps[0].y > height.y) { if (ps.y > height.y) {
direction = -1; direction = -1;
} }
for (let i = 0; i < ps.length - 1; i++) { const x = (ps.x + pe.x) / 2;
const x = (ps[i].x + ps[i + 1].x) / 2; if (section.datas.children.length) {
const trainWindow = new TrainWindow(); section.childSections.forEach((childSection) => {
trainWindow.loadData(this.graphicTemplate.datas); const psChild = childSection.localToCanvasPoint(
trainWindow.position.set( childSection.getStartPoint()
x, );
ps[i].y - direction * TrainWindowConsts.offsetSection this.draw(psChild.x, psChild, direction, childSection);
); });
trainWindow.id = GraphicIdGenerator.next(); } else {
trainWindow.datas.sectionId = section.id; this.draw(x, ps, direction, section);
this.storeGraphic(trainWindow);
trainWindow.loadRelations();
} }
}); });
} }
@ -135,11 +142,20 @@ export class RectGraphicHitArea implements IHitArea {
this.rect = rect; this.rect = rect;
} }
contains(x: number, y: number): boolean { contains(x: number, y: number): boolean {
const section = this.rect.queryStore.queryById<Section>(
this.rect.datas.sectionId
);
let width = TrainWindowConsts.width;
if (section.datas.sectionType == SectionType.Logic) {
const ps = section.getStartPoint();
const pe = section.getEndPoint();
width = distance2(ps, pe);
}
let contains = false; let contains = false;
const tolerance = TrainWindowConsts.lineWidth; const tolerance = TrainWindowConsts.lineWidth;
const p1 = new Point(0, 0); const p1 = new Point(0, 0);
const p2 = new Point(TrainWindowConsts.width, 0); const p2 = new Point(width, 0);
const p3 = new Point(TrainWindowConsts.width, TrainWindowConsts.height); const p3 = new Point(width, TrainWindowConsts.height);
const p4 = new Point(0, TrainWindowConsts.height); const p4 = new Point(0, TrainWindowConsts.height);
const p = new Point(x, y); const p = new Point(x, y);

View File

@ -152,12 +152,32 @@ export class StompCli {
} }
// 状态订阅消息转换器 // 状态订阅消息转换器
export type MessageConverter = (message: Uint8Array) => GraphicState[]; export type GraphicStateMessageConvert = (
message: Uint8Array
) => GraphicState[];
// 订阅消息处理器
export type SubscriptionMessageHandle = (message: Uint8Array) => void;
// 图形app状态订阅 // 图形app状态订阅
export interface AppStateSubscription { export interface AppStateSubscription {
/**
*
*/
destination: string; destination: string;
messageConverter: MessageConverter; /**
subscription?: StompSubscription; // 订阅成功对象,用于取消订阅 *
*/
messageConverter?: GraphicStateMessageConvert;
/**
*
*/
messageHandle?: SubscriptionMessageHandle;
/**
*
* 使
*/
subscription?: StompSubscription;
} }
/** /**
@ -180,8 +200,16 @@ export class AppWsMsgBroker {
sub.subscription = StompCli.trySubscribe( sub.subscription = StompCli.trySubscribe(
sub.destination, sub.destination,
(message: Message) => { (message: Message) => {
const graphicStates = sub.messageConverter(message.binaryBody); if (sub.messageConverter) {
this.app.handleGraphicStates(graphicStates); const graphicStates = sub.messageConverter(message.binaryBody);
this.app.handleGraphicStates(graphicStates);
} else if (sub.messageHandle) {
sub.messageHandle(message.binaryBody);
} else {
console.error(
`订阅destination:${sub.destination}没有消息处理器或图形状态消息转换器`
);
}
} }
); );
// console.log('代理订阅结果', sub.subscription) // console.log('代理订阅结果', sub.subscription)

View File

@ -12,12 +12,12 @@ export namespace state {
id?: string; id?: string;
code?: string; code?: string;
type?: dependency_1.graphicData.Section.SectionType; type?: dependency_1.graphicData.Section.SectionType;
kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
children?: Section[]; children?: Section[];
kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
convertKilometer?: number[]; convertKilometer?: number[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 6], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 7], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -28,12 +28,12 @@ export namespace state {
if ("type" in data && data.type != undefined) { if ("type" in data && data.type != undefined) {
this.type = data.type; this.type = data.type;
} }
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem;
}
if ("children" in data && data.children != undefined) { if ("children" in data && data.children != undefined) {
this.children = data.children; this.children = data.children;
} }
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem;
}
if ("convertKilometer" in data && data.convertKilometer != undefined) { if ("convertKilometer" in data && data.convertKilometer != undefined) {
this.convertKilometer = data.convertKilometer; this.convertKilometer = data.convertKilometer;
} }
@ -57,30 +57,30 @@ export namespace state {
set type(value: dependency_1.graphicData.Section.SectionType) { set type(value: dependency_1.graphicData.Section.SectionType) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
get kilometerSystem() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 4) as dependency_1.graphicData.KilometerSystem[];
}
set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get children() { get children() {
return pb_1.Message.getRepeatedWrapperField(this, Section, 5) as Section[]; return pb_1.Message.getRepeatedWrapperField(this, Section, 4) as Section[];
} }
set children(value: Section[]) { set children(value: Section[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get kilometerSystem() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 5) as dependency_1.graphicData.KilometerSystem[];
}
set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value); pb_1.Message.setRepeatedWrapperField(this, 5, value);
} }
get convertKilometer() { get convertKilometer() {
return pb_1.Message.getFieldWithDefault(this, 6, []) as number[]; return pb_1.Message.getFieldWithDefault(this, 7, []) as number[];
} }
set convertKilometer(value: number[]) { set convertKilometer(value: number[]) {
pb_1.Message.setField(this, 6, value); pb_1.Message.setField(this, 7, value);
} }
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
code?: string; code?: string;
type?: dependency_1.graphicData.Section.SectionType; type?: dependency_1.graphicData.Section.SectionType;
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
children?: ReturnType<typeof Section.prototype.toObject>[]; children?: ReturnType<typeof Section.prototype.toObject>[];
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
convertKilometer?: number[]; convertKilometer?: number[];
}): Section { }): Section {
const message = new Section({}); const message = new Section({});
@ -93,12 +93,12 @@ export namespace state {
if (data.type != null) { if (data.type != null) {
message.type = data.type; message.type = data.type;
} }
if (data.kilometerSystem != null) {
message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
}
if (data.children != null) { if (data.children != null) {
message.children = data.children.map(item => Section.fromObject(item)); message.children = data.children.map(item => Section.fromObject(item));
} }
if (data.kilometerSystem != null) {
message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
}
if (data.convertKilometer != null) { if (data.convertKilometer != null) {
message.convertKilometer = data.convertKilometer; message.convertKilometer = data.convertKilometer;
} }
@ -109,8 +109,8 @@ export namespace state {
id?: string; id?: string;
code?: string; code?: string;
type?: dependency_1.graphicData.Section.SectionType; type?: dependency_1.graphicData.Section.SectionType;
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
children?: ReturnType<typeof Section.prototype.toObject>[]; children?: ReturnType<typeof Section.prototype.toObject>[];
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
convertKilometer?: number[]; convertKilometer?: number[];
} = {}; } = {};
if (this.id != null) { if (this.id != null) {
@ -122,12 +122,12 @@ export namespace state {
if (this.type != null) { if (this.type != null) {
data.type = this.type; data.type = this.type;
} }
if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
}
if (this.children != null) { if (this.children != null) {
data.children = this.children.map((item: Section) => item.toObject()); data.children = this.children.map((item: Section) => item.toObject());
} }
if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
}
if (this.convertKilometer != null) { if (this.convertKilometer != null) {
data.convertKilometer = this.convertKilometer; data.convertKilometer = this.convertKilometer;
} }
@ -143,12 +143,12 @@ export namespace state {
writer.writeString(2, this.code); writer.writeString(2, this.code);
if (this.type != dependency_1.graphicData.Section.SectionType.Physical) if (this.type != dependency_1.graphicData.Section.SectionType.Physical)
writer.writeEnum(3, this.type); writer.writeEnum(3, this.type);
if (this.kilometerSystem.length)
writer.writeRepeatedMessage(4, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
if (this.children.length) if (this.children.length)
writer.writeRepeatedMessage(5, this.children, (item: Section) => item.serialize(writer)); writer.writeRepeatedMessage(4, this.children, (item: Section) => item.serialize(writer));
if (this.kilometerSystem.length)
writer.writeRepeatedMessage(5, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
if (this.convertKilometer.length) if (this.convertKilometer.length)
writer.writePackedInt64(6, this.convertKilometer); writer.writePackedInt64(7, this.convertKilometer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -168,12 +168,12 @@ export namespace state {
message.type = reader.readEnum(); message.type = reader.readEnum();
break; break;
case 4: case 4:
reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_1.graphicData.KilometerSystem.deserialize(reader), dependency_1.graphicData.KilometerSystem)); reader.readMessage(message.children, () => pb_1.Message.addToRepeatedWrapperField(message, 4, Section.deserialize(reader), Section));
break; break;
case 5: case 5:
reader.readMessage(message.children, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Section.deserialize(reader), Section)); reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 5, dependency_1.graphicData.KilometerSystem.deserialize(reader), dependency_1.graphicData.KilometerSystem));
break; break;
case 6: case 7:
message.convertKilometer = reader.readPackedInt64(); message.convertKilometer = reader.readPackedInt64();
break; break;
default: reader.skipField(); default: reader.skipField();
@ -193,13 +193,11 @@ export namespace state {
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
code?: string; code?: string;
switchKilometerSystem?: dependency_1.graphicData.KilometerSystem;
switchConvertKilometer?: number;
kilometerSystem?: dependency_1.graphicData.KilometerSystem[]; kilometerSystem?: dependency_1.graphicData.KilometerSystem[];
convertKilometer?: number[]; convertKilometer?: number[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [5, 6], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -207,12 +205,6 @@ export namespace state {
if ("code" in data && data.code != undefined) { if ("code" in data && data.code != undefined) {
this.code = data.code; this.code = data.code;
} }
if ("switchKilometerSystem" in data && data.switchKilometerSystem != undefined) {
this.switchKilometerSystem = data.switchKilometerSystem;
}
if ("switchConvertKilometer" in data && data.switchConvertKilometer != undefined) {
this.switchConvertKilometer = data.switchConvertKilometer;
}
if ("kilometerSystem" in data && data.kilometerSystem != undefined) { if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
this.kilometerSystem = data.kilometerSystem; this.kilometerSystem = data.kilometerSystem;
} }
@ -233,38 +225,21 @@ export namespace state {
set code(value: string) { set code(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get switchKilometerSystem() {
return pb_1.Message.getWrapperField(this, dependency_1.graphicData.KilometerSystem, 3) as dependency_1.graphicData.KilometerSystem;
}
set switchKilometerSystem(value: dependency_1.graphicData.KilometerSystem) {
pb_1.Message.setWrapperField(this, 3, value);
}
get has_switchKilometerSystem() {
return pb_1.Message.getField(this, 3) != null;
}
get switchConvertKilometer() {
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
}
set switchConvertKilometer(value: number) {
pb_1.Message.setField(this, 4, value);
}
get kilometerSystem() { get kilometerSystem() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 5) as dependency_1.graphicData.KilometerSystem[]; return pb_1.Message.getRepeatedWrapperField(this, dependency_1.graphicData.KilometerSystem, 3) as dependency_1.graphicData.KilometerSystem[];
} }
set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) { set kilometerSystem(value: dependency_1.graphicData.KilometerSystem[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value); pb_1.Message.setRepeatedWrapperField(this, 3, value);
} }
get convertKilometer() { get convertKilometer() {
return pb_1.Message.getFieldWithDefault(this, 6, []) as number[]; return pb_1.Message.getFieldWithDefault(this, 4, []) as number[];
} }
set convertKilometer(value: number[]) { set convertKilometer(value: number[]) {
pb_1.Message.setField(this, 6, value); pb_1.Message.setField(this, 4, value);
} }
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
code?: string; code?: string;
switchKilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>;
switchConvertKilometer?: number;
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[]; kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
convertKilometer?: number[]; convertKilometer?: number[];
}): Switch { }): Switch {
@ -275,12 +250,6 @@ export namespace state {
if (data.code != null) { if (data.code != null) {
message.code = data.code; message.code = data.code;
} }
if (data.switchKilometerSystem != null) {
message.switchKilometerSystem = dependency_1.graphicData.KilometerSystem.fromObject(data.switchKilometerSystem);
}
if (data.switchConvertKilometer != null) {
message.switchConvertKilometer = data.switchConvertKilometer;
}
if (data.kilometerSystem != null) { if (data.kilometerSystem != null) {
message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item)); message.kilometerSystem = data.kilometerSystem.map(item => dependency_1.graphicData.KilometerSystem.fromObject(item));
} }
@ -293,8 +262,6 @@ export namespace state {
const data: { const data: {
id?: string; id?: string;
code?: string; code?: string;
switchKilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>;
switchConvertKilometer?: number;
kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[]; kilometerSystem?: ReturnType<typeof dependency_1.graphicData.KilometerSystem.prototype.toObject>[];
convertKilometer?: number[]; convertKilometer?: number[];
} = {}; } = {};
@ -304,12 +271,6 @@ export namespace state {
if (this.code != null) { if (this.code != null) {
data.code = this.code; data.code = this.code;
} }
if (this.switchKilometerSystem != null) {
data.switchKilometerSystem = this.switchKilometerSystem.toObject();
}
if (this.switchConvertKilometer != null) {
data.switchConvertKilometer = this.switchConvertKilometer;
}
if (this.kilometerSystem != null) { if (this.kilometerSystem != null) {
data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject()); data.kilometerSystem = this.kilometerSystem.map((item: dependency_1.graphicData.KilometerSystem) => item.toObject());
} }
@ -326,14 +287,10 @@ export namespace state {
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (this.code.length) if (this.code.length)
writer.writeString(2, this.code); writer.writeString(2, this.code);
if (this.has_switchKilometerSystem)
writer.writeMessage(3, this.switchKilometerSystem, () => this.switchKilometerSystem.serialize(writer));
if (this.switchConvertKilometer != 0)
writer.writeInt64(4, this.switchConvertKilometer);
if (this.kilometerSystem.length) if (this.kilometerSystem.length)
writer.writeRepeatedMessage(5, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer)); writer.writeRepeatedMessage(3, this.kilometerSystem, (item: dependency_1.graphicData.KilometerSystem) => item.serialize(writer));
if (this.convertKilometer.length) if (this.convertKilometer.length)
writer.writePackedInt64(6, this.convertKilometer); writer.writePackedInt64(4, this.convertKilometer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -350,15 +307,9 @@ export namespace state {
message.code = reader.readString(); message.code = reader.readString();
break; break;
case 3: case 3:
reader.readMessage(message.switchKilometerSystem, () => message.switchKilometerSystem = dependency_1.graphicData.KilometerSystem.deserialize(reader)); reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_1.graphicData.KilometerSystem.deserialize(reader), dependency_1.graphicData.KilometerSystem));
break; break;
case 4: case 4:
message.switchConvertKilometer = reader.readInt64();
break;
case 5:
reader.readMessage(message.kilometerSystem, () => pb_1.Message.addToRepeatedWrapperField(message, 5, dependency_1.graphicData.KilometerSystem.deserialize(reader), dependency_1.graphicData.KilometerSystem));
break;
case 6:
message.convertKilometer = reader.readPackedInt64(); message.convertKilometer = reader.readPackedInt64();
break; break;
default: reader.skipField(); default: reader.skipField();

View File

@ -3159,12 +3159,12 @@ export namespace graphicData {
points?: Point[]; points?: Point[];
nameColor?: string; nameColor?: string;
nameBgColor?: string; nameBgColor?: string;
upPathLineId?: string;
downPathLineId?: string;
containSta?: string[]; containSta?: string[];
linkPathLines?: string[];
lineId?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 8], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 8, 9], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) { if ("common" in data && data.common != undefined) {
this.common = data.common; this.common = data.common;
@ -3181,15 +3181,15 @@ export namespace graphicData {
if ("nameBgColor" in data && data.nameBgColor != undefined) { if ("nameBgColor" in data && data.nameBgColor != undefined) {
this.nameBgColor = data.nameBgColor; this.nameBgColor = data.nameBgColor;
} }
if ("upPathLineId" in data && data.upPathLineId != undefined) {
this.upPathLineId = data.upPathLineId;
}
if ("downPathLineId" in data && data.downPathLineId != undefined) {
this.downPathLineId = data.downPathLineId;
}
if ("containSta" in data && data.containSta != undefined) { if ("containSta" in data && data.containSta != undefined) {
this.containSta = data.containSta; this.containSta = data.containSta;
} }
if ("linkPathLines" in data && data.linkPathLines != undefined) {
this.linkPathLines = data.linkPathLines;
}
if ("lineId" in data && data.lineId != undefined) {
this.lineId = data.lineId;
}
} }
} }
get common() { get common() {
@ -3225,33 +3225,33 @@ export namespace graphicData {
set nameBgColor(value: string) { set nameBgColor(value: string) {
pb_1.Message.setField(this, 5, value); pb_1.Message.setField(this, 5, value);
} }
get upPathLineId() {
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
}
set upPathLineId(value: string) {
pb_1.Message.setField(this, 6, value);
}
get downPathLineId() {
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
}
set downPathLineId(value: string) {
pb_1.Message.setField(this, 7, value);
}
get containSta() { get containSta() {
return pb_1.Message.getFieldWithDefault(this, 8, []) as string[]; return pb_1.Message.getFieldWithDefault(this, 8, []) as string[];
} }
set containSta(value: string[]) { set containSta(value: string[]) {
pb_1.Message.setField(this, 8, value); pb_1.Message.setField(this, 8, value);
} }
get linkPathLines() {
return pb_1.Message.getFieldWithDefault(this, 9, []) as string[];
}
set linkPathLines(value: string[]) {
pb_1.Message.setField(this, 9, value);
}
get lineId() {
return pb_1.Message.getFieldWithDefault(this, 10, "") as string;
}
set lineId(value: string) {
pb_1.Message.setField(this, 10, value);
}
static fromObject(data: { static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>; common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string; code?: string;
points?: ReturnType<typeof Point.prototype.toObject>[]; points?: ReturnType<typeof Point.prototype.toObject>[];
nameColor?: string; nameColor?: string;
nameBgColor?: string; nameBgColor?: string;
upPathLineId?: string;
downPathLineId?: string;
containSta?: string[]; containSta?: string[];
linkPathLines?: string[];
lineId?: string;
}): RunLine { }): RunLine {
const message = new RunLine({}); const message = new RunLine({});
if (data.common != null) { if (data.common != null) {
@ -3269,15 +3269,15 @@ export namespace graphicData {
if (data.nameBgColor != null) { if (data.nameBgColor != null) {
message.nameBgColor = data.nameBgColor; message.nameBgColor = data.nameBgColor;
} }
if (data.upPathLineId != null) {
message.upPathLineId = data.upPathLineId;
}
if (data.downPathLineId != null) {
message.downPathLineId = data.downPathLineId;
}
if (data.containSta != null) { if (data.containSta != null) {
message.containSta = data.containSta; message.containSta = data.containSta;
} }
if (data.linkPathLines != null) {
message.linkPathLines = data.linkPathLines;
}
if (data.lineId != null) {
message.lineId = data.lineId;
}
return message; return message;
} }
toObject() { toObject() {
@ -3287,9 +3287,9 @@ export namespace graphicData {
points?: ReturnType<typeof Point.prototype.toObject>[]; points?: ReturnType<typeof Point.prototype.toObject>[];
nameColor?: string; nameColor?: string;
nameBgColor?: string; nameBgColor?: string;
upPathLineId?: string;
downPathLineId?: string;
containSta?: string[]; containSta?: string[];
linkPathLines?: string[];
lineId?: string;
} = {}; } = {};
if (this.common != null) { if (this.common != null) {
data.common = this.common.toObject(); data.common = this.common.toObject();
@ -3306,15 +3306,15 @@ export namespace graphicData {
if (this.nameBgColor != null) { if (this.nameBgColor != null) {
data.nameBgColor = this.nameBgColor; data.nameBgColor = this.nameBgColor;
} }
if (this.upPathLineId != null) {
data.upPathLineId = this.upPathLineId;
}
if (this.downPathLineId != null) {
data.downPathLineId = this.downPathLineId;
}
if (this.containSta != null) { if (this.containSta != null) {
data.containSta = this.containSta; data.containSta = this.containSta;
} }
if (this.linkPathLines != null) {
data.linkPathLines = this.linkPathLines;
}
if (this.lineId != null) {
data.lineId = this.lineId;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -3331,12 +3331,12 @@ export namespace graphicData {
writer.writeString(4, this.nameColor); writer.writeString(4, this.nameColor);
if (this.nameBgColor.length) if (this.nameBgColor.length)
writer.writeString(5, this.nameBgColor); writer.writeString(5, this.nameBgColor);
if (this.upPathLineId.length)
writer.writeString(6, this.upPathLineId);
if (this.downPathLineId.length)
writer.writeString(7, this.downPathLineId);
if (this.containSta.length) if (this.containSta.length)
writer.writeRepeatedString(8, this.containSta); writer.writeRepeatedString(8, this.containSta);
if (this.linkPathLines.length)
writer.writeRepeatedString(9, this.linkPathLines);
if (this.lineId.length)
writer.writeString(10, this.lineId);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -3361,15 +3361,15 @@ export namespace graphicData {
case 5: case 5:
message.nameBgColor = reader.readString(); message.nameBgColor = reader.readString();
break; break;
case 6:
message.upPathLineId = reader.readString();
break;
case 7:
message.downPathLineId = reader.readString();
break;
case 8: case 8:
pb_1.Message.addToRepeatedField(message, 8, reader.readString()); pb_1.Message.addToRepeatedField(message, 8, reader.readString());
break; break;
case 9:
pb_1.Message.addToRepeatedField(message, 9, reader.readString());
break;
case 10:
message.lineId = reader.readString();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }

@ -1 +1 @@
Subproject commit 2dad2c17b2e3cb13fd4fc3d8af75d0e668111b65 Subproject commit 549aa2ec10bffe292a1a68e278ae824a8502db0b