accel and mag calibration hooks

10.3.x-maintenance
cTn 2013-04-08 22:02:58 +02:00
parent 9fda14b5f2
commit ae7a6cfa0a
6 changed files with 72 additions and 9 deletions

View File

@ -16,7 +16,7 @@ a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
text-decoration: none;
}
.clear-both {
clear: both;
@ -170,4 +170,35 @@ a:hover {
height: 400px;
border: 1px solid #848484;
}
}
/* tab specific sections */
.tab-initial_setup .section {
clear: both;
padding-bottom: 10px;
}
.tab-initial_setup .section a {
display: block;
float: left;
width: 160px;
height: 24px;
line-height: 24px;
text-align: center;
color: white;
border: 1px solid #c0c0c0;
background-color: #5569d0;
}
.tab-initial_setup .section a:hover {
background-color: #424d84;
}
.tab-initial_setup .section p {
margin-left: 180px;
padding: 5px;
border: 1px dotted silver;
}

View File

@ -129,10 +129,8 @@ function onOpen(openInfo) {
serial_poll = setInterval(readPoll, 10);
// should request some sort of configuration data
//send_message(MSP_codes.MSP_ACC_CALIBRATION, MSP_codes.MSP_ACC_CALIBRATION);
send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS);
send_message(MSP_codes.MSP_IDENT, MSP_codes.MSP_IDENT);
//send_message(MSP_codes.MSP_BOXNAMES, MSP_codes.MSP_BOXNAMES);
send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS);
}, connection_delay * 1000);
}
@ -371,10 +369,10 @@ function process_message(code, data) {
console.log(data);
break;
case MSP_codes.MSP_ACC_CALIBRATION:
console.log('Accel calibration finished');
console.log('Accel calibration executed');
break;
case MSP_codes.MSP_MAG_CALIBRATION:
console.log('Mag calibration finished');
console.log('Mag calibration executed');
break;
case MSP_codes.MSP_SET_MISC:
console.log(data);
@ -421,7 +419,19 @@ function sensor_status(sensors_detected) {
$('.mag', e_sensor_status).addClass('on');
} else {
$('.mag', e_sensor_status).removeClass('on');
}
}
if (bit_check(sensors_detected, 3)) { // GPS detected
$('.gps', e_sensor_status).addClass('on');
} else {
$('.gps', e_sensor_status).removeClass('on');
}
if (bit_check(sensors_detected, 4)) { // Sonar detected
$('.sonar', e_sensor_status).addClass('on');
} else {
$('.sonar', e_sensor_status).removeClass('on');
}
}
function highByte(num) {

View File

@ -66,7 +66,6 @@
<li class="baro">Baro</li>
<li class="gps">GPS</li>
<li class="sonar">Sonar</li>
<li class="optic">Optic</li>
</ul>
</div>
<div class="clear-both"></div>

View File

@ -0,0 +1,14 @@
<div class="tab-initial_setup">
<div class="section">
<a class="calibrateAccel" href="#">Calibrate Accelerometer</a>
<p>
Some info / rules about calibration goes here
</p>
</div>
<div class="section">
<a class="calibrateMag" href="#">Calibrate Magnetometer</a>
<p>
Some info / rules about calibration goes here
</p>
</div>
</div>

View File

@ -1,2 +1,9 @@
function tab_initialize_initial_setup() {
$('a.calibrateAccel').click(function() {
send_message(MSP_codes.MSP_ACC_CALIBRATION, MSP_codes.MSP_ACC_CALIBRATION);
});
$('a.calibrateMag').click(function() {
send_message(MSP_codes.MSP_MAG_CALIBRATION, MSP_codes.MSP_MAG_CALIBRATION);
});
}

View File

@ -0,0 +1,2 @@
<div class="tab-pid_tuning">
</div>