Skip to content

Commit

Permalink
MZD Speedometer v5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevelopment committed Jan 27, 2018
1 parent 781f0bd commit 9e0faa4
Show file tree
Hide file tree
Showing 81 changed files with 5,407 additions and 0 deletions.
Binary file added cmu_dataretrieval.up
Binary file not shown.
1 change: 1 addition & 0 deletions config/jci/gui/addon-common/cufon-yui.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions config/jci/gui/addon-common/jquery.flot.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions config/jci/gui/addon-common/jquery.min.js

Large diffs are not rendered by default.

Binary file added config/jci/gui/addon-common/websocketd
Binary file not shown.
168 changes: 168 additions & 0 deletions config/jci/opera/opera_dir/userjs/additionalApps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
var systemAppId = 'system';
var additionalAppsConfig = '/jci/opera/opera_dir/userjs/additionalApps.json';
var additionalApps = [];

/**
* Sets up the additional apps and MMUI message interception magic
*/
function addAdditionalApps() {
var category = 'Applications';

// check that we're in the system app
if(typeof framework === 'object' && framework._currentAppUiaId === systemAppId) {
var systemApp = framework.getAppInstance(systemAppId);

if(!systemApp.hasAdditionalApps) {
systemApp.hasAdditionalApps = true; // so we only do this if needed

// load additional app definitions from from
getJSON('file://localhost' + additionalAppsConfig, function(data) {
additionalApps = JSON.parse(data);
}, function(status) {
framework.log.error('Unable to load additionalApps from ' + additionalAppsConfig);
});
// add additional apps to 'Applications' list
for (var i = 0; i < additionalApps.length; ++i) {
var additionalApp = additionalApps[i];
systemApp._masterApplicationDataList.items.push({ appData : { appName : additionalApp.name, isVisible : true, mmuiEvent : 'Select'+additionalApp.name }, text1Id : additionalApp.name, disabled : false, itemStyle : 'style01', hasCaret : false });
framework.localize._appDicts[systemAppId][additionalApp.name] = additionalApp.label;
framework.common._contextCategory._contextCategoryTable[additionalApp.name+'.*'] = category;
if(typeof systemApp._applicationsCtxtWiseAppNames !== "undefined" && systemApp._applicationsCtxtWiseAppNames.Applications.indexOf(additionalApp.name) === -1) {
systemApp._applicationsCtxtWiseAppNames.Applications.push(additionalApp.name);
}
if (additionalApp.preload !== undefined) {
var preloadPath = "apps/" + additionalApp.name + "/js/" + additionalApp.preload;
utility.loadScript(preloadPath);
}
}

// intercept app selection from the list to do our magic
systemApp._contextTable[category].controlProperties.List2Ctrl.selectCallback = additionalAppMenuItemSelectCallback.bind(systemApp);

// intercept MMUI messages in the framework
framework.origRouteMmuiMsg = framework.routeMmuiMsg;
framework.routeMmuiMsg = additionalAppRouteMmuiMsg.bind(framework);
framework.sendEventToMmui = additionalAppSendEventToMmui.bind(framework);
}
}
}

/**
* Using a disabled app from the list of apps in systemApp.js as a replacement to the MMUI
*/
var additionalAppReplacedAppName = 'vdt';
var additionalAppReplacedAppContext = 'DriveChartDetails';
var additionalAppReplacedMmuiEvent = 'SelectDriveRecord';

/**
* Interceptor for systemApp._menuItemSelectCallback
*/
function additionalAppMenuItemSelectCallback(listCtrlObj, appData, params) {
for (var i = 0; i < additionalApps.length; ++i) {
var additionalApp = additionalApps[i];
if(additionalApp.name === appData.appName) {
framework.additionalAppName = appData.appName;
framework.additionalAppContext = 'Start';
appData = JSON.parse(JSON.stringify(appData));
appData.appName = additionalAppReplacedAppName;
appData.mmuiEvent = additionalAppReplacedMmuiEvent;
break;
}
}
this._menuItemSelectCallback(listCtrlObj, appData, params);
}

