去掉protoPort2Data

This commit is contained in:
joylink_zhaoerwei 2024-01-05 09:14:59 +08:00
parent 78453c82ab
commit c120822467
5 changed files with 5 additions and 20 deletions

View File

@ -36,4 +36,3 @@ export interface IRelatedRef {
export declare namespace IRelatedRef {
function create(type: string, id: number, port: DevicePort): IRelatedRef;
}
export declare function protoPort2Data(port: DevicePort): "A" | "B" | "C" | undefined;

View File

@ -37,13 +37,5 @@ var IRelatedRef;
}
IRelatedRef.create = create;
})(IRelatedRef || (IRelatedRef = {}));
function protoPort2Data(port) {
if (port === DevicePort.A)
return 'A';
if (port === DevicePort.B)
return 'B';
if (port === DevicePort.C)
return 'C';
}
export { DevicePort, DeviceType, Direction, IRelatedRef, protoPort2Data };
export { DevicePort, DeviceType, Direction, IRelatedRef };

View File

@ -1,5 +1,5 @@
import { JlGraphic, GraphicRelationParam, JlGraphicTemplate } from 'jl-graphic';
import { protoPort2Data } from '../../common/common.js';
import { DevicePort } from '../../common/common.js';
import { Container, Graphics, Color } from 'pixi.js';
var TypeDetectionPoint;
@ -73,7 +73,7 @@ class AxleCounting extends JlGraphic {
loadRelations() {
if (this.datas.axleCountingRef.length) {
this.datas.axleCountingRef.forEach((device) => {
this.relationManage.addRelation(new GraphicRelationParam(this, 'A'), new GraphicRelationParam(this.queryStore.queryById(device.id), protoPort2Data(device.devicePort)));
this.relationManage.addRelation(new GraphicRelationParam(this, 'A'), new GraphicRelationParam(this.queryStore.queryById(device.id), DevicePort[device.devicePort]));
});
}
}

View File

@ -54,9 +54,3 @@ export namespace IRelatedRef {
};
}
}
export function protoPort2Data(port: DevicePort) {
if (port === DevicePort.A) return 'A';
if (port === DevicePort.B) return 'B';
if (port === DevicePort.C) return 'C';
}

View File

@ -4,7 +4,7 @@ import {
JlGraphic,
JlGraphicTemplate,
} from 'jl-graphic';
import { IRelatedRef, KilometerSystem, protoPort2Data } from 'common/common';
import { DevicePort, IRelatedRef, KilometerSystem } from 'common/common';
import { Container, Graphics, Color } from 'pixi.js';
enum TypeDetectionPoint {
@ -100,7 +100,7 @@ export class AxleCounting extends JlGraphic {
new GraphicRelationParam(this, 'A'),
new GraphicRelationParam(
this.queryStore.queryById(device.id),
protoPort2Data(device.devicePort),
DevicePort[device.devicePort],
),
);
});