mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
separate rate and scale select events
This commit is contained in:
parent
b577479678
commit
e057db2343
2 changed files with 15 additions and 11 deletions
|
@ -3,7 +3,7 @@
|
||||||
<div class="title">Gyroscope - deg/s</div>
|
<div class="title">Gyroscope - deg/s</div>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Refresh:</dt>
|
<dt>Refresh:</dt>
|
||||||
<dd>
|
<dd class="rate">
|
||||||
<select name="gyro_refresh_rate">
|
<select name="gyro_refresh_rate">
|
||||||
<option value="10">10 ms</option>
|
<option value="10">10 ms</option>
|
||||||
<option value="20">20 ms</option>
|
<option value="20">20 ms</option>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
</select>
|
</select>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Scale:</dt>
|
<dt>Scale:</dt>
|
||||||
<dd>
|
<dd class="scale">
|
||||||
<select name="gyro_scale">
|
<select name="gyro_scale">
|
||||||
<option value="100">100</option>
|
<option value="100">100</option>
|
||||||
<option value="1000">1000</option>
|
<option value="1000">1000</option>
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
<div class="title">Accelerometer - g</div>
|
<div class="title">Accelerometer - g</div>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Refresh:</dt>
|
<dt>Refresh:</dt>
|
||||||
<dd>
|
<dd class="rate">
|
||||||
<select name="accel_refresh_rate">
|
<select name="accel_refresh_rate">
|
||||||
<option value="10">10 ms</option>
|
<option value="10">10 ms</option>
|
||||||
<option value="20">20 ms</option>
|
<option value="20">20 ms</option>
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
</select>
|
</select>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Scale:</dt>
|
<dt>Scale:</dt>
|
||||||
<dd>
|
<dd class="scale">
|
||||||
<select name="accel_scale">
|
<select name="accel_scale">
|
||||||
<option value="1">1</option>
|
<option value="1">1</option>
|
||||||
<option value="2" selected="selected">2</option>
|
<option value="2" selected="selected">2</option>
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
<div class="title">Magnetometer - Ga</div>
|
<div class="title">Magnetometer - Ga</div>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Refresh:</dt>
|
<dt>Refresh:</dt>
|
||||||
<dd>
|
<dd class="rate">
|
||||||
<select name="mag_refrash_rate">
|
<select name="mag_refrash_rate">
|
||||||
<option value="10">10 ms</option>
|
<option value="10">10 ms</option>
|
||||||
<option value="20">20 ms</option>
|
<option value="20">20 ms</option>
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
</select>
|
</select>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Scale:</dt>
|
<dt>Scale:</dt>
|
||||||
<dd>
|
<dd class="scale">
|
||||||
<select name="mag_scale">
|
<select name="mag_scale">
|
||||||
<option value="0.5">0.5</option>
|
<option value="0.5">0.5</option>
|
||||||
<option value="1" selected="selected">1</option>
|
<option value="1" selected="selected">1</option>
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
<div class="title">Barometer - meters</div>
|
<div class="title">Barometer - meters</div>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Refresh:</dt>
|
<dt>Refresh:</dt>
|
||||||
<dd>
|
<dd class="rate">
|
||||||
<select name="baro_refresh_rate">
|
<select name="baro_refresh_rate">
|
||||||
<option value="10">10 ms</option>
|
<option value="10">10 ms</option>
|
||||||
<option value="20">20 ms</option>
|
<option value="20">20 ms</option>
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
<div class="title">Debug 1</div>
|
<div class="title">Debug 1</div>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Refresh:</dt>
|
<dt>Refresh:</dt>
|
||||||
<dd>
|
<dd class="rate">
|
||||||
<select name="debug_refresh_rate">
|
<select name="debug_refresh_rate">
|
||||||
<option value="10">10 ms</option>
|
<option value="10">10 ms</option>
|
||||||
<option value="20">20 ms</option>
|
<option value="20">20 ms</option>
|
||||||
|
|
|
@ -175,14 +175,14 @@ function tab_initialize_sensors() {
|
||||||
$('.tab-sensors select[name="baro_refresh_rate"]').val(result.sensor_refresh_rates.baro); // baro
|
$('.tab-sensors select[name="baro_refresh_rate"]').val(result.sensor_refresh_rates.baro); // baro
|
||||||
$('.tab-sensors select[name="debug_refresh_rate"]').val(result.sensor_refresh_rates.debug); // debug
|
$('.tab-sensors select[name="debug_refresh_rate"]').val(result.sensor_refresh_rates.debug); // debug
|
||||||
|
|
||||||
$('.tab-sensors select').change(); // start polling data by triggering refresh rate change event
|
$('.tab-sensors .rate select').change(); // start polling data by triggering refresh rate change event
|
||||||
} else {
|
} else {
|
||||||
// start polling immediatly (as there is no configuration saved in the storage)
|
// start polling immediatly (as there is no configuration saved in the storage)
|
||||||
$('.tab-sensors select').change(); // start polling data by triggering refresh rate change event
|
$('.tab-sensors .rate select').change(); // start polling data by triggering refresh rate change event
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.tab-sensors select').change(function() {
|
$('.tab-sensors .rate select').change(function() {
|
||||||
// if any of the select fields change value, all of the select values are grabbed
|
// if any of the select fields change value, all of the select values are grabbed
|
||||||
// and timers are re-initialized with the new settings
|
// and timers are re-initialized with the new settings
|
||||||
|
|
||||||
|
@ -260,5 +260,9 @@ function tab_initialize_sensors() {
|
||||||
samples_debug_i++;
|
samples_debug_i++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.tab-sensors .scale select').change(function() {
|
||||||
|
console.log('change scale');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue