Skip to content

Commit

Permalink
💄 [feat/rework-scania] #78 finalizing somme adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
JAGFx committed Feb 27, 2022
1 parent d8b6c55 commit d38eb66
Show file tree
Hide file tree
Showing 25 changed files with 333 additions and 172 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module.exports = {
'plugin:jest/recommended',
'prettier'
],
parserOptions: {
ecmaVersion: 13
},
plugins: ['vue', 'html', 'prettier', 'jest'],
rules: {
'no-console': 1,
Expand Down
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" : "JAGFx",
"general_skin_on_load" : "Scania",
"general_h-shift-layout" : "h-shifter",
"general_skin_locale" : "en-EN",
"general_job_remaining" : "due_date",
Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"ets2-dashboard-lib": "file:lib",
"file-saver": "~2.0.2",
"file-server": "^2.1.0",
"gsap": "^3.9.1",
"http-server": "^13.0.2",
"jquery": "^3.6.0",
"json-query": "^2.2.2",
Expand Down
5 changes: 2 additions & 3 deletions src/assets/scss/dashboard/scania/_display.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,11 @@
.value {
color: $cGreen;
margin-right: 1rem;
font-size: 2.5rem;
font-size: 3rem;
}

.unit {
font-size: 1.6rem;
margin-top: .5rem;
font-size: 3rem;
}
}
}
Expand Down
19 changes: 1 addition & 18 deletions src/components/dashboards/RdInfoDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,13 @@
}}
</div>

<!-- <div class="truck-odometer wrapper-area"><span>{{ $toFixed(unit_length( telemetry.truck.odometer, 'km', true, false ), 0 ) }}</span></div>-->
<!-- <div class="truck-cruiseControlSpeedRounded wrapper-area"><span>{{ telemetry.truck.cruiseControl.kph }}</span></div>-->
<div class="truck-displayedGear wrapper-area">
<span>{{ telemetry2.truck.gearDisplayed }}</span>
</div>
<!-- indicators -->
<!-- <div :class="{ 'yes': telemetry.truck.lights.blinker.left.active}" class="truck-blinkerLeftOn"></div>-->
<!-- <div :class="{ 'yes': telemetry.truck.lights.blinker.right.active }" class="truck-blinkerRightOn"></div>-->

