Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic bed leveling screen to Calibration menu #2438

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martin357
Copy link
Collaborator

  • Use screen_t as ancestor and get the last marlin message localy from the screen
  • Block MenuTimeout when Mesh Bed Leveling is in progress
  • Add progressBar

BFW-2586

const uint8_t *data = reinterpret_cast<const uint8_t *>(msg);
auto newText = string_view_utf8::MakeRAM(data);
if (newText != this->m_statusMsg.GetText()) {
this->m_statusMsg.SetText(newText);
Copy link
Contributor

Choose a reason for hiding this comment

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

The data could change under our hands between the call and invalidate.
MakeRAM does not allocate any memory, it uses the memory where the pointer points.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should be fixed by keeping an internal copy.


/** While an instance exists, MenuTimeout will be disabled.
**/
class MenuTimeoutBlocker {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just call DisableMenuTimeout() in constructor. and it will disable timeout for this screen. This object is not needed.

With Screens::Access() you get pinter to current screen

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed, switched to DisableMenuTimeout()

#include "screen.hpp"
#include "ScreenHandler.hpp"

class screen_bed_leveling_t : public AddSuperWindow<screen_t> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use CamelCase for the name of the screen.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed

, footer(this) {
header.SetIcon(IDR_PNG_heatbed_16px);
header.SetText(_("BED LEVELING"));
this->m_statusMsg.SetText(_(""));
Copy link
Contributor

Choose a reason for hiding this comment

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

Text will be initialized as empty, but if you want use directly stringview insted of translating empty string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

 - Use screen_t as ancestor and get the last marlin message localy from the screen
 - Block MenuTimeout when Mesh Bed Leveling is in progress
 - Add progressBar

BFW-2586
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.

2 participants