Purging volumes dialog now uses filament colour in case extruder color is undefined

This commit is contained in:
Lukas Matena 2019-09-18 11:47:19 +02:00
parent cd7895065a
commit 741e98804c
2 changed files with 11 additions and 1 deletions

View File

@ -522,7 +522,11 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent) :
const std::vector<double> &init_extruders = (project_config.option<ConfigOptionFloats>("wiping_volumes_extruders"))->values;
const DynamicPrintConfig* config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
const std::vector<std::string> &extruder_colours = (config->option<ConfigOptionStrings>("extruder_colour"))->values;
std::vector<std::string> extruder_colours = (config->option<ConfigOptionStrings>("extruder_colour"))->values;
const std::vector<std::string>& filament_colours = (wxGetApp().plater()->get_plater_config()->option<ConfigOptionStrings>("filament_colour"))->values;
for (size_t i=0; i<extruder_colours.size(); ++i)
if (extruder_colours[i] == "")
extruder_colours[i] = filament_colours[i];
WipingDialog dlg(parent, cast<float>(init_matrix), cast<float>(init_extruders), extruder_colours);
@ -4838,6 +4842,11 @@ void Plater::on_activate()
this->p->show_delayed_error_message();
}
const DynamicPrintConfig* Plater::get_plater_config() const
{
return p->config;
}
wxString Plater::get_project_filename(const wxString& extension) const
{
return p->get_project_filename(extension);

View File

@ -213,6 +213,7 @@ public:
void on_config_change(const DynamicPrintConfig &config);
// On activating the parent window.
void on_activate();
const DynamicPrintConfig* get_plater_config() const;
void update_object_menu();