<div class="job-remainingTime wrapper-area">
<span v-if="$jobRemainingTimeToDueDate()">{{
<span v-if="telemetry2.job.deliveryTimeIsSetToDuDate">{{
$dateTimeLocalized(
telemetry.job.expectedDeliveryTimestamp.value,
DATE_FORMAT_LONG,
Expand All @@ -207,19 +203,6 @@
<div class="trailer-name wrapper-area">
<span>{{ telemetry.trailer.model.name }}</span>
</div>

<!-- <div :class="{'yes': telemetry.trailer.attached}" class="trailer-attached"></div>-->
<!-- <div class="trailer-mass wrapper-area">-->
<!-- <span>{{ $toFixed(unit_weight( telemetry.job.cargo.mass, true, false ), 1 ) }}<span class="ton">{{ unit_weight( telemetry.job.cargo.mass, false ) }}</span></span></div>-->
<!-- <div class="trailer-name">{{ telemetry.job.cargo.name }}</div>-->
<!-- <div :class="{ 'yes': telemetry.truck.fuel.warning.enabled }" class="truck-fuelWarningOn"></div>-->
<!-- <div :class="{ 'yes': telemetry.truck.brakes.airPressure.warning.enabled }" class="truck-airPressureWarningOn"></div>-->

<!-- <div class="truck-retarderBrake">{{ telemetry.truck.brakes.retarder.level > 0 ? 'On' : 'Off' }}</div>-->
<!-- <div class="truck-oilTemperature">{{ telemetry.truck.engine.oilTemperature.value.toFixed(0) }}</div>-->
<!-- <div class="truck-batteryVoltage">{{ telemetry.truck.engine.batteryVoltage.warning.factor.toFixed(0) }}</div>-->
<!-- <div class="game-time wrapper-area"><span>{{ $formatDate( $telemetryData().game.time.unix ) }}</span></div>-->
<!-- <div :class="{ 'yes': telemetry.truck.brakes.airPressure.emergency.enabled }" class="truck-airPressureEmergencyOn"></div>-->
</div>
</div>
</Dashboard>
Expand Down
8 changes: 6 additions & 2 deletions src/components/dashboards/jagfx/Zone/JagfxJob.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
<i class="icon-time" />
</div>
<span
v-if="telemetry2.job.hasAnActiveJob && $jobRemainingTimeToDueDate()"
v-if="
telemetry2.job.hasAnActiveJob &&
telemetry2.job.deliveryTimeIsSetToDuDate
"
>{{
$dateTimeLocalized(
telemetry2.job.expectedDeliveryTime,
Expand All @@ -55,7 +58,8 @@
>
<span
v-else-if="
telemetry2.job.hasAnActiveJob && !$jobRemainingTimeToDueDate()
telemetry2.job.hasAnActiveJob &&
!telemetry2.job.deliveryTimeIsSetToDuDate
"
>{{ telemetry2.job.remainingDeliveryTime }}</span
>
Expand Down
14 changes: 1 addition & 13 deletions src/components/dashboards/jagfx/Zone/JagfxTrailer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,13 @@
<span v-else class="w-100 text-center">{{ $t('N/A') }}</span>
</small>
<div v-if="telemetry2.trailer.hasATrailer" class="damage left">
{{ $trailerDamage() }} %
{{ telemetry2.trailer.damage }} %
</div>
<div v-else class="damage left">
{{ $t('N/A') }}
</div>
</div>
<!--<div class="trailer-wear text-center">
<div class="damage" v-for="key in Object.keys(damage)">
<b>{{key}}</b><span>{{(100 * damage[key]).toFixed()}}%</span>
</div>
</div>-->
</div>
<!--<div><b>Brand:</b><span>{{brand.name || brand.id}}</span></div>
<div><b>Model:</b><span>{{telemetry.trailer.model.name || telemetry.trailer.model.id}}</span></div>
<div><b>Accessory ID:</b><span>{{accessoryId}}</span></div>
<div><b>Body type:</b><span>{{bodyType}}</span></div>
<div><b>Chain type:</b><span>{{chainType}}</span></div>
<div><b>License plate:</b><span>{{telemetry.trailer.licensePlate.value}} ({{telemetry.trailer.licensePlate.country.name}})</span></div>
<div><b>Attached:</b><span>{{attached ? 'YES' : 'NO'}}</span></div>-->
</div>
</template>

Expand Down
19 changes: 2 additions & 17 deletions src/components/dashboards/jagfx/Zone/JagfxTruck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
<div class="theTruk">
<div class="truck-data">
<span />
<!-- <img alt="" class="brand" v-bind:src="`img/Truck/brands/${brand.id}.svg`">-->
<!--<img src="../assets/Truck/brands/volvo.svg" class="brand" alt="">-->
<small>
<span>{{ telemetry2.truck.modelName }}</span>
</small>
<!--<span>
{{unit_consumption( telemetry.truck.fuel.avgConsumption )}} l/100
</span>-->
</div>
<div class="truck-stats">
<div class="damage right">
<span>{{ $truckDamage() }} %</span>
<span>{{ telemetry2.truck.damage }} %</span>
</div>
<span>
<span class="licencePlate right">
Expand All @@ -31,16 +26,6 @@
</div>
</div>

<!--<div class="truck-wear text-center capitalized">
&lt;!&ndash;<div class="telemetry.truck.damage" v-for="key in Object.keys(telemetry.truck.damage)">
<b>{{key}}</b>
<span>{{Math.round(100 * telemetry.truck.damage[key])}}%</span>
</div>&ndash;&gt;
<div class="telemetry.truck.damage">
<span>{{Math.floor(100 * chassis.telemetry.truck.damage)}}%</span>
</div>
</div>-->

<Map
v-if="config('jagfx_elements_right_map')"
:embedded="true"
Expand Down Expand Up @@ -104,7 +89,7 @@
class="default"
>
<span>
in {{ $nextRestStop(telemetry2.navigation.nextRestStopTime) }}
in {{ $nextRestStopFormater(telemetry2.navigation.nextRestStopTime) }}
</span>
<div class="round">
<i class="icon-rest_stop" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboards/scania/ScaniaDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ScaniaIndicatorSymbols />
</div>

<ScaniaDisplay />
<ScaniaDisplay v-if="telemetry2.truck.ignitionIsTurnedOn" />
</div>
</Dashboard>
</template>
Expand Down
28 changes: 14 additions & 14 deletions src/components/dashboards/scania/ScaniaGauges.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
classCSS: 'truck-speed',
type: 'meter',
value: telemetry2.truck.speed,
min: 2.77778,
max: 36.1111,
minAngle: -122,
maxAngle: 123
min: $convertToUnit(2.77778, 'unit_speed'),
max: $convertToUnit(36.1111, 'unit_speed'),
minAngle: -118,
maxAngle: 118
}"
/>
<Cadran
v-bind="{
classCSS: 'truck-engineRpm',
type: 'meter',
value: telemetry2.truck.rpm / 100,
min: 3,
max: 27,
minAngle: -122,
maxAngle: 122
value: telemetry2.truck.rpm,
min: 300,
max: 2700,
minAngle: -118,
maxAngle: 118
}"
/>
<Cadran
Expand All @@ -38,10 +38,10 @@
classCSS: 'truck-waterTemperature',
type: 'meter',
value: telemetry2.truck.engineWaterTemperature,
min: 40,
max: 100,
min: $convertToUnit(40, 'unit_degrees'),
max: $convertToUnit(100, 'unit_degrees'),
minAngle: -55,
maxAngle: 40
maxAngle: 55
}"
/>
<Cadran
Expand All @@ -50,7 +50,7 @@
type: 'meter',
value: telemetry2.truck.oilPressure,
min: 0,
max: 116,
max: $convertToUnit(116, 'unit_pressure'),
minAngle: -53,
maxAngle: 53
}"
Expand All @@ -61,7 +61,7 @@
type: 'meter',
value: telemetry2.truck.fuelAverageConsumption,
min: 0,
max: 120,
max: $convertToUnit(120, 'unit_consumption'),
minAngle: -56,
maxAngle: 57
}"
Expand Down
7 changes: 6 additions & 1 deletion src/components/dashboards/scania/display/ScaniaDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@
>
<!-- Rest time -->
<div class="value">
{{ $nextRestStop(telemetry2.navigation.nextRestStopTime, 'HH:mm') }}
{{
$nextRestStopFormater(
telemetry2.navigation.nextRestStopTime,
'HH:mm'
)
}}
</div>
<div class="unit">h</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions src/components/dashboards/scania/symbols/ScaniaIndicatorSymbols.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,67 @@
<div>
<!-- Line 1 -->
<div
v-if="telemetry2.truck.hasErrors || $truckElectricOn"
v-if="telemetry2.truck.hasErrors"
class="truck-stopWarning flex-area symbol r1 c1 red"
>
<i class="icon-scania-warning_red" />
</div>
<div
v-if="telemetry2.truck.hasWarnings || $truckElectricOn"
v-if="telemetry2.truck.hasWarnings"
class="truck-checkWarning flex-area symbol r1 c2 yellow"
>
<i class="icon-scania-warning_yellow" />
</div>

<!-- Line 2 -->
<div
v-if="telemetry2.symbols.brakePressureIsActive || $truckElectricOn"
v-if="telemetry2.symbols.brakePressureIsActive"
class="truck-brake-pressure flex-area symbol r2 c1 red"
>
<i class="icon-scania-break-pressure_red_yellow" />
</div>
<div
v-if="telemetry2.symbols.parkingBrakeIsEnabled || $truckElectricOn"
v-if="telemetry2.symbols.parkingBrakeIsEnabled"
class="truck-parkBrake flex-area symbol r2 c2 red"
>
<i class="icon-scania-parking-break_red" />
</div>
<div
v-if="telemetry2.symbols.retarderIsActive || $truckElectricOn"
v-if="telemetry2.symbols.retarderIsActive"
class="retarder flex-area symbol r2 c4 green"
>
<i class="icon-scania-retarder_green" />
</div>

<!-- Line 3 -->
<div
v-if="telemetry2.truck.hasEngineWarning || $truckElectricOn"
v-if="telemetry2.truck.hasEngineWarning"
class="engine-failure flex-area symbol r3 c2 yellow"
>
<i class="icon-scania-engine-failure_yellow" />
</div>
<div
v-if="telemetry2.symbols.differentialIsLocked || $truckElectricOn"
v-if="telemetry2.symbols.differentialIsLocked"
class="truck-differentialLock flex-area symbol r3 c4 yellow"
>
<i class="icon-scania-differential-lock_yellow" />
</div>

<!-- Line 4 -->
<div
v-if="$truckElectricOn"
v-if="telemetry2.truck.ignitionStart"
class="driver-safty-belt flex-area symbol r4 c2 red"
>
<i class="icon-scania-driver-safty-belt_red" />
</div>
<div
v-if="telemetry2.symbols.truckLiftAxleIsEnabled || $truckElectricOn"
v-if="telemetry2.symbols.truckLiftAxleIsEnabled"
class="tractor-tag-axle-raised flex-area symbol r4 c3 yellow"
>
<i class="icon-scania-tractor-tag-axle-raised_yellow" />
</div>
<div
v-if="telemetry2.symbols.trailerLiftAxleIsEnabled || $truckElectricOn"
v-if="telemetry2.symbols.trailerLiftAxleIsEnabled"
class="trailer-tag-axle-raised flex-area symbol r4 c4 yellow"
>
<i class="icon-scania-trailer-tag-axle-raised_yellow" />
Expand Down
Loading

0 comments on commit d38eb66

Please sign in to comment.