Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates Nextion display interactions from direct NextionControl “external update” calls to a centralized MessageBus publish/subscribe model, so UI pages react to system events rather than being pushed update payload structs.
Changes:
- Inject
MessageBus*throughNextionFactory,BasePage, and various Nextion pages; pages now subscribe to bus events instead of overridinghandleExternalUpdate(). - Update command handlers (
SensorCommandHandler,AckCommandHandler,BaseNextionCommandHandler) to publish state changes onto theMessageBus. - Extend
MessageBuswith additional event types for UI/system metrics and sensor updates.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| SmartFuseBox/SmartFuseBoxApp.cpp | Wires MessageBus into Nextion and command handlers. |
| SmartFuseBox/SmartFuseBox.vcxproj | Adjusts include path ordering/contents for Debug |
| SmartFuseBox/SensorCommandHandler.h | Changes constructor to take MessageBus* (replacing NextionControl*). |
| SmartFuseBox/SensorCommandHandler.cpp | Publishes sensor updates to MessageBus instead of notifying Nextion pages directly. |
| SmartFuseBox/PageWarning.h / .cpp | Adds MessageBus* and subscribes to WarningChanged. |
| SmartFuseBox/PageVhfDistress.h / .cpp | Adds MessageBus* and subscribes to GpsLocationUpdated. |
| SmartFuseBox/PageSystem.h / .cpp | Adds MessageBus* and subscribes to CPU/memory events. |
| SmartFuseBox/PageSoundSignals.h / .cpp | Adds MessageBus* and subscribes to SoundSignalUpdated. |
| SmartFuseBox/PageRelay.h / .cpp | Adds MessageBus* and subscribes to RelayStatusChanged. |
| SmartFuseBox/PageHome.h / .cpp | Adds MessageBus* and subscribes to multiple sensor/relay events. |
| SmartFuseBox/PageEnvironment.h / .cpp | Adds MessageBus* and subscribes to temperature/humidity/GPS events. |
| SmartFuseBox/NextionFactory.h | Extends factory Create() to accept and pass through MessageBus* to pages. |
| SmartFuseBox/MessageBus.h | Adds new event types (bearing/speed/GPS direction/etc.). |
| SmartFuseBox/BasePage.h / .cpp | Stores MessageBus* in base page and updates constructor signature. |
| SmartFuseBox/BaseNextionCommandHandler.h / .cpp | Replaces NextionControl* dependency with MessageBus*. |
| SmartFuseBox/AckCommandHandler.h / .cpp | Publishes relay/sound/system ACK-derived updates to MessageBus. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.