计轴关联区段关系调整

This commit is contained in:
dong 2023-09-05 11:23:47 +08:00
parent 5d7f341d62
commit beb94c765b

View File

@ -5,7 +5,7 @@ import {
GraphicDrawAssistant,
GraphicIdGenerator,
GraphicInteractionPlugin,
JlDrawApp,
IDrawApp,
JlGraphic,
distance2,
} from 'src/jl-graphic';
@ -15,7 +15,7 @@ import {
AxleCounting,
AxleCountingTemplate,
} from './AxleCounting';
import { Section, SectionPort } from '../section/Section';
import { Section, SectionPort, SectionType } from '../section/Section';
import { Turnout, TurnoutPort } from '../turnout/Turnout';
import { IRelatedRefData, createRelatedRefProto } from '../CommonGraphics';
import { Signal } from '../signal/Signal';
@ -41,7 +41,7 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
IAxleCountingData
> {
codeGraph: AxleCounting;
constructor(app: JlDrawApp, template: AxleCountingTemplate) {
constructor(app: IDrawApp, template: AxleCountingTemplate) {
super(app, template, 'sym_o_circle', '不展示');
this.codeGraph = this.graphicTemplate.new();
this.container.addChild(this.codeGraph);
@ -170,7 +170,7 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
section.relationManage.getRelationsOfGraphicAndOtherType(
section,
AxleCounting.Type
).length < 2
).length < 2 && section.datas.sectionType == SectionType.Physical
);
});
@ -339,10 +339,10 @@ function buildAbsorbablePositions(
export class AxleCountingInteraction extends GraphicInteractionPlugin<AxleCounting> {
static Name = 'AxleCounting_transform';
constructor(app: JlDrawApp) {
constructor(app: IDrawApp) {
super(AxleCountingInteraction.Name, app);
}
static init(app: JlDrawApp) {
static init(app: IDrawApp) {
return new AxleCountingInteraction(app);
}
filter(...grahpics: JlGraphic[]): AxleCounting[] | undefined {