/**
* Interceptor for Framework.routeMmuiMsg
*/
function additionalAppRouteMmuiMsg(jsObject) {
switch(jsObject.msgType) {
case 'ctxtChg':
if(this.additionalAppName && jsObject.uiaId == additionalAppReplacedAppName) {
jsObject.uiaId = this.additionalAppName;
jsObject.ctxtId = this.additionalAppContext;
}
break;
case 'focusStack':
var additionalAppInFocusStack = false;
if(this.additionalAppName) {
for(var i = 0; i < jsObject.appIdList.length; i++) {
var appId = jsObject.appIdList[i];
if(appId.id == additionalAppReplacedAppName) {
appId.id = this.additionalAppName;
}
if(appId.id == this.additionalAppName) {
additionalAppInFocusStack = true;
}
}
}
if(!additionalAppInFocusStack) {
this.additionalAppName = null;
this.additionalAppContext = null;
}
case 'msg': // fall-through to alert
case 'alert':
if(this.additionalAppName && jsObject.uiaId == additionalAppReplacedAppName) {
jsObject.uiaId = this.additionalAppName;
}
break;
default:
// do nothing
break;
}

this.origRouteMmuiMsg(jsObject);
}

/**
* Interceptor for Framework.sendEventToMmui
*/
function additionalAppSendEventToMmui(uiaId, eventId, params, fromVui)
{
if(uiaId == this.additionalAppName) {
uiaId = additionalAppReplacedAppName;
}

var currentUiaId = this.getCurrentApp();
var currentContextId = this.getCurrCtxtId();

if(currentUiaId == this.additionalAppName) {
currentUiaId = additionalAppReplacedAppName;
currentContextId = additionalAppReplacedAppContext;
}

this.websockets.sendEventMsg(uiaId, eventId, params, fromVui, currentUiaId, currentContextId);

// Let debug know about the message
this.debug.triggerEvtToMmuiCallbacks(uiaId, eventId, params);
}

/**
* Helper function to get JSON data
*/
function getJSON(url, successHandler, errorHandler) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
xhr.timeout = 30000;
xhr.onload = function() {
var status = xhr.status;
if (status == 0) {
successHandler && successHandler(xhr.response);
} else {
errorHandler && errorHandler(status);
}
};
xhr.onerror = function() {
var status = xhr.status;
};
xhr.send();
}

/**
* Function to get the whole thing started.
*/
(function () {
window.opera.addEventListener('AfterEvent.load', function (e) {
addAdditionalApps();
});
})();
Binary file added config/speedometer/color/blue/NeedlePointer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/blue/currentSpeed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/green/NeedlePointer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/green/currentSpeed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/orange/NeedlePointer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/orange/currentSpeed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/pink/NeedlePointer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/pink/currentSpeed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/purple/NeedlePointer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/purple/currentSpeed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/silver/NeedlePointer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/silver/currentSpeed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added config/speedometer/color/yellow/currentSpeed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#SbSpeedo {
font-family:Tipperary,verdana;
color: white;
height: 64px;
position: absolute;
right: 115px;
top: 0px;
width: 84px;
z-index: 20200;
/* text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; */
}
#SbSpeedo .gpsSpeedValue,
#SbSpeedo .outsideTempValue,
#SbSpeedo .Drv1AvlFuelEValue,
#SbSpeedo .gpsAltitudeValue,
#SbSpeedo .gpsHeading {
text-align: right;
position: absolute;
}
#SbSpeedo .gpsSpeedValue {
font-size: 40px;
line-height: 40px;
height: 40px;
top: 23px;
right: 16px;
width: 100%;
}
#SbSpeedo .speedUnit {
color: #DDDDDD;
font-size: 12px;
position: absolute;
width: 30px;
right: -8px;
transform: rotate(-90deg);
bottom: 12px;
white-space: nowrap;
}
#SbSpeedo .outsideTempValue,
#SbSpeedo .Drv1AvlFuelEValue,
#SbSpeedo .gpsAltitudeValue,
#SbSpeedo .gpsHeading {
padding-right: 24px;
background: transparent url('IcnCompass.png') no-repeat scroll right 0px / 18px 18px;
font-size: 17px;
line-height: 17px;
height: 20px;
top: 6px;
right: 17px;
}
#SbSpeedo .outsideTempValue {
background-image: url('IcnTemp.png');
}
#SbSpeedo .gpsAltitudeValue {
display: none;
background-image: url('IcnMountain.png');
}
#SbSpeedo .Drv1AvlFuelEValue {
display: none;
background-image: url('IcnFuel.png')
}

