Skip to content

Convert nextion to message bus#181

Merged
k3ldar merged 2 commits intomainfrom
NextionMessageBus
Apr 19, 2026
Merged

Convert nextion to message bus#181
k3ldar merged 2 commits intomainfrom
NextionMessageBus

Conversation

@k3ldar
Copy link
Copy Markdown
Owner

@k3ldar k3ldar commented Apr 19, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 19, 2026 14:43
@k3ldar k3ldar linked an issue Apr 19, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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* through NextionFactory, BasePage, and various Nextion pages; pages now subscribe to bus events instead of overriding handleExternalUpdate().
  • Update command handlers (SensorCommandHandler, AckCommandHandler, BaseNextionCommandHandler) to publish state changes onto the MessageBus.
  • Extend MessageBus with 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.

Comment thread SmartFuseBox/SmartFuseBoxApp.cpp
Comment thread SmartFuseBox/SensorCommandHandler.cpp
Comment thread SmartFuseBox/SensorCommandHandler.cpp Outdated
Comment thread SmartFuseBox/AckCommandHandler.cpp Outdated
@k3ldar k3ldar merged commit 4de78c2 into main Apr 19, 2026
1 check passed
@k3ldar k3ldar deleted the NextionMessageBus branch April 19, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert nextion to use message bus

2 participants