Fix GUI_control ReferenceError in magnetometer and other tabs #2544
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Summary
Fixes JavaScript
ReferenceError: GUI_control is not definedthat on magnetometer tab, firmware flasher and serial connection flows.Changes
Changed 4 instances across 3 files from incorrect
GUI_control.prototype.log()to correctGUI.log():tabs/magnetometer.js:653- Magnetometer 3D initialization error messagetabs/firmware_flasher.js:829- Firmware flasher connection error loggingjs/serial_backend.js:348, 416- Serial connection restart-required and API version error loggingRoot Cause
Code was calling
GUI_control.prototype.log()(the constructor prototype method) instead of using the exported singleton instanceGUI.log(). All other tabs in the codebase correctly useGUI.log()- these 4 locations were inconsistent with the established pattern.PR Type
Bug fix
Description
Fix ReferenceError by replacing GUI_control.prototype.log() with GUI.log()
Corrects 4 instances across 3 files to use singleton pattern
Affects magnetometer, firmware flasher, and serial backend modules
Aligns code with established GUI logging pattern throughout codebase
Diagram Walkthrough
File Walkthrough
serial_backend.js
Fix GUI logging calls in serial backendjs/serial_backend.js
GUI_control.prototype.log()toGUI.log()at line 348 forrestart-required error message
GUI_control.prototype.log()toGUI.log()at line 416 for APIversion error message
paths
firmware_flasher.js
Fix GUI logging in firmware flashertabs/firmware_flasher.js
GUI_control.prototype.log()toGUI.log()at line 829 fortarget prefetch error message
flashing
magnetometer.js
Fix GUI logging in magnetometer tabtabs/magnetometer.js
GUI_control.prototype.log()toGUI.log()at line 653 for mixerconfiguration error message
is not configured