add gps info block to fill some of the whitespace

10.3.x-maintenance
cTn 2014-09-18 12:54:59 +02:00
parent 287a1df962
commit f2ac7369de
4 changed files with 54 additions and 7 deletions

View File

@ -266,6 +266,9 @@
"initialSetupRSSIValue": { "initialSetupRSSIValue": {
"message": "$1 %" "message": "$1 %"
}, },
"initialSetupGPSHead": {
"message": "GPS"
},
"initialSetupButtonSave": { "initialSetupButtonSave": {
"message": "Save" "message": "Save"
}, },

View File

@ -5,7 +5,31 @@
height: calc(100% - 142px); height: calc(100% - 142px);
} }
.tab-initial_setup .CAP_BASEFLIGHT_CONFIG #interactive_block { .tab-initial_setup .CAP_BASEFLIGHT_CONFIG #interactive_block {
width: calc(100% - 411px); width: calc(100% - 199px);
}
.tab-initial_setup .CAP_BASEFLIGHT_CONFIG .gps {
width: 185px;
}
.tab-initial_setup .CAP_BASEFLIGHT_CONFIG .gps .fields {
padding: 5px 5px 3px 5px;
}
.tab-initial_setup .CAP_BASEFLIGHT_CONFIG .gps dt {
float: left;
width: 85px;
height: 20px;
margin-bottom: 2px;
line-height: 20px;
}
.tab-initial_setup .CAP_BASEFLIGHT_CONFIG .gps dd {
height: 20px;
margin-left: 85px;
margin-bottom: 2px;
line-height: 20px;
} }
/* temporary styles end*/ /* temporary styles end*/
@ -182,9 +206,6 @@
.tab-initial_setup .block .info { .tab-initial_setup .block .info {
width: 200px; width: 200px;
} }
.tab-initial_setup .battery, .tab-initial_setup .battery,
.tab-initial_setup .throttle, .tab-initial_setup .throttle,
.tab-initial_setup .acc-trim, .tab-initial_setup .acc-trim,

View File

@ -39,6 +39,17 @@
</dl> </dl>
</div> </div>
</div> </div>
<div class="block gps">
<span class="head" i18n="initialSetupGPSHead"></span>
<div class="fields">
<dl>
<dt i18n="gps3dFix"></dt><dd class="gpsFix"></dd>
<dt i18n="gpsSats"></dt><dd class="gpsSats"></dd>
<dt i18n="gpsLat"></dt><dd class="gpsLat"></dd>
<dt i18n="gpsLon"></dt><dd class="gpsLon"></dd>
</dl>
</div>
</div>
</div> </div>
<div class="COMPATIBILITY"> <div class="COMPATIBILITY">
<div id="interactive_block"> <div id="interactive_block">

View File

@ -257,23 +257,35 @@ TABS.initial_setup.initialize = function (callback) {
$('#content .restore').click(configuration_restore); $('#content .restore').click(configuration_restore);
// data pulling functions used inside interval timer // data pulling functions used inside interval timer
// this stuff will be reworked when compatibility period ends, to make the pulling more efficient
function get_analog_data() { function get_analog_data() {
MSP.send_message(MSP_codes.MSP_ANALOG, false, false, get_attitude_data); MSP.send_message(MSP_codes.MSP_ANALOG, false, false, get_gps_data);
}
function get_gps_data() {
MSP.send_message(MSP_codes.MSP_RAW_GPS, false, false, get_attitude_data);
} }
function get_attitude_data() { function get_attitude_data() {
MSP.send_message(MSP_codes.MSP_ATTITUDE, false, false, update_ui); MSP.send_message(MSP_codes.MSP_ATTITUDE, false, false, update_ui);
} }
// in future update selectors will be moved outside to specific variables to increase performance
function update_ui() { function update_ui() {
// Update heading
$('span.heading').text(chrome.i18n.getMessage('initialSetupheading', [SENSOR_DATA.kinematics[2]]));
// Update voltage indicator // Update voltage indicator
$('.bat-voltage').text(chrome.i18n.getMessage('initialSetupBatteryValue', [ANALOG.voltage])); $('.bat-voltage').text(chrome.i18n.getMessage('initialSetupBatteryValue', [ANALOG.voltage]));
$('.bat-mah-drawn').text(chrome.i18n.getMessage('initialSetupBatteryMahValue', [ANALOG.mAhdrawn])); $('.bat-mah-drawn').text(chrome.i18n.getMessage('initialSetupBatteryMahValue', [ANALOG.mAhdrawn]));
$('.bat-mah-drawing').text(chrome.i18n.getMessage('initialSetupBatteryAValue', [ANALOG.amperage.toFixed(2)])); $('.bat-mah-drawing').text(chrome.i18n.getMessage('initialSetupBatteryAValue', [ANALOG.amperage.toFixed(2)]));
$('.rssi').text(chrome.i18n.getMessage('initialSetupRSSIValue', [((ANALOG.rssi / 1023) * 100).toFixed(0)])); $('.rssi').text(chrome.i18n.getMessage('initialSetupRSSIValue', [((ANALOG.rssi / 1023) * 100).toFixed(0)]));
// Update heading // Update gps
$('span.heading').text(chrome.i18n.getMessage('initialSetupheading', [SENSOR_DATA.kinematics[2]])); $('.gpsFix').html((GPS_DATA.fix) ? chrome.i18n.getMessage('gpsFixTrue') : chrome.i18n.getMessage('gpsFixFalse'));
$('.gpsSats').text(GPS_DATA.numSat);
$('.gpsLat').text((GPS_DATA.lat / 10000000).toFixed(4) + ' deg');
$('.gpsLon').text((GPS_DATA.lon / 10000000).toFixed(4) + ' deg');
// Update 3D // Update 3D
self.render3D(); self.render3D();