Skip to content

Commit

Permalink
v5.6 🐧
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevelopment committed Mar 15, 2018
1 parent c33132f commit 449d769
Show file tree
Hide file tree
Showing 82 changed files with 1,380 additions and 1,007 deletions.
171 changes: 137 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
# MZD_Speedometer v5
### A Versatile Speedometer App For The MZD Infotainment System

[Changelog](https://github.com/Trevelopment/MZD_Speedometer/changelog.md "changelog")

### A Versatile Speedometer App For The MZD Infotainment System

> **2 Speedometers in 1 With Multiple Variants:**
> - Classic MZD Speedometer (By Diginix)
> - Basic Analog Speedometer With Rotating Compass
> - Modded Digital & Analog Speedometer With Toggle Controls
> - Digital Bar Speedometers
> - Value Positions Fully Customizable
>
> - Classic MZD Speedometer
> - Basic Analog Speedometer With Rotating Compass
> - Modded Digital & Analog Speedometer With Toggle Controls
> - Change Colors, Text Size, Table Values
> - Digital Bar Speedometers
> - Value Positions [Fully Customizable](config/speedometer-config.js)
> - [Customizable Themes](config/barThemes.css)
> - [Remap Multicontroller Functions](config/speedometer-controls.js) For Both Speedometers
## How To Install:
- Download a release zip from [releases](https://github.com/Trevelopment/MZD_Speedometer/releases) page or <http://speedo.mazdatweaks.win>
- Unzip onto blank FAT32 formatted USB drive
- Connect to car USB port and wait for installation to begin (2 - 20 minutes)
- Choose options when prompted by installer
- For more info visit [MazdaTweaks.com](https://mazdatweaks.com)

- Download a release zip from [releases](https://github.com/Trevelopment/MZD_Speedometer/releases) page or <http://speedo.mazdatweaks.win>
- Unzip onto blank FAT32 formatted USB drive
- Connect to car USB port and wait for installation to begin (2 - 20 minutes)
- Choose options when prompted by installer
- For more info visit [MazdaTweaks.com](https://mazdatweaks.com)

![MZD Speedometers](MZD_Speedo.gif)

## How To Customize
> To customize edit the configuration file `/config/speedometer-config.js`

To customize edit the configuration file [speedometer-config.js](/config/speedometer-config.js)

##### Example Configuration:

```js
/** speedometer-config.js ************************************************************** *\
|* ========================= *|
Expand All @@ -34,7 +47,6 @@
|* To Hide a Value = [1, 1, 0] (Any bottom row position 0 will hide the value) *|
|* To Change Bottom Row Push Command Knob ("Select") *|
|* Note: Only numbers inside [] brackets determine position, order in this list DOES NOT *|
|* ******* DELETE THIS CONFIG FILE TO REUSE YOUR CURRENT CONFIG-SPEEDOMETER.JS ********* *|
\* ************************************************************************************* */
var spdBottomRows = 3; //Number of Bottom Rows
var spdTbl = { // Example Layout:
Expand Down Expand Up @@ -136,26 +148,117 @@ var SORV = {
speedAnimation: false,
};
```
### Controls

### Controls - [speedometer-controls.js](/config/speedometer-controls.js)

> (Long Hold Is 1.5 Seconds)
- (Long) Up: Change from Classic To Bar Spedometers (Both)
- (Short) Left: Toggle Speedometer Background (Both)
- Digital Bar
- (Short) Select: Toggle Next Bottom Row
- (Short) Up: Toggle mph - km/h
- (Short) Down: Toggle Speed Bar: Vehicle Speed - RPM
- (Short) Right: In mph Toggle Temp (C - F) and km/h Toggle Fuel Efficiency (L/100km - km/L)
- (Long) Down: Hide / Show Speed Bar
- (Long) Left: TBD (Same as Short Click)
- (Long) Right: TBD (Same as Short Click)
- (Long) Select: TBD (Same as Short Click)
- Classic (Modded)
- (Short) Select: Change between Analog w/ Compass & Digital
- (Short) Up: Toggle Alternate Values (Temperatures and Gear Position)
- (Short) Down: Increase Value Table Font Size
- (Short) Right: Toggle mph - km/h
- (Long) Down: Toggle Modded - Basic Speedometers (Basic mode has no short click toggles)
- (Long) Left: TBD (Same as Short Click)
- (Long) Right: TBD (Same as Short Click)
- (Long) Select: TBD (Same as Short Click)
```js
/** speedometer-controls.js ************************************************************** *\
|* =========================
|* Speedometer Controls - Used to map multicontroller "clicks" to toggle actions/events
|* =========================
|* Numbers may be used multiple times. Ex: set all directions under bar to 4
|* and all multicontroller directions will toggle the background
|* KEY:
|* Both Speedometers: (Same by default but can be set independently)
|* 1: (Default: up) - Toggle Speed Unit (mph-km/h)
|* 3: (Default: right) - Toggle Temp C-F (mph mode) Fuel Eff L/km-km/100L (km/h mode)
|* 4: (Default: left) - Toggle Background
|* 8: (Default: hold.right) - Reset Trip Time, Distance, Top/Ave Speed
|* 9: (Default: hold.left) - Change Color Theme
|* Bar (Colored Speed Bar w/ Bottom Rows):
|* 0: (Default: select) - Show Next Bottom Row
|* 2: (Default: down) - Toggle Speed Bar (VehSpeed-RPM)
|* 5: (Default: hold.select) - Reset Layout
|* 6: (Default: hold.up) - Switch To Classic Speedometer
|* 7: (Default: hold.down) - Hide/Show Speed Bar
|* Classic (Analog w/ Compass):
|* 0: (Default: select) - Toggle Speed (Analog-Digital)
|* 2: (Default: down) - Toggle Larger Text
|* 5: (Default: hold.select) - Toggle Alternate Values (Time-Temp)
|* 6: (Default: hold.up) - Switch To Bar Speedometer
|* 7: (Default: hold.down) - Basic Speedo - Analog & Disables Toggles Except Itself To Toggle Back
|* ************************************************************************************* *|
|* null: To Disable Multicontroller Key (do not leave any blank!!!)
\* ************************************************************************************* */
var spdBtn = {
bar: { // Controls for the Bar Speedometer context
select: 0,
up: 1,
down: 2,
right: 3,
left: 4,
hold: { // Used when the click is held for 2 seconds
select: 5,
up: 6,
down: 7,
right: 8,
left: 9,
}
},
classic: { // Controls for the Classic (Analog) Speedometer context
select: 0,
up: 1,
down: 2,
right: 3,
left: 4,
hold: { // Used when the click is held for 2 seconds
select: 5,
up: 6,
down: 7,
right: 8,
left: 9,
}
}
};
```

### Custom Themes For Bar Speedometer - [barThemes.css](/config/barThemes.css)

```css
/* barThemes.css - Customize Bar Speedometer Color Themes
* Any Valid CSS Colors Can Be Used Examples:
* Names - Ex: blue;
* Hex - Ex: #00ff66;
* RGB - Ex: rgb(100, 255, 0);
* HSL - Ex: hsl(248, 53%, 58%);
* For More Info On CSS Colors Visit https://www.w3schools.com/colors/colors_names.asp
* Each Theme Has 3 Colors In This Order:
* Primary - Color of Values
* Secondary - Color of Labels/Units
* Border-Color - Color of the Box Borders
* If you know CSS then have fun with it
* CSS is a very forgiving language any errors in this file will be ignored
*/

/* Theme #1 */

#speedBarContainer.theme1 #vehdataMainDiv fieldset div, #speedBarContainer.theme1 #vehdataMainDiv [class*="vehDataMain"].pos0 div {
/* Primary */
color: aquamarine;
}

#speedBarContainer.theme1 #vehdataMainDiv [class*="vehDataMain"].pos0 legend .spunit span, #speedBarContainer.theme1 #vehdataMainDiv fieldset {
/* Secondary */
color: #64bfff;
/* Border-Color */
border-color: blue;
}

/* Theme #2 */

#speedBarContainer.theme2 #vehdataMainDiv fieldset div, #speedBarContainer.theme2 #vehdataMainDiv [class*="vehDataMain"].pos0 div {
color: #3fff17;
}

#speedBarContainer.theme2 #vehdataMainDiv [class*="vehDataMain"].pos0 legend .spunit span, #speedBarContainer.theme2 #vehdataMainDiv fieldset {
color: hsl(248, 53%, 58%);
border-color: rgb(100, 0, 12);
}

/* Theme #3 */
...
...
...
```
35 changes: 35 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Speedometer Changelog (Since v5.5 before that it was 2 different speedometers)

#### v5.5

- Analog, Modded and Bar Speedometers are now All In One
- All options are available and will be applied to the proper Speedometer
- Choose which speedometer to start with by default (if starting with Bar Speedometer other options will still determine the starting state of the Classic Speedometer)
- The speedometer-config.js file now has all the options, set a variable to determine if override values are used or installed options.
- Invalid Values Show "---" Such As Gear Position/Lever for Manual Transmissions
- Toggles will Show The Action In A Statusbar Notification
- Hold "Up" on multicontroller to switch between Classic and Bar Speedometer Mode
- Hold "Down" in Classic mode to switch between Basic and Modded Speedometer (Basic is only analog with no toggles except long holds to change to Modded or Bar Speedometer)
- Modded Speedometer (in Classic mode):
- Single click "Up" to increase size of values
- Multicontroller "Select" toggles between Digital and Analog speed
- Single click "Down" to show alternate values
- Bar Speedometer:
- Configure The Amount of Bottom Rows in "speedometer-config.js" (Default 4)
- Hold "Down" to show/hide speed bar
- **TAP Any 2 Values To Swap Their Positions!**
- Any Values Can Be Swapped Even The Main
- When The Main Value Is Swapped An SBN Will Show With The Value Name
- Tap Below The Bottom Row To Swap Hidden Values In Other Rows
- Tap Selected Value Again To Cancel

#### v5.6

- Bar Speedometer layout changes are remembered until shutdown
- Exiting or changing speedometers no longer resets layout to default
- Hold "Select" on the multicontroller to reset to your default layout
- Change Between 5 Configurable Color Themes (hold.left)
- Remap Multicontroller Functions [speedometer-controls.js](config/speedometer-controls.js)
- All controls are able to be customized in speedometer-controls.js
- Custom themes for bar speedometer with CSS (mostly colors but other CSS tweaks can be applied)
- Set Colors In [barThemes.css](config/barThemes.css)
65 changes: 65 additions & 0 deletions config/barThemes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* barThemes.css - Customize Bar Speedometer Color Themes
* Any Valid CSS Colors Can Be Used Examples:
* Names - Ex: blue;
* Hex - Ex: #00ff66;
* RGB - Ex: rgb(100, 255, 0);
* HSL - Ex: hsl(248, 53%, 58%);
* For More Info On CSS Colors Visit https://www.w3schools.com/colors/colors_names.asp
* Each Theme Has 3 Colors In This Order:
* Primary - Color of Values
* Secondary - Color of Labels/Units
* Border-Color - Color of the Box Borders
* If you know CSS then have fun with it
* CSS is a very forgiving language any errors in this file will be ignored
*/

/* Theme #1 */

#speedBarContainer.theme1 #vehdataMainDiv fieldset div, #speedBarContainer.theme1 #vehdataMainDiv [class*="vehDataMain"].pos0 div {
/* Primary */
color: aquamarine;
}
#speedBarContainer.theme1 #vehdataMainDiv [class*="vehDataMain"].pos0 legend .spunit span, #speedBarContainer.theme1 #vehdataMainDiv fieldset {
/* Secondary */
color: #64bfff;
/* Border-Color */
border-color: blue;
}
/* Theme #2 */

#speedBarContainer.theme2 #vehdataMainDiv fieldset div, #speedBarContainer.theme2 #vehdataMainDiv [class*="vehDataMain"].pos0 div {
color: #3fff17;
}
#speedBarContainer.theme2 #vehdataMainDiv [class*="vehDataMain"].pos0 legend .spunit span, #speedBarContainer.theme2 #vehdataMainDiv fieldset {
color: #ff8181;
border-color: #ffca00;
}
/* Theme #3 */

#speedBarContainer.theme3 #vehdataMainDiv fieldset div, #speedBarContainer.theme3 #vehdataMainDiv [class*="vehDataMain"].pos0 div {
color: rgb(237, 75, 255);
}
#speedBarContainer.theme3 #vehdataMainDiv [class*="vehDataMain"].pos0 legend .spunit span, #speedBarContainer.theme3 #vehdataMainDiv fieldset {
color: #52ff5a;
border-color: #e4c300;
}
/* Theme #4 */

