diff --git a/locales/en/messages.json b/locales/en/messages.json index 5436277292..52a0c3a0b2 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -7409,6 +7409,9 @@ "firmwareFlasherBuildMotorProtocols": { "message": "Motor Protocol" }, + "firmwareFlasherBuildOsdProtocols": { + "message": "OSD Protocol" + }, "firmwareFlasherConfigurationFile": { "message": "Configuration Filename:" }, @@ -7427,6 +7430,9 @@ "firmwareFlasherMotorProtocolDescription": { "message": "Select the motor (ESC) protocol you would like included in this build. Note this is a drop down, but only one item may be selected." }, + "firmwareFlasherOsdProtocolDescription": { + "message": "Select the OSD protocol you would like included in this build. Note this is a drop down, but only one item may be selected." + }, "firmwareFlasherBranchDescription": { "message": "Especially useful for developers, you can select a merged PR, specify a commit sha, or specify a 'yet to be merged' PR by typing in a # followed by the PR number e.g. #1234 (this is shorthand for the branch 'pull/1234/head')." }, diff --git a/src/js/tabs/firmware_flasher.js b/src/js/tabs/firmware_flasher.js index 85a21e791c..5970fbb69a 100644 --- a/src/js/tabs/firmware_flasher.js +++ b/src/js/tabs/firmware_flasher.js @@ -220,8 +220,24 @@ firmware_flasher.initialize = function (callback) { return; } + // extract osd protocols from general options and add to osdProtocols + data.osdProtocols = data.generalOptions + .filter(option => option.group === 'OSD') + .map(option => { + option.name = option.groupedName; + option.default = self.cloudBuildOptions?.includes(option.value); + return option; + }); + + // add None option to osdProtocols as first option + data.osdProtocols.unshift({name: 'None', value: ''}); + + // remove osdProtocols from generalOptions + data.generalOptions = data.generalOptions.filter(option => !option.group); + buildOptionsList($('select[name="radioProtocols"]'), data.radioProtocols); buildOptionsList($('select[name="telemetryProtocols"]'), data.telemetryProtocols); + buildOptionsList($('select[name="osdProtocols"]'), data.osdProtocols); buildOptionsList($('select[name="options"]'), data.generalOptions); buildOptionsList($('select[name="motorProtocols"]'), data.motorProtocols); @@ -440,6 +456,7 @@ firmware_flasher.initialize = function (callback) { } $('select[name="board"]').select2(); + $('select[name="osdProtocols"]').select2(); $('select[name="radioProtocols"]').select2(); $('select[name="telemetryProtocols"]').select2(); $('select[name="motorProtocols"]').select2(); @@ -522,6 +539,7 @@ firmware_flasher.initialize = function (callback) { 'select[name="board"]', 'select[name="radioProtocols"]', 'select[name="telemetryProtocols"]', + 'select[name="osdProtocols"]', 'select[name="motorProtocols"]', 'select[name="options"]', 'select[name="commits"]', @@ -837,6 +855,10 @@ firmware_flasher.initialize = function (callback) { request.options.push($(this).val()); }); + $('select[name="osdProtocols"] option:selected').each(function () { + request.options.push($(this).val()); + }); + $('select[name="motorProtocols"] option:selected').each(function () { request.options.push($(this).val()); }); diff --git a/src/tabs/firmware_flasher.html b/src/tabs/firmware_flasher.html index db608481b8..a2bb7bc57e 100644 --- a/src/tabs/firmware_flasher.html +++ b/src/tabs/firmware_flasher.html @@ -172,11 +172,11 @@