mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 16:25:19 +03:00
report IMU2 hardware status
This commit is contained in:
parent
291a2289c2
commit
f719f7c464
8 changed files with 37 additions and 3 deletions
BIN
images/icons/sensor_imu2_error.png
Normal file
BIN
images/icons/sensor_imu2_error.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
BIN
images/icons/sensor_imu2_off.png
Normal file
BIN
images/icons/sensor_imu2_off.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
BIN
images/icons/sensor_imu2_on.png
Normal file
BIN
images/icons/sensor_imu2_on.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
3
js/fc.js
3
js/fc.js
|
@ -93,7 +93,8 @@ var FC = {
|
||||||
gpsHwStatus: 0,
|
gpsHwStatus: 0,
|
||||||
rangeHwStatus: 0,
|
rangeHwStatus: 0,
|
||||||
speedHwStatus: 0,
|
speedHwStatus: 0,
|
||||||
flowHwStatus: 0
|
flowHwStatus: 0,
|
||||||
|
imu2HwStatus: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
SENSOR_CONFIG = {
|
SENSOR_CONFIG = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*global $, SERVO_DATA, PID_names, ADJUSTMENT_RANGES, RXFAIL_CONFIG, SERVO_CONFIG*/
|
/*global $, SERVO_DATA, PID_names, ADJUSTMENT_RANGES, RXFAIL_CONFIG, SERVO_CONFIG,CONFIG*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var mspHelper = (function (gui) {
|
var mspHelper = (function (gui) {
|
||||||
|
@ -133,6 +133,12 @@ var mspHelper = (function (gui) {
|
||||||
SENSOR_STATUS.rangeHwStatus = data.getUint8(6);
|
SENSOR_STATUS.rangeHwStatus = data.getUint8(6);
|
||||||
SENSOR_STATUS.speedHwStatus = data.getUint8(7);
|
SENSOR_STATUS.speedHwStatus = data.getUint8(7);
|
||||||
SENSOR_STATUS.flowHwStatus = data.getUint8(8);
|
SENSOR_STATUS.flowHwStatus = data.getUint8(8);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "3.1.0")) {
|
||||||
|
SENSOR_STATUS.imu2HwStatus = data.getUint8(9);
|
||||||
|
} else {
|
||||||
|
SENSOR_STATUS.imu2HwStatus = 0;
|
||||||
|
}
|
||||||
sensor_status_ex(SENSOR_STATUS);
|
sensor_status_ex(SENSOR_STATUS);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -403,6 +403,7 @@ function sensor_status_ex(hw_status)
|
||||||
sensor_status_update_icon('.sonar', '.sonaricon', hw_status.rangeHwStatus);
|
sensor_status_update_icon('.sonar', '.sonaricon', hw_status.rangeHwStatus);
|
||||||
sensor_status_update_icon('.airspeed', '.airspeedicon', hw_status.speedHwStatus);
|
sensor_status_update_icon('.airspeed', '.airspeedicon', hw_status.speedHwStatus);
|
||||||
sensor_status_update_icon('.opflow', '.opflowicon', hw_status.flowHwStatus);
|
sensor_status_update_icon('.opflow', '.opflowicon', hw_status.flowHwStatus);
|
||||||
|
sensor_status_update_icon('.imu2', '.imu2icon', hw_status.imu2HwStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sensor_status_update_icon(sensId, sensIconId, status)
|
function sensor_status_update_icon(sensId, sensIconId, status)
|
||||||
|
@ -437,7 +438,8 @@ function sensor_status_hash(hw_status)
|
||||||
hw_status.gpsHwStatus +
|
hw_status.gpsHwStatus +
|
||||||
hw_status.rangeHwStatus +
|
hw_status.rangeHwStatus +
|
||||||
hw_status.speedHwStatus +
|
hw_status.speedHwStatus +
|
||||||
hw_status.flowHwStatus;
|
hw_status.flowHwStatus +
|
||||||
|
hw_status.imu2HwStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -460,6 +462,7 @@ function sensor_status(sensors_detected) {
|
||||||
SENSOR_STATUS.rangeHwStatus = have_sensor(sensors_detected, 'sonar') ? 1 : 0;
|
SENSOR_STATUS.rangeHwStatus = have_sensor(sensors_detected, 'sonar') ? 1 : 0;
|
||||||
SENSOR_STATUS.speedHwStatus = have_sensor(sensors_detected, 'airspeed') ? 1 : 0;
|
SENSOR_STATUS.speedHwStatus = have_sensor(sensors_detected, 'airspeed') ? 1 : 0;
|
||||||
SENSOR_STATUS.flowHwStatus = have_sensor(sensors_detected, 'opflow') ? 1 : 0;
|
SENSOR_STATUS.flowHwStatus = have_sensor(sensors_detected, 'opflow') ? 1 : 0;
|
||||||
|
SENSOR_STATUS.imu2HwStatus = have_sensor(sensors_detected, 'imu2') ? 1 : 0;
|
||||||
sensor_status_ex(SENSOR_STATUS);
|
sensor_status_ex(SENSOR_STATUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
21
main.css
21
main.css
|
@ -318,6 +318,27 @@ input[type="number"]::-webkit-inner-spin-button {
|
||||||
color: #d40000;
|
color: #d40000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.imu2icon {
|
||||||
|
background: url("../images/icons/sensor_imu2_off.png") no-repeat -5px 2px;
|
||||||
|
background-size: 40px;
|
||||||
|
height: 30px;
|
||||||
|
margin-top: 3px;
|
||||||
|
width: 100%;
|
||||||
|
padding-top: 40px;
|
||||||
|
color: #4f4f4f;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imu2icon.active {
|
||||||
|
background-image: url("../images/icons/sensor_imu2_on.png");
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imu2icon.error {
|
||||||
|
background-image: url("../images/icons/sensor_imu2_error.png");
|
||||||
|
color: #d40000;
|
||||||
|
}
|
||||||
|
|
||||||
.magicon {
|
.magicon {
|
||||||
background: url("../images/icons/sensor_mag_off.png") no-repeat -5px 2px;
|
background: url("../images/icons/sensor_mag_off.png") no-repeat -5px 2px;
|
||||||
background-size: 42px;
|
background-size: 42px;
|
||||||
|
|
|
@ -138,6 +138,9 @@
|
||||||
<li class="airspeed" title="Airspeed">
|
<li class="airspeed" title="Airspeed">
|
||||||
<div class="airspeedicon">Speed</div>
|
<div class="airspeedicon">Speed</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="imu2" title="IMU2">
|
||||||
|
<div class="imu2icon">IMU2</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="quad-status_wrapper">
|
<div id="quad-status_wrapper">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue