参数名变更

This commit is contained in:
fan 2024-01-18 17:29:28 +08:00
parent b46f8c71e4
commit 0f1c65c6e6
10 changed files with 224 additions and 154 deletions

@ -1 +1 @@
Subproject commit c7ee997a5efe4d07da79bbad667fec38c9da4da8
Subproject commit 13b90a82739ae8e8eda04969a7031d966865e9e3

View File

@ -321,9 +321,9 @@ export interface TrainConfig {
simulationId: string;
wheelDiameter: number;
configData: {
baseResistanceParamA: number;
baseResistanceParamB: number;
baseResistanceParamC: number;
davisParamA: number;
davisParamB: number;
davisParamC: number;
curveResistanceParamR1: number;
curveResistanceParamR2: number;
curveResistanceParamR3: number;
@ -333,6 +333,7 @@ export interface TrainConfig {
slide: number;
slip: number;
stopSign: number;
idling: number;
},
trainEndsA: {
radarCheckSpeedDiff: number;

View File

@ -28,9 +28,9 @@ export async function pageQuery(
}
export interface TrainConfigData {
baseResistanceParamA: number;
baseResistanceParamB: number;
baseResistanceParamC: number;
davisParamA: number;
davisParamB: number;
davisParamC: number;
curveResistanceParamR1: number;
curveResistanceParamR2: number;
curveResistanceParamR3: number;
@ -39,7 +39,8 @@ export interface TrainConfigData {
revolvingMassParam: number;
slide: number;
slip: number;
stopSign: number
stopSign: number;
idling: number;
}
export interface TrainCreateParams {

View File

@ -106,7 +106,7 @@
outlined
class="q-input--sm"
v-model.number="model.length"
label="列车长度(m)"
label="列车长度(mm)"
hint=""
/>
</div>
@ -126,7 +126,7 @@
<q-input
outlined
class="q-input--sm"
v-model.number="model.configData.baseResistanceParamA"
v-model.number="model.configData.davisParamA"
label="基本阻力参数A"
hint=""
/>
@ -134,7 +134,7 @@
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="model.configData.baseResistanceParamB"
v-model.number="model.configData.davisParamB"
label="基本阻力参数B"
hint=""
/>
@ -142,7 +142,7 @@
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="model.configData.baseResistanceParamC"
v-model.number="model.configData.davisParamC"
label="基本阻力参数C"
hint=""
/>
@ -218,6 +218,14 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="model.configData.idling"
label="空转(%)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<q-checkbox
style="font-size: 12px"
@ -268,9 +276,9 @@ const model = reactive({
speedSensorEnableB: true,
},
configData: {
baseResistanceParamA: 0,
baseResistanceParamB: 0,
baseResistanceParamC: 0,
davisParamA: 0,
davisParamB: 0,
davisParamC: 0,
curveResistanceParamR1: 0,
curveResistanceParamR2: 0,
curveResistanceParamR3: 0,
@ -280,6 +288,7 @@ const model = reactive({
slide: 0,
slip: 0,
stopSign: 0,
idling: 0,
},
length: 0,
wheelDiameter: 0,
@ -315,9 +324,9 @@ function initModel() {
speedSensorEnableB: trainState.bSpeedSensorEnableB,
};
model.configData = {
baseResistanceParamA: trainState.baseResistanceParamA,
baseResistanceParamB: trainState.baseResistanceParamB,
baseResistanceParamC: trainState.baseResistanceParamC,
davisParamA: trainState.davisParamA,
davisParamB: trainState.davisParamB,
davisParamC: trainState.davisParamC,
curveResistanceParamR1: trainState.curveResistanceParamR1,
curveResistanceParamR2: trainState.curveResistanceParamR2,
curveResistanceParamR3: trainState.curveResistanceParamR3,
@ -327,6 +336,7 @@ function initModel() {
slide: trainState.slide,
slip: trainState.slip,
stopSign: trainState.stopSign,
idling: trainState.idling,
};
model.length = trainState.trainLength;
model.wheelDiameter = trainState.wheelDiameter;

View File

@ -229,9 +229,9 @@ const list3: KeyType[] = [
];
const list4: KeyType[] = [
{ label: '基本阻力参数A', key: 'baseResistanceParamA' },
{ label: '基本阻力参数B', key: 'baseResistanceParamB' },
{ label: '基本阻力参数C', key: 'baseResistanceParamC' },
{ label: '基本阻力参数A', key: 'davisParamA' },
{ label: '基本阻力参数B', key: 'davisParamB' },
{ label: '基本阻力参数C', key: 'davisParamC' },
{ label: '曲线阻力参数R1', key: 'curveResistanceParamR1' },
{ label: '曲线阻力参数R2', key: 'curveResistanceParamR2' },
{ label: '曲线阻力参数R3', key: 'curveResistanceParamR3' },
@ -241,6 +241,7 @@ const list4: KeyType[] = [
{ 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端速传1是否有效', key: 'aSpeedSensorEnableA', formatFn: upFormat },
@ -400,7 +401,7 @@ watch(
);
});
if (find) {
console.log(find, '1111');
// console.log(find, '1111');
trainInfo.value = find as ITrainState;
}
}

View File

@ -396,23 +396,23 @@ export class TrainState extends GraphicStateBase implements ITrainState {
set vobcInterruption(v: boolean) {
this.states.vobcInterruption = v;
}
get baseResistanceParamA(): number {
return +this.states.trainDynamicConfig.baseResistanceParamA;
get davisParamA(): number {
return +this.states.trainDynamicConfig.davisParamA;
}
set baseResistanceParamA(v: number) {
this.states.trainDynamicConfig.baseResistanceParamA = v + '';
set davisParamA(v: number) {
this.states.trainDynamicConfig.davisParamA = v + '';
}
get baseResistanceParamB(): number {
return +this.states.trainDynamicConfig.baseResistanceParamB;
get davisParamB(): number {
return +this.states.trainDynamicConfig.davisParamB;
}
set baseResistanceParamB(v: number) {
this.states.trainDynamicConfig.baseResistanceParamB = v + '';
set davisParamB(v: number) {
this.states.trainDynamicConfig.davisParamB = v + '';
}
get baseResistanceParamC(): number {
return +this.states.trainDynamicConfig.baseResistanceParamC;
get davisParamC(): number {
return +this.states.trainDynamicConfig.davisParamC;
}
set baseResistanceParamC(v: number) {
this.states.trainDynamicConfig.baseResistanceParamC = v + '';
set davisParamC(v: number) {
this.states.trainDynamicConfig.davisParamC = v + '';
}
get curveResistanceParamR1(): number {
return +this.states.trainDynamicConfig.curveResistanceParamR1;
@ -462,6 +462,12 @@ export class TrainState extends GraphicStateBase implements ITrainState {
set slide(v: number) {
this.states.trainDynamicConfig.slide = v;
}
get idling(): number {
return +this.states.trainDynamicConfig.idling;
}
set idling(v: number) {
this.states.trainDynamicConfig.idling = v + '';
}
get stopSign(): number {
return this.states.trainDynamicConfig.stopSign;
}

View File

@ -147,12 +147,12 @@ export interface ITrainState extends GraphicState {
set allDoorClose(v: boolean);
get vobcInterruption(): boolean;
set vobcInterruption(v: boolean);
get baseResistanceParamA(): number;
set baseResistanceParamA(v: number);
get baseResistanceParamB(): number;
set baseResistanceParamB(v: number);
get baseResistanceParamC(): number;
set baseResistanceParamC(v: number);
get davisParamA(): number;
set davisParamA(v: number);
get davisParamB(): number;
set davisParamB(v: number);
get davisParamC(): number;
set davisParamC(v: number);
get curveResistanceParamR1(): number;
set curveResistanceParamR1(v: number);
get curveResistanceParamR2(): number;
@ -171,6 +171,8 @@ export interface ITrainState extends GraphicState {
set slide(v: number);
get stopSign(): number;
set stopSign(v: number);
get idling(): number;
set idling(v: number);
get aSpeedSensorEnableA(): boolean;
set aSpeedSensorEnableA(v: boolean);
get aSpeedSensorEnableB(): boolean;

View File

@ -174,9 +174,7 @@
<q-input
outlined
class="q-input--sm"
v-model.number="
editInfo.trainConfigData.baseResistanceParamA
"
v-model.number="editInfo.trainConfigData.davisParamA"
label="基本阻力参数A"
hint=""
/>
@ -184,9 +182,7 @@
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="
editInfo.trainConfigData.baseResistanceParamB
"
v-model.number="editInfo.trainConfigData.davisParamB"
label="基本阻力参数B"
hint=""
/>
@ -194,9 +190,7 @@
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="
editInfo.trainConfigData.baseResistanceParamC
"
v-model.number="editInfo.trainConfigData.davisParamC"
label="基本阻力参数C"
hint=""
/>
@ -269,7 +263,7 @@
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="editInfo.trainConfigData.slide"
v-model.number="editInfo.trainConfigData.slip"
label="打滑(%)"
hint=""
/>
@ -282,6 +276,14 @@
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="editInfo.trainConfigData.idling"
label="空转(%)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<q-checkbox
style="font-size: 12px"
@ -484,9 +486,9 @@ function onReset() {
// editInfo.min_diameter = 0;
// editInfo.max_diameter = 0;
editInfo.train_sets = '';
editInfo.trainConfigData.baseResistanceParamA = 2.25;
editInfo.trainConfigData.baseResistanceParamB = 0.019;
editInfo.trainConfigData.baseResistanceParamC = 0.00032;
editInfo.trainConfigData.davisParamA = 2.25;
editInfo.trainConfigData.davisParamB = 0.019;
editInfo.trainConfigData.davisParamC = 0.00032;
editInfo.trainConfigData.curveResistanceParamR1 = 6.38;
editInfo.trainConfigData.curveResistanceParamR2 = 55;
editInfo.trainConfigData.curveResistanceParamR3 = 4.91;
@ -496,6 +498,7 @@ function onReset() {
editInfo.trainConfigData.slide = 0;
editInfo.trainConfigData.slip = 0;
editInfo.trainConfigData.stopSign = 0;
editInfo.trainConfigData.idling = 0;
createForm.value?.resetValidation();
}
@ -534,9 +537,9 @@ interface EditCreateItem extends TrainCreateParams {
train_model: number;
train_sets: string;
trainConfigData: {
baseResistanceParamA: number;
baseResistanceParamB: number;
baseResistanceParamC: number;
davisParamA: number;
davisParamB: number;
davisParamC: number;
curveResistanceParamR1: number;
curveResistanceParamR2: number;
curveResistanceParamR3: number;
@ -546,6 +549,7 @@ interface EditCreateItem extends TrainCreateParams {
slide: number;
slip: number;
stopSign: number;
idling: number;
};
}
@ -560,9 +564,9 @@ const editInfo = reactive<EditCreateItem>({
max_diameter: 0,
train_sets: '',
trainConfigData: {
baseResistanceParamA: 2.25,
baseResistanceParamB: 0.019,
baseResistanceParamC: 0.00032,
davisParamA: 2.25,
davisParamB: 0.019,
davisParamC: 0.00032,
curveResistanceParamR1: 6.38,
curveResistanceParamR2: 55,
curveResistanceParamR3: 4.91,
@ -572,6 +576,7 @@ const editInfo = reactive<EditCreateItem>({
slide: 0,
slip: 0,
stopSign: 0,
idling: 0,
},
});
function editData(row: TrainItem) {
@ -587,12 +592,9 @@ function editData(row: TrainItem) {
// editInfo.max_diameter = res.max_diameter;
editInfo.train_sets = res.train_sets;
if (res.trainConfigData) {
editInfo.trainConfigData.baseResistanceParamA =
res.trainConfigData.baseResistanceParamA;
editInfo.trainConfigData.baseResistanceParamB =
res.trainConfigData.baseResistanceParamB;
editInfo.trainConfigData.baseResistanceParamC =
res.trainConfigData.baseResistanceParamC;
editInfo.trainConfigData.davisParamA = res.trainConfigData.davisParamA;
editInfo.trainConfigData.davisParamB = res.trainConfigData.davisParamB;
editInfo.trainConfigData.davisParamC = res.trainConfigData.davisParamC;
editInfo.trainConfigData.curveResistanceParamR1 =
res.trainConfigData.curveResistanceParamR1;
editInfo.trainConfigData.curveResistanceParamR2 =
@ -601,12 +603,13 @@ function editData(row: TrainItem) {
res.trainConfigData.curveResistanceParamR3;
editInfo.trainConfigData.curveResistanceParamR4 =
res.trainConfigData.curveResistanceParamR4;
editInfo.trainConfigData.jump = editInfo.trainConfigData.jump;
editInfo.trainConfigData.jump = res.trainConfigData.jump;
editInfo.trainConfigData.revolvingMassParam =
editInfo.trainConfigData.revolvingMassParam;
editInfo.trainConfigData.slide = editInfo.trainConfigData.slide;
editInfo.trainConfigData.slip = editInfo.trainConfigData.slide;
editInfo.trainConfigData.stopSign = editInfo.trainConfigData.stopSign;
res.trainConfigData.revolvingMassParam;
editInfo.trainConfigData.slide = res.trainConfigData.slide;
editInfo.trainConfigData.slip = res.trainConfigData.slip;
editInfo.trainConfigData.stopSign = res.trainConfigData.stopSign;
editInfo.trainConfigData.idling = res.trainConfigData.idling;
}
createFormShow.value = true;
})

View File

@ -8,9 +8,9 @@ export namespace common {
export class TrainDynamicConfig extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
baseResistanceParamA?: number;
baseResistanceParamB?: number;
baseResistanceParamC?: number;
davisParamA?: number;
davisParamB?: number;
davisParamC?: number;
curveResistanceParamR1?: number;
curveResistanceParamR2?: number;
curveResistanceParamR3?: number;
@ -20,18 +20,19 @@ export namespace common {
slip?: number;
slide?: number;
stopSign?: number;
idling?: 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 ("davisParamA" in data && data.davisParamA != undefined) {
this.davisParamA = data.davisParamA;
}
if ("baseResistanceParamB" in data && data.baseResistanceParamB != undefined) {
this.baseResistanceParamB = data.baseResistanceParamB;
if ("davisParamB" in data && data.davisParamB != undefined) {
this.davisParamB = data.davisParamB;
}
if ("baseResistanceParamC" in data && data.baseResistanceParamC != undefined) {
this.baseResistanceParamC = data.baseResistanceParamC;
if ("davisParamC" in data && data.davisParamC != undefined) {
this.davisParamC = data.davisParamC;
}
if ("curveResistanceParamR1" in data && data.curveResistanceParamR1 != undefined) {
this.curveResistanceParamR1 = data.curveResistanceParamR1;
@ -60,24 +61,27 @@ export namespace common {
if ("stopSign" in data && data.stopSign != undefined) {
this.stopSign = data.stopSign;
}
if ("idling" in data && data.idling != undefined) {
this.idling = data.idling;
}
}
}
get baseResistanceParamA() {
get davisParamA() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set baseResistanceParamA(value: number) {
set davisParamA(value: number) {
pb_1.Message.setField(this, 1, value);
}
get baseResistanceParamB() {
get davisParamB() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set baseResistanceParamB(value: number) {
set davisParamB(value: number) {
pb_1.Message.setField(this, 2, value);
}
get baseResistanceParamC() {
get davisParamC() {
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set baseResistanceParamC(value: number) {
set davisParamC(value: number) {
pb_1.Message.setField(this, 3, value);
}
get curveResistanceParamR1() {
@ -134,10 +138,16 @@ export namespace common {
set stopSign(value: number) {
pb_1.Message.setField(this, 12, value);
}
get idling() {
return pb_1.Message.getFieldWithDefault(this, 13, 0) as number;
}
set idling(value: number) {
pb_1.Message.setField(this, 13, value);
}
static fromObject(data: {
baseResistanceParamA?: number;
baseResistanceParamB?: number;
baseResistanceParamC?: number;
davisParamA?: number;
davisParamB?: number;
davisParamC?: number;
curveResistanceParamR1?: number;
curveResistanceParamR2?: number;
curveResistanceParamR3?: number;
@ -147,16 +157,17 @@ export namespace common {
slip?: number;
slide?: number;
stopSign?: number;
idling?: number;
}): TrainDynamicConfig {
const message = new TrainDynamicConfig({});
if (data.baseResistanceParamA != null) {
message.baseResistanceParamA = data.baseResistanceParamA;
if (data.davisParamA != null) {
message.davisParamA = data.davisParamA;
}
if (data.baseResistanceParamB != null) {
message.baseResistanceParamB = data.baseResistanceParamB;
if (data.davisParamB != null) {
message.davisParamB = data.davisParamB;
}
if (data.baseResistanceParamC != null) {
message.baseResistanceParamC = data.baseResistanceParamC;
if (data.davisParamC != null) {
message.davisParamC = data.davisParamC;
}
if (data.curveResistanceParamR1 != null) {
message.curveResistanceParamR1 = data.curveResistanceParamR1;
@ -185,13 +196,16 @@ export namespace common {
if (data.stopSign != null) {
message.stopSign = data.stopSign;
}
if (data.idling != null) {
message.idling = data.idling;
}
return message;
}
toObject() {
const data: {
baseResistanceParamA?: number;
baseResistanceParamB?: number;
baseResistanceParamC?: number;
davisParamA?: number;
davisParamB?: number;
davisParamC?: number;
curveResistanceParamR1?: number;
curveResistanceParamR2?: number;
curveResistanceParamR3?: number;
@ -201,15 +215,16 @@ export namespace common {
slip?: number;
slide?: number;
stopSign?: number;
idling?: number;
} = {};
if (this.baseResistanceParamA != null) {
data.baseResistanceParamA = this.baseResistanceParamA;
if (this.davisParamA != null) {
data.davisParamA = this.davisParamA;
}
if (this.baseResistanceParamB != null) {
data.baseResistanceParamB = this.baseResistanceParamB;
if (this.davisParamB != null) {
data.davisParamB = this.davisParamB;
}
if (this.baseResistanceParamC != null) {
data.baseResistanceParamC = this.baseResistanceParamC;
if (this.davisParamC != null) {
data.davisParamC = this.davisParamC;
}
if (this.curveResistanceParamR1 != null) {
data.curveResistanceParamR1 = this.curveResistanceParamR1;
@ -238,18 +253,21 @@ export namespace common {
if (this.stopSign != null) {
data.stopSign = this.stopSign;
}
if (this.idling != null) {
data.idling = this.idling;
}
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 != 0)
writer.writeFloat(1, this.baseResistanceParamA);
if (this.baseResistanceParamB != 0)
writer.writeFloat(2, this.baseResistanceParamB);
if (this.baseResistanceParamC != 0)
writer.writeFloat(3, this.baseResistanceParamC);
if (this.davisParamA != 0)
writer.writeFloat(1, this.davisParamA);
if (this.davisParamB != 0)
writer.writeFloat(2, this.davisParamB);
if (this.davisParamC != 0)
writer.writeFloat(3, this.davisParamC);
if (this.curveResistanceParamR1 != 0)
writer.writeFloat(4, this.curveResistanceParamR1);
if (this.curveResistanceParamR2 != 0)
@ -268,6 +286,8 @@ export namespace common {
writer.writeInt32(11, this.slide);
if (this.stopSign != 0)
writer.writeInt32(12, this.stopSign);
if (this.idling != 0)
writer.writeFloat(13, this.idling);
if (!w)
return writer.getResultBuffer();
}
@ -278,13 +298,13 @@ export namespace common {
break;
switch (reader.getFieldNumber()) {
case 1:
message.baseResistanceParamA = reader.readFloat();
message.davisParamA = reader.readFloat();
break;
case 2:
message.baseResistanceParamB = reader.readFloat();
message.davisParamB = reader.readFloat();
break;
case 3:
message.baseResistanceParamC = reader.readFloat();
message.davisParamC = reader.readFloat();
break;
case 4:
message.curveResistanceParamR1 = reader.readFloat();
@ -313,6 +333,9 @@ export namespace common {
case 12:
message.stopSign = reader.readInt32();
break;
case 13:
message.idling = reader.readFloat();
break;
default: reader.skipField();
}
}

View File

@ -4186,9 +4186,9 @@ export namespace state {
export class TrainDynamicConfigMqtt extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
baseResistanceParamA?: string;
baseResistanceParamB?: string;
baseResistanceParamC?: string;
davisParamA?: string;
davisParamB?: string;
davisParamC?: string;
curveResistanceParamR1?: string;
curveResistanceParamR2?: string;
curveResistanceParamR3?: string;
@ -4198,18 +4198,19 @@ export namespace state {
slip?: string;
slide?: number;
stopSign?: number;
idling?: string;
}) {
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 ("davisParamA" in data && data.davisParamA != undefined) {
this.davisParamA = data.davisParamA;
}
if ("baseResistanceParamB" in data && data.baseResistanceParamB != undefined) {
this.baseResistanceParamB = data.baseResistanceParamB;
if ("davisParamB" in data && data.davisParamB != undefined) {
this.davisParamB = data.davisParamB;
}
if ("baseResistanceParamC" in data && data.baseResistanceParamC != undefined) {
this.baseResistanceParamC = data.baseResistanceParamC;
if ("davisParamC" in data && data.davisParamC != undefined) {
this.davisParamC = data.davisParamC;
}
if ("curveResistanceParamR1" in data && data.curveResistanceParamR1 != undefined) {
this.curveResistanceParamR1 = data.curveResistanceParamR1;
@ -4238,24 +4239,27 @@ export namespace state {
if ("stopSign" in data && data.stopSign != undefined) {
this.stopSign = data.stopSign;
}
if ("idling" in data && data.idling != undefined) {
this.idling = data.idling;
}
}
}
get baseResistanceParamA() {
get davisParamA() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set baseResistanceParamA(value: string) {
set davisParamA(value: string) {
pb_1.Message.setField(this, 1, value);
}
get baseResistanceParamB() {
get davisParamB() {
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
}
set baseResistanceParamB(value: string) {
set davisParamB(value: string) {
pb_1.Message.setField(this, 2, value);
}
get baseResistanceParamC() {
get davisParamC() {
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
}
set baseResistanceParamC(value: string) {
set davisParamC(value: string) {
pb_1.Message.setField(this, 3, value);
}
get curveResistanceParamR1() {
@ -4312,10 +4316,16 @@ export namespace state {
set stopSign(value: number) {
pb_1.Message.setField(this, 12, value);
}
get idling() {
return pb_1.Message.getFieldWithDefault(this, 13, "") as string;
}
set idling(value: string) {
pb_1.Message.setField(this, 13, value);
}
static fromObject(data: {
baseResistanceParamA?: string;
baseResistanceParamB?: string;
baseResistanceParamC?: string;
davisParamA?: string;
davisParamB?: string;
davisParamC?: string;
curveResistanceParamR1?: string;
curveResistanceParamR2?: string;
curveResistanceParamR3?: string;
@ -4325,16 +4335,17 @@ export namespace state {
slip?: string;
slide?: number;
stopSign?: number;
idling?: string;
}): TrainDynamicConfigMqtt {
const message = new TrainDynamicConfigMqtt({});
if (data.baseResistanceParamA != null) {
message.baseResistanceParamA = data.baseResistanceParamA;
if (data.davisParamA != null) {
message.davisParamA = data.davisParamA;
}
if (data.baseResistanceParamB != null) {
message.baseResistanceParamB = data.baseResistanceParamB;
if (data.davisParamB != null) {
message.davisParamB = data.davisParamB;
}
if (data.baseResistanceParamC != null) {
message.baseResistanceParamC = data.baseResistanceParamC;
if (data.davisParamC != null) {
message.davisParamC = data.davisParamC;
}
if (data.curveResistanceParamR1 != null) {
message.curveResistanceParamR1 = data.curveResistanceParamR1;
@ -4363,13 +4374,16 @@ export namespace state {
if (data.stopSign != null) {
message.stopSign = data.stopSign;
}
if (data.idling != null) {
message.idling = data.idling;
}
return message;
}
toObject() {
const data: {
baseResistanceParamA?: string;
baseResistanceParamB?: string;
baseResistanceParamC?: string;
davisParamA?: string;
davisParamB?: string;
davisParamC?: string;
curveResistanceParamR1?: string;
curveResistanceParamR2?: string;
curveResistanceParamR3?: string;
@ -4379,15 +4393,16 @@ export namespace state {
slip?: string;
slide?: number;
stopSign?: number;
idling?: string;
} = {};
if (this.baseResistanceParamA != null) {
data.baseResistanceParamA = this.baseResistanceParamA;
if (this.davisParamA != null) {
data.davisParamA = this.davisParamA;
}
if (this.baseResistanceParamB != null) {
data.baseResistanceParamB = this.baseResistanceParamB;
if (this.davisParamB != null) {
data.davisParamB = this.davisParamB;
}
if (this.baseResistanceParamC != null) {
data.baseResistanceParamC = this.baseResistanceParamC;
if (this.davisParamC != null) {
data.davisParamC = this.davisParamC;
}
if (this.curveResistanceParamR1 != null) {
data.curveResistanceParamR1 = this.curveResistanceParamR1;
@ -4416,18 +4431,21 @@ export namespace state {
if (this.stopSign != null) {
data.stopSign = this.stopSign;
}
if (this.idling != null) {
data.idling = this.idling;
}
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.davisParamA.length)
writer.writeString(1, this.davisParamA);
if (this.davisParamB.length)
writer.writeString(2, this.davisParamB);
if (this.davisParamC.length)
writer.writeString(3, this.davisParamC);
if (this.curveResistanceParamR1.length)
writer.writeString(4, this.curveResistanceParamR1);
if (this.curveResistanceParamR2.length)
@ -4446,6 +4464,8 @@ export namespace state {
writer.writeInt32(11, this.slide);
if (this.stopSign != 0)
writer.writeInt32(12, this.stopSign);
if (this.idling.length)
writer.writeString(13, this.idling);
if (!w)
return writer.getResultBuffer();
}
@ -4456,13 +4476,13 @@ export namespace state {
break;
switch (reader.getFieldNumber()) {
case 1:
message.baseResistanceParamA = reader.readString();
message.davisParamA = reader.readString();
break;
case 2:
message.baseResistanceParamB = reader.readString();
message.davisParamB = reader.readString();
break;
case 3:
message.baseResistanceParamC = reader.readString();
message.davisParamC = reader.readString();
break;
case 4:
message.curveResistanceParamR1 = reader.readString();
@ -4491,6 +4511,9 @@ export namespace state {
case 12:
message.stopSign = reader.readInt32();
break;
case 13:
message.idling = reader.readString();
break;
default: reader.skipField();
}
}