Merge remote-tracking branch 'origin/develop' into local-test

This commit is contained in:
joylink_fanyuhong 2024-08-29 17:41:04 +08:00
commit cc4d57d305
11 changed files with 231 additions and 47 deletions

@ -1 +1 @@
Subproject commit 939b7a2604a29cb3d486199cc9491af49f81a2f3 Subproject commit 67d7d79c5a50880b61be05d98184209422f15f1b

View File

@ -390,7 +390,6 @@ export interface TrainConfig {
idlingA: number; idlingA: number;
idlingR: number; idlingR: number;
idlingD: number; idlingD: number;
trainLoad?: number;
}; };
trainEndsA: { trainEndsA: {
radarCheckSpeedDiff: number; radarCheckSpeedDiff: number;

View File

@ -45,7 +45,6 @@ export interface TrainConfigData {
idlingA: number; idlingA: number;
idlingR: number; idlingR: number;
idlingD: number; idlingD: number;
trainLoad?: number;
} }
export interface TrainCreateParams { export interface TrainCreateParams {
@ -57,6 +56,10 @@ export interface TrainCreateParams {
total_length: number; total_length: number;
train_model: number; train_model: number;
train_sets: string; train_sets: string;
train_load: number;
train_max_speed: number;
train_max_acc: number;
train_max_brake: number;
trainConfigData?: TrainConfigData; trainConfigData?: TrainConfigData;
trainControlMapId: number; trainControlMapId: number;
} }

View File

@ -171,6 +171,10 @@ function onCreate() {
trainSpeed: trainSpeed.value, trainSpeed: trainSpeed.value,
wheelDiameter: wheelDiameter.value, wheelDiameter: wheelDiameter.value,
trainLength: trainConfig.value.total_length, trainLength: trainConfig.value.total_length,
trainLoad: trainConfig.value.train_load,
trianMaxSpeed: trainConfig.value.train_max_speed,
trainMaxAcc: trainConfig.value.train_max_acc,
trianMaxBrake: trainConfig.value.train_max_brake,
configTrain: trainConfig.value.trainConfigData as TrainConfigData, configTrain: trainConfig.value.trainConfigData as TrainConfigData,
trainControlMapId: trainConfig.value.trainControlMapId, trainControlMapId: trainConfig.value.trainControlMapId,
trainEndsA: { trainEndsA: {
@ -218,6 +222,10 @@ const trainConfig = ref<TrainConfigItem | null>({
total_length: 0, total_length: 0,
train_model: 0, train_model: 0,
train_sets: '', train_sets: '',
train_load: 0,
train_max_speed: 0,
train_max_acc: 0,
train_max_brake: 0,
trainControlMapId: 0, trainControlMapId: 0,
}); });
function setConfigVal(val: TrainConfigItem | null) { function setConfigVal(val: TrainConfigItem | null) {

View File

@ -328,14 +328,6 @@
hint="" hint=""
/> />
</div> </div>
<div class="col-3 q-px-sm">
<q-input
outlined
v-model.number="model.configData.trainLoad"
label="载荷参数"
hint=""
/>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -521,7 +513,6 @@ const model = reactive({
idlingA: 0, idlingA: 0,
idlingR: 0, idlingR: 0,
idlingD: 0, idlingD: 0,
trainLoad: 0,
}, },
length: 0, length: 0,
wheelDiameter: 0, wheelDiameter: 0,
@ -582,7 +573,6 @@ function initModel() {
idlingA: trainState.idlingA, idlingA: trainState.idlingA,
idlingR: trainState.idlingR, idlingR: trainState.idlingR,
idlingD: trainState.idlingD, idlingD: trainState.idlingD,
trainLoad: trainState.trainLoad,
}; };
model.length = trainState.trainLength; model.length = trainState.trainLength;
model.wheelDiameter = trainState.wheelDiameter; model.wheelDiameter = trainState.wheelDiameter;

View File

@ -9,6 +9,7 @@ import Tcc_Handle_JSON from './tcc-handle-data.json';
import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js'; import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js';
export const zeroOffset = 9;
interface TccHandleTextures { interface TccHandleTextures {
tccHandle: Texture; tccHandle: Texture;
handleBackground: Texture; handleBackground: Texture;
@ -54,7 +55,14 @@ export class TccHandle extends JlGraphic {
return this.getStates<ITccHandleState>(); return this.getStates<ITccHandleState>();
} }
doRepaint(): void { doRepaint(): void {
this._tccHandle.y = -(this.state.gear * 144) / 100; const pos = -(this.state.gear * (144 - zeroOffset)) / 100;
if (pos > 0) {
this._tccHandle.y = pos + zeroOffset;
} else if (pos < 0) {
this._tccHandle.y = pos - zeroOffset;
} else {
this._tccHandle.y = 0;
}
this._tccHandle.texture = this.tccHandleTextures.tccHandle; this._tccHandle.texture = this.tccHandleTextures.tccHandle;
} }
} }

View File

@ -166,6 +166,38 @@
label="关联驾驶台地图" label="关联驾驶台地图"
/> />
</div> </div>
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="editInfo.train_load"
label="载荷参数(吨)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="editInfo.train_max_speed"
label="列车最大速度(km/h)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="editInfo.train_max_acc"
label="最大加速度(m/s²)"
hint=""
/>
</div>
<div class="col-4 q-px-sm">
<q-input
outlined
v-model.number="editInfo.train_max_brake"
label="最大减速度(m/s²)"
hint=""
/>
</div>
<div class="col-12 q-px-sm" style="padding-bottom: 10px"> <div class="col-12 q-px-sm" style="padding-bottom: 10px">
<q-input <q-input
outlined outlined
@ -256,11 +288,13 @@
/> />
</div> </div>
<div class="col-4 q-px-sm"> <div class="col-4 q-px-sm">
<q-input <q-select
outlined outlined
v-model.number="editInfo.trainConfigData.trainLoad" v-model="editInfo.trainConfigData.maxSpeed"
label="载荷参数" emitValue
hint="" mapOptions
:options="tccNameList"
label="最大速度(km/h)"
/> />
</div> </div>
</div> </div>
@ -535,6 +569,10 @@ function onCreate() {
// min_diameter: editInfo.min_diameter, // min_diameter: editInfo.min_diameter,
// max_diameter: editInfo.max_diameter, // max_diameter: editInfo.max_diameter,
train_sets: editInfo.train_sets, train_sets: editInfo.train_sets,
train_load: editInfo.train_load,
train_max_speed: editInfo.train_max_speed,
train_max_acc: editInfo.train_max_acc,
train_max_brake: editInfo.train_max_brake,
trainConfigData: editInfo.trainConfigData, trainConfigData: editInfo.trainConfigData,
trainControlMapId: editInfo.trainControlMapId, trainControlMapId: editInfo.trainControlMapId,
}; };
@ -566,6 +604,10 @@ function onReset() {
editInfo.train_model = 0; editInfo.train_model = 0;
editInfo.carriage_length = 0; editInfo.carriage_length = 0;
editInfo.total_length = 0; editInfo.total_length = 0;
editInfo.train_load = 0;
editInfo.train_max_speed = 0;
editInfo.train_max_acc = 0;
editInfo.train_max_brake = 0;
// editInfo.min_diameter = 0; // editInfo.min_diameter = 0;
// editInfo.max_diameter = 0; // editInfo.max_diameter = 0;
editInfo.train_sets = ''; editInfo.train_sets = '';
@ -587,7 +629,6 @@ function onReset() {
editInfo.trainConfigData.idlingA = 0; editInfo.trainConfigData.idlingA = 0;
editInfo.trainConfigData.idlingR = 0; editInfo.trainConfigData.idlingR = 0;
editInfo.trainConfigData.idlingD = 0; editInfo.trainConfigData.idlingD = 0;
editInfo.trainConfigData.trainLoad = 0;
createForm.value?.resetValidation(); createForm.value?.resetValidation();
} }
@ -625,6 +666,10 @@ interface EditCreateItem extends TrainCreateParams {
total_length: number; total_length: number;
train_model: number; train_model: number;
train_sets: string; train_sets: string;
train_load: number;
train_max_speed: number;
train_max_acc: number;
train_max_brake: number;
trainControlMapId: number; trainControlMapId: number;
trainConfigData: { trainConfigData: {
davisParamA: number; davisParamA: number;
@ -644,7 +689,6 @@ interface EditCreateItem extends TrainCreateParams {
idlingA: number; idlingA: number;
idlingR: number; idlingR: number;
idlingD: number; idlingD: number;
trainLoad: number;
}; };
} }
@ -658,6 +702,10 @@ const editInfo = reactive<EditCreateItem>({
min_diameter: 0, min_diameter: 0,
max_diameter: 0, max_diameter: 0,
train_sets: '', train_sets: '',
train_load: 0,
train_max_speed: 0,
train_max_acc: 0,
train_max_brake: 0,
trainControlMapId: 0, trainControlMapId: 0,
trainConfigData: { trainConfigData: {
davisParamA: 2.25, davisParamA: 2.25,
@ -677,7 +725,6 @@ const editInfo = reactive<EditCreateItem>({
idlingA: 0, idlingA: 0,
idlingR: 0, idlingR: 0,
idlingD: 0, idlingD: 0,
trainLoad: 0,
}, },
}); });
function editData(row: TrainItem) { function editData(row: TrainItem) {
@ -689,6 +736,10 @@ function editData(row: TrainItem) {
editInfo.train_model = res.train_model; editInfo.train_model = res.train_model;
editInfo.carriage_length = res.carriage_length; editInfo.carriage_length = res.carriage_length;
editInfo.total_length = res.total_length; editInfo.total_length = res.total_length;
editInfo.train_load = res.train_load;
editInfo.train_max_speed = res.train_max_speed;
editInfo.train_max_acc = res.train_max_acc;
editInfo.train_max_brake = res.train_max_brake;
// editInfo.min_diameter = res.min_diameter; // editInfo.min_diameter = res.min_diameter;
// editInfo.max_diameter = res.max_diameter; // editInfo.max_diameter = res.max_diameter;
editInfo.train_sets = res.train_sets; editInfo.train_sets = res.train_sets;
@ -716,7 +767,6 @@ function editData(row: TrainItem) {
editInfo.trainConfigData.idlingA = res.trainConfigData.idlingA; editInfo.trainConfigData.idlingA = res.trainConfigData.idlingA;
editInfo.trainConfigData.idlingR = res.trainConfigData.idlingR; editInfo.trainConfigData.idlingR = res.trainConfigData.idlingR;
editInfo.trainConfigData.idlingD = res.trainConfigData.idlingD; editInfo.trainConfigData.idlingD = res.trainConfigData.idlingD;
editInfo.trainConfigData.trainLoad = res.trainConfigData.trainLoad || 0;
} }
createFormShow.value = true; createFormShow.value = true;
}) })

