@ -63,9 +63,14 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
mspHelper . saveVTXConfig ,
saveCraftName ,
mspHelper . saveMiscV2 ,
saveSettings ,
mspHelper . saveToEeprom
] ;
function saveSettings ( onComplete ) {
Settings . saveInputs ( ) . then ( onComplete ) ;
}
saveChainer . setChain ( saveChain ) ;
saveChainer . setExitPoint ( reboot ) ;
@ -85,7 +90,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
function load _html ( ) {
GUI . load ( "./tabs/configuration.html" , process_html ) ;
GUI . load ( "./tabs/configuration.html" , Settings. processHtml ( process_html ) ) ;
}
function process _html ( ) {
@ -278,6 +283,39 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$ ( '#battery_capacity_critical' ) . val ( MISC . battery _capacity _critical * 100 / MISC . battery _capacity ) ;
$ ( '#battery_capacity_unit' ) . val ( MISC . battery _capacity _unit ) ;
let $i2cSpeed = $ ( '#i2c_speed' ) ,
$i2cSpeedInfo = $ ( '#i2c_speed-info' ) ;
$i2cSpeed . change ( function ( ) {
let $this = $ ( this ) ,
value = $this . children ( "option:selected" ) . text ( ) ;
if ( value == "400KHZ" ) {
$i2cSpeedInfo . removeClass ( 'ok-box' ) ;
$i2cSpeedInfo . addClass ( 'info-box' ) ;
$i2cSpeedInfo . removeClass ( 'warning-box' ) ;
$i2cSpeedInfo . html ( chrome . i18n . getMessage ( 'i2cSpeedSuggested800khz' ) ) ;
$i2cSpeedInfo . show ( ) ;
} else if ( value == "800KHZ" ) {
$i2cSpeedInfo . removeClass ( 'ok-box' ) ;
$i2cSpeedInfo . removeClass ( 'info-box' ) ;
$i2cSpeedInfo . removeClass ( 'warning-box' ) ;
$i2cSpeedInfo . hide ( ) ;
} else {
$i2cSpeedInfo . removeClass ( 'ok-box' ) ;
$i2cSpeedInfo . removeClass ( 'info-box' ) ;
$i2cSpeedInfo . addClass ( 'warning-box' ) ;
$i2cSpeedInfo . html ( chrome . i18n . getMessage ( 'i2cSpeedTooLow' ) ) ;
$i2cSpeedInfo . show ( ) ;
}
} ) ;
$i2cSpeed . change ( ) ;
var $looptime = $ ( "#looptime" ) ;
var $gyroLpf = $ ( "#gyro-lpf" ) ,
@ -460,12 +498,8 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
googleAnalytics . sendEvent ( 'Setting' , 'Looptime' , FC _CONFIG . loopTime ) ;
/ *
* send gyro LPF and async _mode tracking
* /
googleAnalytics . sendEvent ( 'Setting' , 'GyroLpf' , FC . getGyroLpfValues ( ) [ INAV _PID _CONFIG . gyroscopeLpf ] . label ) ;
googleAnalytics . sendEvent ( 'Setting' , ' AsyncMode', FC . getAsyncModes ( ) [ INAV _PID _CONFIG . asynchronousMode ] ) ;
googleAnalytics . sendEvent ( 'Setting' , 'I2CSpeed' , $ ( '#i2c_speed' ) . children ( "option:selected" ) . text ( ) ) ;
googleAnalytics . sendEvent ( 'Board' , 'Accelerometer' , FC . getAccelerometerNames ( ) [ SENSOR _CONFIG . accelerometer ] ) ;
googleAnalytics . sendEvent ( 'Board' , 'Magnetometer' , FC . getMagnetometerNames ( ) [ SENSOR _CONFIG . magnetometer ] ) ;
@ -479,6 +513,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
}
helper . features . reset ( ) ;
helper . features . fromUI ( $ ( '.tab-configuration' ) ) ;
helper . features . execute ( function ( ) {