Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 69 additions & 1 deletion locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,60 @@
"tabOptions": {
"message": "Options"
},

"tabNornConfig": {
"message": "NORN Config"
},
"nornManticore": {
"message": "Manticore"
},
"nornVtx": {
"message": "VTX"
},
"nornNone": {
"message": "None"
},
"nornGenerate": {
"message": "Generate"
},
"nornOutput": {
"message": "NORN Configuration"
},
"nornDrone": {
"message": "Drone"
},
"nornController": {
"message": "Controller"
},
"nornRadioController": {
"message": "Radio Controller"
},
"nornSize": {
"message": "Size"
},
"nornCraftName": {
"message": "Craft Name"
},
"nornMBId": {
"message": "MB ID"
},
"nornFailSafe": {
"message": "FailSafe"
},
"nornVideoFormat": {
"message": "Video Format"
},
"nornCamera": {
"message": "Camera"
},
"nornGPS": {
"message": "GPS"
},
"nornCopy": {
"message": "Copy to clipboard"
},
"nornSave": {
"message": "Save"
},
"tabSetup": {
"message": "Setup"
},
Expand Down Expand Up @@ -1937,6 +1990,12 @@
"portsFunction_VTX_MSP": {
"message": "VTX (MSP + Displayport)"
},
"portsFunction_MANTICORE_INITIATOR_V1": {
"message": "Manticore V1"
},
"portsFunction_MANTICORE_INITIATOR_V2": {
"message": "Manticore V2"
},
"pidTuningProfileOption": {
"message": "Profile $1"
},
Expand Down Expand Up @@ -7745,6 +7804,15 @@
"message": "Sonar",
"description": "Displays distance from sonar sensor in cm"
},
"osdTextElementManticoreV1": {
"message": "Manticore V1"
},
"osdTextElementManticoreV2": {
"message": "Manticore V2"
},
"osdTextElementManticoreV2Logger": {
"message": "Manticore V2 Logger"
},
Comment on lines +7808 to +7815
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add the missing OSD description strings.

Every OSD element string in this file has a paired osdDescElement… entry. Without the new descriptions, the UI falls back to the raw key (or shows nothing) for the tooltips of these Manticore elements. Please add the descriptions alongside the text entries so the help popovers remain readable.

     "osdTextElementManticoreV1": {
         "message": "Manticore V1"
     },
+    "osdDescElementManticoreV1": {
+        "message": "Displays the status/state for the Manticore V1 data feed."
+    },
     "osdTextElementManticoreV2": {
         "message": "Manticore V2"
     },
+    "osdDescElementManticoreV2": {
+        "message": "Displays the status/state for the Manticore V2 data feed."
+    },
     "osdTextElementManticoreV2Logger": {
         "message": "Manticore V2 Logger"
     },
+    "osdDescElementManticoreV2Logger": {
+        "message": "Displays the logger status for the Manticore V2 data feed."
+    },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"message": "Manticore V1"
},
"osdTextElementManticoreV2": {
"message": "Manticore V2"
},
"osdTextElementManticoreV2Logger": {
"message": "Manticore V2 Logger"
},
"osdTextElementManticoreV1": {
"message": "Manticore V1"
},
"osdDescElementManticoreV1": {
"message": "Displays the status/state for the Manticore V1 data feed."
},
"osdTextElementManticoreV2": {
"message": "Manticore V2"
},
"osdDescElementManticoreV2": {
"message": "Displays the status/state for the Manticore V2 data feed."
},
"osdTextElementManticoreV2Logger": {
"message": "Manticore V2 Logger"
},
"osdDescElementManticoreV2Logger": {
"message": "Displays the logger status for the Manticore V2 data feed."
},
🤖 Prompt for AI Agents
In locales/en/messages.json around lines 7793-7800, three OSD text keys
(osdTextElementManticoreV1, osdTextElementManticoreV2,
osdTextElementManticoreV2Logger) are missing their corresponding description
keys; add matching osdDescElementManticoreV1, osdDescElementManticoreV2, and
osdDescElementManticoreV2Logger entries directly alongside the existing text
entries with concise tooltip strings (e.g., brief descriptions of each Manticore
element) so the UI help popovers display human-readable descriptions instead of
raw keys.

