mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 00:35:26 +03:00
Add current info to motors tab
This commit is contained in:
parent
5244473769
commit
0cfeb3bbdc
4 changed files with 58 additions and 1 deletions
|
@ -230,6 +230,11 @@ TABS.motors.initialize = function (callback) {
|
|||
accel_offset = [0, 0, 0],
|
||||
accel_offset_established = false;
|
||||
|
||||
// cached elements
|
||||
var motor_voltage_e = $('.motors-bat-voltage'),
|
||||
motor_mah_drawing_e = $('.motors-bat-mah-drawing'),
|
||||
motor_mah_drawn_e = $('.motors-bat-mah-drawn');
|
||||
|
||||
|
||||
var raw_data_text_ements = {
|
||||
x: [],
|
||||
|
@ -310,7 +315,7 @@ TABS.motors.initialize = function (callback) {
|
|||
var rate = parseInt($('.tab-motors select[name="rate"]').val(), 10);
|
||||
var scale = parseFloat($('.tab-motors select[name="scale"]').val());
|
||||
|
||||
GUI.interval_kill_all(['motor_and_status_pull']);
|
||||
GUI.interval_kill_all(['motor_and_status_pull','motors_power_data_pull_slow']);
|
||||
|
||||
switch(TABS.motors.sensor) {
|
||||
case "gyro":
|
||||
|
@ -393,6 +398,15 @@ TABS.motors.initialize = function (callback) {
|
|||
}
|
||||
});
|
||||
|
||||
// Amperage
|
||||
function power_data_pull() {
|
||||
motor_voltage_e.text(i18n.getMessage('motorsVoltageValue', [ANALOG.voltage]));
|
||||
motor_mah_drawing_e.text(i18n.getMessage('motorsADrawingValue', [ANALOG.amperage.toFixed(2)]));
|
||||
motor_mah_drawn_e.text(i18n.getMessage('motorsmAhDrawnValue', [ANALOG.mAhdrawn]));
|
||||
|
||||
}
|
||||
GUI.interval_add('motors_power_data_pull_slow', power_data_pull, 250, true); // 4 fps
|
||||
|
||||
$('a.reset_max').click(function () {
|
||||
gyro_max_read = [0, 0, 0];
|
||||
accel_max_read = [0, 0, 0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue