列车调整

This commit is contained in:
fan 2024-01-18 16:29:28 +08:00
parent 88a0cd9ec4
commit d781b6afd2
13 changed files with 596 additions and 170 deletions

@ -1 +1 @@
Subproject commit 2db94f19b5b0f66b6120ff110bdfd3ab6abc6e05
Subproject commit c7ee997a5efe4d07da79bbad667fec38c9da4da8

View File

@ -335,14 +335,14 @@ export interface TrainConfig {
stopSign: number;
},
trainEndsA: {
radarCheckSpeed: number;
radarCheckSpeedDiff: number;
radarCheckTime: number;
radarEnable: boolean;
speedSensorEnableA: boolean;
speedSensorEnableB: boolean;
},
trainEndsB: {
radarCheckSpeed: number;
radarCheckSpeedDiff: number;
radarCheckTime: number;
radarEnable: boolean;
speedSensorEnableA: boolean;

View File

@ -45,8 +45,8 @@ export interface TrainConfigData {
export interface TrainCreateParams {
carriage_length: number;
description: string;
max_diameter: number;
min_diameter: number;
// max_diameter: number;
// min_diameter: number;
name: string;
total_length: number;
train_model: number;

View File

@ -6,7 +6,6 @@
<q-form ref="myForm" @submit="onCreate" class="q-gutter-md">
<div class="text-h6">添加列车</div>
<q-input
dense
outlined
readonly
:label="props.dev.type"
@ -14,7 +13,6 @@
/>
<q-input
type="number"
dense
outlined
:label="`列车偏移(mm)【长度${props.kmLength}mm】`"
:max="kmLength"
@ -26,7 +24,6 @@
<q-select
v-model="dir"
label="运行方向"
dense
outlined
:options="dirOptions"
emitValue
@ -37,7 +34,6 @@
<q-select
v-model="trainConfig"
label="列车配置"
dense
outlined
:options="trainConfigOption"
:option-label="
@ -55,13 +51,10 @@
</q-select>
<q-input
type="number"
dense
outlined
:label="`列车轮径(mm)【${
trainConfig ? trainConfig.min_diameter : ''
}-${trainConfig ? trainConfig.max_diameter : ''}mm`"
:max="trainConfig?.max_diameter"
:min="trainConfig?.min_diameter"
:label="`列车轮径(mm)【750-840mm】`"
:max="840"
:min="750"
v-model.number="wheelDiameter"
lazy-rules
:rules="wheelDiameterRules"
@ -142,13 +135,7 @@ function onCreate() {
const wheelDiameter = ref(800);
const wheelDiameterRules = [
(val: string) => (val !== null && val !== '') || '列车轮径不能为空!',
// (val: number) =>
// (trainConfig.value &&
// val >= trainConfig.value.min_diameter &&
// val <= trainConfig.value.max_diameter) ||
// `${trainConfig.value ? trainConfig.value.min_diameter : ''}${
// trainConfig.value ? trainConfig.value.max_diameter : ''
// }mm`,
(val: number) => (val >= 750 && val <= 840) || '列车轮径在750到840mm之间',
];
const trainConfigOption = computed(() => {
@ -159,8 +146,6 @@ const trainConfig = ref<TrainConfigItem | null>({
id: 0,
carriage_length: 0,
description: '',
max_diameter: 0,
min_diameter: 0,
name: '',
total_length: 0,
train_model: 0,

View File

@ -13,7 +13,7 @@
<q-input
class="q-input-xm"
outlined
v-model.number="model.trainEndsA.radarCheckSpeed"
v-model.number="model.trainEndsA.radarCheckSpeedDiff"
label="雷达测数数值"
hint=""
/>
@ -59,7 +59,7 @@
<q-input
class="q-input-xm"
outlined
v-model.number="model.trainEndsB.radarCheckSpeed"
v-model.number="model.trainEndsB.radarCheckSpeedDiff"
label="雷达测数数值"
hint=""
/>
@ -115,7 +115,10 @@
outlined
class="q-input--sm"
v-model.number="model.wheelDiameter"
label="轮径"
:label="`列车轮径(mm)【750-840mm】`"
:max="840"
:min="750"
:rules="wheelDiameterRules"
hint=""
/>
</div>
@ -251,14 +254,14 @@ const model = reactive({
trainId: 0,
simulationId: '',
trainEndsA: {
radarCheckSpeed: 0,
radarCheckSpeedDiff: 0,
radarCheckTime: 0,
radarEnable: true,
speedSensorEnableA: true,
speedSensorEnableB: true,
},
trainEndsB: {
radarCheckSpeed: 0,
radarCheckSpeedDiff: 0,
radarCheckTime: 0,
radarEnable: true,
speedSensorEnableA: true,
@ -287,20 +290,25 @@ onMounted(() => {
defineEmits([...useDialogPluginComponent.emits]);
const wheelDiameterRules = [
(val: string) => (val !== null && val !== '') || '列车轮径不能为空!',
(val: number) => (val >= 750 && val <= 840) || '列车轮径在750到840mm之间',
];
const { dialogRef, onDialogOK, onDialogCancel } = useDialogPluginComponent();
const myForm = ref<QForm | null>(null);
function initModel() {
const trainState = props.train.states;
model.trainEndsA = {
radarCheckSpeed: trainState.aRadarCheckSpeed,
radarCheckSpeedDiff: trainState.aRadarCheckSpeedDiff,
radarCheckTime: trainState.aRadarCheckTime,
radarEnable: trainState.aRadarEnable,
speedSensorEnableA: trainState.aSpeedSensorEnableA,
speedSensorEnableB: trainState.aSpeedSensorEnableB,
};
model.trainEndsB = {
radarCheckSpeed: trainState.bRadarCheckSpeed,
radarCheckSpeedDiff: trainState.bRadarCheckSpeedDiff,
radarCheckTime: trainState.bRadarCheckTime,
radarEnable: trainState.bRadarEnable,
speedSensorEnableA: trainState.bSpeedSensorEnableA,

View File

@ -246,7 +246,7 @@ const list5: KeyType[] = [
{ label: '1端速传1是否有效', key: 'aSpeedSensorEnableA', formatFn: upFormat },
{ label: '1端速传2是否有效', key: 'aSpeedSensorEnableB', formatFn: upFormat },
{ label: '1端雷达是否有效', key: 'aRadarEnable', formatFn: upFormat },
{ label: '1端雷达测速数值', key: 'aRadarCheckSpeed', formatFn: msFormat },
{ label: '1端雷达测速数值', key: 'aRadarCheckSpeedDiff', formatFn: msFormat },
{
label: '1端雷达检测时间(秒)',
key: 'aRadarCheckTime',
@ -257,7 +257,7 @@ 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: 'bRadarCheckSpeed', formatFn: msFormat },
{ label: '2端雷达测速数值', key: 'aRadarCheckSpeedDiff', formatFn: msFormat },
{
label: '2端雷达检测时间',
key: 'bRadarCheckTime',

View File

@ -8,7 +8,7 @@ function getHost(): string {
// return '192.168.3.47:9091';
// return '192.168.3.37:9091';
// return '192.168.3.15:9091';
// return '192.168.3.93:9091';
return '192.168.3.93:9091';
// return '192.168.3.37:9091'; //卫志宏
return '192.168.3.233:9091';
}

View File

@ -397,52 +397,52 @@ export class TrainState extends GraphicStateBase implements ITrainState {
this.states.vobcInterruption = v;
}
get baseResistanceParamA(): number {
return this.states.trainDynamicConfig.baseResistanceParamA;
return +this.states.trainDynamicConfig.baseResistanceParamA;
}
set baseResistanceParamA(v: number) {
this.states.trainDynamicConfig.baseResistanceParamA = v;
this.states.trainDynamicConfig.baseResistanceParamA = v + '';
}
get baseResistanceParamB(): number {
return this.states.trainDynamicConfig.baseResistanceParamB;
return +this.states.trainDynamicConfig.baseResistanceParamB;
}
set baseResistanceParamB(v: number) {
this.states.trainDynamicConfig.baseResistanceParamB = v;
this.states.trainDynamicConfig.baseResistanceParamB = v + '';
}
get baseResistanceParamC(): number {
return this.states.trainDynamicConfig.baseResistanceParamC;
return +this.states.trainDynamicConfig.baseResistanceParamC;
}
set baseResistanceParamC(v: number) {
this.states.trainDynamicConfig.baseResistanceParamC = v;
this.states.trainDynamicConfig.baseResistanceParamC = v + '';
}
get curveResistanceParamR1(): number {
return this.states.trainDynamicConfig.curveResistanceParamR1;
return +this.states.trainDynamicConfig.curveResistanceParamR1;
}
set curveResistanceParamR1(v: number) {
this.states.trainDynamicConfig.curveResistanceParamR1 = v;
this.states.trainDynamicConfig.curveResistanceParamR1 = v + '';
}
get curveResistanceParamR2(): number {
return this.states.trainDynamicConfig.curveResistanceParamR2;
return +this.states.trainDynamicConfig.curveResistanceParamR2;
}
set curveResistanceParamR2(v: number) {
this.states.trainDynamicConfig.curveResistanceParamR2 = v;
this.states.trainDynamicConfig.curveResistanceParamR2 = v + '';
}
get curveResistanceParamR3(): number {
return this.states.trainDynamicConfig.curveResistanceParamR3;
return +this.states.trainDynamicConfig.curveResistanceParamR3;
}
set curveResistanceParamR3(v: number) {
this.states.trainDynamicConfig.curveResistanceParamR3 = v;
this.states.trainDynamicConfig.curveResistanceParamR3 = v + '';
}
get curveResistanceParamR4(): number {
return this.states.trainDynamicConfig.curveResistanceParamR4;
return +this.states.trainDynamicConfig.curveResistanceParamR4;
}
set curveResistanceParamR4(v: number) {
this.states.trainDynamicConfig.curveResistanceParamR4 = v;
this.states.trainDynamicConfig.curveResistanceParamR4 = v + '';
}
get revolvingMassParam(): number {
return this.states.trainDynamicConfig.revolvingMassParam;
return +this.states.trainDynamicConfig.revolvingMassParam;
}
set revolvingMassParam(v: number) {
this.states.trainDynamicConfig.revolvingMassParam = v;
this.states.trainDynamicConfig.revolvingMassParam = v + '';
}
get jump(): boolean {
return this.states.trainDynamicConfig.jump;
@ -451,10 +451,10 @@ export class TrainState extends GraphicStateBase implements ITrainState {
this.states.trainDynamicConfig.jump = v;
}
get slip(): number {
return this.states.trainDynamicConfig.slip;
return +this.states.trainDynamicConfig.slip;
}
set slip(v: number) {
this.states.trainDynamicConfig.slip = v;
this.states.trainDynamicConfig.slip = v + '';
}
get slide(): number {
return this.states.trainDynamicConfig.slide;
@ -486,11 +486,11 @@ export class TrainState extends GraphicStateBase implements ITrainState {
set aRadarEnable(v: boolean) {
this.states.trainEndsA.radarEnable = v;
}
get aRadarCheckSpeed(): number {
return this.states.trainEndsA.radarCheckSpeed;
get aRadarCheckSpeedDiff(): number {
return +this.states.trainEndsA.radarCheckSpeedDiff;
}
set aRadarCheckSpeed(v: number) {
this.states.trainEndsA.radarCheckSpeed;
set aRadarCheckSpeedDiff(v: number) {
this.states.trainEndsA.radarCheckSpeedDiff + '';
}
get aRadarCheckTime(): number {
return this.states.trainEndsA.radarCheckTime;
@ -516,11 +516,11 @@ export class TrainState extends GraphicStateBase implements ITrainState {
set bRadarEnable(v: boolean) {
this.states.trainEndsB.radarEnable;
}
get bRadarCheckSpeed(): number {
return this.states.trainEndsB.radarCheckSpeed;
get bRadarCheckSpeedDiff(): number {
return +this.states.trainEndsB.radarCheckSpeedDiff;
}
set bRadarCheckSpeed(v: number) {
this.states.trainEndsB.radarCheckSpeed = v;
set bRadarCheckSpeedDiff(v: number) {
this.states.trainEndsB.radarCheckSpeedDiff = v + '';
}
get bRadarCheckTime(): number {
return this.states.trainEndsB.radarCheckTime;

View File

@ -177,8 +177,8 @@ export interface ITrainState extends GraphicState {
set aSpeedSensorEnableB(v: boolean);
get aRadarEnable(): boolean;
set aRadarEnable(v: boolean);
get aRadarCheckSpeed(): number;
set aRadarCheckSpeed(v: number);
get aRadarCheckSpeedDiff(): number;
set aRadarCheckSpeedDiff(v: number);
get aRadarCheckTime(): number;
set aRadarCheckTime(v: number);
get bSpeedSensorEnableA(): boolean;
@ -187,8 +187,8 @@ export interface ITrainState extends GraphicState {
set bSpeedSensorEnableB(v: boolean);
get bRadarEnable(): boolean;
set bRadarEnable(v: boolean);
get bRadarCheckSpeed(): number;
set bRadarCheckSpeed(v: number);
get bRadarCheckSpeedDiff(): number;
set bRadarCheckSpeedDiff(v: number);
get bRadarCheckTime(): number;
set bRadarCheckTime(v: number);
}

View File

@ -71,7 +71,7 @@
<div class="row">
<div class="col-4 q-px-sm">
<q-input
dense
outlined
v-model="editInfo.name"
label="名称"
lazy-rules
@ -80,7 +80,7 @@
</div>
<div class="col-4 q-px-sm">
<q-select
dense
outlined
v-model="editInfo.train_model"
:options="trainModelOption"
map-options
@ -91,7 +91,7 @@
</div>
<div class="col-4 q-px-sm">
<q-input
dense
outlined
v-model.number="editInfo.carriage_length"
type="number"
label="车厢长度mm"
@ -105,7 +105,7 @@
</div>
<div class="col-4 q-px-sm">
<q-input
dense
outlined
v-model.number="editInfo.total_length"
type="number"
label="总长度mm"
@ -150,15 +150,15 @@
</div> -->
<div class="col-4 q-px-sm">
<q-input
dense
outlined
v-model="editInfo.train_sets"
label="编组"
hint=""
></q-input>
</div>
<div class="col-8 q-px-sm">
<div class="col-8 q-px-sm" style="padding-bottom: 10px">
<q-input
dense
outlined
v-model="editInfo.description"
label="描述"
></q-input>
@ -368,18 +368,18 @@ const columnDefs: QTableColumn[] = [
field: (row) => row.total_length,
align: 'center',
},
{
name: 'min_diameter',
label: '车轮的最小直径mm',
field: (row) => row.min_diameter,
align: 'center',
},
{
name: 'max_diameter',
label: '车轮的最大直径mm',
field: (row) => row.max_diameter,
align: 'center',
},
// {
// name: 'min_diameter',
// label: 'mm',
// field: (row) => row.min_diameter,
// align: 'center',
// },
// {
// name: 'max_diameter',
// label: 'mm',
// field: (row) => row.max_diameter,
// align: 'center',
// },
{
name: 'train_sets',
label: '编组',
@ -448,8 +448,8 @@ function onCreate() {
train_model: editInfo.train_model,
carriage_length: editInfo.carriage_length,
total_length: editInfo.total_length,
min_diameter: editInfo.min_diameter,
max_diameter: editInfo.max_diameter,
// min_diameter: editInfo.min_diameter,
// max_diameter: editInfo.max_diameter,
train_sets: editInfo.train_sets,
trainConfigData: editInfo.trainConfigData,
};
@ -481,8 +481,8 @@ function onReset() {
editInfo.train_model = 0;
editInfo.carriage_length = 0;
editInfo.total_length = 0;
editInfo.min_diameter = 0;
editInfo.max_diameter = 0;
// editInfo.min_diameter = 0;
// editInfo.max_diameter = 0;
editInfo.train_sets = '';
editInfo.trainConfigData.baseResistanceParamA = 2.25;
editInfo.trainConfigData.baseResistanceParamB = 0.019;
@ -583,8 +583,8 @@ function editData(row: TrainItem) {
editInfo.train_model = res.train_model;
editInfo.carriage_length = res.carriage_length;
editInfo.total_length = res.total_length;
editInfo.min_diameter = res.min_diameter;
editInfo.max_diameter = res.max_diameter;
// editInfo.min_diameter = res.min_diameter;
// editInfo.max_diameter = res.max_diameter;
editInfo.train_sets = res.train_sets;
if (res.trainConfigData) {
editInfo.trainConfigData.baseResistanceParamA =

View File

@ -331,7 +331,7 @@ export namespace common {
speedSensorEnableA?: boolean;
speedSensorEnableB?: boolean;
radarEnable?: boolean;
radarCheckSpeed?: number;
radarCheckSpeedDiff?: number;
radarCheckTime?: number;
}) {
super();
@ -346,8 +346,8 @@ export namespace common {
if ("radarEnable" in data && data.radarEnable != undefined) {
this.radarEnable = data.radarEnable;
}
if ("radarCheckSpeed" in data && data.radarCheckSpeed != undefined) {
this.radarCheckSpeed = data.radarCheckSpeed;
if ("radarCheckSpeedDiff" in data && data.radarCheckSpeedDiff != undefined) {
this.radarCheckSpeedDiff = data.radarCheckSpeedDiff;
}
if ("radarCheckTime" in data && data.radarCheckTime != undefined) {
this.radarCheckTime = data.radarCheckTime;
@ -372,10 +372,10 @@ export namespace common {
set radarEnable(value: boolean) {
pb_1.Message.setField(this, 3, value);
}
get radarCheckSpeed() {
get radarCheckSpeedDiff() {
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
}
set radarCheckSpeed(value: number) {
set radarCheckSpeedDiff(value: number) {
pb_1.Message.setField(this, 4, value);
}
get radarCheckTime() {
@ -388,7 +388,7 @@ export namespace common {
speedSensorEnableA?: boolean;
speedSensorEnableB?: boolean;
radarEnable?: boolean;
radarCheckSpeed?: number;
radarCheckSpeedDiff?: number;
radarCheckTime?: number;
}): TrainEndsState {
const message = new TrainEndsState({});
@ -401,8 +401,8 @@ export namespace common {
if (data.radarEnable != null) {
message.radarEnable = data.radarEnable;
}
if (data.radarCheckSpeed != null) {
message.radarCheckSpeed = data.radarCheckSpeed;
if (data.radarCheckSpeedDiff != null) {
message.radarCheckSpeedDiff = data.radarCheckSpeedDiff;
}
if (data.radarCheckTime != null) {
message.radarCheckTime = data.radarCheckTime;
@ -414,7 +414,7 @@ export namespace common {
speedSensorEnableA?: boolean;
speedSensorEnableB?: boolean;
radarEnable?: boolean;
radarCheckSpeed?: number;
radarCheckSpeedDiff?: number;
radarCheckTime?: number;
} = {};
if (this.speedSensorEnableA != null) {
@ -426,8 +426,8 @@ export namespace common {
if (this.radarEnable != null) {
data.radarEnable = this.radarEnable;
}
if (this.radarCheckSpeed != null) {
data.radarCheckSpeed = this.radarCheckSpeed;
if (this.radarCheckSpeedDiff != null) {
data.radarCheckSpeedDiff = this.radarCheckSpeedDiff;
}
if (this.radarCheckTime != null) {
data.radarCheckTime = this.radarCheckTime;
@ -444,8 +444,8 @@ export namespace common {
writer.writeBool(2, this.speedSensorEnableB);
if (this.radarEnable != false)
writer.writeBool(3, this.radarEnable);
if (this.radarCheckSpeed != 0)
writer.writeFloat(4, this.radarCheckSpeed);
if (this.radarCheckSpeedDiff != 0)
writer.writeFloat(4, this.radarCheckSpeedDiff);
if (this.radarCheckTime != 0)
writer.writeInt32(5, this.radarCheckTime);
if (!w)
@ -467,7 +467,7 @@ export namespace common {
message.radarEnable = reader.readBool();
break;
case 4:
message.radarCheckSpeed = reader.readFloat();
message.radarCheckSpeedDiff = reader.readFloat();
break;
case 5:
message.radarCheckTime = reader.readInt32();

View File

@ -2722,9 +2722,9 @@ export namespace state {
rightDoorCloseCommand?: boolean;
allDoorClose?: boolean;
vobcInterruption?: boolean;
trainDynamicConfig?: dependency_2.common.TrainDynamicConfig;
trainEndsA?: dependency_2.common.TrainEndsState;
trainEndsB?: dependency_2.common.TrainEndsState;
trainDynamicConfig?: TrainDynamicConfigMqtt;
trainEndsA?: TrainEndsStateMqtt;
trainEndsB?: TrainEndsStateMqtt;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [20], this.#one_of_decls);
@ -3290,27 +3290,27 @@ export namespace state {
pb_1.Message.setField(this, 61, value);
}
get trainDynamicConfig() {
return pb_1.Message.getWrapperField(this, dependency_2.common.TrainDynamicConfig, 62) as dependency_2.common.TrainDynamicConfig;
return pb_1.Message.getWrapperField(this, TrainDynamicConfigMqtt, 62) as TrainDynamicConfigMqtt;
}
set trainDynamicConfig(value: dependency_2.common.TrainDynamicConfig) {
set trainDynamicConfig(value: TrainDynamicConfigMqtt) {
pb_1.Message.setWrapperField(this, 62, value);
}
get has_trainDynamicConfig() {
return pb_1.Message.getField(this, 62) != null;
}
get trainEndsA() {
return pb_1.Message.getWrapperField(this, dependency_2.common.TrainEndsState, 63) as dependency_2.common.TrainEndsState;
return pb_1.Message.getWrapperField(this, TrainEndsStateMqtt, 63) as TrainEndsStateMqtt;
}
set trainEndsA(value: dependency_2.common.TrainEndsState) {
set trainEndsA(value: TrainEndsStateMqtt) {
pb_1.Message.setWrapperField(this, 63, value);
}
get has_trainEndsA() {
return pb_1.Message.getField(this, 63) != null;
}
get trainEndsB() {
return pb_1.Message.getWrapperField(this, dependency_2.common.TrainEndsState, 64) as dependency_2.common.TrainEndsState;
return pb_1.Message.getWrapperField(this, TrainEndsStateMqtt, 64) as TrainEndsStateMqtt;
}
set trainEndsB(value: dependency_2.common.TrainEndsState) {
set trainEndsB(value: TrainEndsStateMqtt) {
pb_1.Message.setWrapperField(this, 64, value);
}
get has_trainEndsB() {
@ -3378,9 +3378,9 @@ export namespace state {
rightDoorCloseCommand?: boolean;
allDoorClose?: boolean;
vobcInterruption?: boolean;
trainDynamicConfig?: ReturnType<typeof dependency_2.common.TrainDynamicConfig.prototype.toObject>;
trainEndsA?: ReturnType<typeof dependency_2.common.TrainEndsState.prototype.toObject>;
trainEndsB?: ReturnType<typeof dependency_2.common.TrainEndsState.prototype.toObject>;
trainDynamicConfig?: ReturnType<typeof TrainDynamicConfigMqtt.prototype.toObject>;
trainEndsA?: ReturnType<typeof TrainEndsStateMqtt.prototype.toObject>;
trainEndsB?: ReturnType<typeof TrainEndsStateMqtt.prototype.toObject>;
}): TrainMapState {
const message = new TrainMapState({});
if (data.id != null) {
@ -3567,13 +3567,13 @@ export namespace state {
message.vobcInterruption = data.vobcInterruption;
}
if (data.trainDynamicConfig != null) {
message.trainDynamicConfig = dependency_2.common.TrainDynamicConfig.fromObject(data.trainDynamicConfig);
message.trainDynamicConfig = TrainDynamicConfigMqtt.fromObject(data.trainDynamicConfig);
}
if (data.trainEndsA != null) {
message.trainEndsA = dependency_2.common.TrainEndsState.fromObject(data.trainEndsA);
message.trainEndsA = TrainEndsStateMqtt.fromObject(data.trainEndsA);
}
if (data.trainEndsB != null) {
message.trainEndsB = dependency_2.common.TrainEndsState.fromObject(data.trainEndsB);
message.trainEndsB = TrainEndsStateMqtt.fromObject(data.trainEndsB);
}
return message;
}
@ -3640,9 +3640,9 @@ export namespace state {
rightDoorCloseCommand?: boolean;
allDoorClose?: boolean;
vobcInterruption?: boolean;
trainDynamicConfig?: ReturnType<typeof dependency_2.common.TrainDynamicConfig.prototype.toObject>;
trainEndsA?: ReturnType<typeof dependency_2.common.TrainEndsState.prototype.toObject>;
trainEndsB?: ReturnType<typeof dependency_2.common.TrainEndsState.prototype.toObject>;
trainDynamicConfig?: ReturnType<typeof TrainDynamicConfigMqtt.prototype.toObject>;
trainEndsA?: ReturnType<typeof TrainEndsStateMqtt.prototype.toObject>;
trainEndsB?: ReturnType<typeof TrainEndsStateMqtt.prototype.toObject>;
} = {};
if (this.id != null) {
data.id = this.id;
@ -4163,13 +4163,13 @@ export namespace state {
message.vobcInterruption = reader.readBool();
break;
case 62:
reader.readMessage(message.trainDynamicConfig, () => message.trainDynamicConfig = dependency_2.common.TrainDynamicConfig.deserialize(reader));
reader.readMessage(message.trainDynamicConfig, () => message.trainDynamicConfig = TrainDynamicConfigMqtt.deserialize(reader));
break;
case 63:
reader.readMessage(message.trainEndsA, () => message.trainEndsA = dependency_2.common.TrainEndsState.deserialize(reader));
reader.readMessage(message.trainEndsA, () => message.trainEndsA = TrainEndsStateMqtt.deserialize(reader));
break;
case 64:
reader.readMessage(message.trainEndsB, () => message.trainEndsB = dependency_2.common.TrainEndsState.deserialize(reader));
reader.readMessage(message.trainEndsB, () => message.trainEndsB = TrainEndsStateMqtt.deserialize(reader));
break;
default: reader.skipField();
}
@ -4183,6 +4183,485 @@ export namespace state {
return TrainMapState.deserialize(bytes);
}
}
export class TrainDynamicConfigMqtt extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
baseResistanceParamA?: string;
baseResistanceParamB?: string;
baseResistanceParamC?: string;
curveResistanceParamR1?: string;
curveResistanceParamR2?: string;
curveResistanceParamR3?: string;
curveResistanceParamR4?: string;
revolvingMassParam?: string;
jump?: boolean;
slip?: string;
slide?: number;
stopSign?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("baseResistanceParamA" in data && data.baseResistanceParamA != undefined) {
this.baseResistanceParamA = data.baseResistanceParamA;
}
if ("baseResistanceParamB" in data && data.baseResistanceParamB != undefined) {
this.baseResistanceParamB = data.baseResistanceParamB;
}
if ("baseResistanceParamC" in data && data.baseResistanceParamC != undefined) {
this.baseResistanceParamC = data.baseResistanceParamC;
}
if ("curveResistanceParamR1" in data && data.curveResistanceParamR1 != undefined) {
this.curveResistanceParamR1 = data.curveResistanceParamR1;
}
if ("curveResistanceParamR2" in data && data.curveResistanceParamR2 != undefined) {
this.curveResistanceParamR2 = data.curveResistanceParamR2;
}
if ("curveResistanceParamR3" in data && data.curveResistanceParamR3 != undefined) {
this.curveResistanceParamR3 = data.curveResistanceParamR3;
}
if ("curveResistanceParamR4" in data && data.curveResistanceParamR4 != undefined) {
this.curveResistanceParamR4 = data.curveResistanceParamR4;
}
if ("revolvingMassParam" in data && data.revolvingMassParam != undefined) {
this.revolvingMassParam = data.revolvingMassParam;
}
if ("jump" in data && data.jump != undefined) {
this.jump = data.jump;
}
if ("slip" in data && data.slip != undefined) {
this.slip = data.slip;
}
if ("slide" in data && data.slide != undefined) {
this.slide = data.slide;
}
if ("stopSign" in data && data.stopSign != undefined) {
this.stopSign = data.stopSign;
}
}
}
get baseResistanceParamA() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set baseResistanceParamA(value: string) {
pb_1.Message.setField(this, 1, value);
}
get baseResistanceParamB() {
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
}
set baseResistanceParamB(value: string) {
pb_1.Message.setField(this, 2, value);
}
get baseResistanceParamC() {
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
}
set baseResistanceParamC(value: string) {
pb_1.Message.setField(this, 3, value);
}
get curveResistanceParamR1() {
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
}
set curveResistanceParamR1(value: string) {
pb_1.Message.setField(this, 4, value);
}
get curveResistanceParamR2() {
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
}
set curveResistanceParamR2(value: string) {
pb_1.Message.setField(this, 5, value);
}
get curveResistanceParamR3() {
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
}
set curveResistanceParamR3(value: string) {
pb_1.Message.setField(this, 6, value);
}
get curveResistanceParamR4() {
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
}
set curveResistanceParamR4(value: string) {
pb_1.Message.setField(this, 7, value);
}
get revolvingMassParam() {
return pb_1.Message.getFieldWithDefault(this, 8, "") as string;
}
set revolvingMassParam(value: string) {
pb_1.Message.setField(this, 8, value);
}
get jump() {
return pb_1.Message.getFieldWithDefault(this, 9, false) as boolean;
}
set jump(value: boolean) {
pb_1.Message.setField(this, 9, value);
}
get slip() {
return pb_1.Message.getFieldWithDefault(this, 10, "") as string;
}
set slip(value: string) {
pb_1.Message.setField(this, 10, value);
}
get slide() {
return pb_1.Message.getFieldWithDefault(this, 11, 0) as number;
}
set slide(value: number) {
pb_1.Message.setField(this, 11, value);
}
get stopSign() {
return pb_1.Message.getFieldWithDefault(this, 12, 0) as number;
}
set stopSign(value: number) {
pb_1.Message.setField(this, 12, value);
}
static fromObject(data: {
baseResistanceParamA?: string;
baseResistanceParamB?: string;
baseResistanceParamC?: string;
curveResistanceParamR1?: string;
curveResistanceParamR2?: string;
curveResistanceParamR3?: string;
curveResistanceParamR4?: string;
revolvingMassParam?: string;
jump?: boolean;
slip?: string;
slide?: number;
stopSign?: number;
}): TrainDynamicConfigMqtt {
const message = new TrainDynamicConfigMqtt({});
if (data.baseResistanceParamA != null) {
message.baseResistanceParamA = data.baseResistanceParamA;
}
if (data.baseResistanceParamB != null) {
message.baseResistanceParamB = data.baseResistanceParamB;
}
if (data.baseResistanceParamC != null) {
message.baseResistanceParamC = data.baseResistanceParamC;
}
if (data.curveResistanceParamR1 != null) {
message.curveResistanceParamR1 = data.curveResistanceParamR1;
}
if (data.curveResistanceParamR2 != null) {
message.curveResistanceParamR2 = data.curveResistanceParamR2;
}
if (data.curveResistanceParamR3 != null) {
message.curveResistanceParamR3 = data.curveResistanceParamR3;
}
if (data.curveResistanceParamR4 != null) {
message.curveResistanceParamR4 = data.curveResistanceParamR4;
}
if (data.revolvingMassParam != null) {
message.revolvingMassParam = data.revolvingMassParam;
}
if (data.jump != null) {
message.jump = data.jump;
}
if (data.slip != null) {
message.slip = data.slip;
}
if (data.slide != null) {
message.slide = data.slide;
}
if (data.stopSign != null) {
message.stopSign = data.stopSign;
}
return message;
}
toObject() {
const data: {
baseResistanceParamA?: string;
baseResistanceParamB?: string;
baseResistanceParamC?: string;
curveResistanceParamR1?: string;
curveResistanceParamR2?: string;
curveResistanceParamR3?: string;
curveResistanceParamR4?: string;
revolvingMassParam?: string;
jump?: boolean;
slip?: string;
slide?: number;
stopSign?: number;
} = {};
if (this.baseResistanceParamA != null) {
data.baseResistanceParamA = this.baseResistanceParamA;
}
if (this.baseResistanceParamB != null) {
data.baseResistanceParamB = this.baseResistanceParamB;
}
if (this.baseResistanceParamC != null) {
data.baseResistanceParamC = this.baseResistanceParamC;
}
if (this.curveResistanceParamR1 != null) {
data.curveResistanceParamR1 = this.curveResistanceParamR1;
}
if (this.curveResistanceParamR2 != null) {
data.curveResistanceParamR2 = this.curveResistanceParamR2;
}
if (this.curveResistanceParamR3 != null) {
data.curveResistanceParamR3 = this.curveResistanceParamR3;
}
if (this.curveResistanceParamR4 != null) {
data.curveResistanceParamR4 = this.curveResistanceParamR4;
}
if (this.revolvingMassParam != null) {
data.revolvingMassParam = this.revolvingMassParam;
}
if (this.jump != null) {
data.jump = this.jump;
}
if (this.slip != null) {
data.slip = this.slip;
}
if (this.slide != null) {
data.slide = this.slide;
}
if (this.stopSign != null) {
data.stopSign = this.stopSign;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.baseResistanceParamA.length)
writer.writeString(1, this.baseResistanceParamA);
if (this.baseResistanceParamB.length)
writer.writeString(2, this.baseResistanceParamB);
if (this.baseResistanceParamC.length)
writer.writeString(3, this.baseResistanceParamC);
if (this.curveResistanceParamR1.length)
writer.writeString(4, this.curveResistanceParamR1);
if (this.curveResistanceParamR2.length)
writer.writeString(5, this.curveResistanceParamR2);
if (this.curveResistanceParamR3.length)
writer.writeString(6, this.curveResistanceParamR3);
if (this.curveResistanceParamR4.length)
writer.writeString(7, this.curveResistanceParamR4);
if (this.revolvingMassParam.length)
writer.writeString(8, this.revolvingMassParam);
if (this.jump != false)
writer.writeBool(9, this.jump);
if (this.slip.length)
writer.writeString(10, this.slip);
if (this.slide != 0)
writer.writeInt32(11, this.slide);
if (this.stopSign != 0)
writer.writeInt32(12, this.stopSign);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainDynamicConfigMqtt {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrainDynamicConfigMqtt();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.baseResistanceParamA = reader.readString();
break;
case 2:
message.baseResistanceParamB = reader.readString();
break;
case 3:
message.baseResistanceParamC = reader.readString();
break;
case 4:
message.curveResistanceParamR1 = reader.readString();
break;
case 5:
message.curveResistanceParamR2 = reader.readString();
break;
case 6:
message.curveResistanceParamR3 = reader.readString();
break;
case 7:
message.curveResistanceParamR4 = reader.readString();
break;
case 8:
message.revolvingMassParam = reader.readString();
break;
case 9:
message.jump = reader.readBool();
break;
case 10:
message.slip = reader.readString();
break;
case 11:
message.slide = reader.readInt32();
break;
case 12:
message.stopSign = reader.readInt32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): TrainDynamicConfigMqtt {
return TrainDynamicConfigMqtt.deserialize(bytes);
}
}
export class TrainEndsStateMqtt extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
speedSensorEnableA?: boolean;
speedSensorEnableB?: boolean;
radarEnable?: boolean;
radarCheckSpeedDiff?: string;
radarCheckTime?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("speedSensorEnableA" in data && data.speedSensorEnableA != undefined) {
this.speedSensorEnableA = data.speedSensorEnableA;
}
if ("speedSensorEnableB" in data && data.speedSensorEnableB != undefined) {
this.speedSensorEnableB = data.speedSensorEnableB;
}
if ("radarEnable" in data && data.radarEnable != undefined) {
this.radarEnable = data.radarEnable;
}
if ("radarCheckSpeedDiff" in data && data.radarCheckSpeedDiff != undefined) {
this.radarCheckSpeedDiff = data.radarCheckSpeedDiff;
}
if ("radarCheckTime" in data && data.radarCheckTime != undefined) {
this.radarCheckTime = data.radarCheckTime;
}
}
}
get speedSensorEnableA() {
return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean;
}
set speedSensorEnableA(value: boolean) {
pb_1.Message.setField(this, 1, value);
}
get speedSensorEnableB() {
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
}
set speedSensorEnableB(value: boolean) {
pb_1.Message.setField(this, 2, value);
}
get radarEnable() {
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
}
set radarEnable(value: boolean) {
pb_1.Message.setField(this, 3, value);
}
get radarCheckSpeedDiff() {
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
}
set radarCheckSpeedDiff(value: string) {
pb_1.Message.setField(this, 4, value);
}
get radarCheckTime() {
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
}
set radarCheckTime(value: number) {
pb_1.Message.setField(this, 5, value);
}
static fromObject(data: {
speedSensorEnableA?: boolean;
speedSensorEnableB?: boolean;
radarEnable?: boolean;
radarCheckSpeedDiff?: string;
radarCheckTime?: number;
}): TrainEndsStateMqtt {
const message = new TrainEndsStateMqtt({});
if (data.speedSensorEnableA != null) {
message.speedSensorEnableA = data.speedSensorEnableA;
}
if (data.speedSensorEnableB != null) {
message.speedSensorEnableB = data.speedSensorEnableB;
}
if (data.radarEnable != null) {
message.radarEnable = data.radarEnable;
}
if (data.radarCheckSpeedDiff != null) {
message.radarCheckSpeedDiff = data.radarCheckSpeedDiff;
}
if (data.radarCheckTime != null) {
message.radarCheckTime = data.radarCheckTime;
}
return message;
}
toObject() {
const data: {
speedSensorEnableA?: boolean;
speedSensorEnableB?: boolean;
radarEnable?: boolean;
radarCheckSpeedDiff?: string;
radarCheckTime?: number;
} = {};
if (this.speedSensorEnableA != null) {
data.speedSensorEnableA = this.speedSensorEnableA;
}
if (this.speedSensorEnableB != null) {
data.speedSensorEnableB = this.speedSensorEnableB;
}
if (this.radarEnable != null) {
data.radarEnable = this.radarEnable;
}
if (this.radarCheckSpeedDiff != null) {
data.radarCheckSpeedDiff = this.radarCheckSpeedDiff;
}
if (this.radarCheckTime != null) {
data.radarCheckTime = this.radarCheckTime;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.speedSensorEnableA != false)
writer.writeBool(1, this.speedSensorEnableA);
if (this.speedSensorEnableB != false)
writer.writeBool(2, this.speedSensorEnableB);
if (this.radarEnable != false)
writer.writeBool(3, this.radarEnable);
if (this.radarCheckSpeedDiff.length)
writer.writeString(4, this.radarCheckSpeedDiff);
if (this.radarCheckTime != 0)
writer.writeInt32(5, this.radarCheckTime);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainEndsStateMqtt {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrainEndsStateMqtt();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.speedSensorEnableA = reader.readBool();
break;
case 2:
message.speedSensorEnableB = reader.readBool();
break;
case 3:
message.radarEnable = reader.readBool();
break;
case 4:
message.radarCheckSpeedDiff = reader.readString();
break;
case 5:
message.radarCheckTime = reader.readInt32();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): TrainEndsStateMqtt {
return TrainEndsStateMqtt.deserialize(bytes);
}
}
export class ReplyState extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {

View File

@ -8907,8 +8907,6 @@ export namespace graphicData {
trainModel?: Train.TrainModel;
carriageLength?: number;
totalLength?: number;
minDiameter?: number;
maxDiameter?: number;
trainSets?: string;
dynamicConfig?: dependency_1.common.TrainDynamicConfig;
}) {
@ -8924,12 +8922,6 @@ export namespace graphicData {
if ("totalLength" in data && data.totalLength != undefined) {
this.totalLength = data.totalLength;
}
if ("minDiameter" in data && data.minDiameter != undefined) {
this.minDiameter = data.minDiameter;
}
if ("maxDiameter" in data && data.maxDiameter != undefined) {
this.maxDiameter = data.maxDiameter;
}
if ("trainSets" in data && data.trainSets != undefined) {
this.trainSets = data.trainSets;
}
@ -8956,18 +8948,6 @@ export namespace graphicData {
set totalLength(value: number) {
pb_1.Message.setField(this, 3, value);
}
get minDiameter() {
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
}
set minDiameter(value: number) {
pb_1.Message.setField(this, 4, value);
}
get maxDiameter() {
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
}
set maxDiameter(value: number) {
pb_1.Message.setField(this, 5, value);
}
get trainSets() {
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
}
@ -8987,8 +8967,6 @@ export namespace graphicData {
trainModel?: Train.TrainModel;
carriageLength?: number;
totalLength?: number;
minDiameter?: number;
maxDiameter?: number;
trainSets?: string;
dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>;
}): Train {
@ -9002,12 +8980,6 @@ export namespace graphicData {
if (data.totalLength != null) {
message.totalLength = data.totalLength;
}
if (data.minDiameter != null) {
message.minDiameter = data.minDiameter;
}
if (data.maxDiameter != null) {
message.maxDiameter = data.maxDiameter;
}
if (data.trainSets != null) {
message.trainSets = data.trainSets;
}
@ -9021,8 +8993,6 @@ export namespace graphicData {
trainModel?: Train.TrainModel;
carriageLength?: number;
totalLength?: number;
minDiameter?: number;
maxDiameter?: number;
trainSets?: string;
dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>;
} = {};
@ -9035,12 +9005,6 @@ export namespace graphicData {
if (this.totalLength != null) {
data.totalLength = this.totalLength;
}
if (this.minDiameter != null) {
data.minDiameter = this.minDiameter;
}
if (this.maxDiameter != null) {
data.maxDiameter = this.maxDiameter;
}
if (this.trainSets != null) {
data.trainSets = this.trainSets;
}
@ -9059,10 +9023,6 @@ export namespace graphicData {
writer.writeInt32(2, this.carriageLength);
if (this.totalLength != 0)
writer.writeInt32(3, this.totalLength);
if (this.minDiameter != 0)
writer.writeInt32(4, this.minDiameter);
if (this.maxDiameter != 0)
writer.writeInt32(5, this.maxDiameter);
if (this.trainSets.length)
writer.writeString(6, this.trainSets);
if (this.has_dynamicConfig)
@ -9085,12 +9045,6 @@ export namespace graphicData {
case 3:
message.totalLength = reader.readInt32();
break;
case 4:
message.minDiameter = reader.readInt32();
break;
case 5:
message.maxDiameter = reader.readInt32();
break;
case 6:
message.trainSets = reader.readString();
break;