"osdDescElementLidar": {
"message": "$t(osdTextElementLidar.message)",
"description": "Don't translate!!!"
Expand Down
39 changes: 39 additions & 0 deletions locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7510,5 +7510,44 @@
"osdDescElementLidar": {
"message": "$t(osdTextElementLidar.message)",
"description": "Don't translate!!!"
},
"nornManticore": {
"message": "Manticore"
},
"nornVtx": {
"message": "VTX"
},
"nornNone": {
"message": "Немає"
},
"nornGenerate": {
"message": "Згенерувати"
},
"nornOutput": {
"message": "Конфігурація"
},
"nornDrone": {
"message": "Дрон"
},
"nornController": {
"message": "Контролер"
},
"nornSize": {
"message": "Розмір"
},
"nornCraftName": {
"message": "Назва дрона"
},
"nornGPS": {
"message": "GPS"
},
"nornCopy": {
"message": "Копіювати в буффер"
},
"nornSave": {
"message": "Зберегти"
},
"tabNornConfig": {
"message": "NORN Налаштування"
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"node": "20.x"
},
"dependencies": {
"ejs": "^3.1.9",
"handlebars": "^4.7.8",
"@capacitor/android": "^7.0.1",
"@capacitor/core": "^7.0.1",
"@fortawesome/fontawesome-free": "^6.5.2",
Expand Down
2 changes: 2 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@
<li class="tab_help" id="tab_help"><a href="#" i18n="tabHelp" class="tabicon ic_help" i18n_title="tabHelp"></a></li>
<li class="tab_options" id="tab_options"><a href="#" i18n="tabOptions" class="tabicon ic_config" i18n_title="tabOptions"></a></li>
<li class="tab_firmware_flasher" id="tabFirmware"><a href="#" i18n="tabFirmwareFlasher" class="tabicon ic_flasher" i18n_title="tabFirmwareFlasher"></a></li>
<li class="tab_norn_config"><a href="#" i18n="tabNornConfig" class="tabicon ic_setup" i18n_title="tabNornConfig"></a></li>
</ul>
<ul class="mode-connected">
<li class="tab_setup"><a href="#" i18n="tabSetup" class="tabicon ic_setup" i18n_title="tabSetup"></a></li>
<li class="tab_setup_osd"><a href="#" i18n="tabSetupOSD" class="tabicon ic_setup" i18n_title="tabSetupOSD"></a></li>
<li class="tab_ports"><a href="#" i18n="tabPorts" class="tabicon ic_ports" i18n_title="tabPorts"></a></li>
<li class="tab_configuration"><a href="#" i18n="tabConfiguration" class="tabicon ic_config" i18n_title="tabConfiguration"></a></li>
<li class="tab_norn_config"><a href="#" i18n="tabNornConfig" class="tabicon ic_setup" i18n_title="tabNornConfig"></a></li>
<li class="tab_power"><a href="#" i18n="tabPower" class="tabicon ic_power" i18n_title="tabPower"></a></li>
<li class="tab_failsafe"><a href="#" i18n="tabFailsafe" class="tabicon ic_failsafe" i18n_title="tabFailsafe"></a></li>
<li class="tab_presets"><a href="#" i18n="tabPresets" class="tabicon ic_wizzard" i18n_title="tabPresets"></a></li>
Expand Down
10 changes: 9 additions & 1 deletion src/js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ class GuiControl {
this.timeout_array = [];
this.buttonDisabledClass = "disabled";

this.defaultAllowedTabsWhenDisconnected = ["landing", "firmware_flasher", "privacy_policy", "options", "help"];
this.defaultAllowedTabsWhenDisconnected = [
"landing",
"firmware_flasher",
"privacy_policy",
"options",
"help",
"norn_config",
];

this.defaultAllowedTabs = [
"setup",
Expand All @@ -30,6 +37,7 @@ class GuiControl {
"presets",
"cli",
"configuration",
"norn_config",
"logging",
"onboard_logging",
"modes",
Expand Down
3 changes: 3 additions & 0 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ function startProcess() {
configuration.initialize(content_ready),
);
break;
case "norn_config":
import("./tabs/norn_config").then(({ norn_config }) => norn_config.initialize(content_ready));
break;
case "pid_tuning":
import("./tabs/pid_tuning").then(({ pid_tuning }) => pid_tuning.initialize(content_ready));
break;
Expand Down
5 changes: 5 additions & 0 deletions src/js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ function MspHelper() {
LIDAR_TF: 15,
FRSKY_OSD: 16,
VTX_MSP: 17,
GIMBAL: 18,
KOLIBRI_INITIATOR: 19,
DETONATOR: 20,
MANTICORE_INITIATOR_V1: 21,
MANTICORE_INITIATOR_V2: 22,
};

self.REBOOT_TYPES = {
Expand Down
1 change: 1 addition & 0 deletions src/js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ function checkReportProblems() {
}
}

needsProblemReportingDialog = false;
if (needsProblemReportingDialog) {
problems.forEach((problem) => {
problemItemTemplate.clone().html(problem.description).appendTo(problemDialogList);
Expand Down
67 changes: 67 additions & 0 deletions src/js/tabs/firmware_flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,60 @@ firmware_flasher.initialize = async function (callback) {
STM32.rebootMode = 0;
GUI.connect_lock = false;
startFlashing();
} else {
// Auto-detect board when firmware flasher tab is active and no flash-on-connect
console.log(`${self.logHead} Auto-detecting board for connected USB device`);
AutoDetect.verifyBoard();
}
}

function detectedSerialDevice(device) {
const isFlashOnConnect = $("input.flash_on_connect").is(":checked");

console.log(`${self.logHead} Detected serial device:`, device);
console.log(`${self.logHead} Reboot mode: %s, flash on connect`, STM32.rebootMode, isFlashOnConnect);

if (STM32.rebootMode || isFlashOnConnect) {
STM32.rebootMode = 0;
GUI.connect_lock = false;
startFlashing();
} else {
// Auto-detect board when firmware flasher tab is active and no flash-on-connect
console.log(`${self.logHead} Auto-detecting board for connected serial device`);
AutoDetect.verifyBoard();
}
}

EventBus.$on("port-handler:auto-select-usb-device", detectedUsbDevice);
EventBus.$on("port-handler:auto-select-serial-device", detectedSerialDevice);

// Also listen for port changes to catch reconnections
function onPortChange(port) {
console.log(`${self.logHead} Port changed to:`, port);
// Auto-detect board when port changes and we're on firmware flasher tab
if (port && port !== "0" && !$("input.flash_on_connect").is(":checked") && !STM32.rebootMode) {
console.log(`${self.logHead} Auto-detecting board for port change`);
setTimeout(() => {
AutoDetect.verifyBoard();
}, 500); // Small delay to ensure port is ready
} else if (!port || port === "0") {
// Clear board selection when no port is selected
console.log(`${self.logHead} Clearing board selection - no port selected`);
$('select[name="board"]').val("0").trigger("change");
}
}

// Listen for device removal to clear board selection
function onDeviceRemoved(devicePath) {
console.log(`${self.logHead} Device removed:`, devicePath);
// Clear board selection when device is removed
$('select[name="board"]').val("0").trigger("change");
// Also clear any loaded firmware
clearBufferedFirmware();
}

EventBus.$on("ports-input:change", onPortChange);
EventBus.$on("port-handler:device-removed", onDeviceRemoved);

async function saveFirmware() {
const fileType = self.firmware_type;
Expand Down Expand Up @@ -1458,6 +1508,17 @@ firmware_flasher.initialize = async function (callback) {
$("a.exit_dfu").removeClass("disabled");
}

// Auto-detect board if a drone is already connected when tab becomes active
if (
(PortHandler.portAvailable && !$('select[name="board"]').val()) ||
$('select[name="board"]').val() === "0"
) {
console.log(`${self.logHead} Auto-detecting board for already connected device`);
setTimeout(() => {
AutoDetect.verifyBoard();
}, 1000); // Small delay to ensure tab is fully loaded
}

GUI.content_ready(callback);
}

Expand All @@ -1476,6 +1537,12 @@ firmware_flasher.cleanup = function (callback) {
$(document).unbind("keypress");
$(document).off("click", "span.progressLabel a");

// Clean up EventBus listeners
EventBus.$off("port-handler:auto-select-usb-device");
EventBus.$off("port-handler:auto-select-serial-device");
EventBus.$off("ports-input:change");
EventBus.$off("port-handler:device-removed");

if (callback) callback();
};

Expand Down
Loading