mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 15:51:10 -06:00
FIX: the P1P printer is not support smooth timelapse
Change-Id: I0e9faf9d9c63d6541189724813fd803c8522a26b (cherry picked from commit 84edf0b3eeb84c65990926ab8fc69b0f51ce6f3d)
This commit is contained in:
parent
882e06bd9b
commit
7dddb17d8a
5 changed files with 62 additions and 2 deletions
|
@ -602,6 +602,11 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
bool has_fuzzy_skin = (config->opt_enum<FuzzySkinType>("fuzzy_skin") != FuzzySkinType::None);
|
||||
for (auto el : { "fuzzy_skin_thickness", "fuzzy_skin_point_distance"})
|
||||
toggle_line(el, has_fuzzy_skin);
|
||||
|
||||
// C11 printer is not support smooth timelapse
|
||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||
std::string str_preset_type = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
|
||||
toggle_field("timelapse_type", str_preset_type != "C11");
|
||||
}
|
||||
|
||||
void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/)
|
||||
|
|
|
@ -802,7 +802,8 @@ UnsavedChangesDialog::UnsavedChangesDialog(const wxString &caption, const wxStri
|
|||
}
|
||||
|
||||
UnsavedChangesDialog::UnsavedChangesDialog(Preset::Type type, PresetCollection *dependent_presets, const std::string &new_selected_preset, bool no_transfer)
|
||||
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe),
|
||||
: m_new_selected_preset_name(new_selected_preset)
|
||||
, DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe),
|
||||
wxID_ANY,
|
||||
_L("Discard or Keep changes"),
|
||||
wxDefaultPosition,
|
||||
|
@ -1057,6 +1058,9 @@ void UnsavedChangesDialog::show_info_line(Action action, std::string preset_name
|
|||
|
||||
void UnsavedChangesDialog::close(Action action)
|
||||
{
|
||||
if (action == Action::Transfer) {
|
||||
check_option_valid();
|
||||
}
|
||||
m_exit_action = action;
|
||||
this->EndModal(wxID_CLOSE);
|
||||
}
|
||||
|
@ -1653,6 +1657,28 @@ void UnsavedChangesDialog::on_sys_color_changed()
|
|||
Refresh();
|
||||
}
|
||||
|
||||
bool UnsavedChangesDialog::check_option_valid()
|
||||
{
|
||||
auto itor = std::find_if(m_presetitems.begin(), m_presetitems.end(), [](const PresetItem &item) {
|
||||
return item.opt_key == "timelapse_type";
|
||||
});
|
||||
|
||||
if (itor != m_presetitems.end()) {
|
||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||
Preset * new_preset = preset_bundle->printers.find_preset(m_new_selected_preset_name);
|
||||
std::string str_print_type = new_preset->get_current_printer_type(preset_bundle);
|
||||
if (str_print_type == "C11" && itor->new_value.ToStdString() == "Smooth") {
|
||||
MessageDialog dlg(wxGetApp().plater(), _L("The P1P printer is not support smooth timelapse, it will not transform the timelapse changes."),
|
||||
_L("Warning"), wxICON_WARNING | wxOK);
|
||||
dlg.ShowModal();
|
||||
m_presetitems.erase(itor);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------
|
||||
// FullCompareDialog
|
||||
|
|
|
@ -311,6 +311,8 @@ private:
|
|||
// additional action buttons used in dialog
|
||||
int m_buttons { ActionButtons::TRANSFER | ActionButtons::SAVE };
|
||||
|
||||
std::string m_new_selected_preset_name;
|
||||
|
||||
public:
|
||||
// Discard and Cancel buttons are always but next buttons are optional
|
||||
enum ActionButtons {
|
||||
|
@ -377,6 +379,7 @@ public:
|
|||
protected:
|
||||
void on_dpi_changed(const wxRect& suggested_rect) override;
|
||||
void on_sys_color_changed() override;
|
||||
bool check_option_valid();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue