Merge pull request #249 from AustinSaintAubin/development

Added Roll & Pitch to Setup Tab
10.3.x-maintenance
Dominic Clifton 2015-10-14 20:05:30 +01:00
commit f4c12c40e7
4 changed files with 36 additions and 10 deletions

View File

@ -372,8 +372,8 @@
"initialSetupModel": { "initialSetupModel": {
"message": "Model: $1" "message": "Model: $1"
}, },
"initialSetupHeading": { "initialSetupAttitude": {
"message": "Heading: $1 deg" "message": "$1 deg"
}, },
"initialSetupAccelCalibStarted": { "initialSetupAccelCalibStarted": {
"message": "Accelerometer calibration started" "message": "Accelerometer calibration started"

View File

@ -68,12 +68,23 @@
border: 1px solid silver; border: 1px solid silver;
background-color: white; background-color: white;
} }
.tab-setup #interactive_block .heading { .tab-setup #interactive_block .attitude {
float: right; float: right;
height: 15px; margin: 10px 10px 0px 0px
}
margin: 10px 10px 0 0; .tab-setup #interactive_block .attitude dt {
font-weight: bold; float: left;
width: 64px;
font-weight: 700;
text-align: right
}
.tab-setup #interactive_block .attitude dd {
display: block;
margin-left: 64px;
width: 64px;
text-align: right
} }
.tab-setup #interactive_block a.reset { .tab-setup #interactive_block a.reset {
position: absolute; position: absolute;

View File

@ -25,7 +25,13 @@
<div id="canvas_wrapper"> <div id="canvas_wrapper">
<canvas id="canvas"></canvas> <canvas id="canvas"></canvas>
</div> </div>
<span class="heading"></span> <div class="attitude">
<dl>
<dt>Heading:</dt><dd class="heading">&nbsp;</dd>
<dt>Pitch:</dt><dd class="pitch">&nbsp;</dd>
<dt>Roll:</dt><dd class="roll">&nbsp;</dd>
</dl>
</div>
<a class="reset" href="#" i18n="initialSetupButtonResetZaxis"></a> <a class="reset" href="#" i18n="initialSetupButtonResetZaxis"></a>
</div> </div>
<div class="block info"> <div class="block info">

View File

@ -47,8 +47,13 @@ TABS.setup.initialize = function (callback) {
// initialize 3D // initialize 3D
self.initialize3D(); self.initialize3D();
// set roll in interactive block
$('span.roll').text(chrome.i18n.getMessage('initialSetupAttitude', [0]));
// set pitch in interactive block
$('span.pitch').text(chrome.i18n.getMessage('initialSetupAttitude', [0]));
// set heading in interactive block // set heading in interactive block
$('span.heading').text(chrome.i18n.getMessage('initialSetupheading', [0])); $('span.heading').text(chrome.i18n.getMessage('initialSetupAttitude', [0]));
// check if we have magnetometer // check if we have magnetometer
if (!bit_check(CONFIG.activeSensors, 2)) { if (!bit_check(CONFIG.activeSensors, 2)) {
@ -151,7 +156,9 @@ TABS.setup.initialize = function (callback) {
gpsSats_e = $('.gpsSats'), gpsSats_e = $('.gpsSats'),
gpsLat_e = $('.gpsLat'), gpsLat_e = $('.gpsLat'),
gpsLon_e = $('.gpsLon'), gpsLon_e = $('.gpsLon'),
heading_e = $('span.heading'); roll_e = $('dd.roll'),
pitch_e = $('dd.pitch'),
heading_e = $('dd.heading');
function get_slow_data() { function get_slow_data() {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);
@ -175,7 +182,9 @@ TABS.setup.initialize = function (callback) {
function get_fast_data() { function get_fast_data() {
MSP.send_message(MSP_codes.MSP_ATTITUDE, false, false, function () { MSP.send_message(MSP_codes.MSP_ATTITUDE, false, false, function () {
heading_e.text(chrome.i18n.getMessage('initialSetupheading', [SENSOR_DATA.kinematics[2]])); roll_e.text(chrome.i18n.getMessage('initialSetupAttitude', [SENSOR_DATA.kinematics[0]]));
pitch_e.text(chrome.i18n.getMessage('initialSetupAttitude', [SENSOR_DATA.kinematics[1]]));
heading_e.text(chrome.i18n.getMessage('initialSetupAttitude', [SENSOR_DATA.kinematics[2]]));
self.render3D(); self.render3D();
self.updateInstruments(); self.updateInstruments();
}); });