ENH:add "reset all" function
jira: none Change-Id: Iac2c267e95ca0589bf2e6d6d536d70d3b3e4a70c
This commit is contained in:
parent
165882e723
commit
7239f7bfaa
|
@ -0,0 +1,4 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.56488 0.993197C8.82745 0.56744 7.88449 0.820103 7.45874 1.55754L2.93734 9.38883C2.7187 9.76752 2.84845 10.2517 3.22713 10.4704L3.4092 10.5755L2.07447 12.8873C1.41858 14.0233 1.80781 15.476 2.94386 16.1319L7.67368 18.8626C8.80973 19.5185 10.2624 19.1293 10.9183 17.9933L12.253 15.6815L12.4361 15.7872C12.8148 16.0058 13.299 15.876 13.5176 15.4974L18.039 7.66606C18.4648 6.92863 18.2121 5.98568 17.4747 5.55992L9.56488 0.993197ZM8.68571 2.26593C8.72023 2.20614 8.79669 2.18565 8.85648 2.22017L16.7663 6.7869C16.8261 6.82142 16.8466 6.89787 16.812 6.95766L12.6032 14.2476L4.47684 9.55591L8.68571 2.26593ZM3.30145 13.5957C3.03679 14.0541 3.19385 14.6402 3.65226 14.9049L8.38208 17.6357C8.84048 17.9003 9.42664 17.7433 9.6913 17.2849L11.0259 14.9732L4.63607 11.2841L3.30145 13.5957Z" fill="#1F1F1F"/>
|
||||
<path d="M17.3527 18.5051C17.3527 18.8964 17.0355 19.2135 16.6443 19.2135H8.97745C8.58622 19.2135 8.26906 18.8964 8.26906 18.5051C8.26906 18.1139 8.58622 17.7967 8.97745 17.7967H16.6443C17.0355 17.7967 17.3527 18.1139 17.3527 18.5051Z" fill="#1F1F1F"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,3 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3.54857 9.22868C3.11861 9.22868 2.77271 8.88275 2.77271 8.45275V3.79717C2.77271 3.36718 3.11861 3.02124 3.54857 3.02124C3.97852 3.02124 4.32443 3.36718 4.32443 3.79717V6.38684L4.97098 5.62707C6.29641 4.03642 8.29749 3.02124 10.5313 3.02124C14.5302 3.02124 17.7727 6.26398 17.7727 10.2633C17.7727 14.2625 14.5302 17.5053 10.5313 17.5053C8.90202 17.5053 7.39555 16.9654 6.1865 16.0569C5.84383 15.7982 5.77594 15.3133 6.03133 14.9706C6.28671 14.6279 6.77486 14.56 7.11753 14.8154C8.06796 15.5299 9.24792 15.9534 10.5313 15.9534C13.6736 15.9534 16.221 13.4058 16.221 10.2633C16.221 7.12074 13.6736 4.5731 10.5313 4.5731C8.77594 4.5731 7.20482 5.36843 6.16064 6.62285L6.1574 6.62932L5.26516 7.67682H8.20374C8.6337 7.67682 8.9796 8.02276 8.9796 8.45275C8.9796 8.88275 8.6337 9.22868 8.20374 9.22868H3.54857Z" fill="#6B6B6B"/>
|
||||
</svg>
|
After Width: | Height: | Size: 933 B |
|
@ -91,9 +91,10 @@ void MaterialItem::set_ams_info(wxColour col, wxString txt, int ctype, std::vect
|
|||
|
||||
void MaterialItem::reset_ams_info() {
|
||||
m_ams_name = "-";
|
||||
m_ams_coloul = wxColour(0xEE, 0xEE, 0xEE);
|
||||
m_ams_coloul = wxColour(0xCE, 0xCE, 0xCE);
|
||||
m_ams_cols.clear();
|
||||
m_ams_ctype = 0;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MaterialItem::disable()
|
||||
|
@ -660,7 +661,7 @@ AmsMapingPopup::AmsMapingPopup(wxWindow *parent, bool use_in_sync_dialog) :
|
|||
m_right_tips->SetLabel(m_right_tip_text);
|
||||
m_sizer_ams_right_horizonal->Add(m_right_tips, 0, wxEXPAND , 0);
|
||||
|
||||
m_reset_btn = new ScalableButton(m_right_first_text_panel, wxID_ANY, "text_undo", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true, 14);
|
||||
m_reset_btn = new ScalableButton(m_right_first_text_panel, wxID_ANY, "erase", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true, 14);
|
||||
m_reset_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { reset_ams_info(); });
|
||||
m_reset_btn->SetBackgroundColour(*wxWHITE);
|
||||
m_reset_btn->SetToolTip(_L("Reset current filament mapping"));
|
||||
|
|
|
@ -90,6 +90,7 @@ bool SyncAmsInfoDialog::Show(bool show)
|
|||
m_are_you_sure_title->Show(true);
|
||||
if (m_mode_combox_sizer) {
|
||||
m_mode_combox_sizer->Show(true);
|
||||
m_reset_all_btn->Hide();
|
||||
}
|
||||
m_confirm_title->SetLabel(m_undone_str);
|
||||
}
|
||||
|
@ -136,7 +137,6 @@ void SyncAmsInfoDialog::update_select_layout(MachineObject *obj)
|
|||
m_checkbox_list["timelapse"]->Hide();
|
||||
m_checkbox_list["bed_leveling"]->Hide();
|
||||
m_checkbox_list["use_ams"]->Hide();
|
||||
m_checkbox_list["flow_cali"]->Hide();
|
||||
m_checkbox_list["nozzle_offset_cali"]->Hide();
|
||||
|
||||
if (!obj) { return; }
|
||||
|
@ -146,30 +146,20 @@ void SyncAmsInfoDialog::update_select_layout(MachineObject *obj)
|
|||
m_checkbox_list["nozzle_offset_cali"]->Show();
|
||||
m_checkbox_list["nozzle_offset_cali"]->update_options(ops_auto);
|
||||
m_checkbox_list["bed_leveling"]->update_options(ops_auto);
|
||||
m_checkbox_list["flow_cali"]->update_options(ops_auto);
|
||||
|
||||
m_checkbox_list["nozzle_offset_cali"]->setValue("auto");
|
||||
m_checkbox_list["bed_leveling"]->setValue("auto");
|
||||
m_checkbox_list["flow_cali"]->setValue("auto");
|
||||
} else {
|
||||
m_checkbox_list["bed_leveling"]->update_options(ops_no_auto);
|
||||
m_checkbox_list["flow_cali"]->update_options(ops_auto);
|
||||
|
||||
if (config && config->get("print", "bed_leveling") == "0") {
|
||||
m_checkbox_list["bed_leveling"]->setValue("off");
|
||||
} else {
|
||||
m_checkbox_list["bed_leveling"]->setValue("on");
|
||||
}
|
||||
|
||||
if (config && config->get("print", "flow_cali") == "0") {
|
||||
m_checkbox_list["flow_cali"]->setValue("off");
|
||||
} else {
|
||||
m_checkbox_list["flow_cali"]->setValue("on");
|
||||
}
|
||||
}
|
||||
|
||||
update_timelapse_enable_status();
|
||||
update_flow_cali_check(obj);
|
||||
|
||||
if (config && config->get("print", "timelapse") == "0") {
|
||||
m_checkbox_list["timelapse"]->setValue("off");
|
||||
|
@ -769,6 +759,13 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
|
|||
m_mode_combox_sizer->AddSpacer(FromDIP(8));
|
||||
m_mode_combox_sizer->Add(m_override_btn, 0, wxALIGN_CENTER | wxEXPAND | wxALL, FromDIP(2));
|
||||
m_mode_combox_sizer->AddStretchSpacer();
|
||||
m_reset_all_btn = new ScalableButton(m_scrolledWindow, wxID_ANY, "reset_gray", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER,
|
||||
true, 14);
|
||||
m_reset_all_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { reset_all_ams_info(); });
|
||||
m_reset_all_btn->SetBackgroundColour(*wxWHITE);
|
||||
m_reset_all_btn->SetToolTip(_L("Reset all filament mapping"));
|
||||
m_mode_combox_sizer->Add(m_reset_all_btn, 0, wxALIGN_CENTER | wxEXPAND | wxALL, FromDIP(2));
|
||||
m_mode_combox_sizer->AddSpacer(FromDIP(30));
|
||||
|
||||
m_colormap_btn->Bind(wxEVT_BUTTON, &SyncAmsInfoDialog::update_when_change_map_mode,this); // update_when_change_map_mode(e.GetSelection());
|
||||
m_override_btn->Bind(wxEVT_BUTTON, &SyncAmsInfoDialog::update_when_change_map_mode,this);
|
||||
|
@ -917,10 +914,6 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
|
|||
_L("Check heatbed flatness. Leveling makes extruded height uniform.\n*Automatic mode: Level first (about 10 seconds). Skip if surface is fine."),
|
||||
ops_auto, "bed_leveling");
|
||||
|
||||
auto option_flow_dynamics_cali =
|
||||
new PrintOption(m_options_other, _L("Flow Dynamics Calibration"),
|
||||
_L("Find the best coefficient for dynamic flow calibration to enhance print quality.\n*Automatic mode: Skip if the filament was calibrated recently."),
|
||||
ops_auto, "flow_cali");
|
||||
|
||||
auto option_nozzle_offset_cali_cali =
|
||||
new PrintOption(m_options_other, _L("Nozzle Offset Calibration"),
|
||||
|
@ -937,7 +930,6 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
|
|||
m_sizer_options_timelapse->Add(option_timelapse, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_use_ams, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_auto_bed_level, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_flow_dynamics_cali, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_nozzle_offset_cali_cali, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
|
||||
|
||||
m_options_other->SetSizer(m_sizer_options_other);
|
||||
|
@ -945,12 +937,10 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
|
|||
m_checkbox_list["timelapse"] = option_timelapse;
|
||||
m_checkbox_list["bed_leveling"] = option_auto_bed_level;
|
||||
m_checkbox_list["use_ams"] = option_use_ams;
|
||||
m_checkbox_list["flow_cali"] = option_flow_dynamics_cali;
|
||||
m_checkbox_list["nozzle_offset_cali"] = option_nozzle_offset_cali_cali;
|
||||
|
||||
option_timelapse->Hide();
|
||||
option_auto_bed_level->Hide();
|
||||
option_flow_dynamics_cali->Hide();
|
||||
option_nozzle_offset_cali_cali->Hide();
|
||||
option_use_ams->Hide();
|
||||
|
||||
|
@ -2215,6 +2205,11 @@ void SyncAmsInfoDialog::on_set_finish_mapping(wxCommandEvent &evt)
|
|||
change_default_normal(old_filament_id, ams_colour);
|
||||
final_deal_edge_pixels_data(m_preview_thumbnail_data);
|
||||
set_default_normal(m_preview_thumbnail_data); // do't reset ams
|
||||
if (!m_reset_all_btn->IsShown()) {
|
||||
m_reset_all_btn->Show();
|
||||
Layout();
|
||||
Fit();
|
||||
}
|
||||
}
|
||||
|
||||
int ctype = 0;
|
||||
|
@ -2401,16 +2396,6 @@ void SyncAmsInfoDialog::on_timer(wxTimerEvent &event)
|
|||
}
|
||||
}
|
||||
|
||||
void SyncAmsInfoDialog::update_flow_cali_check(MachineObject *obj)
|
||||
{
|
||||
auto bed_type = m_plater->get_partplate_list().get_curr_plate()->get_bed_type(true);
|
||||
auto show_cali_tips = true;
|
||||
|
||||
if (obj && obj->get_printer_arch() == PrinterArch::ARCH_I3) { show_cali_tips = false; }
|
||||
|
||||
set_flow_calibration_state(true, show_cali_tips);
|
||||
}
|
||||
|
||||
void SyncAmsInfoDialog::update_show_status()
|
||||
{
|
||||
// refreshing return
|
||||
|
@ -2714,7 +2699,16 @@ void SyncAmsInfoDialog::reset_ams_material()
|
|||
}
|
||||
}
|
||||
|
||||
void SyncAmsInfoDialog::reset_one_ams_material(const std::string& index_str)
|
||||
void SyncAmsInfoDialog::reset_all_ams_info()
|
||||
{
|
||||
for (int i = 0; i < m_ams_mapping_result.size(); i++) {
|
||||
reset_one_ams_material(std::to_string(i+1),true);
|
||||
}
|
||||
m_reset_all_btn->Hide();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SyncAmsInfoDialog::reset_one_ams_material(const std::string &index_str, bool reset_to_first)
|
||||
{
|
||||
MaterialHash::iterator iter = m_materialList.begin();
|
||||
while (iter != m_materialList.end()) {
|
||||
|
@ -2722,10 +2716,21 @@ void SyncAmsInfoDialog::reset_one_ams_material(const std::string& index_str)
|
|||
Material *item = iter->second;
|
||||
auto m = dynamic_cast<MaterialSyncItem*> (item->item);
|
||||
if (m && m->get_material_index_str() == index_str) {
|
||||
m->reset_valid_info();
|
||||
if (reset_to_first) {
|
||||
m->reset_valid_info();
|
||||
} else {
|
||||
m->reset_ams_info();
|
||||
}
|
||||
|
||||
int index = std::atoi(index_str.c_str()) - 1;
|
||||
if (index >=0 && index < m_back_ams_mapping_result.size()) {
|
||||
m_ams_mapping_result[index] = m_back_ams_mapping_result[index];
|
||||
if (reset_to_first) {
|
||||
m_ams_mapping_result[index] = m_back_ams_mapping_result[index];
|
||||
} else {
|
||||
m_ams_mapping_result[index].ams_id = "";
|
||||
m_ams_mapping_result[index].slot_id = "";
|
||||
m_ams_mapping_result[index].color = "";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2752,23 +2757,6 @@ void SyncAmsInfoDialog::on_dpi_changed(const wxRect &suggested_rect)
|
|||
Refresh();
|
||||
}
|
||||
|
||||
void SyncAmsInfoDialog::set_flow_calibration_state(bool state, bool show_tips)
|
||||
{
|
||||
if (!state) {
|
||||
m_checkbox_list["flow_cali"]->setValue(state ? "on" : "off");
|
||||
m_checkbox_list["flow_cali"]->Enable();
|
||||
} else {
|
||||
AppConfig *config = wxGetApp().app_config;
|
||||
if (config && config->get("print", "flow_cali") == "0") {
|
||||
m_checkbox_list["flow_cali"]->setValue("off");
|
||||
} else {
|
||||
m_checkbox_list["flow_cali"]->setValue("on");
|
||||
}
|
||||
|
||||
m_checkbox_list["flow_cali"]->Enable();
|
||||
}
|
||||
}
|
||||
|
||||
void SyncAmsInfoDialog::set_default(bool hide_some)
|
||||
{
|
||||
if (m_print_type == PrintFromType::FROM_NORMAL) {
|
||||
|
@ -2989,6 +2977,9 @@ void SyncAmsInfoDialog::reset_and_sync_ams_list()
|
|||
reset_one_ams_material(item_index_str);
|
||||
m_mapping_popup.update_items_check_state(m_ams_mapping_result);
|
||||
m_mapping_popup.Refresh();
|
||||
if (!m_reset_all_btn->IsShown()) {
|
||||
m_reset_all_btn->Show();
|
||||
}
|
||||
};
|
||||
m_mapping_popup.set_reset_callback(reset_call_back);
|
||||
m_mapping_popup.set_tag_texture(materials[extruder]);
|
||||
|
|
|
@ -168,7 +168,8 @@ public:
|
|||
void reset_timeout();
|
||||
void update_user_printer();
|
||||
void reset_ams_material();
|
||||
void reset_one_ams_material(const std::string & index_str);
|
||||
void reset_all_ams_info();
|
||||
void reset_one_ams_material(const std::string & index_str,bool reset_to_first =false);
|
||||
void update_show_status();
|
||||
void update_printer_combobox(wxCommandEvent &event);
|
||||
void on_cancel(wxCloseEvent &event);
|
||||
|
@ -192,7 +193,6 @@ public:
|
|||
void unify_deal_thumbnail_data(ThumbnailData &input_data, ThumbnailData &no_light_data,bool allow_clone_ams_color);
|
||||
void change_default_normal(int old_filament_id, wxColour temp_ams_color);
|
||||
void on_timer(wxTimerEvent &event);
|
||||
void update_flow_cali_check(MachineObject *obj);
|
||||
void update_user_machine_list();
|
||||
void update_lan_machine_list();
|
||||
void stripWhiteSpace(std::string &str);
|
||||
|
@ -200,7 +200,6 @@ public:
|
|||
void update_priner_status_msg(wxString msg, bool is_warning = false);
|
||||
void update_print_status_msg(wxString msg, bool is_warning = false, bool is_printer = true);
|
||||
void update_print_error_info(int code, std::string msg, std::string extra);
|
||||
void set_flow_calibration_state(bool state, bool show_tips = true);
|
||||
bool has_timelapse_warning();
|
||||
void update_timelapse_enable_status();
|
||||
bool is_same_printer_model();
|
||||
|
@ -319,6 +318,7 @@ private:
|
|||
|
||||
CapsuleButton * m_colormap_btn = nullptr;
|
||||
CapsuleButton * m_override_btn = nullptr;
|
||||
ScalableButton * m_reset_all_btn{nullptr};
|
||||
wxBoxSizer * m_advace_setting_sizer = nullptr;
|
||||
wxStaticText * m_more_setting_tips = nullptr;
|
||||
wxStaticBitmap * m_advanced_options_icon{nullptr};
|
||||
|
|
Loading…
Reference in New Issue