-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Fix and enhance FTDI Eve Touch UI (#22189)
- Loading branch information
1 parent
906fa05
commit 1ba694c
Showing
11 changed files
with
182 additions
and
17 deletions.
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/********************************* | ||
* cocoa_press/leveling_menu.cpp * | ||
*********************************/ | ||
|
||
/**************************************************************************** | ||
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. * | ||
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * | ||
* * | ||
* This program is free software: you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation, either version 3 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* To view a copy of the GNU General Public License, go to the following * | ||
* location: <https://www.gnu.org/licenses/>. * | ||
****************************************************************************/ | ||
|
||
#include "../config.h" | ||
#include "../screens.h" | ||
|
||
#ifdef COCOA_LEVELING_MENU | ||
|
||
#if BOTH(HAS_BED_PROBE,BLTOUCH) | ||
#include "../../../../feature/bltouch.h" | ||
#endif | ||
|
||
using namespace FTDI; | ||
using namespace ExtUI; | ||
using namespace Theme; | ||
|
||
#define GRID_ROWS 5 | ||
#define GRID_COLS 3 | ||
#define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1) | ||
#define PROBE_BED_POS BTN_POS(1,2), BTN_SIZE(1,1) | ||
#define SHOW_MESH_POS BTN_POS(2,2), BTN_SIZE(1,1) | ||
#define EDIT_MESH_POS BTN_POS(3,2), BTN_SIZE(1,1) | ||
#define BLTOUCH_TITLE_POS BTN_POS(1,3), BTN_SIZE(3,1) | ||
#define BLTOUCH_RESET_POS BTN_POS(1,4), BTN_SIZE(1,1) | ||
#define BLTOUCH_TEST_POS BTN_POS(2,4), BTN_SIZE(1,1) | ||
#define BACK_POS BTN_POS(1,5), BTN_SIZE(3,1) | ||
|
||
void LevelingMenu::onRedraw(draw_mode_t what) { | ||
if (what & BACKGROUND) { | ||
CommandProcessor cmd; | ||
cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) | ||
.cmd(CLEAR(true,true,true)) | ||
.tag(0); | ||
} | ||
|
||
if (what & FOREGROUND) { | ||
CommandProcessor cmd; | ||
cmd.font(font_large) | ||
.cmd(COLOR_RGB(bg_text_enabled)) | ||
.text(BED_MESH_TITLE_POS, GET_TEXT_F(MSG_BED_LEVELING)) | ||
.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) | ||
.font(font_medium).colors(normal_btn) | ||
.tag(2).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED)) | ||
.enabled(ENABLED(HAS_MESH)) | ||
.tag(3).button(SHOW_MESH_POS, GET_TEXT_F(MSG_SHOW_MESH)) | ||
.enabled(ENABLED(HAS_MESH)) | ||
.tag(4).button(EDIT_MESH_POS, GET_TEXT_F(MSG_EDIT_MESH)) | ||
#undef GRID_COLS | ||
#define GRID_COLS 2 | ||
.tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET)) | ||
.tag(6).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST)) | ||
#undef GRID_COLS | ||
#define GRID_COLS 3 | ||
.colors(action_btn) | ||
.tag(1).button(BACK_POS, GET_TEXT_F(MSG_BACK)); | ||
} | ||
} | ||
|
||
bool LevelingMenu::onTouchEnd(uint8_t tag) { | ||
switch (tag) { | ||
case 1: GOTO_PREVIOUS(); break; | ||
case 2: BedMeshViewScreen::doProbe(); break; | ||
case 3: BedMeshViewScreen::show(); break; | ||
case 4: BedMeshEditScreen::show(); break; | ||
case 5: injectCommands_P(PSTR("M280 P0 S60")); break; | ||
case 6: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break; | ||
default: return false; | ||
} | ||
return true; | ||
} | ||
|
||
#endif // COCOA_LEVELING_MENU |
32 changes: 32 additions & 0 deletions
32
Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.h
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/******************************* | ||
* cocoa_press/leveling_menu.h * | ||
******************************/ | ||
|
||
/**************************************************************************** | ||
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. * | ||
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * | ||
* * | ||
* This program is free software: you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation, either version 3 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* GNU General Public License for more details. * | ||
* * | ||
* To view a copy of the GNU General Public License, go to the following * | ||
* location: <https://www.gnu.org/licenses/>. * | ||
****************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#define COCOA_LEVELING_MENU | ||
#define COCOA_LEVELING_MENU_CLASS LevelingMenu | ||
|
||
class LevelingMenu : public BaseScreen, public CachedScreen<LEVELING_SCREEN_CACHE> { | ||
public: | ||
static void onRedraw(draw_mode_t); | ||
static bool onTouchEnd(uint8_t tag); | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,4 +132,3 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) { | |
} | ||
|
||
#endif // FTDI_LEVELING_MENU | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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