#speedBarContainer.theme4 #vehdataMainDiv fieldset div, #speedBarContainer.theme4 #vehdataMainDiv [class*="vehDataMain"].pos0 div {
color: hsl(258, 100%, 75%);
}
#speedBarContainer.theme4 #vehdataMainDiv [class*="vehDataMain"].pos0 legend .spunit span, #speedBarContainer.theme4 #vehdataMainDiv fieldset {
color: hsl(292, 100%, 61%);
border-color: hsl(199, 80%, 40%);
/* Theme Tweak: Rounded Boxes*/
border-radius: 25px;
}
/* Theme #5 */

#speedBarContainer.theme5 #vehdataMainDiv fieldset div, #speedBarContainer.theme5 #vehdataMainDiv [class*="vehDataMain"].pos0 div {
color: #FF0000;
}
#speedBarContainer.theme5 #vehdataMainDiv [class*="vehDataMain"].pos0 legend .spunit span, #speedBarContainer.theme5 #vehdataMainDiv fieldset {
color: transparent;
border-color: transparent;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function _speedometerApp(uiaId) {
* Called just after the app is instantiated by framework.
* All variables local to this app should be declared in this function
*/
_speedometerApp.prototype.appInit = function () {
_speedometerApp.prototype.appInit = function() {
log.debug("_speedometerApp appInit called...");
//Context table
//@formatter:off
Expand All @@ -51,7 +51,7 @@ _speedometerApp.prototype.appInit = function () {
"templatePath": "apps/_speedometer/templates/SpeedBar",
"readyFunction": this._SpeedoContextReady.bind(this),
"contextInFunction": this._BarCtxtInFunction.bind(this),
"contextOutFunction": this._BarCtxtOutFunction.bind(this)
"contextOutFunction": this._BarCtxtOutFunction.bind(this),
} // end of "SpeedBar"
}; // end of this.contextTable object
//@formatter:on
Expand All @@ -68,21 +68,24 @@ _speedometerApp.prototype.appInit = function () {
* CONTEXT CALLBACKS
* =========================
*/
_speedometerApp.prototype._StartContextReady = function () {
_speedometerApp.prototype._StartContextReady = function() {
barSpeedometerMod ? aioMagicRoute("_speedometer", "SpeedBar") : aioMagicRoute("_speedometer", "SpeedClassic");
};
_speedometerApp.prototype._SpeedoContextReady = function () {
_speedometerApp.prototype._SpeedoContextReady = function() {
framework.common.setSbDomainIcon("apps/_speedometer/IcnSbnSpeedometer.png");
}
_speedometerApp.prototype._SpeedCtxtInFunction = function () {
if (barSpeedometerMod) {
LoadSpeedBarLayout();
}
};
_speedometerApp.prototype._SpeedCtxtInFunction = function() {
barSpeedometerMod = false;
}
_speedometerApp.prototype._BarCtxtInFunction = function () {
};
_speedometerApp.prototype._BarCtxtInFunction = function() {
barSpeedometerMod = true;
}
_speedometerApp.prototype._BarCtxtOutFunction = function () {
};
_speedometerApp.prototype._BarCtxtOutFunction = function() {
//TODO: Save changed layout to load when bar speedometer is reopened
}
};

/**
* =========================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ var spdTbl = {
};

/* ************************************************** */
/* Set overRideSpeed to true to use your values below */
/* Set this to true to use your values below ******** */
/* If this is false the following values are not used */
var overRideSpeed = false;
var overRideSpeed=false;
/* ************************************************** */
/* * Start OverRide Variables *********************** */
/* ****************** Start OverRide Variables ****** */
var SORV = {
// Set the language for the speedometer
// Available EN, ES, DE, PL, SK, TR, FR, IT
Expand Down Expand Up @@ -110,4 +110,12 @@ var SORV = {
// False to disable speed counter animation
// The animation causes the digital number to lag by 1 second
speedAnimation: false,

// Set this to the color of the Analog SpeedoMeter
// Valid Colors are (Capitalized and in quotes): Red, Blue, Green, Yellow, Pink, Orange, Purple, silver
analogColor: "Red",

// Set to the color theme for Bar SpeedoMeter
// Theme will be a number 0-5 (0 is default white)
barTheme: 0,
};

0 comments on commit 449d769

Please sign in to comment.