mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 19:57:55 -06:00
Merge remote-tracking branch 'origin/master' into feature_slice_to_png
This commit is contained in:
commit
a5d6064ad6
4 changed files with 54 additions and 48 deletions
|
@ -14,7 +14,7 @@
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
#define SLIC3R_FORK_NAME "Slic3r Prusa Edition"
|
#define SLIC3R_FORK_NAME "Slic3r Prusa Edition"
|
||||||
#define SLIC3R_VERSION "1.40.1-rc"
|
#define SLIC3R_VERSION "1.40.1-rc2"
|
||||||
#define SLIC3R_BUILD "UNKNOWN"
|
#define SLIC3R_BUILD "UNKNOWN"
|
||||||
|
|
||||||
typedef int32_t coord_t;
|
typedef int32_t coord_t;
|
||||||
|
|
|
@ -26,9 +26,9 @@ namespace Slic3r {
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class PngExportDialog : public wxDialog
|
class PngExportDialog : public wxDialog
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxFilePickerCtrl* filepick_ctl_;
|
wxFilePickerCtrl* filepick_ctl_;
|
||||||
wxFilePickerCtrl* confpick_ctl_;
|
wxFilePickerCtrl* confpick_ctl_;
|
||||||
wxSpinCtrl* spin_reso_width_;
|
wxSpinCtrl* spin_reso_width_;
|
||||||
|
@ -52,9 +52,13 @@ class PngExportDialog : public wxDialog
|
||||||
virtual void BedsizeLock( wxCommandEvent& event ) { event.Skip(); }
|
virtual void BedsizeLock( wxCommandEvent& event ) { event.Skip(); }
|
||||||
virtual void Close( wxCommandEvent& /*event*/ ) { EndModal(wxID_OK); }
|
virtual void Close( wxCommandEvent& /*event*/ ) { EndModal(wxID_OK); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
PngExportDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Slice to zipped PNG files"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 452,170 ), long style = wxDEFAULT_DIALOG_STYLE );
|
PngExportDialog( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
|
const wxString& title = L("Slice to zipped PNG files"),
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxSize( 452,170 ),
|
||||||
|
long style = wxDEFAULT_DIALOG_STYLE );
|
||||||
~PngExportDialog();
|
~PngExportDialog();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -265,35 +265,37 @@ void PresetBundle::load_selections(const AppConfig &config)
|
||||||
|
|
||||||
// Parse the initial print / filament / printer profile names.
|
// Parse the initial print / filament / printer profile names.
|
||||||
std::string initial_print_profile_name = remove_ini_suffix(config.get("presets", "print"));
|
std::string initial_print_profile_name = remove_ini_suffix(config.get("presets", "print"));
|
||||||
std::vector<std::string> initial_filament_profile_names;
|
std::string initial_filament_profile_name = remove_ini_suffix(config.get("presets", "filament"));
|
||||||
std::string initial_printer_profile_name = remove_ini_suffix(config.get("presets", "printer"));
|
std::string initial_printer_profile_name = remove_ini_suffix(config.get("presets", "printer"));
|
||||||
|
|
||||||
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(printers.get_selected_preset().config.option("nozzle_diameter"));
|
|
||||||
size_t num_extruders = nozzle_diameter->values.size();
|
|
||||||
initial_filament_profile_names.emplace_back(remove_ini_suffix(config.get("presets", "filament")));
|
|
||||||
this->set_filament_preset(0, initial_filament_profile_names.back());
|
|
||||||
for (unsigned int i = 1; i < (unsigned int)num_extruders; ++ i) {
|
|
||||||
char name[64];
|
|
||||||
sprintf(name, "filament_%d", i);
|
|
||||||
if (! config.has("presets", name))
|
|
||||||
break;
|
|
||||||
initial_filament_profile_names.emplace_back(remove_ini_suffix(config.get("presets", name)));
|
|
||||||
this->set_filament_preset(i, initial_filament_profile_names.back());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Activate print / filament / printer profiles from the config.
|
// Activate print / filament / printer profiles from the config.
|
||||||
// If the printer profile enumerated by the config are not visible, select an alternate preset.
|
// If the printer profile enumerated by the config are not visible, select an alternate preset.
|
||||||
// Do not select alternate profiles for the print / filament profiles as those presets
|
// Do not select alternate profiles for the print / filament profiles as those presets
|
||||||
// will be selected by the following call of this->update_compatible_with_printer(true).
|
// will be selected by the following call of this->update_compatible_with_printer(true).
|
||||||
prints.select_preset_by_name_strict(initial_print_profile_name);
|
prints.select_preset_by_name_strict(initial_print_profile_name);
|
||||||
filaments.select_preset_by_name_strict(initial_filament_profile_names.front());
|
filaments.select_preset_by_name_strict(initial_filament_profile_name);
|
||||||
printers.select_preset_by_name(initial_printer_profile_name, true);
|
printers.select_preset_by_name(initial_printer_profile_name, true);
|
||||||
|
|
||||||
|
// Load the names of the other filament profiles selected for a multi-material printer.
|
||||||
|
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(printers.get_selected_preset().config.option("nozzle_diameter"));
|
||||||
|
size_t num_extruders = nozzle_diameter->values.size();
|
||||||
|
this->filament_presets = { initial_filament_profile_name };
|
||||||
|
for (unsigned int i = 1; i < (unsigned int)num_extruders; ++ i) {
|
||||||
|
char name[64];
|
||||||
|
sprintf(name, "filament_%d", i);
|
||||||
|
if (! config.has("presets", name))
|
||||||
|
break;
|
||||||
|
this->filament_presets.emplace_back(remove_ini_suffix(config.get("presets", name)));
|
||||||
|
}
|
||||||
|
// Do not define the missing filaments, so that the update_compatible_with_printer() will use the preferred filaments.
|
||||||
|
this->filament_presets.resize(num_extruders, "");
|
||||||
|
|
||||||
// Update visibility of presets based on their compatibility with the active printer.
|
// Update visibility of presets based on their compatibility with the active printer.
|
||||||
// Always try to select a compatible print and filament preset to the current printer preset,
|
// Always try to select a compatible print and filament preset to the current printer preset,
|
||||||
// as the application may have been closed with an active "external" preset, which does not
|
// as the application may have been closed with an active "external" preset, which does not
|
||||||
// exist.
|
// exist.
|
||||||
this->update_compatible_with_printer(true);
|
this->update_compatible_with_printer(true);
|
||||||
|
this->update_multi_material_filament_presets();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export selections (current print, current filaments, current printer) into config.ini
|
// Export selections (current print, current filaments, current printer) into config.ini
|
||||||
|
@ -946,10 +948,8 @@ void PresetBundle::update_multi_material_filament_presets()
|
||||||
for (size_t i = 0; i < std::min(this->filament_presets.size(), num_extruders); ++ i)
|
for (size_t i = 0; i < std::min(this->filament_presets.size(), num_extruders); ++ i)
|
||||||
this->filament_presets[i] = this->filaments.find_preset(this->filament_presets[i], true)->name;
|
this->filament_presets[i] = this->filaments.find_preset(this->filament_presets[i], true)->name;
|
||||||
// Append the rest of filament presets.
|
// Append the rest of filament presets.
|
||||||
// if (this->filament_presets.size() < num_extruders)
|
|
||||||
this->filament_presets.resize(num_extruders, this->filament_presets.empty() ? this->filaments.first_visible().name : this->filament_presets.back());
|
this->filament_presets.resize(num_extruders, this->filament_presets.empty() ? this->filaments.first_visible().name : this->filament_presets.back());
|
||||||
|
|
||||||
|
|
||||||
// Now verify if wiping_volumes_matrix has proper size (it is used to deduce number of extruders in wipe tower generator):
|
// Now verify if wiping_volumes_matrix has proper size (it is used to deduce number of extruders in wipe tower generator):
|
||||||
std::vector<double> old_matrix = this->project_config.option<ConfigOptionFloats>("wiping_volumes_matrix")->values;
|
std::vector<double> old_matrix = this->project_config.option<ConfigOptionFloats>("wiping_volumes_matrix")->values;
|
||||||
size_t old_number_of_extruders = int(sqrt(old_matrix.size())+EPSILON);
|
size_t old_number_of_extruders = int(sqrt(old_matrix.size())+EPSILON);
|
||||||
|
|
|
@ -1492,7 +1492,7 @@ void TabPrinter::build()
|
||||||
sizer->Add(btn);
|
sizer->Add(btn);
|
||||||
|
|
||||||
btn->Bind(wxEVT_BUTTON, [this, parent](wxCommandEvent e){
|
btn->Bind(wxEVT_BUTTON, [this, parent](wxCommandEvent e){
|
||||||
auto sender = new GCodeSender();
|
auto sender = Slic3r::make_unique<GCodeSender>();
|
||||||
auto res = sender->connect(
|
auto res = sender->connect(
|
||||||
m_config->opt_string("serial_port"),
|
m_config->opt_string("serial_port"),
|
||||||
m_config->opt_int("serial_speed")
|
m_config->opt_int("serial_speed")
|
||||||
|
@ -2134,6 +2134,8 @@ void Tab::save_preset(std::string name /*= ""*/)
|
||||||
update_tab_ui();
|
update_tab_ui();
|
||||||
// Update the selection boxes at the platter.
|
// Update the selection boxes at the platter.
|
||||||
on_presets_changed();
|
on_presets_changed();
|
||||||
|
// If current profile is saved, "delete preset" button have to be enabled
|
||||||
|
m_btn_delete_preset->Enable(true);
|
||||||
|
|
||||||
if (m_name == "printer")
|
if (m_name == "printer")
|
||||||
static_cast<TabPrinter*>(this)->m_initial_extruders_count = static_cast<TabPrinter*>(this)->m_extruders_count;
|
static_cast<TabPrinter*>(this)->m_initial_extruders_count = static_cast<TabPrinter*>(this)->m_extruders_count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue