列车设置参数调整&状态展示调整

This commit is contained in:
fan 2024-01-29 13:09:20 +08:00
parent 77982dacd2
commit e6b0557b1b
7 changed files with 585 additions and 185 deletions

@ -1 +1 @@
Subproject commit 11e81fe6e710fea687f038f64a7199f0ead6a23e
Subproject commit 099d39589833465c09f01d83cd31d3f063b43089

View File

@ -4,54 +4,100 @@
seamless
title="列车设置"
v-model="showTrainParamOperation"
:width="900"
:width="1000"
:height="722"
>
<q-card style="width: 900px; height: auto">
<q-card style="width: 1000px; height: auto">
<q-form ref="myForm" @submit="onCreate" class="q-gutter-md">
<div class="row">
<div class="col-6">
<div class="float-text">1</div>
<div class="stroke-box">
<div class="row">
<div class="col-6 q-px-sm">
<q-input
class="q-input-xm"
outlined
v-model.number="model.trainEndsA.radarCheckSpeedDiff"
label="雷达测速差值(m/s)"
hint=""
/>
<div class="float-text">雷达</div>
<div class="stroke-box">
<div class="row">
<div class="col-6 q-px-sm">
<q-input
class="q-input-xm"
outlined
v-model.number="model.trainEndsA.radarCheckSpeedDiff"
clearable
@clear="() => (model.trainEndsA.radarCheckSpeedDiff = 0)"
label="雷达测速差值(m/s)"
hint=""
/>
</div>
<div class="col-6 q-px-sm">
<q-input
class="q-input-sm"
outlined
v-model.number="model.trainEndsA.radarCheckTime"
clearable
@clear="() => (model.trainEndsA.radarCheckTime = 0)"
label="雷达检测时间(秒)"
hint=""
/>
</div>
<div class="col-6 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsA.radarEnable"
label="雷达是否有效"
/>
</div>
</div>
<div class="col-6 q-px-sm">
<q-input
class="q-input-sm"
outlined
v-model.number="model.trainEndsA.radarCheckTime"
label="雷达检测时间(秒)"
hint=""
/>
</div>
<div class="float-text">速传</div>
<div class="stroke-box">
<div class="row">
<div class="col-6 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsA.speedSensorEnableA"
label="速传1是否有效"
/>
</div>
<div class="col-6 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsA.speedSensorEnableB"
label="速传2是否有效"
/>
</div>
</div>
<div class="col-4 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsA.radarEnable"
label="雷达是否有效"
/>
</div>
<div class="col-4 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsA.speedSensorEnableA"
label="速传1是否有效"
/>
</div>
<div class="col-4 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsA.speedSensorEnableB"
label="速传2是否有效"
/>
</div>
<div class="float-text">加速度计</div>
<div class="stroke-box" style="margin-bottom: 10px">
<div class="row">
<div class="col-6 q-px-sm">
<q-input
class="q-input-sm"
outlined
v-model.number="model.trainEndsA.accCheckSpeedDiff"
clearable
@clear="() => (model.trainEndsA.accCheckSpeedDiff = 0)"
label="加速度测速差值(米/秒)"
hint=""
/>
</div>
<div class="col-6 q-px-sm">
<q-input
class="q-input-sm"
outlined
v-model.number="model.trainEndsA.accCheckTime"
clearable
@clear="() => (model.trainEndsA.accCheckTime = 0)"
label="加速度持续时间(秒)"
hint=""
/>
</div>
<div class="col-6 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsA.accEnable"
label="加速度计是否有效"
/>
</div>
</div>
</div>
</div>
@ -59,45 +105,91 @@
<div class="col-6">
<div class="float-text">2</div>
<div class="stroke-box">
<div class="row">
<div class="col-6 q-px-sm">
<q-input
class="q-input-xm"
outlined
v-model.number="model.trainEndsB.radarCheckSpeedDiff"
label="雷达测速差值(m/s)"
hint=""
/>
<div class="float-text">雷达</div>
<div class="stroke-box">
<div class="row">
<div class="col-6 q-px-sm">
<q-input
class="q-input-xm"
outlined
v-model.number="model.trainEndsB.radarCheckSpeedDiff"
clearable
@clear="() => (model.trainEndsB.radarCheckSpeedDiff = 0)"
label="雷达测速差值(m/s)"
hint=""
/>
</div>
<div class="col-6 q-px-sm">
<q-input
class="q-input-sm"
outlined
v-model.number="model.trainEndsB.radarCheckTime"
clearable
@clear="() => (model.trainEndsB.radarCheckTime = 0)"
label="雷达检测时间(秒)"
hint=""
/>
</div>
<div class="col-6 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsB.radarEnable"
label="雷达是否有效"
/>
</div>
</div>
<div class="col-6 q-px-sm">
<q-input
class="q-input-sm"
outlined
v-model.number="model.trainEndsB.radarCheckTime"
label="雷达检测时间(秒)"
hint=""
/>
</div>
<div class="float-text">速传</div>
<div class="stroke-box">
<div class="row">
<div class="col-6 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsB.speedSensorEnableA"
label="速传1是否有效"
/>
</div>
<div class="col-6 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsB.speedSensorEnableB"
label="速传2是否有效"
/>
</div>
</div>
<div class="col-4 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsB.radarEnable"
label="雷达是否有效"
/>
</div>
<div class="col-4 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsB.speedSensorEnableA"
label="速传1是否有效"
/>
</div>
<div class="col-4 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsB.speedSensorEnableB"
label="速传2是否有效"
/>
</div>
<div class="float-text">加速度计</div>
<div class="stroke-box" style="margin-bottom: 10px">
<div class="row">
<div class="col-6 q-px-sm">
<q-input
class="q-input-sm"
outlined
v-model.number="model.trainEndsB.accCheckSpeedDiff"
clearable
@clear="() => (model.trainEndsB.accCheckSpeedDiff = 0)"
label="加速度测速差值(米/秒)"
hint=""
/>
</div>
<div class="col-6 q-px-sm">
<q-input
class="q-input-sm"
outlined
v-model.number="model.trainEndsB.accCheckTime"
clearable
@clear="() => (model.trainEndsB.accCheckTime = 0)"
label="加速度持续时间(秒)"
hint=""
/>
</div>
<div class="col-6 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.trainEndsB.accEnable"
label="加速度计是否有效"
/>
</div>
</div>
</div>
</div>
@ -106,7 +198,7 @@
<div class="float-text">基本参数</div>
<div class="stroke-box">
<div class="row">
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
class="q-input--sm"
@ -115,7 +207,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
class="q-input--sm"
@ -127,7 +219,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
class="q-input--sm"
@ -136,7 +228,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.davisParamB"
@ -144,7 +236,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.davisParamC"
@ -152,7 +244,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.curveResistanceParamR1"
@ -160,7 +252,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.curveResistanceParamR2"
@ -168,7 +260,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.curveResistanceParamR3"
@ -176,7 +268,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.curveResistanceParamR4"
@ -184,7 +276,7 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.revolvingMassParam"
@ -199,39 +291,48 @@
<div class="float-text">故障</div>
<div class="stroke-box">
<div class="row">
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.slide"
clearable
@clear="() => (model.configData.slide = 0)"
label="前溜/后溜(m/s)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.slip"
clearable
@clear="() => (model.configData.slip = 0)"
label="打滑(%)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.stopSign"
:default-value="0"
clearable
@clear="() => (model.configData.stopSign = 0)"
label="过标/欠标(mm)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.idling"
clearable
@clear="() => (model.configData.idling = 0)"
label="空转(%)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<div class="col-3 q-px-sm">
<q-checkbox
style="font-size: 12px"
v-model="model.configData.jump"
@ -242,7 +343,6 @@
</div>
</div>
</div>
<q-card-actions align="right" class="text-primary">
<q-btn
flat
@ -258,7 +358,7 @@
</template>
<script setup lang="ts">
import { QForm, useDialogPluginComponent } from 'quasar';
import { QForm } from 'quasar';
import { Train } from 'src/graphics/train/Train';
import { ref, onMounted, reactive, onUnmounted } from 'vue';
import DraggableDialog from 'src/components/common/DraggableDialog.vue';
@ -281,6 +381,9 @@ const model = reactive({
radarEnable: true,
speedSensorEnableA: true,
speedSensorEnableB: true,
accEnable: true,
accCheckSpeedDiff: 0,
accCheckTime: 0,
},
trainEndsB: {
radarCheckSpeedDiff: 0,
@ -288,6 +391,9 @@ const model = reactive({
radarEnable: true,
speedSensorEnableA: true,
speedSensorEnableB: true,
accEnable: true,
accCheckSpeedDiff: 0,
accCheckTime: 0,
},
configData: {
davisParamA: 0,
@ -327,6 +433,9 @@ function initModel() {
radarEnable: trainState.aRadarEnable,
speedSensorEnableA: trainState.aSpeedSensorEnableA,
speedSensorEnableB: trainState.aSpeedSensorEnableB,
accEnable: trainState.aAccEnable,
accCheckSpeedDiff: trainState.aAccCheckSpeedDiff,
accCheckTime: trainState.aAccCheckTime,
};
model.trainEndsB = {
radarCheckSpeedDiff: trainState.bRadarCheckSpeedDiff,
@ -334,6 +443,9 @@ function initModel() {
radarEnable: trainState.bRadarEnable,
speedSensorEnableA: trainState.bSpeedSensorEnableA,
speedSensorEnableB: trainState.bSpeedSensorEnableB,
accEnable: trainState.bAccEnable,
accCheckSpeedDiff: trainState.bAccCheckSpeedDiff,
accCheckTime: trainState.bAccCheckTime,
};
model.configData = {
davisParamA: trainState.davisParamA,

View File

@ -27,70 +27,106 @@
</q-item-section>
</q-item>
<q-separator inset />
<q-item v-for="(item, index) in list2" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
<q-separator inset />
<q-item v-for="(item, index) in list3" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
<q-separator inset />
<q-item v-for="(item, index) in list4" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
<q-separator inset />
<q-item v-for="(item, index) in list5" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
<q-separator inset />
<q-item v-for="(item, index) in list6" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
<q-tabs
v-model="tab"
inline-label
mobile-arrows
class="bg-purple text-white shadow-2"
>
<q-tab name="tab1" label="动力学" />
<q-tab name="tab2" label="半实物" />
<q-tab name="tab3" label="速传" />
<q-tab name="tab4" label="雷达" />
<q-tab name="tab5" label="加速度计" />
</q-tabs>
<q-separator />
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="tab1">
<q-item v-for="(item, index) in list2" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
</q-tab-panel>
<q-tab-panel name="tab2">
<q-item v-for="(item, index) in list3" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
</q-tab-panel>
<q-tab-panel name="tab3">
<q-item v-for="(item, index) in list4" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
</q-tab-panel>
<q-tab-panel name="tab4">
<q-item v-for="(item, index) in list5" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
</q-tab-panel>
<q-tab-panel name="tab5">
<q-item v-for="(item, index) in list6" :key="index">
<q-item-section>
<q-item-label>{{ item.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label caption>{{
item.formatFn
? item.formatFn(trainInfo[item.key])
: trainInfo[item.key]
}}</q-item-label>
</q-item-section>
</q-item>
</q-tab-panel>
</q-tab-panels>
<!-- <q-list class="rounded-borders" dense>
<q-expansion-item label="动力学" header-class="text-purple">
</q-expansion-item>
<q-expansion-item label="半实物" header-class="text-purple">
</q-expansion-item>
<q-expansion-item label="速传" header-class="text-purple">
</q-expansion-item>
<q-expansion-item label="雷达" header-class="text-purple">
</q-expansion-item>
<q-expansion-item label="加速度计" header-class="text-purple">
</q-expansion-item>
</q-list> -->
</q-list>
</q-card>
</template>
@ -108,7 +144,7 @@ interface KeyType {
key: keyof ITrainState;
formatFn?(v: ITrainState[keyof ITrainState]): string;
}
const tab = ref('tab1');
const lineStore = useLineStore();
const trainInfo = ref<ITrainState | null>();
const list: KeyType[] = [
@ -160,14 +196,20 @@ const list2: KeyType[] = [
{ label: '坡道阻力', key: 'rampResistance', formatFn: resistanceFormat },
{ label: '曲线阻力', key: 'curveResistance', formatFn: resistanceFormat },
{ label: '列车运行速度', key: 'speed', formatFn: speedFormat },
{ label: '头车速传1速度值', key: 'headSensorSpeed1', formatFn: speedFormat },
{ label: '头车速传2速度值', key: 'headSensorSpeed2', formatFn: speedFormat },
{ label: '尾车速传1速度值', key: 'tailSensorSpeed1', formatFn: speedFormat },
{ label: '尾车速传2速度值', key: 'tailSensorSpeed2', formatFn: speedFormat },
{ label: '头车雷达速度值', key: 'headRadarSpeed', formatFn: speedFormat },
{ label: '尾车雷达速度值', key: 'tailRadarSpeed', formatFn: speedFormat },
// { label: '', key: 'udpInterruption', formatFn: upFormat },
{ label: '加速度', key: 'acceleration', formatFn: accelerationFormat },
{ label: '基本阻力参数A', key: 'davisParamA' },
{ label: '基本阻力参数B', key: 'davisParamB' },
{ label: '基本阻力参数C', key: 'davisParamC' },
{ label: '曲线阻力参数R1', key: 'curveResistanceParamR1' },
{ label: '曲线阻力参数R2', key: 'curveResistanceParamR2' },
{ label: '曲线阻力参数R3', key: 'curveResistanceParamR3' },
{ label: '曲线阻力参数R4', key: 'curveResistanceParamR4' },
{ label: '旋转质量参数', key: 'revolvingMassParam' },
{ label: '是否跳跃', key: 'jump', formatFn: upFormat },
{ label: '打滑', key: 'slip', formatFn: percentFormat },
{ label: '前溜/后溜', key: 'slide', formatFn: msFormat },
{ label: '过标/欠标', key: 'stopSign', formatFn: mmFormat },
{ label: '空转', key: 'idling', formatFn: percentFormat },
];
const list3: KeyType[] = [
//
@ -227,23 +269,18 @@ const list3: KeyType[] = [
];
const list4: KeyType[] = [
{ label: '基本阻力参数A', key: 'davisParamA' },
{ label: '基本阻力参数B', key: 'davisParamB' },
{ label: '基本阻力参数C', key: 'davisParamC' },
{ label: '曲线阻力参数R1', key: 'curveResistanceParamR1' },
{ label: '曲线阻力参数R2', key: 'curveResistanceParamR2' },
{ label: '曲线阻力参数R3', key: 'curveResistanceParamR3' },
{ label: '曲线阻力参数R4', key: 'curveResistanceParamR4' },
{ label: '旋转质量参数', key: 'revolvingMassParam' },
{ label: '是否跳跃', key: 'jump', formatFn: upFormat },
{ label: '打滑', key: 'slip', formatFn: percentFormat },
{ label: '前溜/后溜', key: 'slide', formatFn: msFormat },
{ label: '过标/欠标', key: 'stopSign', formatFn: mmFormat },
{ label: '空转', key: 'idling', formatFn: percentFormat },
];
const list5: KeyType[] = [
// { label: '1', key: 'headSensorSpeed1', formatFn: speedFormat },
// { label: '2', key: 'headSensorSpeed2', formatFn: speedFormat },
// { label: '1', key: 'tailSensorSpeed1', formatFn: speedFormat },
// { label: '2', key: 'tailSensorSpeed2', formatFn: speedFormat },
{ label: '1端速传1是否有效', key: 'aSpeedSensorEnableA', formatFn: upFormat },
{ label: '1端速传2是否有效', key: 'aSpeedSensorEnableB', formatFn: upFormat },
{ label: '2端速传1是否有效', key: 'bSpeedSensorEnableA', formatFn: upFormat },
{ label: '2端速传2是否有效', key: 'bSpeedSensorEnableB', formatFn: upFormat },
];
const list5: KeyType[] = [
// { label: '', key: 'headRadarSpeed', formatFn: speedFormat },
// { label: '', key: 'tailRadarSpeed', formatFn: speedFormat },
{ label: '1端雷达是否有效', key: 'aRadarEnable', formatFn: upFormat },
{ label: '1端雷达测速差值', key: 'aRadarCheckSpeedDiff', formatFn: msFormat },
{
@ -251,10 +288,6 @@ const list5: KeyType[] = [
key: 'aRadarCheckTime',
formatFn: timeFormat,
},
];
const list6: KeyType[] = [
{ label: '2端速传1是否有效', key: 'bSpeedSensorEnableA', formatFn: upFormat },
{ label: '2端速传2是否有效', key: 'bSpeedSensorEnableB', formatFn: upFormat },
{ label: '2端雷达是否有效', key: 'bRadarEnable', formatFn: upFormat },
{ label: '2端雷达测速差值', key: 'bRadarCheckSpeedDiff', formatFn: msFormat },
{
@ -263,6 +296,23 @@ const list6: KeyType[] = [
formatFn: timeFormat,
},
];
const list6: KeyType[] = [
{ label: '加速度', key: 'acceleration', formatFn: accelerationFormat },
{ label: '1端加速度计是否有效', key: 'aAccEnable', formatFn: upFormat },
{ label: '1端加速度测速差值', key: 'aAccCheckSpeedDiff', formatFn: msFormat },
{
label: '1端加速度持续时间',
key: 'aAccCheckTime',
formatFn: timeFormat,
},
{ label: '2端加速度计是否有效', key: 'bAccEnable', formatFn: upFormat },
{ label: '2端加速度测速差值', key: 'bAccCheckSpeedDiff', formatFn: msFormat },
{
label: '2端加速度持续时间',
key: 'bAccCheckTime',
formatFn: timeFormat,
},
];
function mmFormat(v: number) {
return v + 'mm';
}
@ -408,6 +458,7 @@ watch(
function getTrainStates(train: Train) {
trainInfo.value = null;
const s = train.states as ITrainState;
console.log(s, '=======');
trainInfo.value = s;
}
@ -453,3 +504,8 @@ function setTrain() {
});
}
</script>
<style lang="scss" scoped>
.q-item {
min-height: 32px;
}
</style>

View File

@ -534,6 +534,42 @@ export class TrainState extends GraphicStateBase implements ITrainState {
set bRadarCheckTime(v: number) {
this.states.trainEndsB.radarCheckTime = v;
}
get aAccEnable(): boolean {
return this.states.trainEndsA.accEnable;
}
set aAccEnable(v: boolean) {
this.states.trainEndsA.accEnable = v;
}
get aAccCheckTime(): number {
return this.states.trainEndsA.accCheckTime;
}
set aAccCheckTime(v: number) {
this.states.trainEndsA.accCheckTime = v;
}
get aAccCheckSpeedDiff(): number {
return +this.states.trainEndsA.accCheckSpeedDiff;
}
set aAccCheckSpeedDiff(v: number) {
this.states.trainEndsA.accCheckSpeedDiff = v + '';
}
get bAccEnable(): boolean {
return this.states.trainEndsB.accEnable;
}
set bAccEnable(v: boolean) {
this.states.trainEndsB.accEnable = v;
}
get bAccCheckTime(): number {
return this.states.trainEndsB.accCheckTime;
}
set bAccCheckTime(v: number) {
this.states.trainEndsB.accCheckTime = v;
}
get bAccCheckSpeedDiff(): number {
return +this.states.trainEndsB.accCheckSpeedDiff;
}
set bAccCheckSpeedDiff(v: number) {
this.states.trainEndsB.accCheckSpeedDiff = v + '';
}
clone(): TrainState {
return new TrainState(this.states.cloneMessage());
}

View File

@ -193,6 +193,18 @@ export interface ITrainState extends GraphicState {
set bRadarCheckSpeedDiff(v: number);
get bRadarCheckTime(): number;
set bRadarCheckTime(v: number);
get aAccEnable(): boolean;
set aAccEnable(v: boolean);
get aAccCheckSpeedDiff(): number;
set aAccCheckSpeedDiff(v: number);
get aAccCheckTime(): number;
set aAccCheckTime(v: number);
get bAccEnable(): boolean;
set bAccEnable(v: boolean);
get bAccCheckSpeedDiff(): number;
set bAccCheckSpeedDiff(v: number);
get bAccCheckTime(): number;
set bAccCheckTime(v: number);
}
interface bodyWH {
width: number; // 宽

View File

@ -356,6 +356,9 @@ export namespace common {
radarEnable?: boolean;
radarCheckSpeedDiff?: number;
radarCheckTime?: number;
accEnable?: boolean;
accCheckSpeedDiff?: number;
accCheckTime?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -375,6 +378,15 @@ export namespace common {
if ("radarCheckTime" in data && data.radarCheckTime != undefined) {
this.radarCheckTime = data.radarCheckTime;
}
if ("accEnable" in data && data.accEnable != undefined) {
this.accEnable = data.accEnable;
}
if ("accCheckSpeedDiff" in data && data.accCheckSpeedDiff != undefined) {
this.accCheckSpeedDiff = data.accCheckSpeedDiff;
}
if ("accCheckTime" in data && data.accCheckTime != undefined) {
this.accCheckTime = data.accCheckTime;
}
}
}
get speedSensorEnableA() {
@ -407,12 +419,33 @@ export namespace common {
set radarCheckTime(value: number) {
pb_1.Message.setField(this, 5, value);
}
get accEnable() {
return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean;
}
set accEnable(value: boolean) {
pb_1.Message.setField(this, 6, value);
}
get accCheckSpeedDiff() {
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
}
set accCheckSpeedDiff(value: number) {
pb_1.Message.setField(this, 7, value);
}
get accCheckTime() {
return pb_1.Message.getFieldWithDefault(this, 8, 0) as number;
}
set accCheckTime(value: number) {
pb_1.Message.setField(this, 8, value);
}
static fromObject(data: {
speedSensorEnableA?: boolean;
speedSensorEnableB?: boolean;
radarEnable?: boolean;
radarCheckSpeedDiff?: number;
radarCheckTime?: number;
accEnable?: boolean;
accCheckSpeedDiff?: number;
accCheckTime?: number;
}): TrainEndsState {
const message = new TrainEndsState({});
if (data.speedSensorEnableA != null) {
@ -430,6 +463,15 @@ export namespace common {
if (data.radarCheckTime != null) {
message.radarCheckTime = data.radarCheckTime;
}
if (data.accEnable != null) {
message.accEnable = data.accEnable;
}
if (data.accCheckSpeedDiff != null) {
message.accCheckSpeedDiff = data.accCheckSpeedDiff;
}
if (data.accCheckTime != null) {
message.accCheckTime = data.accCheckTime;
}
return message;
}
toObject() {
@ -439,6 +481,9 @@ export namespace common {
radarEnable?: boolean;
radarCheckSpeedDiff?: number;
radarCheckTime?: number;
accEnable?: boolean;
accCheckSpeedDiff?: number;
accCheckTime?: number;
} = {};
if (this.speedSensorEnableA != null) {
data.speedSensorEnableA = this.speedSensorEnableA;
@ -455,6 +500,15 @@ export namespace common {
if (this.radarCheckTime != null) {
data.radarCheckTime = this.radarCheckTime;
}
if (this.accEnable != null) {
data.accEnable = this.accEnable;
}
if (this.accCheckSpeedDiff != null) {
data.accCheckSpeedDiff = this.accCheckSpeedDiff;
}
if (this.accCheckTime != null) {
data.accCheckTime = this.accCheckTime;
}
return data;
}
serialize(): Uint8Array;
@ -471,6 +525,12 @@ export namespace common {
writer.writeFloat(4, this.radarCheckSpeedDiff);
if (this.radarCheckTime != 0)
writer.writeInt32(5, this.radarCheckTime);
if (this.accEnable != false)
writer.writeBool(6, this.accEnable);
if (this.accCheckSpeedDiff != 0)
writer.writeFloat(7, this.accCheckSpeedDiff);
if (this.accCheckTime != 0)
writer.writeInt32(8, this.accCheckTime);
if (!w)
return writer.getResultBuffer();
}
@ -495,6 +555,15 @@ export namespace common {
case 5:
message.radarCheckTime = reader.readInt32();
break;
case 6:
message.accEnable = reader.readBool();
break;
case 7:
message.accCheckSpeedDiff = reader.readFloat();
break;
case 8:
message.accCheckTime = reader.readInt32();
break;
default: reader.skipField();
}
}

View File

@ -1536,6 +1536,7 @@ export namespace state {
tailRadarSpeed?: number;
udpInterruption?: boolean;
acceleration?: number;
Displacement?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6], this.#one_of_decls);
@ -1606,6 +1607,9 @@ export namespace state {
if ("acceleration" in data && data.acceleration != undefined) {
this.acceleration = data.acceleration;
}
if ("Displacement" in data && data.Displacement != undefined) {
this.Displacement = data.Displacement;
}
}
}
get heartbeat() {
@ -1740,6 +1744,12 @@ export namespace state {
set acceleration(value: number) {
pb_1.Message.setField(this, 22, value);
}
get Displacement() {
return pb_1.Message.getFieldWithDefault(this, 23, 0) as number;
}
set Displacement(value: number) {
pb_1.Message.setField(this, 23, value);
}
static fromObject(data: {
heartbeat?: number;
headLinkId?: string;
@ -1763,6 +1773,7 @@ export namespace state {
tailRadarSpeed?: number;
udpInterruption?: boolean;
acceleration?: number;
Displacement?: number;
}): TrainDynamicState {
const message = new TrainDynamicState({});
if (data.heartbeat != null) {
@ -1831,6 +1842,9 @@ export namespace state {
if (data.acceleration != null) {
message.acceleration = data.acceleration;
}
if (data.Displacement != null) {
message.Displacement = data.Displacement;
}
return message;
}
toObject() {
@ -1857,6 +1871,7 @@ export namespace state {
tailRadarSpeed?: number;
udpInterruption?: boolean;
acceleration?: number;
Displacement?: number;
} = {};
if (this.heartbeat != null) {
data.heartbeat = this.heartbeat;
@ -1924,6 +1939,9 @@ export namespace state {
if (this.acceleration != null) {
data.acceleration = this.acceleration;
}
if (this.Displacement != null) {
data.Displacement = this.Displacement;
}
return data;
}
serialize(): Uint8Array;
@ -1974,6 +1992,8 @@ export namespace state {
writer.writeBool(21, this.udpInterruption);
if (this.acceleration != 0)
writer.writeFloat(22, this.acceleration);
if (this.Displacement != 0)
writer.writeInt32(23, this.Displacement);
if (!w)
return writer.getResultBuffer();
}
@ -2049,6 +2069,9 @@ export namespace state {
case 22:
message.acceleration = reader.readFloat();
break;
case 23:
message.Displacement = reader.readInt32();
break;
default: reader.skipField();
}
}
@ -2770,6 +2793,7 @@ export namespace state {
trainDynamicConfig?: TrainDynamicConfigMqtt;
trainEndsA?: TrainEndsStateMqtt;
trainEndsB?: TrainEndsStateMqtt;
Displacement?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [20], this.#one_of_decls);
@ -2966,6 +2990,9 @@ export namespace state {
if ("trainEndsB" in data && data.trainEndsB != undefined) {
this.trainEndsB = data.trainEndsB;
}
if ("Displacement" in data && data.Displacement != undefined) {
this.Displacement = data.Displacement;
}
}
}
get id() {
@ -3361,6 +3388,12 @@ export namespace state {
get has_trainEndsB() {
return pb_1.Message.getField(this, 64) != null;
}
get Displacement() {
return pb_1.Message.getFieldWithDefault(this, 65, 0) as number;
}
set Displacement(value: number) {
pb_1.Message.setField(this, 65, value);
}
static fromObject(data: {
id?: string;
up?: boolean;
@ -3426,6 +3459,7 @@ export namespace state {
trainDynamicConfig?: ReturnType<typeof TrainDynamicConfigMqtt.prototype.toObject>;
trainEndsA?: ReturnType<typeof TrainEndsStateMqtt.prototype.toObject>;
trainEndsB?: ReturnType<typeof TrainEndsStateMqtt.prototype.toObject>;
Displacement?: number;
}): TrainMapState {
const message = new TrainMapState({});
if (data.id != null) {
@ -3620,6 +3654,9 @@ export namespace state {
if (data.trainEndsB != null) {
message.trainEndsB = TrainEndsStateMqtt.fromObject(data.trainEndsB);
}
if (data.Displacement != null) {
message.Displacement = data.Displacement;
}
return message;
}
toObject() {
@ -3688,6 +3725,7 @@ export namespace state {
trainDynamicConfig?: ReturnType<typeof TrainDynamicConfigMqtt.prototype.toObject>;
trainEndsA?: ReturnType<typeof TrainEndsStateMqtt.prototype.toObject>;
trainEndsB?: ReturnType<typeof TrainEndsStateMqtt.prototype.toObject>;
Displacement?: number;
} = {};
if (this.id != null) {
data.id = this.id;
@ -3881,6 +3919,9 @@ export namespace state {
if (this.trainEndsB != null) {
data.trainEndsB = this.trainEndsB.toObject();
}
if (this.Displacement != null) {
data.Displacement = this.Displacement;
}
return data;
}
serialize(): Uint8Array;
@ -4015,6 +4056,8 @@ export namespace state {
writer.writeMessage(63, this.trainEndsA, () => this.trainEndsA.serialize(writer));
if (this.has_trainEndsB)
writer.writeMessage(64, this.trainEndsB, () => this.trainEndsB.serialize(writer));
if (this.Displacement != 0)
writer.writeInt32(65, this.Displacement);
if (!w)
return writer.getResultBuffer();
}
@ -4216,6 +4259,9 @@ export namespace state {
case 64:
reader.readMessage(message.trainEndsB, () => message.trainEndsB = TrainEndsStateMqtt.deserialize(reader));
break;
case 65:
message.Displacement = reader.readInt32();
break;
default: reader.skipField();
}
}
@ -4579,6 +4625,9 @@ export namespace state {
radarEnable?: boolean;
radarCheckSpeedDiff?: string;
radarCheckTime?: number;
accEnable?: boolean;
accCheckSpeedDiff?: string;
accCheckTime?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -4598,6 +4647,15 @@ export namespace state {
if ("radarCheckTime" in data && data.radarCheckTime != undefined) {
this.radarCheckTime = data.radarCheckTime;
}
if ("accEnable" in data && data.accEnable != undefined) {
this.accEnable = data.accEnable;
}
if ("accCheckSpeedDiff" in data && data.accCheckSpeedDiff != undefined) {
this.accCheckSpeedDiff = data.accCheckSpeedDiff;
}
if ("accCheckTime" in data && data.accCheckTime != undefined) {
this.accCheckTime = data.accCheckTime;
}
}
}
get speedSensorEnableA() {
@ -4630,12 +4688,33 @@ export namespace state {
set radarCheckTime(value: number) {
pb_1.Message.setField(this, 5, value);
}
get accEnable() {
return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean;
}
set accEnable(value: boolean) {
pb_1.Message.setField(this, 6, value);
}
get accCheckSpeedDiff() {
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
}
set accCheckSpeedDiff(value: string) {
pb_1.Message.setField(this, 7, value);
}
get accCheckTime() {
return pb_1.Message.getFieldWithDefault(this, 8, 0) as number;
}
set accCheckTime(value: number) {
pb_1.Message.setField(this, 8, value);
}
static fromObject(data: {
speedSensorEnableA?: boolean;
speedSensorEnableB?: boolean;
radarEnable?: boolean;
radarCheckSpeedDiff?: string;
radarCheckTime?: number;
accEnable?: boolean;
accCheckSpeedDiff?: string;
accCheckTime?: number;
}): TrainEndsStateMqtt {
const message = new TrainEndsStateMqtt({});
if (data.speedSensorEnableA != null) {
@ -4653,6 +4732,15 @@ export namespace state {
if (data.radarCheckTime != null) {
message.radarCheckTime = data.radarCheckTime;
}
if (data.accEnable != null) {
message.accEnable = data.accEnable;
}
if (data.accCheckSpeedDiff != null) {
message.accCheckSpeedDiff = data.accCheckSpeedDiff;
}
if (data.accCheckTime != null) {
message.accCheckTime = data.accCheckTime;
}
return message;
}
toObject() {
@ -4662,6 +4750,9 @@ export namespace state {
radarEnable?: boolean;
radarCheckSpeedDiff?: string;
radarCheckTime?: number;
accEnable?: boolean;
accCheckSpeedDiff?: string;
accCheckTime?: number;
} = {};
if (this.speedSensorEnableA != null) {
data.speedSensorEnableA = this.speedSensorEnableA;
@ -4678,6 +4769,15 @@ export namespace state {
if (this.radarCheckTime != null) {
data.radarCheckTime = this.radarCheckTime;
}
if (this.accEnable != null) {
data.accEnable = this.accEnable;
}
if (this.accCheckSpeedDiff != null) {
data.accCheckSpeedDiff = this.accCheckSpeedDiff;
}
if (this.accCheckTime != null) {
data.accCheckTime = this.accCheckTime;
}
return data;
}
serialize(): Uint8Array;
@ -4694,6 +4794,12 @@ export namespace state {
writer.writeString(4, this.radarCheckSpeedDiff);
if (this.radarCheckTime != 0)
writer.writeInt32(5, this.radarCheckTime);
if (this.accEnable != false)
writer.writeBool(6, this.accEnable);
if (this.accCheckSpeedDiff.length)
writer.writeString(7, this.accCheckSpeedDiff);
if (this.accCheckTime != 0)
writer.writeInt32(8, this.accCheckTime);
if (!w)
return writer.getResultBuffer();
}
@ -4718,6 +4824,15 @@ export namespace state {
case 5:
message.radarCheckTime = reader.readInt32();
break;
case 6:
message.accEnable = reader.readBool();
break;
case 7:
message.accCheckSpeedDiff = reader.readString();
break;
case 8:
message.accCheckTime = reader.readInt32();
break;
default: reader.skipField();
}
}