/*global Bootstrap, dashBoardControler */
/**
* DashBoard application show information about vehicle from [tizen.vehicle API](https://raw.github.com/otcshare/automotive-message-broker/master/docs/amb.idl).
* Uses mainly {{#crossLink "CarIndicator"}}{{/crossLink}} module from {{#crossLink "Bootstrap/carIndicator:property"}}{{/crossLink}}. Dashboard application uses following
* AMB properties to show car data in display only mode:
*
* * SteeringWheelAngle
* * SteeringWheelAngle
* * WheelBrake
* * Engaged
* * TirePressure
* * leftFront
* * rightFront
* * leftRear
* * rightRear
* * DoorStatus
* * ChildLockStatus
* * LightStatus
* * Hazard
* * Head
* * Parking
* * BatteryStatus
* * FullBatteryRange
* * ExteriorTemperature
* * Exterior
* * InteriorTemperature
* * Interior
* * WheelInformation
* * FrontWheelRadius
* * AvgKW
* * AvgKW
* * VehicleSpeed
* * Odometer
* * Transmission
* * ShiftPosition
* * ExteriorBrightness
* * NightMode
*
*
* Hover and click on elements in images below to navigate to components of Home screen application.
*
*
*
* @module DashboardApplication
* @main DashboardApplication
* @class Dashboard
*/
/**
* Reference to instance of dashBoardIndicator this class manage graphics elements on dasboard
* @property dashBoardIndicator {dashBoardIndicator}
*/
var dashBoardIndicator;
/**
* Reference to instance of bootstrap class this class help booting theme , config and carIndicator
* @property bootstrap {Bootstrap}
* @private
*/
var bootstrap;
/**
* Method initializes user interface and create events listeners for status indicators.
* @method init
*/
var init = function () {
"use strict";
dashBoardIndicator = new dashBoardControler();
bootstrap = new Bootstrap(function (status) {
$('#clockElement').ClockPlugin('init', 60);
$('#clockElement').ClockPlugin('startTimer');
$('#bottomPanel').bottomPanel('init', 'withoutBack');
$("#topBarIcons").topBarIconsPlugin('init');
bootstrap.carIndicator.addListener({
/* this si for steeringWheel game controler */
onSteeringWheelAngleChanged : function(newValue){
dashBoardIndicator.onWheelAngleChanged(newValue,bootstrap.carIndicator.status);
},
onWheelBrakeChanged : function(newValue){
dashBoardIndicator.onBreakLightsChanged(newValue);
},
/* end steeringWheel game controler*/
onTirePressureLeftFrontChanged : function (newValue){
dashBoardIndicator.onTirePressureLeftFrontChanged(newValue);
},
onTirePressureRightFrontChanged : function (newValue){
dashBoardIndicator.onTirePressureRightFrontChanged(newValue);
},
onTirePressureLeftRearChanged : function (newValue){
dashBoardIndicator.onTirePressureLeftRearChanged(newValue);
},
onTirePressureRightRearChanged : function (newValue){
dashBoardIndicator.onTirePressureRightRearChanged(newValue);
},
onChildLockChanged : function(newValue){
dashBoardIndicator.onChildLockChanged(newValue);
},
onFrontLightsChanged : function(newValue){
dashBoardIndicator.onFrontLightsChanged(newValue);
},
onRearLightsChanged : function(newValue){
dashBoardIndicator.onRearLightsChanged(newValue);
},
onBatteryStatusChanged : function(newValue) {
dashBoardIndicator.onBatteryStatusChanged(newValue,bootstrap.carIndicator.status);
},
onFullBatteryRange : function(newValue) {
dashBoardIndicator.onBatteryRangeChanged(newValue,bootstrap.carIndicator.status);
},
onOutsideTempChanged : function(newValue) {
dashBoardIndicator.onOutsiteTempChanged(newValue);
},
onInsideTempChanged : function(newValue) {
dashBoardIndicator.onInsideTempChanged(newValue);
},
onWheelAngleChanged : function(newValue){
dashBoardIndicator.onWheelAngleChanged(newValue,bootstrap.carIndicator.status);
},
onWeatherChanged : function(newValue){
dashBoardIndicator.onWeatherChanged(newValue);
},
onSpeedChanged : function(newValue) {
dashBoardIndicator.onSpeedChanged(newValue);
},
onOdoMeterChanged : function(newValue){
dashBoardIndicator.onOdoMeterChanged(newValue);
},
onGearChanged : function(newValue){
dashBoardIndicator.onGearChanged(newValue);
},
onRandomizeChanged : function(newValue) {
dashBoardIndicator.onRandomizerChanged(newValue);
},
onNightModeChanged : function(newValue) {
dashBoardIndicator.onNightModeChanged(newValue);
},
onExteriorBrightnessChanged : function(newValue) {
dashBoardIndicator.onExteriorBrightnessChanged(newValue);
},
onAvgKWChanged : function(newValue) {
dashBoardIndicator.onAvgKWChanged(newValue);
}
});
});
};
$(document).ready(init);