mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 11:45:34 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b35293575a | |||
| 633f7f4c26 | |||
| b68e9da715 | |||
| 05ae446af7 | |||
| 09e5c53558 | |||
| fe70b19f2a | |||
| 32fbf51943 | |||
| 39f2688611 | |||
| 1090249e08 | |||
| c38debb458 | |||
| ee552d65ec |
+1
-1
@@ -2,5 +2,5 @@
|
|||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "es5",
|
"trailingComma": "es5",
|
||||||
"printWidth": 100
|
"printWidth": 150
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pojazdownik",
|
"name": "pojazdownik",
|
||||||
"version": "1.9.1",
|
"version": "1.9.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -9,7 +9,13 @@
|
|||||||
</i18n-t>
|
</i18n-t>
|
||||||
|
|
||||||
<div class="text--grayed" v-if="store.vehiclesData">
|
<div class="text--grayed" v-if="store.vehiclesData">
|
||||||
{{ $t('footer.version-check', { version: store.compatibleSimulatorVersion }) }}
|
{{
|
||||||
|
$t('footer.vehicles-count', {
|
||||||
|
all: vehiclesCounters.all,
|
||||||
|
units: vehiclesCounters.units,
|
||||||
|
cars: vehiclesCounters.cars,
|
||||||
|
})
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -33,6 +39,27 @@ export default defineComponent({
|
|||||||
store: useStore(),
|
store: useStore(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
vehiclesCounters() {
|
||||||
|
let counters = {
|
||||||
|
all: 0,
|
||||||
|
cars: 0,
|
||||||
|
units: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!this.store.vehiclesData) return counters;
|
||||||
|
|
||||||
|
this.store.vehiclesData?.forEach((v) => {
|
||||||
|
counters.all += 1;
|
||||||
|
|
||||||
|
if (v.group.locoProps !== null) counters.units += 1;
|
||||||
|
else counters.cars += 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
return counters;
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
<div class="stock-specs">
|
<div class="stock-specs">
|
||||||
<div v-if="store.chosenStorageStockName || chosenRealComposition">
|
<div v-if="store.chosenStorageStockName || chosenRealComposition">
|
||||||
<b v-if="store.chosenStorageStockName">
|
<b v-if="store.chosenStorageStockName">
|
||||||
<span
|
<span class="text--accent" :title="store.chosenStorageStockName.length > 41 ? store.chosenStorageStockName : ''">
|
||||||
class="text--accent"
|
|
||||||
:title="store.chosenStorageStockName.length > 41 ? store.chosenStorageStockName : ''"
|
|
||||||
>
|
|
||||||
<BookmarkCheck :size="19" />
|
<BookmarkCheck :size="19" />
|
||||||
{{ store.chosenStorageStockName.slice(0, 40) }}
|
{{ store.chosenStorageStockName.slice(0, 40) }}
|
||||||
{{ store.chosenStorageStockName.length > 41 ? '...' : '' }}
|
{{ store.chosenStorageStockName.length > 41 ? '...' : '' }}
|
||||||
@@ -16,11 +13,7 @@
|
|||||||
|
|
||||||
<b class="real-stock-info" v-if="chosenRealComposition">
|
<b class="real-stock-info" v-if="chosenRealComposition">
|
||||||
<span class="text--accent">
|
<span class="text--accent">
|
||||||
<img
|
<img class="real-stock-icon" :src="getIconURL(chosenRealComposition.type)" :alt="chosenRealComposition.type" />
|
||||||
class="real-stock-icon"
|
|
||||||
:src="getIconURL(chosenRealComposition.type)"
|
|
||||||
:alt="chosenRealComposition.type"
|
|
||||||
/>
|
|
||||||
{{ chosenRealComposition.number }} {{ chosenRealComposition.name }}
|
{{ chosenRealComposition.number }} {{ chosenRealComposition.name }}
|
||||||
</span>
|
</span>
|
||||||
</b>
|
</b>
|
||||||
@@ -30,14 +23,11 @@
|
|||||||
{{ $t('stocklist.mass') }}
|
{{ $t('stocklist.mass') }}
|
||||||
<span class="text--accent">{{ (store.totalWeight / 1000).toFixed(1) }}t</span>
|
<span class="text--accent">{{ (store.totalWeight / 1000).toFixed(1) }}t</span>
|
||||||
({{ $t('stocklist.mass-accepted') }}:
|
({{ $t('stocklist.mass-accepted') }}:
|
||||||
<span class="text--accent">{{
|
<span class="text--accent">{{ store.acceptableWeight ? `${~~(store.acceptableWeight / 1000)}t` : '-' }}</span
|
||||||
store.acceptableWeight ? `${~~(store.acceptableWeight / 1000)}t` : '-'
|
|
||||||
}}</span
|
|
||||||
>) - {{ $t('stocklist.length') }}:
|
>) - {{ $t('stocklist.length') }}:
|
||||||
<span class="text--accent">{{ store.totalLength }}m</span>
|
<span class="text--accent">{{ store.totalLength }}m</span>
|
||||||
- {{ $t('stocklist.vmax') }}
|
- {{ $t('stocklist.vmax') }} <span tabindex="0" :data-tooltip="$t('stocklist.disclaimer')">(?)</span>:
|
||||||
<span tabindex="0" :data-tooltip="$t('stocklist.disclaimer')">(?)</span>:
|
<span class="text--accent">{{ isFinite(store.maxStockSpeed) ? store.maxStockSpeed : '--' }} km/h</span>
|
||||||
<span class="text--accent">{{ store.maxStockSpeed }} km/h</span>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -2,31 +2,25 @@
|
|||||||
<div class="stock_warnings" v-if="hasAnyWarnings">
|
<div class="stock_warnings" v-if="hasAnyWarnings">
|
||||||
<div class="warning" v-if="locoNotSuitable">(!) {{ $t('stocklist.warning-not-suitable') }}</div>
|
<div class="warning" v-if="locoNotSuitable">(!) {{ $t('stocklist.warning-not-suitable') }}</div>
|
||||||
|
|
||||||
<div class="warning" v-if="lengthExceeded && store.isTrainPassenger">
|
<div class="warning" v-if="lengthExceeded && store.isTrainPassenger">(!) {{ $t('stocklist.warning-passenger-too-long') }}</div>
|
||||||
(!) {{ $t('stocklist.warning-passenger-too-long') }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="warning" v-if="lengthExceeded && !store.isTrainPassenger">
|
<div class="warning" v-if="lengthExceeded && !store.isTrainPassenger">(!) {{ $t('stocklist.warning-freight-too-long') }}</div>
|
||||||
(!) {{ $t('stocklist.warning-freight-too-long') }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="warning" v-if="teamOnlyVehicles.length > 0">
|
<div class="warning" v-if="teamOnlyVehicles.length > 0">
|
||||||
(!)
|
(!)
|
||||||
{{
|
{{ $t('stocklist.warning-team-only-vehicle', [teamOnlyVehicles.map((v) => v.vehicleRef.type).join(', ')]) }}
|
||||||
$t('stocklist.warning-team-only-vehicle', [
|
</div>
|
||||||
teamOnlyVehicles.map((v) => v.vehicleRef.type).join(', '),
|
|
||||||
])
|
<div class="warning" v-if="store.cargoWarnings.size > 0">
|
||||||
}}
|
(!) <b>{{ $t('cargo-warnings.title') }}</b>
|
||||||
|
{{ [...store.cargoWarnings].map((v) => $t(`cargo-warnings.${v}`)).join('; ') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="warning" v-if="weightExceeded">
|
<div class="warning" v-if="weightExceeded">
|
||||||
(!)
|
(!)
|
||||||
<i18n-t keypath="stocklist.warning-too-heavy">
|
<i18n-t keypath="stocklist.warning-too-heavy">
|
||||||
<template #href>
|
<template #href>
|
||||||
<a
|
<a target="_blank" href="https://docs.google.com/spreadsheets/d/1BvTU-U7huIaEheov22TrhTtROUM4MwVfdbq03GVAEM8">
|
||||||
target="_blank"
|
|
||||||
href="https://docs.google.com/spreadsheets/d/1BvTU-U7huIaEheov22TrhTtROUM4MwVfdbq03GVAEM8"
|
|
||||||
>
|
|
||||||
{{ $t('stocklist.acceptable-mass-docs') }}
|
{{ $t('stocklist.acceptable-mass-docs') }}
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
@@ -55,16 +49,11 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
hasAnyWarnings() {
|
hasAnyWarnings() {
|
||||||
return (
|
return this.weightExceeded || this.lengthExceeded || this.locoNotSuitable || this.teamOnlyVehicles;
|
||||||
this.weightExceeded || this.lengthExceeded || this.locoNotSuitable || this.teamOnlyVehicles
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
lengthExceeded() {
|
lengthExceeded() {
|
||||||
return (
|
return (this.store.totalLength > 350 && this.store.isTrainPassenger) || (this.store.totalLength > 650 && !this.store.isTrainPassenger);
|
||||||
(this.store.totalLength > 350 && this.store.isTrainPassenger) ||
|
|
||||||
(this.store.totalLength > 650 && !this.store.isTrainPassenger)
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
weightExceeded() {
|
weightExceeded() {
|
||||||
@@ -76,9 +65,7 @@ export default defineComponent({
|
|||||||
!this.store.isTrainPassenger &&
|
!this.store.isTrainPassenger &&
|
||||||
this.store.stockList.length > 1 &&
|
this.store.stockList.length > 1 &&
|
||||||
!this.store.stockList.every((stock) => isTractionUnit(stock.vehicleRef)) &&
|
!this.store.stockList.every((stock) => isTractionUnit(stock.vehicleRef)) &&
|
||||||
this.store.stockList.some(
|
this.store.stockList.some((stock) => isTractionUnit(stock.vehicleRef) && stock.vehicleRef.type.startsWith('EP'))
|
||||||
(stock) => isTractionUnit(stock.vehicleRef) && stock.vehicleRef.type.startsWith('EP')
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,5 +7,12 @@
|
|||||||
"EP08": [650000, 650000],
|
"EP08": [650000, 650000],
|
||||||
"EP09": [800000, 800000],
|
"EP09": [800000, 800000],
|
||||||
"ET41": [700000, 4000000],
|
"ET41": [700000, 4000000],
|
||||||
"SM42": [2400000, 2400000]
|
"SM42": [2400000, 2400000],
|
||||||
|
"ET22": [650000, 3100000],
|
||||||
|
"201E": [650000, 3100000],
|
||||||
|
"ST44": [3000000, 3000000],
|
||||||
|
"M62": [3000000, 3000000],
|
||||||
|
"CTLR4C": [3000000, 3000000],
|
||||||
|
"SU45": [1500000, 1500000],
|
||||||
|
"SP45": [1500000, 1500000]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,153 +0,0 @@
|
|||||||
{
|
|
||||||
"EU07": {
|
|
||||||
"passenger": {
|
|
||||||
"650000": 125
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"2000000": 70
|
|
||||||
},
|
|
||||||
"none": 110
|
|
||||||
},
|
|
||||||
"4E": {
|
|
||||||
"passenger": {
|
|
||||||
"650000": 125
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"2000000": 70
|
|
||||||
},
|
|
||||||
"none": 110
|
|
||||||
},
|
|
||||||
"EU07E": {
|
|
||||||
"passenger": {
|
|
||||||
"650000": 125
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"2000000": 70
|
|
||||||
},
|
|
||||||
"none": 110
|
|
||||||
},
|
|
||||||
"EP07": {
|
|
||||||
"passenger": {
|
|
||||||
"650000": 125
|
|
||||||
},
|
|
||||||
"cargo": null,
|
|
||||||
"none": 110
|
|
||||||
},
|
|
||||||
"EP08": {
|
|
||||||
"passenger": {
|
|
||||||
"650000": 140
|
|
||||||
},
|
|
||||||
"cargo": null,
|
|
||||||
"none": 110
|
|
||||||
},
|
|
||||||
"EP09": {
|
|
||||||
"passenger": {
|
|
||||||
"650000": 160
|
|
||||||
},
|
|
||||||
"cargo": null,
|
|
||||||
"none": 160
|
|
||||||
},
|
|
||||||
"ET22": {
|
|
||||||
"passenger": {
|
|
||||||
"650000": 125
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"1200000": 100,
|
|
||||||
"3100000": 70
|
|
||||||
},
|
|
||||||
"none": 125
|
|
||||||
},
|
|
||||||
"201E": {
|
|
||||||
"passenger": {
|
|
||||||
"650000": 125
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"1200000": 100,
|
|
||||||
"3100000": 70
|
|
||||||
},
|
|
||||||
"none": 125
|
|
||||||
},
|
|
||||||
"ET41": {
|
|
||||||
"passenger": {
|
|
||||||
"700000": 125
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"4000000": 70
|
|
||||||
},
|
|
||||||
"none": 110
|
|
||||||
},
|
|
||||||
"SM42": {
|
|
||||||
"passenger": {
|
|
||||||
"95000": 90,
|
|
||||||
"200000": 80,
|
|
||||||
"300000": 70,
|
|
||||||
"450000": 60,
|
|
||||||
"750000": 50,
|
|
||||||
"1130000": 40,
|
|
||||||
"1720000": 30,
|
|
||||||
"2400000": 20
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"95000": 90,
|
|
||||||
"200000": 80,
|
|
||||||
"300000": 70,
|
|
||||||
"450000": 60,
|
|
||||||
"750000": 50,
|
|
||||||
"1130000": 40,
|
|
||||||
"1720000": 30,
|
|
||||||
"2400000": 20
|
|
||||||
},
|
|
||||||
"none": 90
|
|
||||||
},
|
|
||||||
"M62": {
|
|
||||||
"passenger": {
|
|
||||||
"500000": 100,
|
|
||||||
"800000": 80,
|
|
||||||
"1200000": 60,
|
|
||||||
"2000000": 40,
|
|
||||||
"3000000": 20
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"500000": 100,
|
|
||||||
"800000": 80,
|
|
||||||
"1200000": 60,
|
|
||||||
"2000000": 40,
|
|
||||||
"3000000": 20
|
|
||||||
},
|
|
||||||
"none": 100
|
|
||||||
},
|
|
||||||
"ST44": {
|
|
||||||
"passenger": {
|
|
||||||
"500000": 100,
|
|
||||||
"800000": 80,
|
|
||||||
"1200000": 60,
|
|
||||||
"2000000": 40,
|
|
||||||
"3000000": 20
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"500000": 100,
|
|
||||||
"800000": 80,
|
|
||||||
"1200000": 60,
|
|
||||||
"2000000": 40,
|
|
||||||
"3000000": 20
|
|
||||||
},
|
|
||||||
"none": 100
|
|
||||||
},
|
|
||||||
"CTLR4C": {
|
|
||||||
"passenger": {
|
|
||||||
"500000": 100,
|
|
||||||
"800000": 80,
|
|
||||||
"1200000": 60,
|
|
||||||
"2000000": 40,
|
|
||||||
"3000000": 20
|
|
||||||
},
|
|
||||||
"cargo": {
|
|
||||||
"500000": 100,
|
|
||||||
"800000": 80,
|
|
||||||
"1200000": 60,
|
|
||||||
"2000000": 40,
|
|
||||||
"3000000": 20
|
|
||||||
},
|
|
||||||
"none": 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+283
-28
@@ -1,10 +1,197 @@
|
|||||||
{
|
{
|
||||||
"cargo": {
|
"cargo": {
|
||||||
"kontenery": ["627Z:all", "412Z:all"],
|
"kontenery": [
|
||||||
"chłodnia": ["202Lc:all"],
|
"412Z:sc_20_red",
|
||||||
"drobnica": ["426S:all", "208Kf:all", "401Ka_PKP_Gags:all", "401Ka_PKPC_Gags:all"],
|
"412Z:sc_20_blue",
|
||||||
"węgiel": ["412W:coal_01", "413S:coal_413S", "429W:coal_01", "401Zb:coal_02"],
|
"412Z:sc_20_green",
|
||||||
"ruda": ["412W:ore_01", "401Zl:ore_35", "429W:ore_01"],
|
"412Z:sc_20_APL",
|
||||||
|
"412Z:sc_20_CMA",
|
||||||
|
"412Z:sc_20_Cosco",
|
||||||
|
"412Z:sc_20_Evr1",
|
||||||
|
"412Z:sc_20_Evr2",
|
||||||
|
"412Z:sc_20_Finnlines",
|
||||||
|
"412Z:sc_20_Hamburg",
|
||||||
|
"412Z:sc_20_Hanjin",
|
||||||
|
"412Z:sc_20_HapagLloyd",
|
||||||
|
"412Z:sc_20_HMM",
|
||||||
|
"412Z:sc_20_KLine",
|
||||||
|
"412Z:sc_20_Maersk",
|
||||||
|
"412Z:sc_20_ONE",
|
||||||
|
"412Z:sc_20_OOCL",
|
||||||
|
"412Z:sc_20_Schavemaker",
|
||||||
|
"412Z:sc_20_TD2",
|
||||||
|
"412Z:sc_20_Titan",
|
||||||
|
"412Z:sc_20_Toll",
|
||||||
|
"412Z:sc_40_red",
|
||||||
|
"412Z:sc_40_blue",
|
||||||
|
"412Z:sc_40_green",
|
||||||
|
"412Z:sc_40_APL",
|
||||||
|
"412Z:sc_40_CMA",
|
||||||
|
"412Z:sc_40_Cosco",
|
||||||
|
"412Z:sc_40_Evr1",
|
||||||
|
"412Z:sc_40_Evr2",
|
||||||
|
"412Z:sc_40_Finnlines",
|
||||||
|
"412Z:sc_40_Hamburg",
|
||||||
|
"412Z:sc_40_Hanjin",
|
||||||
|
"412Z:sc_40_HapagLloyd",
|
||||||
|
"412Z:sc_40_HMM",
|
||||||
|
"412Z:sc_40_KLine",
|
||||||
|
"412Z:sc_40_Maersk",
|
||||||
|
"412Z:sc_40_ONE",
|
||||||
|
"412Z:sc_40_OOCL",
|
||||||
|
"412Z:sc_40_Schavemaker",
|
||||||
|
"412Z:sc_40_TD2",
|
||||||
|
"412Z:sc_40_Titan",
|
||||||
|
"412Z:sc_40_Toll",
|
||||||
|
"612Z:sc_20",
|
||||||
|
"612Z:sc_20_red",
|
||||||
|
"612Z:sc_20_blue",
|
||||||
|
"612Z:sc_20_green",
|
||||||
|
"612Z:sc_20_APL",
|
||||||
|
"612Z:sc_20_CMA",
|
||||||
|
"612Z:sc_20_Cosco",
|
||||||
|
"612Z:sc_20_Evr1",
|
||||||
|
"612Z:sc_20_Evr2",
|
||||||
|
"612Z:sc_20_Finnlines",
|
||||||
|
"612Z:sc_20_Hamburg",
|
||||||
|
"612Z:sc_20_Hanjin",
|
||||||
|
"612Z:sc_20_HapagLloyd",
|
||||||
|
"612Z:sc_20_HMM",
|
||||||
|
"612Z:sc_20_KLine",
|
||||||
|
"612Z:sc_20_Maersk",
|
||||||
|
"612Z:sc_20_ONE",
|
||||||
|
"612Z:sc_20_OOCL",
|
||||||
|
"612Z:sc_20_Schavemaker",
|
||||||
|
"612Z:sc_20_TD2",
|
||||||
|
"612Z:sc_20_Titan",
|
||||||
|
"612Z:sc_20_Toll",
|
||||||
|
"612Z:sc_40_red",
|
||||||
|
"612Z:sc_40",
|
||||||
|
"612Z:sc_40_blue",
|
||||||
|
"612Z:sc_40_green",
|
||||||
|
"612Z:sc_40_APL",
|
||||||
|
"612Z:sc_40_CMA",
|
||||||
|
"612Z:sc_40_Cosco",
|
||||||
|
"612Z:sc_40_Evr1",
|
||||||
|
"612Z:sc_40_Evr2",
|
||||||
|
"612Z:sc_40_Finnlines",
|
||||||
|
"612Z:sc_40_Hamburg",
|
||||||
|
"612Z:sc_40_Hanjin",
|
||||||
|
"612Z:sc_40_HapagLloyd",
|
||||||
|
"612Z:sc_40_HMM",
|
||||||
|
"612Z:sc_40_KLine",
|
||||||
|
"612Z:sc_40_Maersk",
|
||||||
|
"612Z:sc_40_ONE",
|
||||||
|
"612Z:sc_40_OOCL",
|
||||||
|
"612Z:sc_40_Schavemaker",
|
||||||
|
"612Z:sc_40_TD2",
|
||||||
|
"612Z:sc_40_Titan",
|
||||||
|
"612Z:sc_40_Toll"
|
||||||
|
],
|
||||||
|
"biomasa": [
|
||||||
|
"412Z:wt_20_biomass",
|
||||||
|
"412Z:wt_20_mix_black_green_biomass",
|
||||||
|
"412Z:wt_20_mix_blue_biomass",
|
||||||
|
"412Z:wt_20_mix_blue_CDC_white_biomass",
|
||||||
|
"412Z:wt_20_mix_blue_white_biomass",
|
||||||
|
"412Z:wt_20_mix_EPC_biomass",
|
||||||
|
"412Z:wt_20_mix_green_biomass",
|
||||||
|
"412Z:wt_20_black_biomass",
|
||||||
|
"412Z:wt_20_blue_biomass",
|
||||||
|
"412Z:wt_20_blue_gr_biomass",
|
||||||
|
"412Z:wt_20_blue_gr_r_biomass",
|
||||||
|
"412Z:wt_20_CDC_biomass",
|
||||||
|
"412Z:wt_20_EPC_black_biomass",
|
||||||
|
"412Z:wt_20_EPC_red_biomass",
|
||||||
|
"412Z:wt_20_green_new_biomass",
|
||||||
|
"412Z:wt_20_green_old_biomass",
|
||||||
|
"412Z:wt_20_white_new_biomass",
|
||||||
|
"412Z:wt_20_white_old_biomass",
|
||||||
|
"412Z:wt_20_white_old_gr_biomass",
|
||||||
|
"412Z:wt_20_white_old_gr_r_biomass",
|
||||||
|
"627Z:wt_20_biomass",
|
||||||
|
"627Z:wt_20_mix_black_green_biomass",
|
||||||
|
"627Z:wt_20_mix_blue_biomass",
|
||||||
|
"627Z:wt_20_mix_blue_CDC_white_biomass",
|
||||||
|
"627Z:wt_20_mix_blue_white_biomass",
|
||||||
|
"627Z:wt_20_mix_EPC_biomass",
|
||||||
|
"627Z:wt_20_mix_green_biomass",
|
||||||
|
"627Z:wt_20_black_biomass",
|
||||||
|
"627Z:wt_20_blue_biomass",
|
||||||
|
"627Z:wt_20_blue_gr_biomass",
|
||||||
|
"627Z:wt_20_blue_gr_r_biomass",
|
||||||
|
"627Z:wt_20_CDC_biomass",
|
||||||
|
"627Z:wt_20_EPC_black_biomass",
|
||||||
|
"627Z:wt_20_EPC_red_biomass",
|
||||||
|
"627Z:wt_20_green_new_biomass",
|
||||||
|
"627Z:wt_20_green_old_biomass",
|
||||||
|
"627Z:wt_20_white_new_biomass",
|
||||||
|
"627Z:wt_20_white_old_biomass",
|
||||||
|
"627Z:wt_20_white_old_gr_biomass",
|
||||||
|
"627Z:wt_20_white_old_gr_r_biomass"
|
||||||
|
],
|
||||||
|
"biomasa-puste": [
|
||||||
|
"412Z:wt_20_empty",
|
||||||
|
"412Z:wt_20_mix_black_green_empty",
|
||||||
|
"412Z:wt_20_mix_blue_empty",
|
||||||
|
"412Z:wt_20_mix_blue_CDC_white_empty",
|
||||||
|
"412Z:wt_20_mix_blue_white_empty",
|
||||||
|
"412Z:wt_20_mix_EPC_empty",
|
||||||
|
"412Z:wt_20_mix_green_empty",
|
||||||
|
"412Z:wt_20_black_empty",
|
||||||
|
"412Z:wt_20_blue_empty",
|
||||||
|
"412Z:wt_20_blue_gr_empty",
|
||||||
|
"412Z:wt_20_blue_gr_r_empty",
|
||||||
|
"412Z:wt_20_CDC_empty",
|
||||||
|
"412Z:wt_20_EPC_black_empty",
|
||||||
|
"412Z:wt_20_EPC_red_empty",
|
||||||
|
"412Z:wt_20_green_new_empty",
|
||||||
|
"412Z:wt_20_green_old_empty",
|
||||||
|
"412Z:wt_20_white_new_empty",
|
||||||
|
"412Z:wt_20_white_old_empty",
|
||||||
|
"412Z:wt_20_white_old_gr_empty",
|
||||||
|
"412Z:wt_20_white_old_gr_r_empty",
|
||||||
|
"627Z:wt_20_empty",
|
||||||
|
"627Z:wt_20_mix_black_green_empty",
|
||||||
|
"627Z:wt_20_mix_blue_empty",
|
||||||
|
"627Z:wt_20_mix_blue_CDC_white_empty",
|
||||||
|
"627Z:wt_20_mix_blue_white_empty",
|
||||||
|
"627Z:wt_20_mix_EPC_empty",
|
||||||
|
"627Z:wt_20_mix_green_empty",
|
||||||
|
"627Z:wt_20_black_empty",
|
||||||
|
"627Z:wt_20_blue_empty",
|
||||||
|
"627Z:wt_20_blue_gr_empty",
|
||||||
|
"627Z:wt_20_blue_gr_r_empty",
|
||||||
|
"627Z:wt_20_CDC_empty",
|
||||||
|
"627Z:wt_20_EPC_black_empty",
|
||||||
|
"627Z:wt_20_EPC_red_empty",
|
||||||
|
"627Z:wt_20_green_new_empty",
|
||||||
|
"627Z:wt_20_green_old_empty",
|
||||||
|
"627Z:wt_20_white_new_empty",
|
||||||
|
"627Z:wt_20_white_old_empty",
|
||||||
|
"627Z:wt_20_white_old_gr_empty",
|
||||||
|
"627Z:wt_20_white_old_gr_r_empty"
|
||||||
|
],
|
||||||
|
"chłodnia": [
|
||||||
|
"202Lc:all"
|
||||||
|
],
|
||||||
|
"drobnica": [
|
||||||
|
"426S:all",
|
||||||
|
"208Kf:all",
|
||||||
|
"401Ka_PKP_Gags:all",
|
||||||
|
"401Ka_PKPC_Gags:all"
|
||||||
|
],
|
||||||
|
"węgiel": [
|
||||||
|
"412W:coal_01",
|
||||||
|
"413S:coal_413S",
|
||||||
|
"429W:coal_01",
|
||||||
|
"401Zb:coal_02"
|
||||||
|
],
|
||||||
|
"ruda": [
|
||||||
|
"412W:ore_01",
|
||||||
|
"401Zl:ore_35",
|
||||||
|
"429W:ore_01"
|
||||||
|
],
|
||||||
"piasek": [
|
"piasek": [
|
||||||
"412W:sand_01",
|
"412W:sand_01",
|
||||||
"412W:sand_02",
|
"412W:sand_02",
|
||||||
@@ -16,7 +203,9 @@
|
|||||||
"418Va:sand_418V",
|
"418Va:sand_418V",
|
||||||
"418Vb:sand_418V"
|
"418Vb:sand_418V"
|
||||||
],
|
],
|
||||||
"kreda": ["413S:chalk_413S"],
|
"kreda": [
|
||||||
|
"413S:chalk_413S"
|
||||||
|
],
|
||||||
"kamień": [
|
"kamień": [
|
||||||
"412W:stone_01",
|
"412W:stone_01",
|
||||||
"412W:stone_50",
|
"412W:stone_50",
|
||||||
@@ -26,32 +215,98 @@
|
|||||||
"418Va:stone_418V",
|
"418Va:stone_418V",
|
||||||
"418Vb:stone_418V"
|
"418Vb:stone_418V"
|
||||||
],
|
],
|
||||||
"złom": ["412W:scrap_01", "412W:scrap_02", "429W:scrap_01", "429W:scrap_02"],
|
"złom": [
|
||||||
"paliwo": ["29R_CTLL:all", "29R_PKP:all", "445Rb:all"],
|
"412W:scrap_01",
|
||||||
"melasa": ["29R_PLPOL:all"],
|
"412W:scrap_02",
|
||||||
"żwir": ["441V"],
|
"429W:scrap_01",
|
||||||
"koła": ["424Z:wheels_01"],
|
"429W:scrap_02"
|
||||||
"drewno": ["424Z:woods_01", "424Z:woods_02"],
|
],
|
||||||
"szyny": ["424Z:rails_01"],
|
"paliwo": [
|
||||||
"kable": ["424Z:cables_01", "24Z:cables_Ks", "401Ze:cables_02"],
|
"29R_CTLL:all",
|
||||||
"kruszywo": ["59WS:all"],
|
"29R_PKP:all",
|
||||||
"techniczne": ["209c", "304Ca", "102a_PKPE", "401Ka_PKP_XGa:all"],
|
"445Rb:all"
|
||||||
"poczta": ["211K:all"],
|
],
|
||||||
|
"melasa": [
|
||||||
|
"29R_PLPOL:all"
|
||||||
|
],
|
||||||
|
"żwir": [
|
||||||
|
"441V"
|
||||||
|
],
|
||||||
|
"koła": [
|
||||||
|
"424Z:wheels_01"
|
||||||
|
],
|
||||||
|
"drewno": [
|
||||||
|
"424Z:woods_01",
|
||||||
|
"424Z:woods_02"
|
||||||
|
],
|
||||||
|
"szyny": [
|
||||||
|
"424Z:rails_01"
|
||||||
|
],
|
||||||
|
"kable": [
|
||||||
|
"424Z:cables_01",
|
||||||
|
"24Z:cables_Ks",
|
||||||
|
"401Ze:cables_02"
|
||||||
|
],
|
||||||
|
"kruszywo": [
|
||||||
|
"59WS:all"
|
||||||
|
],
|
||||||
|
"techniczne": [
|
||||||
|
"209c",
|
||||||
|
"304Ca",
|
||||||
|
"102a_PKPE",
|
||||||
|
"401Ka_PKP_XGa:all"
|
||||||
|
],
|
||||||
|
"poczta": [
|
||||||
|
"211K:all"
|
||||||
|
],
|
||||||
"cement": [
|
"cement": [
|
||||||
"408S:cement_4",
|
"408S:cement_4",
|
||||||
"206S_CEMET:cement_3",
|
"206S_CEMET:cement_3",
|
||||||
"206S_SPEED:cement_3",
|
"206S_SPEED:cement_3",
|
||||||
"220S_CEMET:cement_3"
|
"220S_CEMET:cement_3"
|
||||||
],
|
],
|
||||||
"wapno": ["408S:lime_4", "206S_CEMET:lime_3", "206S_SPEED:lime_3", "220S_CEMET:lime_3"],
|
"wapno": [
|
||||||
"soda": ["408S:soda_4", "206S_CEMET:soda_3", "206S_SPEED:soda_3", "220S_CEMET:soda_3"],
|
"408S:lime_4",
|
||||||
"pszenica": ["206Sh_PKP_Ugpps:wheat_3", "206Sh_PKPC_Ugpps:wheat_3"],
|
"206S_CEMET:lime_3",
|
||||||
"kukurydza": ["206Sh_PKP_Ugpps:corn_3", "206Sh_PKPC_Ugpps:corn_3"],
|
"206S_SPEED:lime_3",
|
||||||
"pasza": ["206Sh_PKP_Ugpps:forage_3", "206Sh_PKPC_Ugpps:forage_3"],
|
"220S_CEMET:lime_3"
|
||||||
"pojazdy": ["426Z:tank_01", "426Z:truck_01", "426Z:vehicles_01"],
|
],
|
||||||
"karbid": ["421S:carbide_01"],
|
"soda": [
|
||||||
"wrażliwe": ["425S:all", "421S:carbide_01"],
|
"408S:soda_4",
|
||||||
"stal": ["401Ze:steel_01", "401Ze:steel_02"],
|
"206S_CEMET:soda_3",
|
||||||
"gaz": ["WB117:all"]
|
"206S_SPEED:soda_3",
|
||||||
|
"220S_CEMET:soda_3"
|
||||||
|
],
|
||||||
|
"pszenica": [
|
||||||
|
"206Sh_PKP_Ugpps:wheat_3",
|
||||||
|
"206Sh_PKPC_Ugpps:wheat_3"
|
||||||
|
],
|
||||||
|
"kukurydza": [
|
||||||
|
"206Sh_PKP_Ugpps:corn_3",
|
||||||
|
"206Sh_PKPC_Ugpps:corn_3"
|
||||||
|
],
|
||||||
|
"pasza": [
|
||||||
|
"206Sh_PKP_Ugpps:forage_3",
|
||||||
|
"206Sh_PKPC_Ugpps:forage_3"
|
||||||
|
],
|
||||||
|
"pojazdy": [
|
||||||
|
"426Z:tank_01",
|
||||||
|
"426Z:truck_01",
|
||||||
|
"426Z:vehicles_01"
|
||||||
|
],
|
||||||
|
"karbid": [
|
||||||
|
"421S:carbide_01"
|
||||||
|
],
|
||||||
|
"wrażliwe": [
|
||||||
|
"425S:all",
|
||||||
|
"421S:carbide_01"
|
||||||
|
],
|
||||||
|
"stal": [
|
||||||
|
"401Ze:steel_01",
|
||||||
|
"401Ze:steel_02"
|
||||||
|
],
|
||||||
|
"gaz": [
|
||||||
|
"WB117:all"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+14
-2
@@ -6,7 +6,8 @@
|
|||||||
"disclaimer": "This site has only an informational intent. The author does not carry any responsibility for creating trains against {tos}!",
|
"disclaimer": "This site has only an informational intent. The author does not carry any responsibility for creating trains against {tos}!",
|
||||||
"tos": "Train Driver 2 simulator rules",
|
"tos": "Train Driver 2 simulator rules",
|
||||||
"tos-href": "https://docs.google.com/document/d/1UAAPUtN0d_RoS4RgOzEzllJZJhA0VcizzCzKW4QylbY/edit#heading=h.1ldcvhomwjp9",
|
"tos-href": "https://docs.google.com/document/d/1UAAPUtN0d_RoS4RgOzEzllJZJhA0VcizzCzKW4QylbY/edit#heading=h.1ldcvhomwjp9",
|
||||||
"version-check": "Site is complete for version {version} of Train Driver 2 simulator"
|
"version-check": "Site is complete for version {version} of Train Driver 2 simulator",
|
||||||
|
"vehicles-count": "Site contains currently {all} vehicles - including {units} traction units and {cars} car wagons!"
|
||||||
},
|
},
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"title": "CHOOSE A VEHICLE",
|
"title": "CHOOSE A VEHICLE",
|
||||||
@@ -100,7 +101,7 @@
|
|||||||
"chosen-empty-warning": "Choose at least one cargo type to see available cars!",
|
"chosen-empty-warning": "Choose at least one cargo type to see available cars!",
|
||||||
"chosen-warning": "Cars containing chosen cargo are shown below. Hover over a type to see a preview of the car. Click it to include/exclude it from a drawing (only highlighted types will be included).",
|
"chosen-warning": "Cars containing chosen cargo are shown below. Hover over a type to see a preview of the car. Click it to include/exclude it from a drawing (only highlighted types will be included).",
|
||||||
"action-generate": "GENERATE",
|
"action-generate": "GENERATE",
|
||||||
"action-generate-empty": "GENERATE EMPTY",
|
"action-generate-empty": "GENERATE CARS ALONE",
|
||||||
"action-reset": "RESET CARGO"
|
"action-reset": "RESET CARGO"
|
||||||
},
|
},
|
||||||
"numgen": {
|
"numgen": {
|
||||||
@@ -220,6 +221,8 @@
|
|||||||
},
|
},
|
||||||
"cargo": {
|
"cargo": {
|
||||||
"kontenery": "containers",
|
"kontenery": "containers",
|
||||||
|
"biomasa": "biomass",
|
||||||
|
"biomasa-puste": "biomass (empty)",
|
||||||
"chłodnia": "refrigerator",
|
"chłodnia": "refrigerator",
|
||||||
"drobnica": "loose cargo",
|
"drobnica": "loose cargo",
|
||||||
"węgiel": "coal",
|
"węgiel": "coal",
|
||||||
@@ -322,5 +325,14 @@
|
|||||||
"418Vb_WIEBE": "loose cargo (sand, stone)",
|
"418Vb_WIEBE": "loose cargo (sand, stone)",
|
||||||
"418Vb_ZOS": "loose cargo (sand, stone)",
|
"418Vb_ZOS": "loose cargo (sand, stone)",
|
||||||
"418Vb_ZUE": "loose cargo (sand, stone)"
|
"418Vb_ZUE": "loose cargo (sand, stone)"
|
||||||
|
},
|
||||||
|
"cargo-warnings": {
|
||||||
|
"title": "Rolling stock containing extra cargo warnings:",
|
||||||
|
"warning_wt_20_pn": "PN: exceeded gauge (Innofreight - C45)",
|
||||||
|
"warning_un1965_twr": "TWR: LPG (UN 1965)",
|
||||||
|
"warning_un1965_tn": "TN: LPG - empty tank (UN 1965)",
|
||||||
|
"warning_un1202_twr": "TWR: diesel fuel (UN 1202)",
|
||||||
|
"warning_un1202_tn": "TN: diesel fuel - empty tank (UN 1202)",
|
||||||
|
"warning_military_pn": "PN: military transport"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+14
-2
@@ -6,7 +6,8 @@
|
|||||||
"disclaimer": "Ta strona ma charakter informacyjny. Autor nie ponosi odpowiedzialności za tworzenie pociągów niezgodnych z {tos}!",
|
"disclaimer": "Ta strona ma charakter informacyjny. Autor nie ponosi odpowiedzialności za tworzenie pociągów niezgodnych z {tos}!",
|
||||||
"tos": "regulaminem symulatora Train Driver 2",
|
"tos": "regulaminem symulatora Train Driver 2",
|
||||||
"tos-href": "https://docs.google.com/document/d/1UAAPUtN0d_RoS4RgOzEzllJZJhA0VcizzCzKW4QylbY/edit",
|
"tos-href": "https://docs.google.com/document/d/1UAAPUtN0d_RoS4RgOzEzllJZJhA0VcizzCzKW4QylbY/edit",
|
||||||
"version-check": "Strona jest kompletna dla wersji {version} symulatora TD2"
|
"version-check": "Strona jest kompletna dla wersji {version} symulatora TD2",
|
||||||
|
"vehicles-count": "Strona zawiera obecnie {all} pojazdów - w tym {units} jednostek trakcyjnych i {cars} wagonów!"
|
||||||
},
|
},
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"title": "WYBIERZ POJAZD",
|
"title": "WYBIERZ POJAZD",
|
||||||
@@ -100,7 +101,7 @@
|
|||||||
"chosen-empty-warning": "Wybierz co najmniej jeden ładunek, aby zobaczyć wagony, które go posiadają!",
|
"chosen-empty-warning": "Wybierz co najmniej jeden ładunek, aby zobaczyć wagony, które go posiadają!",
|
||||||
"chosen-warning": "Wagony posiadające wybrane ładunki. Najedź na nazwę, aby zobaczyć podgląd wagonu. Kliknij, aby wyłączyć z losowania (tylko podświetlone nazwy będą uwzględnione).",
|
"chosen-warning": "Wagony posiadające wybrane ładunki. Najedź na nazwę, aby zobaczyć podgląd wagonu. Kliknij, aby wyłączyć z losowania (tylko podświetlone nazwy będą uwzględnione).",
|
||||||
"action-generate": "WYGENERUJ",
|
"action-generate": "WYGENERUJ",
|
||||||
"action-generate-empty": "WYGENERUJ PRÓŻNE WAGONY",
|
"action-generate-empty": "WYGENERUJ SAME WAGONY",
|
||||||
"action-reset": "ZRESETUJ ŁADUNKI"
|
"action-reset": "ZRESETUJ ŁADUNKI"
|
||||||
},
|
},
|
||||||
"numgen": {
|
"numgen": {
|
||||||
@@ -220,6 +221,8 @@
|
|||||||
},
|
},
|
||||||
"cargo": {
|
"cargo": {
|
||||||
"kontenery": "kontenery",
|
"kontenery": "kontenery",
|
||||||
|
"biomasa": "biomasa",
|
||||||
|
"biomasa-puste": "biomasa (puste)",
|
||||||
"chłodnia": "chłodnia",
|
"chłodnia": "chłodnia",
|
||||||
"drobnica": "drobnica",
|
"drobnica": "drobnica",
|
||||||
"węgiel": "węgiel",
|
"węgiel": "węgiel",
|
||||||
@@ -321,5 +324,14 @@
|
|||||||
"418Vb_WIEBE": "drobnica, ładunki sypkie (piasek, kamień)",
|
"418Vb_WIEBE": "drobnica, ładunki sypkie (piasek, kamień)",
|
||||||
"418Vb_ZOS": "drobnica, ładunki sypkie (piasek, kamień)",
|
"418Vb_ZOS": "drobnica, ładunki sypkie (piasek, kamień)",
|
||||||
"418Vb_ZUE": "drobnica, ładunki sypkie (piasek, kamień)"
|
"418Vb_ZUE": "drobnica, ładunki sypkie (piasek, kamień)"
|
||||||
|
},
|
||||||
|
"cargo-warnings": {
|
||||||
|
"title": "Skład z dodatkowymi uwagami przewozowymi:",
|
||||||
|
"warning_wt_20_pn": "PN: przekroczona skrajnia (Innofreight - C45)",
|
||||||
|
"warning_un1965_twr": "TWR: gazy węglowodorowe skroplone (UN 1965)",
|
||||||
|
"warning_un1965_tn": "TN: gazy węglowodorowe skroplone - puste cysterny (UN 1965)",
|
||||||
|
"warning_un1202_twr": "TWR: olej napędowy (UN 1202)",
|
||||||
|
"warning_un1202_tn": "TN: olej napędowy - puste cysterny (UN 1202)",
|
||||||
|
"warning_military_pn": "PN: transport wojskowy"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+6
-13
@@ -15,6 +15,7 @@ import { defineStore } from 'pinia';
|
|||||||
import {
|
import {
|
||||||
acceptableWeight,
|
acceptableWeight,
|
||||||
carDataList,
|
carDataList,
|
||||||
|
getCargoWarnings,
|
||||||
isTractionUnit,
|
isTractionUnit,
|
||||||
isTrainPassenger,
|
isTrainPassenger,
|
||||||
locoDataList,
|
locoDataList,
|
||||||
@@ -25,13 +26,11 @@ import {
|
|||||||
totalWeight,
|
totalWeight,
|
||||||
} from './utils/vehicleUtils';
|
} from './utils/vehicleUtils';
|
||||||
|
|
||||||
import i18n from './i18n-setup';
|
|
||||||
import http from './http';
|
import http from './http';
|
||||||
|
|
||||||
import realCompositionsJSON from './data/realCompositions.json';
|
import realCompositionsJSON from './data/realCompositions.json';
|
||||||
|
|
||||||
export const useStore = defineStore({
|
export const useStore = defineStore('store', {
|
||||||
id: 'store',
|
|
||||||
state: () => ({
|
state: () => ({
|
||||||
chosenCar: null as ICarWagon | null,
|
chosenCar: null as ICarWagon | null,
|
||||||
chosenLoco: null as ILocomotive | null,
|
chosenLoco: null as ILocomotive | null,
|
||||||
@@ -70,15 +69,13 @@ export const useStore = defineStore({
|
|||||||
getters: {
|
getters: {
|
||||||
locoDataList: (state) => locoDataList(state.vehiclesData),
|
locoDataList: (state) => locoDataList(state.vehiclesData),
|
||||||
carDataList: (state) => carDataList(state.vehiclesData),
|
carDataList: (state) => carDataList(state.vehiclesData),
|
||||||
vehicleDataList: (state) => [
|
vehicleDataList: (state) => [...locoDataList(state.vehiclesData), ...carDataList(state.vehiclesData)],
|
||||||
...locoDataList(state.vehiclesData),
|
|
||||||
...carDataList(state.vehiclesData),
|
|
||||||
],
|
|
||||||
totalWeight: (state) => totalWeight(state.stockList),
|
totalWeight: (state) => totalWeight(state.stockList),
|
||||||
totalLength: (state) => totalLength(state.stockList),
|
totalLength: (state) => totalLength(state.stockList),
|
||||||
maxStockSpeed: (state) => maxStockSpeed(state.stockList),
|
maxStockSpeed: (state) => maxStockSpeed(state.stockList),
|
||||||
isTrainPassenger: (state) => isTrainPassenger(state.stockList),
|
isTrainPassenger: (state) => isTrainPassenger(state.stockList),
|
||||||
acceptableWeight: (state) => acceptableWeight(state.stockList),
|
acceptableWeight: (state) => acceptableWeight(state.stockList),
|
||||||
|
cargoWarnings: (state) => getCargoWarnings(state.stockList),
|
||||||
|
|
||||||
stockSupportsColdStart: (state) => stockSupportsColdStart(state.stockList),
|
stockSupportsColdStart: (state) => stockSupportsColdStart(state.stockList),
|
||||||
stockSupportsDoubleManning: (state) => stockSupportsDoubleManning(state.stockList),
|
stockSupportsDoubleManning: (state) => stockSupportsDoubleManning(state.stockList),
|
||||||
@@ -87,15 +84,11 @@ export const useStore = defineStore({
|
|||||||
if (state.stockList.length == 0) return '';
|
if (state.stockList.length == 0) return '';
|
||||||
|
|
||||||
const coldStartActive = state.isColdStart && stockSupportsColdStart(state.stockList);
|
const coldStartActive = state.isColdStart && stockSupportsColdStart(state.stockList);
|
||||||
const doubleManningActive =
|
const doubleManningActive = state.isDoubleManned && stockSupportsDoubleManning(state.stockList);
|
||||||
state.isDoubleManned && stockSupportsDoubleManning(state.stockList);
|
|
||||||
|
|
||||||
return state.stockList
|
return state.stockList
|
||||||
.map((stock, i) => {
|
.map((stock, i) => {
|
||||||
let stockTypeStr =
|
let stockTypeStr = isTractionUnit(stock.vehicleRef) || !stock.cargo ? stock.vehicleRef.type : `${stock.vehicleRef.type}:${stock.cargo.id}`;
|
||||||
isTractionUnit(stock.vehicleRef) || !stock.cargo
|
|
||||||
? stock.vehicleRef.type
|
|
||||||
: `${stock.vehicleRef.type}:${stock.cargo.id}`;
|
|
||||||
|
|
||||||
if (i == 0 && (coldStartActive || doubleManningActive))
|
if (i == 0 && (coldStartActive || doubleManningActive))
|
||||||
return `${stockTypeStr},${coldStartActive ? 'c' : ''}${doubleManningActive ? 'd' : ''}`;
|
return `${stockTypeStr},${coldStartActive ? 'c' : ''}${doubleManningActive ? 'd' : ''}`;
|
||||||
|
|||||||
@@ -28,12 +28,14 @@ export interface ILocomotive {
|
|||||||
constructionType: string;
|
constructionType: string;
|
||||||
cabinType: string;
|
cabinType: string;
|
||||||
maxSpeed: number;
|
maxSpeed: number;
|
||||||
|
maxSpeedLoco: number;
|
||||||
weight: number;
|
weight: number;
|
||||||
length: number;
|
length: number;
|
||||||
coldStart: boolean;
|
coldStart: boolean;
|
||||||
doubleManned: boolean;
|
doubleManned: boolean;
|
||||||
sponsorOnlyTimestamp: number;
|
sponsorOnlyTimestamp: number;
|
||||||
teamOnly: boolean;
|
teamOnly: boolean;
|
||||||
|
massSpeeds: VehicleGroupMassSpeeds | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ICarWagon {
|
export interface ICarWagon {
|
||||||
@@ -42,11 +44,13 @@ export interface ICarWagon {
|
|||||||
constructionType: string;
|
constructionType: string;
|
||||||
loadable: boolean;
|
loadable: boolean;
|
||||||
maxSpeed: number;
|
maxSpeed: number;
|
||||||
|
maxSpeedLoaded: number;
|
||||||
weight: number;
|
weight: number;
|
||||||
length: number;
|
length: number;
|
||||||
cargoTypes: ICargo[];
|
cargoTypes: ICargo[];
|
||||||
sponsorOnlyTimestamp: number;
|
sponsorOnlyTimestamp: number;
|
||||||
teamOnly: boolean;
|
teamOnly: boolean;
|
||||||
|
massSpeeds: VehicleGroupMassSpeeds | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IStock {
|
export interface IStock {
|
||||||
@@ -70,6 +74,7 @@ export interface IVehicleData {
|
|||||||
cabinName: string | null;
|
cabinName: string | null;
|
||||||
restrictions: IVehicleRestrictions | null;
|
restrictions: IVehicleRestrictions | null;
|
||||||
vehicleGroupsId: number;
|
vehicleGroupsId: number;
|
||||||
|
simulatorVersion: string;
|
||||||
group: IVehicleGroup;
|
group: IVehicleGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,10 +87,13 @@ export interface IVehicleGroup {
|
|||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
speed: number;
|
speed: number;
|
||||||
|
speedLoaded?: number;
|
||||||
|
speedLoco?: number;
|
||||||
length: number;
|
length: number;
|
||||||
weight: number;
|
weight: number;
|
||||||
cargoTypes: IVehicleCargoType[] | null;
|
cargoTypes: IVehicleCargoType[] | null;
|
||||||
locoProps: IVehicleLocoProps | null;
|
locoProps: IVehicleLocoProps | null;
|
||||||
|
massSpeeds: VehicleGroupMassSpeeds | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IVehicleCargoType {
|
export interface IVehicleCargoType {
|
||||||
@@ -98,9 +106,15 @@ export interface IVehicleLocoProps {
|
|||||||
doubleManned: boolean;
|
doubleManned: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface VehicleGroupMassSpeeds {
|
||||||
|
passenger: Record<string, number> | null;
|
||||||
|
cargo: Record<string, number> | null;
|
||||||
|
none: number | null;
|
||||||
|
}
|
||||||
|
|
||||||
export interface StorageStockEntry {
|
export interface StorageStockEntry {
|
||||||
id: string;
|
id: string;
|
||||||
createdAt: number;
|
createdAt: number;
|
||||||
updatedAt?: number;
|
updatedAt?: number;
|
||||||
stockString: string;
|
stockString: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,47 @@
|
|||||||
import speedLimits from '../constants/speedLimits.json';
|
|
||||||
import massLimits from '../constants/massLimits.json';
|
import massLimits from '../constants/massLimits.json';
|
||||||
|
import { IStock } from '../types/common.types';
|
||||||
|
|
||||||
export type SpeedLimitLocoType = keyof typeof speedLimits;
|
|
||||||
export type MassLimitLocoType = keyof typeof massLimits;
|
export type MassLimitLocoType = keyof typeof massLimits;
|
||||||
|
|
||||||
export function calculateSpeedLimit(
|
export function calculateSpeedLimit(stockList: IStock[], isPassenger: boolean, stockMass: number) {
|
||||||
locoType: SpeedLimitLocoType,
|
// Check the whole consist speed limit
|
||||||
stockTotalWeight: number,
|
const stockMaxSpeed = stockList.reduce((acc, vehicle, i) => {
|
||||||
stockCount: number,
|
let vehicleSpeed = vehicle.vehicleRef.maxSpeed;
|
||||||
isTrainPassenger: boolean
|
|
||||||
) {
|
|
||||||
if (speedLimits[locoType] === undefined) return 0;
|
|
||||||
|
|
||||||
if (stockCount == 1) return speedLimits[locoType]['none'];
|
if (
|
||||||
|
vehicle.vehicleRef.group == 'wagon-freight' &&
|
||||||
|
vehicle.cargo !== undefined &&
|
||||||
|
vehicle.vehicleRef.maxSpeedLoaded
|
||||||
|
) {
|
||||||
|
vehicleSpeed = vehicle.vehicleRef.maxSpeedLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
const stockType = isTrainPassenger ? 'passenger' : 'cargo';
|
return Math.min(vehicleSpeed, acc);
|
||||||
const speedTable = speedLimits[locoType][stockType];
|
}, Infinity);
|
||||||
|
|
||||||
if (!speedTable) return undefined;
|
// Check the head vehicle speed limit
|
||||||
|
const headVehicle = stockList[0];
|
||||||
|
|
||||||
let speedLimit = 0;
|
// Omit speed check for head vehicle if there's no data for it
|
||||||
for (const mass in speedTable)
|
if (!headVehicle || !headVehicle.vehicleRef.massSpeeds) return stockMaxSpeed;
|
||||||
if (stockTotalWeight > Number(mass)) speedLimit = (speedTable as any)[mass];
|
|
||||||
|
|
||||||
return speedLimit;
|
const massSpeeds =
|
||||||
|
headVehicle.vehicleRef.massSpeeds[
|
||||||
|
stockList.length == 1 ? 'none' : isPassenger ? 'passenger' : 'cargo'
|
||||||
|
];
|
||||||
|
|
||||||
|
// Omit speed check if there's no data on mass speeds
|
||||||
|
if (!massSpeeds) return stockMaxSpeed;
|
||||||
|
|
||||||
|
// Number type for locomotives alone
|
||||||
|
if (typeof massSpeeds === 'number') return massSpeeds;
|
||||||
|
|
||||||
|
// Record type for passenger or cargo, find the closest range
|
||||||
|
const massKey = Object.keys(massSpeeds).findLast((massKey) => stockMass >= Number(massKey));
|
||||||
|
|
||||||
|
const massMaxSpeed = massKey ? massSpeeds[massKey] : Infinity;
|
||||||
|
|
||||||
|
return Math.min(massMaxSpeed, stockMaxSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calculateMassLimit(locoType: MassLimitLocoType, isTrainPassenger: boolean) {
|
export function calculateMassLimit(locoType: MassLimitLocoType, isTrainPassenger: boolean) {
|
||||||
|
|||||||
+30
-57
@@ -1,18 +1,5 @@
|
|||||||
import {
|
import { ICarWagon, ILocomotive, IStock, IVehicleData, LocoGroupType, WagonGroupType } from '../types/common.types';
|
||||||
ICarWagon,
|
import { MassLimitLocoType, calculateMassLimit, calculateSpeedLimit } from './vehicleLimitsUtils';
|
||||||
ILocomotive,
|
|
||||||
IStock,
|
|
||||||
IVehicleData,
|
|
||||||
IVehiclesAPIResponse,
|
|
||||||
LocoGroupType,
|
|
||||||
WagonGroupType,
|
|
||||||
} from '../types/common.types';
|
|
||||||
import {
|
|
||||||
MassLimitLocoType,
|
|
||||||
SpeedLimitLocoType,
|
|
||||||
calculateMassLimit,
|
|
||||||
calculateSpeedLimit,
|
|
||||||
} from './vehicleLimitsUtils';
|
|
||||||
|
|
||||||
export function isTractionUnit(vehicle: ILocomotive | ICarWagon): vehicle is ILocomotive {
|
export function isTractionUnit(vehicle: ILocomotive | ICarWagon): vehicle is ILocomotive {
|
||||||
return (vehicle as ILocomotive).cabinType !== undefined;
|
return (vehicle as ILocomotive).cabinType !== undefined;
|
||||||
@@ -35,11 +22,14 @@ export function locoDataList(vehiclesData: IVehicleData[] | undefined) {
|
|||||||
teamOnly: data.restrictions?.teamOnly ?? false,
|
teamOnly: data.restrictions?.teamOnly ?? false,
|
||||||
|
|
||||||
maxSpeed: data.group.speed,
|
maxSpeed: data.group.speed,
|
||||||
|
maxSpeedLoco: data.group.speedLoco ?? data.group.speed,
|
||||||
length: data.group.length,
|
length: data.group.length,
|
||||||
weight: data.group.weight,
|
weight: data.group.weight,
|
||||||
|
|
||||||
coldStart: data.group.locoProps?.coldStart ?? false,
|
coldStart: data.group.locoProps?.coldStart ?? false,
|
||||||
doubleManned: data.group.locoProps?.doubleManned ?? false,
|
doubleManned: data.group.locoProps?.doubleManned ?? false,
|
||||||
|
|
||||||
|
massSpeeds: data.group.massSpeeds,
|
||||||
});
|
});
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
@@ -63,8 +53,12 @@ export function carDataList(vehiclesData: IVehicleData[] | undefined) {
|
|||||||
teamOnly: data.restrictions?.teamOnly ?? false,
|
teamOnly: data.restrictions?.teamOnly ?? false,
|
||||||
|
|
||||||
maxSpeed: data.group.speed,
|
maxSpeed: data.group.speed,
|
||||||
|
maxSpeedLoaded: data.group.speedLoaded ?? data.group.speed,
|
||||||
|
|
||||||
length: data.group.length,
|
length: data.group.length,
|
||||||
weight: data.group.weight,
|
weight: data.group.weight,
|
||||||
|
|
||||||
|
massSpeeds: data.group.massSpeeds,
|
||||||
});
|
});
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
@@ -72,10 +66,7 @@ export function carDataList(vehiclesData: IVehicleData[] | undefined) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function totalWeight(stockList: IStock[]) {
|
export function totalWeight(stockList: IStock[]) {
|
||||||
return stockList.reduce(
|
return stockList.reduce((acc, stock) => acc + (stock.vehicleRef.weight + (stock.cargo?.weight ?? 0)), 0);
|
||||||
(acc, stock) => acc + (stock.vehicleRef.weight + (stock.cargo?.weight ?? 0)),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function totalLength(stockList: IStock[]) {
|
export function totalLength(stockList: IStock[]) {
|
||||||
@@ -83,27 +74,7 @@ export function totalLength(stockList: IStock[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function maxStockSpeed(stockList: IStock[]) {
|
export function maxStockSpeed(stockList: IStock[]) {
|
||||||
const stockSpeedLimit = stockList.reduce(
|
return calculateSpeedLimit(stockList, isTrainPassenger(stockList), totalWeight(stockList));
|
||||||
(acc, stock) => (stock.vehicleRef.maxSpeed < acc || acc == 0 ? stock.vehicleRef.maxSpeed : acc),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
const headingLoco =
|
|
||||||
stockList[0] && isTractionUnit(stockList[0].vehicleRef) ? stockList[0] : undefined;
|
|
||||||
|
|
||||||
if (!headingLoco) return stockSpeedLimit;
|
|
||||||
|
|
||||||
const locoType = headingLoco.vehicleRef.type.split('-')[0];
|
|
||||||
|
|
||||||
if (/^(EN|2EN|SN)/.test(locoType)) return stockSpeedLimit;
|
|
||||||
|
|
||||||
const speedLimitByMass = calculateSpeedLimit(
|
|
||||||
locoType as SpeedLimitLocoType,
|
|
||||||
totalWeight(stockList),
|
|
||||||
stockList.length,
|
|
||||||
isTrainPassenger(stockList)
|
|
||||||
);
|
|
||||||
|
|
||||||
return speedLimitByMass ? Math.min(stockSpeedLimit, speedLimitByMass) : stockSpeedLimit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function acceptableWeight(stockList: IStock[]) {
|
export function acceptableWeight(stockList: IStock[]) {
|
||||||
@@ -111,10 +82,7 @@ export function acceptableWeight(stockList: IStock[]) {
|
|||||||
|
|
||||||
const activeLocomotiveType = stockList[0].vehicleRef.type.split('-')[0];
|
const activeLocomotiveType = stockList[0].vehicleRef.type.split('-')[0];
|
||||||
|
|
||||||
const locoMassLimit = calculateMassLimit(
|
const locoMassLimit = calculateMassLimit(activeLocomotiveType as MassLimitLocoType, isTrainPassenger(stockList));
|
||||||
activeLocomotiveType as MassLimitLocoType,
|
|
||||||
isTrainPassenger(stockList)
|
|
||||||
);
|
|
||||||
|
|
||||||
return locoMassLimit;
|
return locoMassLimit;
|
||||||
}
|
}
|
||||||
@@ -123,23 +91,28 @@ export function isTrainPassenger(stockList: IStock[]) {
|
|||||||
if (stockList.length == 0) return false;
|
if (stockList.length == 0) return false;
|
||||||
if (stockList.every((stock) => isTractionUnit(stock.vehicleRef))) return false;
|
if (stockList.every((stock) => isTractionUnit(stock.vehicleRef))) return false;
|
||||||
|
|
||||||
return stockList
|
return stockList.filter((stock) => !isTractionUnit(stock.vehicleRef)).every((stock) => stock.vehicleRef.group === 'wagon-passenger');
|
||||||
.filter((stock) => !isTractionUnit(stock.vehicleRef))
|
|
||||||
.every((stock) => stock.vehicleRef.group === 'wagon-passenger');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function stockSupportsColdStart(stockList: IStock[]) {
|
export function stockSupportsColdStart(stockList: IStock[]) {
|
||||||
return (
|
return stockList.length == 1 && isTractionUnit(stockList[0].vehicleRef) && stockList[0].vehicleRef.coldStart;
|
||||||
stockList.length == 1 &&
|
|
||||||
isTractionUnit(stockList[0].vehicleRef) &&
|
|
||||||
stockList[0].vehicleRef.coldStart
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function stockSupportsDoubleManning(stockList: IStock[]) {
|
export function stockSupportsDoubleManning(stockList: IStock[]) {
|
||||||
return (
|
return stockList.length != 0 && isTractionUnit(stockList[0].vehicleRef) && stockList[0].vehicleRef.doubleManned;
|
||||||
stockList.length != 0 &&
|
}
|
||||||
isTractionUnit(stockList[0].vehicleRef) &&
|
|
||||||
stockList[0].vehicleRef.doubleManned
|
export function getCargoWarnings(stockList: IStock[]) {
|
||||||
);
|
let warnings: Set<string> = new Set();
|
||||||
|
|
||||||
|
stockList.forEach((stockVehicle) => {
|
||||||
|
if (stockVehicle.vehicleRef.group == 'wagon-freight') {
|
||||||
|
if (stockVehicle.cargo && stockVehicle.cargo.id.startsWith('wt_20')) warnings.add('warning_wt_20_pn');
|
||||||
|
else if (stockVehicle.cargo && /^(tank|vehicles|truck)/.test(stockVehicle.cargo.id)) warnings.add('warning_military_pn');
|
||||||
|
else if (stockVehicle.vehicleRef.type.startsWith('WB117')) warnings.add(stockVehicle.cargo ? 'warning_un1965_twr' : 'warning_un1965_tn');
|
||||||
|
else if (stockVehicle.vehicleRef.type.startsWith('445Rb')) warnings.add(stockVehicle.cargo ? 'warning_un1202_twr' : 'warning_un1202_tn');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return warnings;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ export default defineConfig({
|
|||||||
runtimeCaching: [
|
runtimeCaching: [
|
||||||
{
|
{
|
||||||
urlPattern: /^https:\/\/.*\.spythere\.eu\/.*/i,
|
urlPattern: /^https:\/\/.*\.spythere\.eu\/.*/i,
|
||||||
handler: 'StaleWhileRevalidate',
|
handler: 'NetworkFirst',
|
||||||
options: { cacheName: 'spythere-cache' },
|
options: { cacheName: 'spythere-cache' },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user