/*** Statusbar speedo style if more than 3 SbIcons ***/
#SbSpeedo.morespace .Drv1AvlFuelEValue,
#SbSpeedo.morespace .outsideTempValue,
#SbSpeedo.morespace .gpsAltitudeValue,
#SbSpeedo.morespace .gpsHeading {
right: 40px;
}

/*** Statusbar speedo style inside backupparking app ***/
#SbSpeedo.parking {
width: 160px;
height: 45px;
right: 320px;
/* opacity: 0.8; */
background-color: rgba(0, 0, 0, 0.7);
border-radius: 0 0 5px 5px;
}
#SbSpeedo.parking .gpsSpeedValue {
right: 19px;
top: 3px;
}
#SbSpeedo.parking .speedUnit {
right: -5px;
bottom: 15px;
}
#SbSpeedo.parking .outsideTempValue,
#SbSpeedo.parking .gpsAltitudeValue {
display: block !important;
right: 88px;
}
#SbSpeedo.parking .Drv1AvlFuelEValue,
#SbSpeedo.parking .gpsHeading {
display: block !important;
right: 88px;
top: 23px;
}
/* *** Statusbar adjustments *** */
.SbnCtrl {
background-image: none !important;
}
.SbnCtrl_Style03_Meter {
left: 110px !important;
}
.SbnCtrl_Style06_Meter {
left: 270px !important;
}

/* Digital Clock Mod - Remove this to apply
#SbSpeedo, .StatusBarCtrlDate, .StatusBarCtrlClock {
font-family: "Crystal"!important;
text-transform: uppercase;
}
Remove this */
Empty file.
69 changes: 69 additions & 0 deletions config/speedometer/jci/gui/apps/_speedometer/js/_speedometerApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
Copyright 2016 Herko ter Horst
__________________________________________________________________________
Filename: _speedometerApp.js
__________________________________________________________________________
*/

log.addSrcFile("_speedometerApp.js", "_speedometer");

function _speedometerApp(uiaId)
{
log.debug("Constructor called.");

// Base application functionality is provided in a common location via this call to baseApp.init().
// See framework/js/BaseApp.js for details.
baseApp.init(this, uiaId);
}


/*********************************
* App Init is standard function *
* called by framework *
*********************************/

/*
* 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()
{
log.debug("_speedometerApp appInit called...");

//Context table
//@formatter:off
this._contextTable = {
"Start": { // initial context must be called "Start"
"sbName": "Speedometer",
"template": "SpeedoMeterTmplt",
"templatePath": "apps/_speedometer/templates/SpeedoMeter", //only needed for app-specific templates
"readyFunction": this._StartContextReady.bind(this)
} // end of "SpeedoMeter"
}; // end of this.contextTable object
//@formatter:on

//@formatter:off
this._messageTable = {
// haven't yet been able to receive messages from MMUI
};
//@formatter:on
};

/**
* =========================
* CONTEXT CALLBACKS
* =========================
*/
_speedometerApp.prototype._StartContextReady = function ()
{
framework.common.setSbDomainIcon("apps/_speedometer/IcnSbnSpeedometer.png");
};

/**
* =========================
* Framework register
* Tell framework this .js file has finished loading
* =========================
*/
framework.registerAppLoaded("_speedometer", null, false);

0 comments on commit 9e0faa4

Please sign in to comment.