This commit is contained in:
fan 2023-07-27 17:48:30 +08:00
commit 7fc10b5ece
2 changed files with 25 additions and 6 deletions

View File

@ -83,7 +83,10 @@ import { StopPositionData } from './graphics/StopPositionInteraction';
import { SpksSwitchData } from './graphics/SpksSwitchInteraction';
import { GatedBoxData } from './graphics/GatedBoxInteraction';
import { EsbButtonData } from './graphics/EsbButtonInteraction';
import { Transponder } from 'src/graphics/transponder/Transponder';
import {
Transponder,
TransponderTemplate,
} from 'src/graphics/transponder/Transponder';
import { TransponderData } from './graphics/TransponderInteraction';
let lineApp: GraphicApp | null = null;
@ -142,6 +145,7 @@ const showType = [
SpksSwitch.Type,
GatedBox.Type,
EsbButton.Type,
Transponder.Type,
];
const physicShowType = [...showType, Section.Type];
const linkShowType = [...showType, SectionLink.Type, AxleCounting.Type];
@ -165,6 +169,7 @@ export function initLineApp(dom: HTMLElement): GraphicApp {
new SpksSwitchTemplate(new SpksSwitchData()),
new GatedBoxTemplate(new GatedBoxData()),
new EsbButtonTemplate(new EsbButtonData()),
new TransponderTemplate(new TransponderData()),
];
lineApp.registerGraphicTemplates(...graphicTemplate);
lineApp.setOptions({

View File

@ -40,11 +40,19 @@ const list: keyType[] = [
{ label: '列车索引', key: 'id' },
{ label: '是否上行', key: 'up', formatFn: upFormat },
{ label: '车头所在link的索引', key: 'headLinkId' },
{ label: '车头所在link内的偏移量', key: 'headLinkOffset' },
{
label: '车头所在link内的偏移量',
key: 'headLinkOffset',
formatFn: offsetFormat,
},
{ label: '车尾所在link的索引', key: 'tailLinkId' },
{ label: '车尾所在link内的偏移量', key: 'tailLinkOffset' },
{
label: '车尾所在link内的偏移量',
key: 'tailLinkOffset',
formatFn: offsetFormat,
},
{ label: '生命信号', key: 'heartbeat' },
{ label: '列车所在位置坡度值', key: 'slope' },
{ label: '列车所在位置坡度值', key: 'slope', formatFn: slopeFormat },
{ label: '列车所在位置坡度走势', key: 'upslope', formatFn: upslopeFormat },
{ label: '列车当前运行方向', key: 'runningUp', formatFn: runningUpFormat },
{
@ -72,11 +80,17 @@ function upslopeFormat(v: boolean) {
function runningUpFormat(v: boolean) {
return v ? '上行' : '下行';
}
function offsetFormat(v: number) {
return `${v} mm`;
}
function slopeFormat(v: number) {
return `${v}`;
}
function resistanceFormat(v: number) {
return `${v}KN`;
return `${v} KN`;
}
function speedFormat(v: number) {
return `${v}km/h`;
return `${v} km/h`;
}
watch(
() => lineStore.selectedGraphics,