Merge branch 'master' of git.code.tencent.com:beijing-rtss-test/bj-rtss-client
This commit is contained in:
commit
40ae549484
@ -77,6 +77,11 @@ const list: KeyType[] = [
|
||||
{ label: '车头所在设备的偏移量', key: 'headOffset', formatFn: offsetFormat },
|
||||
{ label: '是否上行', key: 'runDirection', formatFn: upFormat },
|
||||
{ label: '车头方向是否上行', key: 'headDirection', formatFn: upFormat },
|
||||
{
|
||||
label: '所在公里标',
|
||||
key: 'trainKilometer',
|
||||
formatFn: trainKilometerFormat,
|
||||
},
|
||||
];
|
||||
const list2: DynamicKeyType[] = [
|
||||
// 动力学信息
|
||||
@ -212,6 +217,23 @@ function trainLoadFormat(v: number) {
|
||||
return `${n} ton`;
|
||||
}
|
||||
|
||||
function trainKilometerFormat(v: number) {
|
||||
const f = floatDecimal(v, 0);
|
||||
const r = f.split('').reverse();
|
||||
const x = r.slice(0, 3).reverse();
|
||||
const m = r.slice(3, 6).reverse();
|
||||
const k = r.slice(6).reverse();
|
||||
let n = '';
|
||||
if (k.length) {
|
||||
n = `k${k.join('')}+${m.join('')}.${x.join('')}`;
|
||||
} else if (m.length) {
|
||||
n = `${m.join('')}.${x.join('')}`;
|
||||
} else if (x.length) {
|
||||
n = `0.${x.join('')}`;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
function getDeviveName() {
|
||||
const headDeviceId = trainInfo.value?.headDeviceId;
|
||||
const devicePort = trainInfo.value?.devicePort;
|
||||
|
@ -110,6 +110,12 @@ export class TrainState extends GraphicStateBase implements ITrainState {
|
||||
set vobcState(v: state.TrainVobcState) {
|
||||
this.states.vobcState = new state.TrainVobcState(v);
|
||||
}
|
||||
get trainKilometer(): number {
|
||||
return this.states.trainKilometer;
|
||||
}
|
||||
set trainKilometer(v: number) {
|
||||
this.states.trainKilometer = v;
|
||||
}
|
||||
clone(): TrainState {
|
||||
return new TrainState(this.states.cloneMessage());
|
||||
}
|
||||
|
@ -49,6 +49,8 @@ export interface ITrainState extends GraphicState {
|
||||
set dynamicState(v: state.TrainDynamicState);
|
||||
get vobcState(): state.TrainVobcState;
|
||||
set vobcState(v: state.TrainVobcState);
|
||||
get trainKilometer(): number;
|
||||
set trainKilometer(v: number);
|
||||
}
|
||||
|
||||
interface bodyWH {
|
||||
|
Loading…
Reference in New Issue
Block a user