ENH:add check machine sync status logic

1. Check machine sync logic before pop up filament map
2. Switch to auto for flush mode if is not synced

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I05ef0e610418767f763c5579f5fc85a4e9b79c47
(cherry picked from commit 5d7f8b126789ca4f8f20d5cfbcc70ac24efd4d6c)
This commit is contained in:
xun.zhang
2024-12-20 20:05:43 +08:00
committed by Noisyfox
parent 057a1a4f5d
commit daad39949f
4 changed files with 37 additions and 2 deletions

View File

@@ -11,9 +11,10 @@ static const wxString AutoForFlushLabel = _L("Filament-Saving Mode");
static const wxString AutoForMatchLabel = _L("Convenient Mode");
static const wxString ManualLabel = _L("Manual Mode");
static const wxString AutoForFlushDesp = _L("(Arrage after slicing)");
static const wxString AutoForFlushDesp = _L("(Arrange after slicing)");
static const wxString AutoForMatchDesp = _L("(Arrange before slicing)");
static const wxString ManualDesp = "";
static const wxString MachineSyncTip = _L("(Please sync printer)");
static const wxString AutoForFlushDetail = _L("Disregrad the filaments in AMS. Optimize filament usage "
"by calculating the best allocation for the left and right "
@@ -220,7 +221,19 @@ void FilamentGroupPopup::Init(bool connect_status)
radio_btns[ButtonType::btForMatch]->Enable(connect_status);
button_labels[ButtonType::btForMatch]->Enable(connect_status);
if (connect_status) {
button_desps[ButtonType::btForMatch]->SetLabel(AutoForMatchDesp);
}
else {
button_desps[ButtonType::btForMatch]->SetLabel(MachineSyncTip);
}
m_mode = get_prefered_map_mode();
if (m_mode == fmmAutoForMatch && !connect_status) {
set_prefered_map_mode(fmmAutoForFlush);
m_mode = fmmAutoForFlush;
}
wxCheckBoxState check_state = get_pop_up_remind_flag() ? wxCheckBoxState::wxCHK_UNCHECKED : wxCheckBoxState::wxCHK_CHECKED;
remind_checkbox->Set3StateValue(check_state);