1 /*global Bootstrap, dashBoardControler */
4 * DashBoard application show information about vehicle from [tizen.vehicle API](https://raw.github.com/otcshare/automotive-message-broker/master/docs/amb.idl).
5 * Uses mainly {{#crossLink "CarIndicator"}}{{/crossLink}} module from {{#crossLink "Bootstrap/carIndicator:property"}}{{/crossLink}}. Dashboard application uses following
6 * AMB properties to show car data in display only mode:
25 * * ExteriorTemperature
27 * * InteriorTemperature
37 * * ExteriorBrightness
41 * Hover and click on elements in images below to navigate to components of Home screen application.
43 * <img id="Image-Maps_1201312180420487" src="../assets/img/dashboard.png" usemap="#Image-Maps_1201312180420487" border="0" width="649" height="1152" alt="" />
44 * <map id="_Image-Maps_1201312180420487" name="Image-Maps_1201312180420487">
45 * <area shape="rect" coords="0,0,573,78" href="../classes/TopBarIcons.html" alt="top bar icons" title="Top bar icons" />
46 * <area shape="rect" coords="0,77,644,132" href="../classes/Clock.html" alt="clock" title="Clock" />
47 * <area shape="rect" coords="0,994,644,1147" href="../classes/BottomPanel.html" alt="bottom panel" title="Bottom panel" />
48 * <area shape="rect" coords="573,1,644,76" href="../modules/Settings.html" alt="Settings" title="Settings" />
49 * <area shape="rect" coords="21,132,90,194" alt="Day/Night mode" title="Day/Night mode" target="_self" href="../classes/dashBoardControler.html#method_onNightModeChanged" >
50 * <area shape="rect" coords="415,128,648,173" alt="Exterior Brightness" title="Exterior Brightness" target="_self" href="../classes/dashBoardControler.html#method_onExteriorBrightnessChanged" >
51 * <area shape="rect" coords="372,173,638,279" alt="Weather" title="Weather" target="_self" href="../classes/dashBoardControler.html#method_onWeatherChanged" >
52 * <area shape="rect" coords="21,196,348,292" alt="Battery Level" title="Battery Level" target="_self" href="../classes/dashBoardControler.html#method_onBatteryStatusChanged" >
53 * <area shape="rect" coords="193,395,451,477" alt="Wheel radius" title="Wheel radius" target="_self" href="../classes/dashBoardControler.html#method_onWheelAngleChanged" >
54 * <area shape="rect" coords="224,320,425,398" alt="Front lights status" title="Front lights status" target="_self" href="../classes/dashBoardControler.html#method_onFrontLightsChanged" >
55 * <area shape="rect" coords="472,509,557,541" alt="Speed" title="Speed" target="_self" href="../classes/dashBoardControler.html#method_onSpeedChanged" >
56 * <area shape="rect" coords="556,509,613,558" alt="Transmission Gear" title="Transmission Gear" target="_self" href="../classes/dashBoardControler.html#method_onGearChanged" >
57 * <area shape="rect" coords="34,564,215,664" alt="Child lock status" title="Child lock status" target="_self" href="../classes/dashBoardControler.html#method_onChildLockChanged" >
58 * <area shape="rect" coords="9,904,212,940" alt="Average KW" title="Average KW" target="_self" href="..//classes/dashBoardControler.html#method_onAvgKWChanged" >
59 * <area shape="rect" coords="11,937,200,962" alt="Battery range" title="Battery range" target="_self" href="../classes/dashBoardControler.html#method_onBatteryRangeChanged" >
60 * <area shape="rect" coords="477,540,556,562" alt="Odometer" title="Odometer" target="_self" href="../classes/dashBoardControler.html#method_onOdoMeterChanged" >
61 * <area shape="rect" coords="204,767,441,805" alt="Rear lights" title="Rear lights" target="_self" href="../classes/dashBoardControler.html#method_onRearLightsChanged" >
62 * <area shape="rect" coords="205,823,442,861" alt="Break lights" title="Break lights" target="_self" href="../classes/dashBoardControler.html#method_onBreakLightsChanged" >
63 * <area shape="rect" coords="27,332,188,410" alt="Left front tire pressure" title="Left front tire pressure" target="_self" href="../classes/dashBoardControler.html#method_onTirePressureLeftFrontChanged" >
64 * <area shape="rect" coords="447,304,608,382" alt="Right front tire pressure" title="Right front tire pressure" target="_self" href="../classes/dashBoardControler.html#method_onTirePressureRightFrontChanged" >
65 * <area shape="rect" coords="18,676,179,754" alt="Left rear tire pressure" title="Left rear tire pressure" target="_self" href="../classes/dashBoardControler.html#method_onTirePressureLeftRearChanged" >
66 * <area shape="rect" coords="458,677,621,752" alt="Right rear tire pressure" title="Right rear tire pressure" target="_self" href="../classes/dashBoardControler.html#method_onTirePressureRightRearChanged" >
68 * @module DashboardApplication
69 * @main DashboardApplication
74 * Reference to instance of dashBoardIndicator this class manage graphics elements on dasboard
75 * @property dashBoardIndicator {dashBoardIndicator}
77 var dashBoardIndicator;
80 * Reference to instance of bootstrap class this class help booting theme , config and carIndicator
81 * @property bootstrap {Bootstrap}
87 * Method initializes user interface and create events listeners for status indicators.
90 var init = function () {
92 dashBoardIndicator = new dashBoardControler();
93 bootstrap = new Bootstrap(function (status) {
94 $('#clockElement').ClockPlugin('init', 60);
95 $('#clockElement').ClockPlugin('startTimer');
97 $('#bottomPanel').bottomPanel('init', 'withoutBack');
98 $("#topBarIcons").topBarIconsPlugin('init');
100 bootstrap.carIndicator.addListener({
101 /* this si for steeringWheel game controler */
102 onSteeringWheelAngleChanged : function(newValue){
103 dashBoardIndicator.onWheelAngleChanged(newValue,bootstrap.carIndicator.status);
105 onWheelBrakeChanged : function(newValue){
106 dashBoardIndicator.onBreakLightsChanged(newValue);
108 /* end steeringWheel game controler*/
109 onTirePressureLeftFrontChanged : function (newValue){
110 dashBoardIndicator.onTirePressureLeftFrontChanged(newValue);
112 onTirePressureRightFrontChanged : function (newValue){
113 dashBoardIndicator.onTirePressureRightFrontChanged(newValue);
115 onTirePressureLeftRearChanged : function (newValue){
116 dashBoardIndicator.onTirePressureLeftRearChanged(newValue);
118 onTirePressureRightRearChanged : function (newValue){
119 dashBoardIndicator.onTirePressureRightRearChanged(newValue);
121 onChildLockChanged : function(newValue){
122 dashBoardIndicator.onChildLockChanged(newValue);
124 onFrontLightsChanged : function(newValue){
125 dashBoardIndicator.onFrontLightsChanged(newValue);
127 onRearLightsChanged : function(newValue){
128 dashBoardIndicator.onRearLightsChanged(newValue);
130 onBatteryStatusChanged : function(newValue) {
131 dashBoardIndicator.onBatteryStatusChanged(newValue,bootstrap.carIndicator.status);
133 onFullBatteryRange : function(newValue) {
134 dashBoardIndicator.onBatteryRangeChanged(newValue,bootstrap.carIndicator.status);
136 onOutsideTempChanged : function(newValue) {
137 dashBoardIndicator.onOutsiteTempChanged(newValue);
139 onInsideTempChanged : function(newValue) {
140 dashBoardIndicator.onInsideTempChanged(newValue);
142 onWheelAngleChanged : function(newValue){
143 dashBoardIndicator.onWheelAngleChanged(newValue,bootstrap.carIndicator.status);
145 onWeatherChanged : function(newValue){
146 dashBoardIndicator.onWeatherChanged(newValue);
148 onSpeedChanged : function(newValue) {
149 dashBoardIndicator.onSpeedChanged(newValue);
151 onOdoMeterChanged : function(newValue){
152 dashBoardIndicator.onOdoMeterChanged(newValue);
154 onGearChanged : function(newValue){
155 dashBoardIndicator.onGearChanged(newValue);
157 onRandomizeChanged : function(newValue) {
158 dashBoardIndicator.onRandomizerChanged(newValue);
160 onNightModeChanged : function(newValue) {
161 dashBoardIndicator.onNightModeChanged(newValue);
163 onExteriorBrightnessChanged : function(newValue) {
164 dashBoardIndicator.onExteriorBrightnessChanged(newValue);
166 onAvgKWChanged : function(newValue) {
167 dashBoardIndicator.onAvgKWChanged(newValue);
173 $(document).ready(init);