diff --git a/tabs/pid_tuning.css b/tabs/pid_tuning.css index d86598d063..7bb0394737 100644 --- a/tabs/pid_tuning.css +++ b/tabs/pid_tuning.css @@ -43,7 +43,8 @@ .tab-pid_tuning .rate-tpa input { width: 127px; } - .tab-pid_tuning .update { + .tab-pid_tuning .update, + .tab-pid_tuning .refresh { display: block; float: right; @@ -60,6 +61,10 @@ border: 1px solid silver; background-color: #ececec; } - .tab-pid_tuning .update:hover { + .tab-pid_tuning .refresh { + margin-right: 10px; + } + .tab-pid_tuning .update:hover, + .tab-pid_tuning .refresh:hover { background-color: #dedcdc; } \ No newline at end of file diff --git a/tabs/pid_tuning.html b/tabs/pid_tuning.html index 2bbcdae417..24d3ccb25d 100644 --- a/tabs/pid_tuning.html +++ b/tabs/pid_tuning.html @@ -71,4 +71,5 @@ Save + Refresh \ No newline at end of file diff --git a/tabs/pid_tuning.js b/tabs/pid_tuning.js index 3bbe247afb..fd78fe2a80 100644 --- a/tabs/pid_tuning.js +++ b/tabs/pid_tuning.js @@ -137,6 +137,9 @@ function tab_initialize_pid_tuning() { $('.rate-tpa input[name="tpa"]').val(RC_tuning.dynamic_THR_PID.toFixed(2)); // UI Hooks + $('a.refresh').click(function() { + tab_initialize_pid_tuning(); + }); $('a.update').click(function() { // Catch all the changes and stuff the inside PIDs array diff --git a/tabs/receiver.css b/tabs/receiver.css index 904016dd98..57abb4f4a0 100644 --- a/tabs/receiver.css +++ b/tabs/receiver.css @@ -81,7 +81,8 @@ border: 1px solid silver; } - .tab-receiver .update { + .tab-receiver .update, + .tab-receiver .refresh { display: block; float: right; @@ -98,6 +99,10 @@ border: 1px solid silver; background-color: #ececec; } - .tab-receiver .update:hover { + .tab-receiver .refresh { + margin-right: 10px; + } + .tab-receiver .update:hover, + .tab-receiver .refresh:hover { background-color: #dedcdc; } \ No newline at end of file diff --git a/tabs/receiver.html b/tabs/receiver.html index 875cbd46af..b97724a719 100644 --- a/tabs/receiver.html +++ b/tabs/receiver.html @@ -63,6 +63,7 @@ Save + Refresh
diff --git a/tabs/receiver.js b/tabs/receiver.js index 2f84210fba..da3560c427 100644 --- a/tabs/receiver.js +++ b/tabs/receiver.js @@ -102,6 +102,21 @@ function tab_initialize_receiver() { }, 0); // race condition, that should always trigger after all events are processed }).change(); + $('a.refresh').click(function() { + send_message(MSP_codes.MSP_RC_TUNING, MSP_codes.MSP_RC_TUNING, false, function() { + // fill in data from RC_tuning + $('.tunings .throttle input[name="mid"]').val(RC_tuning.throttle_MID.toFixed(2)); + $('.tunings .throttle input[name="expo"]').val(RC_tuning.throttle_EXPO.toFixed(2)); + + $('.tunings .rate input[name="rate"]').val(RC_tuning.RC_RATE.toFixed(2)); + $('.tunings .rate input[name="expo"]').val(RC_tuning.RC_EXPO.toFixed(2)); + + // update visual representation + $('.tunings .throttle input').change(); + $('.tunings .rate input').change(); + }); + }); + $('a.update').click(function() { // catch RC_tuning changes RC_tuning.throttle_MID = parseFloat($('.tunings .throttle input[name="mid"]').val());