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 tizen.vehicle.vehicleSpeed.get().then(
102 dashBoardIndicator.onSpeedChanged(vSpeed.speed);
105 console.log("Modello Dashboard failed to get Vehicle Speed");
108 bootstrap.carIndicator.addListener({
109 /* this si for steeringWheel game controler */
110 onSteeringWheelAngleChanged : function(newValue){
111 dashBoardIndicator.onWheelAngleChanged(newValue,bootstrap.carIndicator.status);
113 onWheelBrakeChanged : function(newValue){
114 dashBoardIndicator.onBreakLightsChanged(newValue);
116 /* end steeringWheel game controler*/
117 onTirePressureLeftFrontChanged : function (newValue){
118 dashBoardIndicator.onTirePressureLeftFrontChanged(newValue);
120 onTirePressureRightFrontChanged : function (newValue){
121 dashBoardIndicator.onTirePressureRightFrontChanged(newValue);
123 onTirePressureLeftRearChanged : function (newValue){
124 dashBoardIndicator.onTirePressureLeftRearChanged(newValue);
126 onTirePressureRightRearChanged : function (newValue){
127 dashBoardIndicator.onTirePressureRightRearChanged(newValue);
129 onChildLockChanged : function(newValue){
130 dashBoardIndicator.onChildLockChanged(newValue);
132 onFrontLightsChanged : function(newValue){
133 dashBoardIndicator.onFrontLightsChanged(newValue);
135 onRearLightsChanged : function(newValue){
136 dashBoardIndicator.onRearLightsChanged(newValue);
138 onBatteryStatusChanged : function(newValue) {
139 dashBoardIndicator.onBatteryStatusChanged(newValue,bootstrap.carIndicator.status);
141 onFullBatteryRange : function(newValue) {
142 dashBoardIndicator.onBatteryRangeChanged(newValue,bootstrap.carIndicator.status);
144 onOutsideTempChanged : function(newValue) {
145 dashBoardIndicator.onOutsiteTempChanged(newValue);
147 onInsideTempChanged : function(newValue) {
148 dashBoardIndicator.onInsideTempChanged(newValue);
150 onWheelAngleChanged : function(newValue){
151 dashBoardIndicator.onWheelAngleChanged(newValue,bootstrap.carIndicator.status);
153 onWeatherChanged : function(newValue){
154 dashBoardIndicator.onWeatherChanged(newValue);
156 onSpeedChanged : function(newValue) {
157 dashBoardIndicator.onSpeedChanged(newValue);
159 onOdoMeterChanged : function(newValue){
160 dashBoardIndicator.onOdoMeterChanged(newValue);
162 onGearChanged : function(newValue){
163 dashBoardIndicator.onGearChanged(newValue);
165 onRandomizeChanged : function(newValue) {
166 dashBoardIndicator.onRandomizerChanged(newValue);
168 onNightModeChanged : function(newValue) {
169 dashBoardIndicator.onNightModeChanged(newValue);
171 onExteriorBrightnessChanged : function(newValue) {
172 dashBoardIndicator.onExteriorBrightnessChanged(newValue);
174 onAvgKWChanged : function(newValue) {
175 dashBoardIndicator.onAvgKWChanged(newValue);
181 $(document).ready(init);