View File

@ -25,7 +25,6 @@ export namespace common {
idlingD?: number; idlingD?: number;
stopSign?: number; stopSign?: number;
slide?: number; slide?: number;
trainLoad?: number;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -81,9 +80,6 @@ export namespace common {
if ("slide" in data && data.slide != undefined) { if ("slide" in data && data.slide != undefined) {
this.slide = data.slide; this.slide = data.slide;
} }
if ("trainLoad" in data && data.trainLoad != undefined) {
this.trainLoad = data.trainLoad;
}
} }
} }
get davisParamA() { get davisParamA() {
@ -188,12 +184,6 @@ export namespace common {
set slide(value: number) { set slide(value: number) {
pb_1.Message.setField(this, 18, value); pb_1.Message.setField(this, 18, value);
} }
get trainLoad() {
return pb_1.Message.getFieldWithDefault(this, 19, 0) as number;
}
set trainLoad(value: number) {
pb_1.Message.setField(this, 19, value);
}
static fromObject(data: { static fromObject(data: {
davisParamA?: number; davisParamA?: number;
davisParamB?: number; davisParamB?: number;
@ -212,7 +202,6 @@ export namespace common {
idlingD?: number; idlingD?: number;
stopSign?: number; stopSign?: number;
slide?: number; slide?: number;
trainLoad?: number;
}): TrainDynamicConfig { }): TrainDynamicConfig {
const message = new TrainDynamicConfig({}); const message = new TrainDynamicConfig({});
if (data.davisParamA != null) { if (data.davisParamA != null) {
@ -266,9 +255,6 @@ export namespace common {
if (data.slide != null) { if (data.slide != null) {
message.slide = data.slide; message.slide = data.slide;
} }
if (data.trainLoad != null) {
message.trainLoad = data.trainLoad;
}
return message; return message;
} }
toObject() { toObject() {
@ -290,7 +276,6 @@ export namespace common {
idlingD?: number; idlingD?: number;
stopSign?: number; stopSign?: number;
slide?: number; slide?: number;
trainLoad?: number;
} = {}; } = {};
if (this.davisParamA != null) { if (this.davisParamA != null) {
data.davisParamA = this.davisParamA; data.davisParamA = this.davisParamA;
@ -343,9 +328,6 @@ export namespace common {
if (this.slide != null) { if (this.slide != null) {
data.slide = this.slide; data.slide = this.slide;
} }
if (this.trainLoad != null) {
data.trainLoad = this.trainLoad;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -386,8 +368,6 @@ export namespace common {
writer.writeInt32(17, this.stopSign); writer.writeInt32(17, this.stopSign);
if (this.slide != 0) if (this.slide != 0)
writer.writeFloat(18, this.slide); writer.writeFloat(18, this.slide);
if (this.trainLoad != 0)
writer.writeInt32(19, this.trainLoad);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -448,9 +428,6 @@ export namespace common {
case 18: case 18:
message.slide = reader.readFloat(); message.slide = reader.readFloat();
break; break;
case 19:
message.trainLoad = reader.readInt32();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }

View File

@ -3388,6 +3388,8 @@ export namespace state {
lightDir2?: boolean; lightDir2?: boolean;
lightDriverActive?: boolean; lightDriverActive?: boolean;
trainConnInitComplate?: boolean; trainConnInitComplate?: boolean;
atoCloseRightDoor?: boolean;
lightAtoSend?: boolean;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -3626,6 +3628,12 @@ export namespace state {
if ("trainConnInitComplate" in data && data.trainConnInitComplate != undefined) { if ("trainConnInitComplate" in data && data.trainConnInitComplate != undefined) {
this.trainConnInitComplate = data.trainConnInitComplate; this.trainConnInitComplate = data.trainConnInitComplate;
} }
if ("atoCloseRightDoor" in data && data.atoCloseRightDoor != undefined) {
this.atoCloseRightDoor = data.atoCloseRightDoor;
}
if ("lightAtoSend" in data && data.lightAtoSend != undefined) {
this.lightAtoSend = data.lightAtoSend;
}
} }
} }
get lifeSignal() { get lifeSignal() {
@ -4096,6 +4104,18 @@ export namespace state {
set trainConnInitComplate(value: boolean) { set trainConnInitComplate(value: boolean) {
pb_1.Message.setField(this, 82, value); pb_1.Message.setField(this, 82, value);
} }
get atoCloseRightDoor() {
return pb_1.Message.getFieldWithDefault(this, 83, false) as boolean;
}
set atoCloseRightDoor(value: boolean) {
pb_1.Message.setField(this, 83, value);
}
get lightAtoSend() {
return pb_1.Message.getFieldWithDefault(this, 84, false) as boolean;
}
set lightAtoSend(value: boolean) {
pb_1.Message.setField(this, 84, value);
}
static fromObject(data: { static fromObject(data: {
lifeSignal?: number; lifeSignal?: number;
tc1Active?: boolean; tc1Active?: boolean;
@ -4175,6 +4195,8 @@ export namespace state {
lightDir2?: boolean; lightDir2?: boolean;
lightDriverActive?: boolean; lightDriverActive?: boolean;
trainConnInitComplate?: boolean; trainConnInitComplate?: boolean;
atoCloseRightDoor?: boolean;
lightAtoSend?: boolean;
}): TrainVobcState { }): TrainVobcState {
const message = new TrainVobcState({}); const message = new TrainVobcState({});
if (data.lifeSignal != null) { if (data.lifeSignal != null) {
@ -4411,6 +4433,12 @@ export namespace state {
if (data.trainConnInitComplate != null) { if (data.trainConnInitComplate != null) {
message.trainConnInitComplate = data.trainConnInitComplate; message.trainConnInitComplate = data.trainConnInitComplate;
} }
if (data.atoCloseRightDoor != null) {
message.atoCloseRightDoor = data.atoCloseRightDoor;
}
if (data.lightAtoSend != null) {
message.lightAtoSend = data.lightAtoSend;
}
return message; return message;
} }
toObject() { toObject() {
@ -4493,6 +4521,8 @@ export namespace state {
lightDir2?: boolean; lightDir2?: boolean;
lightDriverActive?: boolean; lightDriverActive?: boolean;
trainConnInitComplate?: boolean; trainConnInitComplate?: boolean;
atoCloseRightDoor?: boolean;
lightAtoSend?: boolean;
} = {}; } = {};
if (this.lifeSignal != null) { if (this.lifeSignal != null) {
data.lifeSignal = this.lifeSignal; data.lifeSignal = this.lifeSignal;
@ -4728,6 +4758,12 @@ export namespace state {
if (this.trainConnInitComplate != null) { if (this.trainConnInitComplate != null) {
data.trainConnInitComplate = this.trainConnInitComplate; data.trainConnInitComplate = this.trainConnInitComplate;
} }
if (this.atoCloseRightDoor != null) {
data.atoCloseRightDoor = this.atoCloseRightDoor;
}
if (this.lightAtoSend != null) {
data.lightAtoSend = this.lightAtoSend;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -4890,6 +4926,10 @@ export namespace state {
writer.writeBool(81, this.lightDriverActive); writer.writeBool(81, this.lightDriverActive);
if (this.trainConnInitComplate != false) if (this.trainConnInitComplate != false)
writer.writeBool(82, this.trainConnInitComplate); writer.writeBool(82, this.trainConnInitComplate);
if (this.atoCloseRightDoor != false)
writer.writeBool(83, this.atoCloseRightDoor);
if (this.lightAtoSend != false)
writer.writeBool(84, this.lightAtoSend);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -5133,6 +5173,12 @@ export namespace state {
case 82: case 82:
message.trainConnInitComplate = reader.readBool(); message.trainConnInitComplate = reader.readBool();
break; break;
case 83:
message.atoCloseRightDoor = reader.readBool();
break;
case 84:
message.lightAtoSend = reader.readBool();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }

View File

@ -9084,6 +9084,10 @@ export namespace graphicData {
trainSets?: string; trainSets?: string;
dynamicConfig?: dependency_1.common.TrainDynamicConfig; dynamicConfig?: dependency_1.common.TrainDynamicConfig;
trainControlMapId?: number; trainControlMapId?: number;
trainLoad?: number;
trainMaxSpeed?: number;
trainMaxAcc?: number;
trainMaxBrake?: number;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@ -9106,6 +9110,18 @@ export namespace graphicData {
if ("trainControlMapId" in data && data.trainControlMapId != undefined) { if ("trainControlMapId" in data && data.trainControlMapId != undefined) {
this.trainControlMapId = data.trainControlMapId; this.trainControlMapId = data.trainControlMapId;
} }
if ("trainLoad" in data && data.trainLoad != undefined) {
this.trainLoad = data.trainLoad;
}
if ("trainMaxSpeed" in data && data.trainMaxSpeed != undefined) {
this.trainMaxSpeed = data.trainMaxSpeed;
}
if ("trainMaxAcc" in data && data.trainMaxAcc != undefined) {
this.trainMaxAcc = data.trainMaxAcc;
}
if ("trainMaxBrake" in data && data.trainMaxBrake != undefined) {
this.trainMaxBrake = data.trainMaxBrake;
}
} }
} }
get trainModel() { get trainModel() {
@ -9147,6 +9163,30 @@ export namespace graphicData {
set trainControlMapId(value: number) { set trainControlMapId(value: number) {
pb_1.Message.setField(this, 9, value); pb_1.Message.setField(this, 9, value);
} }
get trainLoad() {
return pb_1.Message.getFieldWithDefault(this, 10, 0) as number;
}
set trainLoad(value: number) {
pb_1.Message.setField(this, 10, value);
}
get trainMaxSpeed() {
return pb_1.Message.getFieldWithDefault(this, 11, 0) as number;
}
set trainMaxSpeed(value: number) {
pb_1.Message.setField(this, 11, value);
}
get trainMaxAcc() {
return pb_1.Message.getFieldWithDefault(this, 12, 0) as number;
}
set trainMaxAcc(value: number) {
pb_1.Message.setField(this, 12, value);
}
get trainMaxBrake() {
return pb_1.Message.getFieldWithDefault(this, 13, 0) as number;
}
set trainMaxBrake(value: number) {
pb_1.Message.setField(this, 13, value);
}
static fromObject(data: { static fromObject(data: {
trainModel?: Train.TrainModel; trainModel?: Train.TrainModel;
carriageLength?: number; carriageLength?: number;
@ -9154,6 +9194,10 @@ export namespace graphicData {
trainSets?: string; trainSets?: string;
dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>; dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>;
trainControlMapId?: number; trainControlMapId?: number;
trainLoad?: number;
trainMaxSpeed?: number;
trainMaxAcc?: number;
trainMaxBrake?: number;
}): Train { }): Train {
const message = new Train({}); const message = new Train({});
if (data.trainModel != null) { if (data.trainModel != null) {
@ -9174,6 +9218,18 @@ export namespace graphicData {
if (data.trainControlMapId != null) { if (data.trainControlMapId != null) {
message.trainControlMapId = data.trainControlMapId; message.trainControlMapId = data.trainControlMapId;
} }
if (data.trainLoad != null) {
message.trainLoad = data.trainLoad;
}
if (data.trainMaxSpeed != null) {
message.trainMaxSpeed = data.trainMaxSpeed;
}
if (data.trainMaxAcc != null) {
message.trainMaxAcc = data.trainMaxAcc;
}
if (data.trainMaxBrake != null) {
message.trainMaxBrake = data.trainMaxBrake;
}
return message; return message;
} }
toObject() { toObject() {
@ -9184,6 +9240,10 @@ export namespace graphicData {
trainSets?: string; trainSets?: string;
dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>; dynamicConfig?: ReturnType<typeof dependency_1.common.TrainDynamicConfig.prototype.toObject>;
trainControlMapId?: number; trainControlMapId?: number;
trainLoad?: number;
trainMaxSpeed?: number;
trainMaxAcc?: number;
trainMaxBrake?: number;
} = {}; } = {};
if (this.trainModel != null) { if (this.trainModel != null) {
data.trainModel = this.trainModel; data.trainModel = this.trainModel;
@ -9203,6 +9263,18 @@ export namespace graphicData {
if (this.trainControlMapId != null) { if (this.trainControlMapId != null) {
data.trainControlMapId = this.trainControlMapId; data.trainControlMapId = this.trainControlMapId;
} }
if (this.trainLoad != null) {
data.trainLoad = this.trainLoad;
}
if (this.trainMaxSpeed != null) {
data.trainMaxSpeed = this.trainMaxSpeed;
}
if (this.trainMaxAcc != null) {
data.trainMaxAcc = this.trainMaxAcc;
}
if (this.trainMaxBrake != null) {
data.trainMaxBrake = this.trainMaxBrake;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -9221,6 +9293,14 @@ export namespace graphicData {
writer.writeMessage(7, this.dynamicConfig, () => this.dynamicConfig.serialize(writer)); writer.writeMessage(7, this.dynamicConfig, () => this.dynamicConfig.serialize(writer));
if (this.trainControlMapId != 0) if (this.trainControlMapId != 0)
writer.writeInt32(9, this.trainControlMapId); writer.writeInt32(9, this.trainControlMapId);
if (this.trainLoad != 0)
writer.writeInt32(10, this.trainLoad);
if (this.trainMaxSpeed != 0)
writer.writeFloat(11, this.trainMaxSpeed);
if (this.trainMaxAcc != 0)
writer.writeFloat(12, this.trainMaxAcc);
if (this.trainMaxBrake != 0)
writer.writeFloat(13, this.trainMaxBrake);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -9248,6 +9328,18 @@ export namespace graphicData {
case 9: case 9:
message.trainControlMapId = reader.readInt32(); message.trainControlMapId = reader.readInt32();
break; break;
case 10:
message.trainLoad = reader.readInt32();
break;
case 11:
message.trainMaxSpeed = reader.readFloat();
break;
case 12:
message.trainMaxAcc = reader.readFloat();
break;
case 13:
message.trainMaxBrake = reader.readFloat();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }

View File

@ -5,7 +5,7 @@ import { useLineStore } from './line-store';
import { tccOperation } from 'src/api/Simulation'; import { tccOperation } from 'src/api/Simulation';
import { errorNotify } from 'src/utils/CommonNotify'; import { errorNotify } from 'src/utils/CommonNotify';
import { request } from 'src/protos/request'; import { request } from 'src/protos/request';
import { TccHandle } from 'src/graphics/tccHandle/TccHandle'; import { TccHandle, zeroOffset } from 'src/graphics/tccHandle/TccHandle';
import { TccKey } from 'src/graphics/tccKey/TccKey'; import { TccKey } from 'src/graphics/tccKey/TccKey';
import { IGraphicApp } from 'jl-graphic'; import { IGraphicApp } from 'jl-graphic';
@ -47,8 +47,19 @@ export const useTccStore = defineStore('tcc', {
.getScene(`tcc${this.tccId}`) .getScene(`tcc${this.tccId}`)
.queryStore.queryById<TccHandle>(this.tccHandleId); .queryStore.queryById<TccHandle>(this.tccHandleId);
if (!simulationId) return; if (!simulationId) return;
let transFormHandleVal = 0;
if (
tccHandle._tccHandle.y >= -zeroOffset &&
tccHandle._tccHandle.y <= zeroOffset
) {
tccHandle._tccHandle.y = 0;
} else if (tccHandle._tccHandle.y < -zeroOffset) {
transFormHandleVal = tccHandle._tccHandle.y + zeroOffset;
} else {
transFormHandleVal = tccHandle._tccHandle.y - zeroOffset;
}
const handleVal = Number( const handleVal = Number(
(-(tccHandle._tccHandle.y / 144) * 100).toFixed() (-(transFormHandleVal / (144 - zeroOffset)) * 100).toFixed()
); );
tccOperation({ tccOperation({
simulationId, simulationId,