From 414a539468f0fb65c6def9ce82d598ddba5fe813 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 21 Oct 2022 15:07:37 +0200 Subject: [PATCH] Poprawki --- src/components/ListSection.vue | 5 +++- src/utils/vehicleUtils.ts | 44 +++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/components/ListSection.vue b/src/components/ListSection.vue index 1c44464..01b7e6d 100644 --- a/src/components/ListSection.vue +++ b/src/components/ListSection.vue @@ -352,7 +352,10 @@ export default defineComponent({ if (this.stockHasWarnings()) return alert('Jazda tym pociągiem jest niezgodna z regulaminem symulatora! Zmień parametry zestawienia!'); - const fileName = prompt('Nazwij plik:', `${this.store.chosenRealStockName || this.store.stockList[0].type}`); + const fileName = prompt( + 'Nazwij plik, a następnie pobierz do folderu Presets (Dokumenty/TTSK/TrainDriver2):', + `${this.store.chosenRealStockName || this.store.stockList[0].type}` + ); if (!fileName) return; diff --git a/src/utils/vehicleUtils.ts b/src/utils/vehicleUtils.ts index 2897257..2d36b81 100644 --- a/src/utils/vehicleUtils.ts +++ b/src/utils/vehicleUtils.ts @@ -1,10 +1,39 @@ -import { computed } from 'vue'; import { EVehicleUseType } from '../enums/EVehicleUseType'; import { ICarWagon, ILocomotive, IStore, IVehicleData } from '../types'; import vehicleDataJSON from '../data/vehicleData.json'; import vehiclePropsJSON from '../data/vehicleProps.json'; +// rodzaj: [tMaxPas, vMaxPas, tMaxTow, vMaxTow] | SM42: [tMax, vMax, ...] +const maxAllowedSpeedTable = { + EU07: [ + [650, 125], + [2000, 70], + ], + EP07: [ + [650, 125], + [0, 0], + ], + EP08: [ + [650, 140], + [0, 0], + ], + ET41: [ + [700, 125], + [4000, 70], + ], + SM42: [ + [95, 90], + [200, 80], + [300, 70], + [450, 60], + [750, 50], + [1130, 40], + [1720, 30], + [2400, 20], + ], +}; + export function isLocomotive(vehicle: ILocomotive | ICarWagon): vehicle is ILocomotive { return (vehicle as ILocomotive).power !== undefined; } @@ -172,6 +201,19 @@ export function chosenRealStock(state: IStore) { return realStockObj; } +// export function maxAllowedSpeed(state: IStore) { +// const headLocoType = state.stockList[0]?.isLoco ? state.stockList[0].type : undefined; + +// if (!headLocoType) return 0; + +// const isPassenger = isTrainPassenger(state); +// const stockMass = totalMass(state); + +// // const maxSpeed = maxAllowedSpeedTable[headLocoType]; + +// // if() +// } + // export function maxAllowedSpeed(state: IStore) { // if (state.stockList.length < 1) return -1; // if (!state.stockList[0].isLoco) return -1;