2023-12-25 17:12:58 +08:00
|
|
|
var TransponderTypeEnum;
|
|
|
|
(function (TransponderTypeEnum) {
|
|
|
|
TransponderTypeEnum[TransponderTypeEnum["FB"] = 0] = "FB";
|
|
|
|
TransponderTypeEnum[TransponderTypeEnum["WB"] = 1] = "WB";
|
|
|
|
TransponderTypeEnum[TransponderTypeEnum["DB"] = 2] = "DB";
|
|
|
|
TransponderTypeEnum[TransponderTypeEnum["VB"] = 3] = "VB";
|
|
|
|
TransponderTypeEnum[TransponderTypeEnum["IB"] = 4] = "IB";
|
|
|
|
})(TransponderTypeEnum || (TransponderTypeEnum = {}));
|
2024-01-02 14:36:10 +08:00
|
|
|
function getTypePoints(type, TrConsts) {
|
|
|
|
const transponderTypePoints = {
|
|
|
|
[TransponderTypeEnum.FB]: [
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2 - TrConsts.lineWidth / 2],
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
],
|
|
|
|
[TransponderTypeEnum.WB]: [
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2 - TrConsts.lineWidth / 2],
|
|
|
|
[0, -TrConsts.height / 2],
|
|
|
|
[0, TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, 0],
|
|
|
|
[-TrConsts.height / 2, 0],
|
|
|
|
],
|
|
|
|
[TransponderTypeEnum.DB]: [
|
|
|
|
[-TrConsts.height, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height, -TrConsts.height / 2 - TrConsts.lineWidth / 2],
|
|
|
|
[-TrConsts.height, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height, TrConsts.height / 2],
|
|
|
|
[TrConsts.height, -TrConsts.height / 2],
|
|
|
|
[-TrConsts.height, TrConsts.height / 2],
|
|
|
|
],
|
|
|
|
[TransponderTypeEnum.VB]: [
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2 - TrConsts.lineWidth / 2],
|
|
|
|
],
|
|
|
|
[TransponderTypeEnum.IB]: [
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, -TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, -TrConsts.height / 2 - TrConsts.lineWidth / 2],
|
|
|
|
[0, -TrConsts.height / 2],
|
|
|
|
[-TrConsts.height / 2, 0],
|
|
|
|
[-TrConsts.height / 2, TrConsts.height / 2],
|
|
|
|
[TrConsts.height / 2, -TrConsts.height / 2 + TrConsts.lineWidth / 2],
|
|
|
|
[TrConsts.height / 2, 0],
|
|
|
|
[0, TrConsts.height / 2],
|
|
|
|
],
|
|
|
|
};
|
|
|
|
return transponderTypePoints[type];
|
|
|
|
}
|
|
|
|
function getTransponderConsts() {
|
|
|
|
const transponderConsts = {
|
|
|
|
height: 12,
|
|
|
|
lineWidth: 2,
|
|
|
|
lineColor: '0xFFFFFF',
|
|
|
|
wblineColor: '0xFF0000',
|
|
|
|
textFontSize: 12,
|
|
|
|
textMarginY: 5, // 名称与应答器的距离
|
|
|
|
vblineColor: '0xFF00FF',
|
|
|
|
iblineColor: '0x0000FF',
|
|
|
|
};
|
|
|
|
return transponderConsts;
|
|
|
|
}
|
2023-12-25 17:12:58 +08:00
|
|
|
|
2024-01-02 14:36:10 +08:00
|
|
|
export { TransponderTypeEnum, getTransponderConsts, getTypePoints };
|