Skip to content

Commit

Permalink
🐛 #78 update map skin
Browse files Browse the repository at this point in the history
Signed-off-by: JAGFx <[email protected]>
  • Loading branch information
JAGFx committed Mar 1, 2022
1 parent aeabecd commit 6287b67
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 46 deletions.
2 changes: 1 addition & 1 deletion lib/config/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"general_refresh_rate" : 100,
"general_skin_on_load" : "Scania",
"general_skin_on_load" : "Map",
"general_h-shift-layout" : "h-shifter",
"general_skin_locale" : "en-EN",
"general_job_remaining" : "due_date",
Expand Down
8 changes: 4 additions & 4 deletions lib/sdk/scs_sdk_plugin_parsed_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,12 +664,12 @@
}
},
"position" : {
"X" : -6274.059234619141,
"Y" : 37.788394927978516,
"Z" : 9571.511840820312
"X": 52850.890144348145,
"Y": 5.716939926147461,
"Z": -31324.724784851074
},
"orientation" : {
"heading" : 0.13367897272109985,
"heading": 0.4390052556991577,
"pitch" : 0.0005585197359323502,
"roll" : 7.589098771632052e-8
},
Expand Down
6 changes: 5 additions & 1 deletion src/assets/scss/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,8 @@ input.btn-outline-ets {

.text-size-1rem { font-size: 1rem; }

.text-line-height-1rem { line-height: 1rem; }
.text-line-height-1rem { line-height: 1rem; }

i[class^=icon]{
line-height: 0;
}
53 changes: 22 additions & 31 deletions src/components/dashboards/shared/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,20 @@
<div
class="barButton m-0 flex-row-reverse h-100 cruise-control"
:class="{
green: telemetry.truck.cruiseControl.enabled,
disabled: !telemetry.truck.cruiseControl.enabled
green: telemetry2.truck.cruiseControlIsEnabled,
disabled: !telemetry2.truck.cruiseControlIsEnabled
}"
>
<div class="round px-2 py-0">
<i class="icon-cruise_control" />
</div>
<span v-if="!telemetry.truck.cruiseControl.enabled" class="pl-2">{{
<span v-if="!telemetry2.truck.cruiseControlIsEnabled" class="pl-2">{{
$t('OFF')
}}</span>
<span v-else class="pl-2">{{
unit_speed(telemetry.truck.cruiseControl)
}}</span>
<span v-else class="pl-2">
{{ telemetry2.truck.speed.toFixed(0) }}
{{ $unitReadable('unit_speed') }}
</span>
</div>
</div>
<div v-if="!embedded" class="barZone spacer" />
Expand All @@ -72,15 +73,12 @@
>
<div class="speed">
<span class="value d-block">{{
unit_speed(telemetry.truck.speed, true, false).toFixed(0)
telemetry2.truck.speed.toFixed(0)
}}</span>
</div>

<div
:class="telemetry.truck.transmission.shifterType"
class="truck-gears ml-2"
>
telemetry2.truck.gearDisplayed
<div :class="telemetry2.truck.shifterType" class="truck-gears ml-2">
{{ telemetry2.truck.gearDisplayed }}
</div>
</div>
</div>
Expand All @@ -89,15 +87,16 @@
v-if="!embedded"
class="barButton m-0 blue h-100 fuel"
:class="{
orange: telemetry.truck.fuel.warning.enabled
orange: telemetry2.symbols.fuelLevelIsLow
}"
>
<div class="round px-2 py-0">
<i class="icon-fuel" />
</div>
<span class="pr-2">{{
unit_volume(telemetry.truck.fuel.value)
}}</span>
<span class="pr-2">
{{ telemetry2.truck.fuelLevel.toFixed(0) }}
{{ $unitReadable('unit_volume') }}
</span>
</div>
<div class="barButton disabled w-100 h-100" />
<div
Expand All @@ -122,9 +121,7 @@
id="speed-limit"
class="justify-content-center align-items-center"
>
<span>{{
unit_speed(telemetry.navigation.speedLimit, true, false)
}}</span>
<span>{{ telemetry2.navigation.speedLimitValue.toFixed(0) }}</span>
</div>
<!-- ./Speed limit -->

Expand Down Expand Up @@ -185,8 +182,8 @@
<tr v-if="configEnabled('maps_general_debug')">
<th>{{ $t('Pos') }}</th>
<td>
X: {{ telemetry.truck.position.X.toFixed(3) }} | Y:
{{ telemetry.truck.position.Y.toFixed(3) }}
X: {{ telemetry2.truck.positionX.toFixed(3) }} | Y:
{{ telemetry2.truck.positionY.toFixed(3) }}
</td>
</tr>
<tr v-if="configEnabled('maps_general_debug')">
Expand Down Expand Up @@ -249,7 +246,7 @@
<i class="icon-ruler" />
</div>
<span class="pl-2 w-100">{{
unit_length(telemetry.navigation.distance, 'm')
telemetry2.navigation.distanceToTargetString
}}</span>
</span>
</div>
Expand All @@ -259,6 +256,7 @@

<script>
import TelemetryMixin from '@/mixins/TelemetryMixin';
import { store as telemetryStore } from '@/store/telemetry.store';
import { history, map } from '@/utils/utils';
import { mapGetters } from 'vuex';
Expand Down Expand Up @@ -310,19 +308,12 @@ export default {
}
}
},
mounted() {
created() {
map
.init(this.telemetry.game.game.name)
.init(telemetryStore.model.gameName)
.then(() => {
this.ready = true;
this.rotateWithPlayer = map.d.gBehaviorRotateWithPlayer;
// --- Dev
//if ( app.useFakeData )
// setTimeout( () => {
// this.$updateTelemetry( testData )
// }, 1000 );
// --- ./Dev
})
.catch((e) => {
this.message.icon = '<i class="fas fa-times"></i>';
Expand Down
10 changes: 5 additions & 5 deletions src/model/telemetry-symbols.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@ export default class TelemetrySymbols {
get beaconIsEnabled() {
return (
telemetryStore.telemetry.truck.lights.beacon.enabled ||
telemetryStore.model.truck.ignitionStart
telemetryStore.model.truck.ignitionIsTurnedOn
);
}
get leftDirectionIsActive() {
return (
telemetryStore.telemetry.truck.lights.blinker.left.active ||
telemetryStore.model.truck.ignitionStart
telemetryStore.model.truck.ignitionIsTurnedOn
);
}
get rightDirectionIsActive() {
return (
telemetryStore.telemetry.truck.lights.blinker.right.active ||
telemetryStore.model.truck.ignitionStart
telemetryStore.model.truck.ignitionIsTurnedOn
);
}
get mainBeamIsEnabled() {
return (
(telemetryStore.telemetry.truck.lights.beamHigh.enabled &&
telemetryStore.telemetry.truck.lights.beamLow.enabled &&
telemetryStore.telemetry.truck.engine.enabled) ||
telemetryStore.model.truck.ignitionStart
telemetryStore.model.truck.ignitionIsTurnedOn
);
}
get lowBeamIsEnabled() {
return (
(telemetryStore.telemetry.truck.lights.beamLow.enabled &&
telemetryStore.telemetry.truck.engine.enabled) ||
telemetryStore.model.truck.ignitionStart
telemetryStore.model.truck.ignitionIsTurnedOn
);
}
get brakePressureIsActive() {
Expand Down
8 changes: 8 additions & 0 deletions src/model/telemetry-truck.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,12 @@ export default class TelemetryTruck {
return telemetryStore.telemetry.truck.model.id;
}
// </editor-folder> Brand

get positionX() {
return telemetryStore.telemetry.truck.position.X;
}

get positionY() {
return telemetryStore.telemetry.truck.position.Y;
}
}
3 changes: 3 additions & 0 deletions src/model/telemetry.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export default class Telemetry {
get gameId() {
return telemetryStore.telemetry.game.game.id;
}
get gameName() {
return telemetryStore.telemetry.game.game.name;
}
get gameSdkIsActive() {
return telemetryStore.telemetry.game.sdkActive;
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/app.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { mutations } from '@/store/telemetry.store';
import { pushLog } from '@/utils/_app';
import { translate } from '@/utils/_i18n';
import { event, history } from '@/utils/utils';
import additionalWatcher from '@/utils/telemetry/_additional-watcher.utils';
import additionalTelemetryWatcher from '@/utils/telemetry/_additional-watcher.utils';

export default {
install(Vue) {
Expand Down Expand Up @@ -53,7 +53,7 @@ export default {
if (gameConnected) mutations.setReceivedData(true);
};

additionalWatcher(Vue);
additionalTelemetryWatcher(Vue);
// ---

Vue.prototype.$t = translate;
Expand Down
13 changes: 11 additions & 2 deletions src/utils/_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/

import store from '@/store/index';
import { app, history } from '@/utils/utils';
import { store as telemetryStore } from '@/store/telemetry.store';
import { app, history, map } from '@/utils/utils';
import axios from 'axios';
import { Feature } from 'ol';
import { defaults as defaultControls } from 'ol/control';
Expand Down Expand Up @@ -196,7 +197,15 @@ const initMap = () => {
const init = (game) => {
return initConfig(game)
.then(() => initMap())
.then(() => (d.ready = true));
.then(() => (d.ready = true))
.then(() => {
map.updatePlayerPositionAndRotation(
telemetryStore.telemetry.truck.position.X,
telemetryStore.telemetry.truck.position.Z,
telemetryStore.telemetry.truck.orientation.heading,
telemetryStore.telemetry.truck.speed.kph
);
});
};

// ----
Expand Down

0 comments on commit 6287b67

Please sign in to comment.