From 289fc7c9f9b06b544ad893a2239ac716f505787c Mon Sep 17 00:00:00 2001 From: JAGFx Date: Fri, 11 Feb 2022 22:27:39 +0100 Subject: [PATCH] :lipstick: #78 add warning and error message Signed-off-by: JAGFx --- lib/sdk/scs_sdk_plugin_parsed_data.json | 4 +- src/assets/scss/dashboard/_scania.scss | 2 +- .../scania/{_scania-bar.scss => _bar.scss} | 12 +- .../dashboard/scania/_display-message.scss | 21 +++ .../scss/dashboard/scania/_display.scss | 42 ++++- src/assets/scss/dashboard/scania/_menu.scss | 8 +- .../dashboards/scania/ScaniaBar.vue | 6 +- .../scania/display/ScaniaDisplay.vue | 31 +++- .../scania/display/ScaniaDisplayMessage.vue | 21 +++ .../scania/display/ScaniaMainMenu.vue | 163 +++--------------- .../menu/ScaniaDrivingAssistanceMenu.vue | 65 +++++++ .../menu/ScaniaInstantaneousDataMenu.vue | 57 ++++++ .../menu/ScaniaVehicleInformationsMenu.vue | 28 +++ .../scania/symbols/ScaniaIndicatorSymbols.vue | 18 +- src/store/index.js | 4 +- src/store/modules/_dashboard.js | 65 +++++++ 16 files changed, 384 insertions(+), 163 deletions(-) rename src/assets/scss/dashboard/scania/{_scania-bar.scss => _bar.scss} (89%) create mode 100644 src/assets/scss/dashboard/scania/_display-message.scss create mode 100644 src/components/dashboards/scania/display/ScaniaDisplayMessage.vue create mode 100644 src/components/dashboards/scania/display/menu/ScaniaDrivingAssistanceMenu.vue create mode 100644 src/components/dashboards/scania/display/menu/ScaniaInstantaneousDataMenu.vue create mode 100644 src/components/dashboards/scania/display/menu/ScaniaVehicleInformationsMenu.vue create mode 100644 src/store/modules/_dashboard.js diff --git a/lib/sdk/scs_sdk_plugin_parsed_data.json b/lib/sdk/scs_sdk_plugin_parsed_data.json index 3cd17c62..08f369ac 100644 --- a/lib/sdk/scs_sdk_plugin_parsed_data.json +++ b/lib/sdk/scs_sdk_plugin_parsed_data.json @@ -610,7 +610,7 @@ "enabled" : false }, "liftAxle" : { - "enabled" : false, + "enabled" : true, "indicator" : { "enabled" : false } @@ -1049,7 +1049,7 @@ "total" : 0.04498915374279022 }, "liftAxle" : { - "enabled" : false, + "enabled" : true, "indicator" : { "enabled" : false } diff --git a/src/assets/scss/dashboard/_scania.scss b/src/assets/scss/dashboard/_scania.scss index d0fab547..ab03b20d 100644 --- a/src/assets/scss/dashboard/_scania.scss +++ b/src/assets/scss/dashboard/_scania.scss @@ -11,7 +11,7 @@ .scania-dash { @import "scania/display"; @import "scania/menu"; - @import "scania/scania-bar"; + @import "scania/bar"; @import "scania/symbols"; .flex-area { diff --git a/src/assets/scss/dashboard/scania/_scania-bar.scss b/src/assets/scss/dashboard/scania/_bar.scss similarity index 89% rename from src/assets/scss/dashboard/scania/_scania-bar.scss rename to src/assets/scss/dashboard/scania/_bar.scss index a1acaa2e..f468292e 100644 --- a/src/assets/scss/dashboard/scania/_scania-bar.scss +++ b/src/assets/scss/dashboard/scania/_bar.scss @@ -9,10 +9,12 @@ @import "variable"; .scania-bar { + margin: 1rem 0; + .icon { font-size: 3.5rem; line-height: 0; - margin-left: 1rem; + margin: 0 .5rem; } .line { @@ -28,8 +30,8 @@ .square { background: #fff; color: transparent; - height: .7rem; - width: 1.8rem; + height: 1rem; + width: 1.85rem; margin: .15rem; &:first-child { margin-left: 0 } @@ -39,7 +41,7 @@ .labels { .start, .middle, .end { - font-size: 1.3rem; + font-size: 1.5rem; background: $cGrey; width: 3rem; text-align: center; @@ -60,7 +62,7 @@ } .value, .unit{ - font-size: 1.6rem; + font-size: 2rem; height: 1.5rem; line-height: 1.2rem; } diff --git a/src/assets/scss/dashboard/scania/_display-message.scss b/src/assets/scss/dashboard/scania/_display-message.scss new file mode 100644 index 00000000..70f3333d --- /dev/null +++ b/src/assets/scss/dashboard/scania/_display-message.scss @@ -0,0 +1,21 @@ +/** + * @author: Emmanuel SMITH + * project: ets2-dashboard-skin + * file: _display-message.scss + * Date: 11/02/2022 + * Time: 21:28 + */ + +@import "variable"; + +.display-message { + color: $cGrey; + font-size: 2.5rem; + width: 437px; + max-width: 437px; + height: 346px; + border-bottom: 3px solid $cGreyLight; + + &.warning { background: $cYellow; } + &.error { background: $cRed } +} \ No newline at end of file diff --git a/src/assets/scss/dashboard/scania/_display.scss b/src/assets/scss/dashboard/scania/_display.scss index ccd1ae27..94d0ff00 100644 --- a/src/assets/scss/dashboard/scania/_display.scss +++ b/src/assets/scss/dashboard/scania/_display.scss @@ -12,6 +12,9 @@ position: fixed; top: 149px; left: 709px; + width: 27.2rem; + + @import "display-message"; .gearbox-info{ background: $cGrey; @@ -82,7 +85,6 @@ background-position: center; cursor: pointer; opacity: 1; - z-index: 35; height: 346px; border-bottom: 3px solid $cGreyLight; } @@ -93,13 +95,49 @@ z-index: 2; border-bottom: 3px solid $cGreyLight; - .truck-fuelWarning { + .item { width: 4.5rem; height: 4.5rem; line-height: 0; font-size: 3rem; + } + + .truck-fuelWarning { color: $cYellow; } + + .message { + position: relative; + z-index: 40; + border-radius: 0 0 1rem 0; + font-size: 3.5rem; + color: $cGrey; + + &:before{ + position: absolute; + content: ""; + background: $cYellow; + height: 0.5rem; + top: -0.4rem; + width: 100%; + } + + &.warning { + background: $cYellow; + + &:before{ + background: $cYellow; + } + } + + &.error { + background: $cRed; + + &:before{ + background: $cRed; + } + } + } } .programmable-field-2 { diff --git a/src/assets/scss/dashboard/scania/_menu.scss b/src/assets/scss/dashboard/scania/_menu.scss index 5cadf621..d9052f6d 100644 --- a/src/assets/scss/dashboard/scania/_menu.scss +++ b/src/assets/scss/dashboard/scania/_menu.scss @@ -15,8 +15,6 @@ max-width: 437px; height: 346px; border-bottom: 3px solid $cGreyLight; - opacity: 1; - z-index: 30; .menuSelectorItem { i { @@ -47,11 +45,9 @@ .drivingAssistanceMenu { background-color: $cGrey; - opacity: 1; z-index: 19; position: relative; - .item { font-size: 2.5rem; padding: 0 1rem; @@ -74,7 +70,6 @@ .vehicleInformationsMenu { background-image: url("/img/dashboard/scania/dashMenu.png"); - opacity: 1; z-index: 19; position: relative; @@ -89,11 +84,10 @@ .instantaneousData { background-color: $cGrey; //background-image: url("/img/dashboard/scania/dashMenu2.png"); - opacity: 1; z-index: 19; .unit { color: #FFF; } } -} \ No newline at end of file +} diff --git a/src/components/dashboards/scania/ScaniaBar.vue b/src/components/dashboards/scania/ScaniaBar.vue index 1eebfc77..fdeefd00 100644 --- a/src/components/dashboards/scania/ScaniaBar.vue +++ b/src/components/dashboards/scania/ScaniaBar.vue @@ -27,9 +27,9 @@
- {{ getValue() }} + {{ unit }}
@@ -91,7 +91,7 @@ export default { return 8; } - return this.displayIcon ? 8 : 10; + return this.displayIcon ? 6 : 8; }, percentage() { return (this.value * this.maxWidth()) / this.max; diff --git a/src/components/dashboards/scania/display/ScaniaDisplay.vue b/src/components/dashboards/scania/display/ScaniaDisplay.vue index cd1d00ef..fdc9ce42 100644 --- a/src/components/dashboards/scania/display/ScaniaDisplay.vue +++ b/src/components/dashboards/scania/display/ScaniaDisplay.vue @@ -73,20 +73,35 @@
- + +
-
+
+
+ +
@@ -130,17 +145,25 @@ diff --git a/src/components/dashboards/scania/display/ScaniaDisplayMessage.vue b/src/components/dashboards/scania/display/ScaniaDisplayMessage.vue new file mode 100644 index 00000000..2f655ab8 --- /dev/null +++ b/src/components/dashboards/scania/display/ScaniaDisplayMessage.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/components/dashboards/scania/display/ScaniaMainMenu.vue b/src/components/dashboards/scania/display/ScaniaMainMenu.vue index 21b9d0a9..2740935f 100644 --- a/src/components/dashboards/scania/display/ScaniaMainMenu.vue +++ b/src/components/dashboards/scania/display/ScaniaMainMenu.vue @@ -4,7 +4,10 @@ >
- @@ -12,7 +15,10 @@ v-if="subMenu === null" class="w-100 d-flex justify-content-around align-items-center" > - - -
-
-
- - tot -
-
-
-
-
{{ unit_length(1, 'km', false, true) }}
-
-
- -
-
- - ave -
-
-
-
-
{{ unit_speed(100, false, true) }}
-
-
- -
-
- - ave -
-
-
- {{ - unit_consumption( - telemetry.truck.fuel.avgConsumption, - true, - false - ).toFixed(1) - }} -
-
- {{ - unit_consumption(telemetry.truck.fuel.avgConsumption, false, true) - }} -
-
-
-
- - - -
- -
- 3 -
-
-
- 4 -
-
- 5 -
-
- -.- -
-
-
- - - -
- - - - - - - - - -
- +
diff --git a/src/components/dashboards/scania/display/menu/ScaniaInstantaneousDataMenu.vue b/src/components/dashboards/scania/display/menu/ScaniaInstantaneousDataMenu.vue new file mode 100644 index 00000000..5f96496d --- /dev/null +++ b/src/components/dashboards/scania/display/menu/ScaniaInstantaneousDataMenu.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/components/dashboards/scania/display/menu/ScaniaVehicleInformationsMenu.vue b/src/components/dashboards/scania/display/menu/ScaniaVehicleInformationsMenu.vue new file mode 100644 index 00000000..fe677742 --- /dev/null +++ b/src/components/dashboards/scania/display/menu/ScaniaVehicleInformationsMenu.vue @@ -0,0 +1,28 @@ + + + diff --git a/src/components/dashboards/scania/symbols/ScaniaIndicatorSymbols.vue b/src/components/dashboards/scania/symbols/ScaniaIndicatorSymbols.vue index 7e9deb6d..72bc57e0 100644 --- a/src/components/dashboards/scania/symbols/ScaniaIndicatorSymbols.vue +++ b/src/components/dashboards/scania/symbols/ScaniaIndicatorSymbols.vue @@ -9,7 +9,13 @@
-
+
-
+
-
+
diff --git a/src/store/index.js b/src/store/index.js index 2df2d863..0a745dc6 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -13,6 +13,7 @@ import skins from '@/store/modules/_skins'; import debug from '@/store/modules/_debug'; import event from '@/store/modules/_event'; import i18n from '@/store/modules/_i18n'; +import dashboard from '@/store/modules/_dashboard'; import Vue from 'vue'; import Vuex from 'vuex'; @@ -28,7 +29,8 @@ export default new Vuex.Store({ app, debug, event, - i18n + i18n, + dashboard }, strict: env }); diff --git a/src/store/modules/_dashboard.js b/src/store/modules/_dashboard.js new file mode 100644 index 00000000..c3a9443d --- /dev/null +++ b/src/store/modules/_dashboard.js @@ -0,0 +1,65 @@ +/** + * @author: Emmanuel SMITH + * project: ets2-dashboard-skin + * file: dashboard.js + * Date: 11/02/2022 + * Time: 19:10 + */ + +// initial state +const state = () => ({ + scania: { + messages: [ + //{ + // id: 'truck.brakes.airPressure.warning.enabled', + // type: 'warning', + // icon: 'icon-scania-break-pressure_red_yellow', + // message: 'The awesome message' + //} + ] + } +}); + +// getters +const getters = { + hasScaniaMessage: (state) => state.scania.messages.length > 0, + getScaniaMessages: (state) => state.scania.messages, + getLatestScaniaMessage: (state) => { + return state.scania.messages[state.scania.messages.length - 1]; + }, + hasScaniaWarningMessage: (state) => { + return ( + state.scania.messages.filter((message) => message.type === 'warning') + .length > 0 + ); + }, + hasScaniaErrorMessage: (state) => { + return ( + state.scania.messages.filter((message) => message.type === 'error') + .length > 0 + ); + } +}; + +// actions +const actions = {}; + +// mutations +const mutations = { + addScaniaMessage(state, message) { + state.scania.messages.push(message); + }, + removeScaniaMessage(state, icon) { + state.scania.messages = state.scania.messages.filter( + (message) => message.icon !== icon + ); + } +}; + +export default { + namespaced: true, + state, + getters, + actions, + mutations +};