diff options
-rwxr-xr-x | _locales/en/messages.json | 6 | ||||
-rw-r--r-- | src/css/tabs/configuration.css | 28 | ||||
-rw-r--r-- | tabs/configuration.html | 83 | ||||
-rw-r--r-- | tabs/configuration.js | 81 |
4 files changed, 30 insertions, 168 deletions
diff --git a/_locales/en/messages.json b/_locales/en/messages.json index d9ede8de..9294dcc4 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -654,12 +654,6 @@ "configurationBoardAlignmentYaw": { "message": "Yaw Degrees" }, - "configurationSensorAlignmentGyro": { - "message": "GYRO Alignment" - }, - "configurationSensorAlignmentAcc": { - "message": "ACCEL Alignment" - }, "configurationSensorAlignmentMag": { "message": "MAG Alignment" }, diff --git a/src/css/tabs/configuration.css b/src/css/tabs/configuration.css index e7ec5481..9ef596ba 100644 --- a/src/css/tabs/configuration.css +++ b/src/css/tabs/configuration.css @@ -156,11 +156,14 @@ hr { } .tab-configuration .alignicon { + display: inline-block; + position: relative; width: 20px; height: 20px; - float: left; - margin-left: -5px; - margin-right: 3px; + margin-top: 0px; + margin-left: 6px; + margin-right: 2px; + top: 6px; } .tab-configuration .pitch { @@ -179,24 +182,7 @@ hr { } .tab-configuration .board select { - width: 45%; - height: 20px; - margin: 0 0 2px 0; -} - -.tab-configuration .sensoralignment { - width: 50%; - float: left; -} - -.tab-configuration .board_align_content { - width: 50%; - float: left; -} - -.tab-configuration .sensoralignment span { - width: 55%; - float: left; + width: 110px; } @media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) { diff --git a/tabs/configuration.html b/tabs/configuration.html index efa62ace..9bc7e613 100644 --- a/tabs/configuration.html +++ b/tabs/configuration.html @@ -22,21 +22,6 @@ <div class="helpicon cf_tip" data-i18n_title="configurationGyroLpfHelp"></div> </div> - <div id="gyro-sync-wrapper" class="checkbox"> - <input type="checkbox" id="gyro-sync-checkbox" class="toggle" /> - <label for="gyro-sync-checkbox"> - <span data-i18n="configurationGyroSyncTitle"></span> - </label> - </div> - - <div id="gyro-frequency-wrapper" class="checkbox"> - <select id="gyro-frequency"></select> - <label for="gyro-frequency"> - <span data-i18n="configurationGyroFrequencyTitle"></span> - </label> - <div class="helpicon cf_tip" data-i18n_title="configurationGyroFrequencyHelp"></div> - </div> - <div id="looptime-warning" class="info-box" data-i18n="looptimeNotAdvised"></div> <div class="select"> <select id="looptime"></select> @@ -90,54 +75,28 @@ <div class="helpicon cf_tip" data-i18n_title="configHelp2"></div> </div> <div class="spacer_box"> - <div class="board_align_content"> - <div class="number"> - <label> <input type="number" name="board_align_roll" step="0.1" min="-180" max="360" /> <span - data-i18n="configurationBoardAlignmentRoll"></span> - </label> - <div class="alignicon roll"></div> - </div> - <div class="number"> - <label> <input type="number" name="board_align_pitch" step="0.1" min="-180" max="360" /> - <span data-i18n="configurationBoardAlignmentPitch"></span> - </label> - <div class="alignicon pitch"></div> - </div> - <div class="number"> - <label> <input type="number" name="board_align_yaw" step="0.1" min="-180" max="360" /> <span - data-i18n="configurationBoardAlignmentYaw"></span> - </label> - <div class="alignicon yaw"></div> - </div> + <div class="number"> + <input type="number" id="board_align_roll" name="board_align_roll" step="0.1" min="-180" max="360" /> + <div class="alignicon roll"></div> + <label for="board_align_roll" data-i18n="configurationBoardAlignmentRoll"></label> </div> - <div class="sensoralignment"> - <div class="select"> - <label> - <span data-i18n="configurationSensorAlignmentGyro"></span> - <select class="gyroalign"> - <option value="0">Default</option> - <!-- list generated here --> - </select> - </label> - </div> - <div class="select"> - <label> - <span data-i18n="configurationSensorAlignmentAcc"></span> - <select class="accalign"> - <option value="0">Default</option> - <!-- list generated here --> - </select> - </label> - </div> - <div class="select"> - <label> - <span data-i18n="configurationSensorAlignmentMag"></span> - <select class="magalign"> - <option value="0">Default</option> - <!-- list generated here --> - </select> - </label> - </div> + <div class="number"> + <input type="number" id="board_align_pitch" name="board_align_pitch" step="0.1" min="-180" max="360" /> + <div class="alignicon pitch"></div> + <label for="board_align_pitch" data-i18n="configurationBoardAlignmentPitch"></label> + </div> + <div class="number"> + <input id="board_align_yaw" type="number" name="board_align_yaw" step="0.1" min="-180" max="360" /> + <div class="alignicon yaw"></div> + <label for="board_align_yaw" data-i18n="configurationBoardAlignmentYaw"></label> + </div> + <div class="select" style="position: relative; top: -3px;"> + <select id="magalign" class="magalign"> + <option value="0">Default</option> + <!-- list generated here --> + </select> + <div class="alignicon yaw"></div> + <label for="magalign" data-i18n="configurationSensorAlignmentMag"></label> </div> </div> </div> diff --git a/tabs/configuration.js b/tabs/configuration.js index ffc0d4bc..261a1c47 100644 --- a/tabs/configuration.js +++ b/tabs/configuration.js @@ -189,19 +189,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) { // translate to user-selected language localize(); - var alignments = FC.getSensorAlignments(); - - var orientation_gyro_e = $('select.gyroalign'); - var orientation_acc_e = $('select.accalign'); - var orientation_mag_e = $('select.magalign'); + let alignments = FC.getSensorAlignments(); + let orientation_mag_e = $('select.magalign'); for (i = 0; i < alignments.length; i++) { - orientation_gyro_e.append('<option value="' + (i + 1) + '">' + alignments[i] + '</option>'); - orientation_acc_e.append('<option value="' + (i + 1) + '">' + alignments[i] + '</option>'); orientation_mag_e.append('<option value="' + (i + 1) + '">' + alignments[i] + '</option>'); } - orientation_gyro_e.val(SENSOR_ALIGNMENT.align_gyro); - orientation_acc_e.val(SENSOR_ALIGNMENT.align_acc); orientation_mag_e.val(SENSOR_ALIGNMENT.align_mag); // generate GPS @@ -368,11 +361,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) { var $looptime = $("#looptime"); var $gyroLpf = $("#gyro-lpf"), - $gyroSync = $("#gyro-sync-checkbox"), - $asyncMode = $('#async-mode'), - $gyroFrequency = $('#gyro-frequency'), - $accelerometerFrequency = $('#accelerometer-frequency'), - $attitudeFrequency = $('#attitude-frequency'), $gyroLpfMessage = $('#gyrolpf-info'); var values = FC.getGyroLpfValues(); @@ -385,7 +373,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) { } $gyroLpf.val(INAV_PID_CONFIG.gyroscopeLpf); - $gyroSync.prop("checked", ADVANCED_CONFIG.gyroSync); $gyroLpf.change(function () { INAV_PID_CONFIG.gyroscopeLpf = $gyroLpf.val(); @@ -399,10 +386,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) { $looptime.val(FC.getLooptimes()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].defaultLooptime); $looptime.change(); - GUI.fillSelect($gyroFrequency, FC.getGyroFrequencies()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].looptimes); - $gyroFrequency.val(FC.getLooptimes()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].defaultLooptime); - $gyroFrequency.change(); - $gyroLpfMessage.hide(); $gyroLpfMessage.removeClass('ok-box'); $gyroLpfMessage.removeClass('info-box'); @@ -460,63 +443,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) { }); $looptime.change(); - $gyroFrequency.val(ADVANCED_CONFIG.gyroSyncDenominator * FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick); - $gyroFrequency.change(function () { - ADVANCED_CONFIG.gyroSyncDenominator = Math.floor($gyroFrequency.val() / FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick); - }); - - $gyroSync.change(function () { - if ($(this).is(":checked")) { - ADVANCED_CONFIG.gyroSync = 1; - } else { - ADVANCED_CONFIG.gyroSync = 0; - } - }); - - $gyroSync.change(); - - /* - * Async mode select - */ - GUI.fillSelect($asyncMode, FC.getAsyncModes()); - $asyncMode.val(INAV_PID_CONFIG.asynchronousMode); - $asyncMode.change(function () { - INAV_PID_CONFIG.asynchronousMode = $asyncMode.val(); - - if (INAV_PID_CONFIG.asynchronousMode == 0) { - $('#gyro-sync-wrapper').show(); - $('#gyro-frequency-wrapper').hide(); - $('#accelerometer-frequency-wrapper').hide(); - $('#attitude-frequency-wrapper').hide(); - } else if (INAV_PID_CONFIG.asynchronousMode == 1) { - $('#gyro-sync-wrapper').hide(); - $('#gyro-frequency-wrapper').show(); - $('#accelerometer-frequency-wrapper').hide(); - $('#attitude-frequency-wrapper').hide(); - ADVANCED_CONFIG.gyroSync = 1; - } else { - $('#gyro-sync-wrapper').hide(); - $('#gyro-frequency-wrapper').show(); - $('#accelerometer-frequency-wrapper').show(); - $('#attitude-frequency-wrapper').show(); - ADVANCED_CONFIG.gyroSync = 1; - } - }); - $asyncMode.change(); - - GUI.fillSelect($accelerometerFrequency, FC.getAccelerometerTaskFrequencies(), INAV_PID_CONFIG.accelerometerTaskFrequency, 'Hz'); - $accelerometerFrequency.val(INAV_PID_CONFIG.accelerometerTaskFrequency); - $accelerometerFrequency.change(function () { - INAV_PID_CONFIG.accelerometerTaskFrequency = $accelerometerFrequency.val(); - }); - - GUI.fillSelect($attitudeFrequency, FC.getAttitudeTaskFrequencies(), INAV_PID_CONFIG.attitudeTaskFrequency, 'Hz'); - $attitudeFrequency.val(INAV_PID_CONFIG.attitudeTaskFrequency); - $attitudeFrequency.change(function () { - INAV_PID_CONFIG.attitudeTaskFrequency = $attitudeFrequency.val(); - }); - - var $sensorAcc = $('#sensor-acc'), $sensorMag = $('#sensor-mag'), $sensorBaro = $('#sensor-baro'), @@ -604,9 +530,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) { _3D.deadband3d_throttle = ($('#3ddeadbandthrottle').val()); } - - SENSOR_ALIGNMENT.align_gyro = parseInt(orientation_gyro_e.val()); - SENSOR_ALIGNMENT.align_acc = parseInt(orientation_acc_e.val()); SENSOR_ALIGNMENT.align_mag = parseInt(orientation_mag_e.val()); craftName = $('input[name="craft_name"]').val(); |