FIX: add some missing translate keys
1. Add missing translation keys 2. Fix filament map dialog can't display in auto mode JIRA:STUDIO-10216 Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I0c3927877dd91befc2463a300324bc6823615673
This commit is contained in:
parent
6e74a4a77b
commit
3733f33953
|
@ -5,6 +5,8 @@
|
||||||
#include "ParameterUtils.hpp"
|
#include "ParameterUtils.hpp"
|
||||||
#include "GCode/ToolOrderUtils.hpp"
|
#include "GCode/ToolOrderUtils.hpp"
|
||||||
#include "FilamentGroupUtils.hpp"
|
#include "FilamentGroupUtils.hpp"
|
||||||
|
#include "I18N.hpp"
|
||||||
|
|
||||||
// #define SLIC3R_DEBUG
|
// #define SLIC3R_DEBUG
|
||||||
|
|
||||||
// Make assert active if SLIC3R_DEBUG
|
// Make assert active if SLIC3R_DEBUG
|
||||||
|
@ -23,6 +25,13 @@
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
//! macro used to mark string used at localization,
|
||||||
|
//! return same string
|
||||||
|
|
||||||
|
#ifndef _L
|
||||||
|
#define _L(s) Slic3r::I18N::translate(s)
|
||||||
|
#endif
|
||||||
|
|
||||||
const static bool g_wipe_into_objects = false;
|
const static bool g_wipe_into_objects = false;
|
||||||
constexpr double similar_color_threshold_de2000 = 20.0;
|
constexpr double similar_color_threshold_de2000 = 20.0;
|
||||||
|
|
||||||
|
@ -63,9 +72,8 @@ bool check_filament_printable_after_group(const std::vector<unsigned int> &used_
|
||||||
std::vector<std::string> limit_types = split_string(print_config->unprintable_filament_types.get_at(idx), ',');
|
std::vector<std::string> limit_types = split_string(print_config->unprintable_filament_types.get_at(idx), ',');
|
||||||
auto iter = std::find(limit_types.begin(), limit_types.end(), filament_type);
|
auto iter = std::find(limit_types.begin(), limit_types.end(), filament_type);
|
||||||
if (iter != limit_types.end()) {
|
if (iter != limit_types.end()) {
|
||||||
std::string error_msg;
|
std::string extruder_name = idx == 0 ? _L("left") : _L("right");
|
||||||
std::string extruder_name = idx == 0 ? "left" : "right";
|
std::string error_msg = _L("Grouping error: ") + filament_type + _L(" can not be placed in the ") + extruder_name + _L(" nozzle");
|
||||||
error_msg = "Grouping error: " + filament_type + " can not be placed in the " + extruder_name + " extruder";
|
|
||||||
throw Slic3r::RuntimeError(error_msg);
|
throw Slic3r::RuntimeError(error_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1141,12 +1149,10 @@ void ToolOrdering::reorder_extruders_for_minimum_flush_volume(bool reorder_first
|
||||||
check_filament_printable_after_group(used_filaments, filament_maps, print_config);
|
check_filament_printable_after_group(used_filaments, filament_maps, print_config);
|
||||||
|
|
||||||
if (nozzle_nums > 1 && !check_tpu_group(used_filaments, filament_maps, print_config)) {
|
if (nozzle_nums > 1 && !check_tpu_group(used_filaments, filament_maps, print_config)) {
|
||||||
if (map_mode == FilamentMapMode::fmmManual) {
|
int master_extruder_id = print_config->master_extruder_id.value - 1; // to 0 based
|
||||||
throw Slic3r::RuntimeError(std::string("Manual grouping error: TPU can only be placed in a nozzle alone."));
|
std::string nozzle_name = master_extruder_id == 0 ? "left" : "right";
|
||||||
}
|
std::string exception_str = _L(std::string("TPU is incompatible with AMS and must be printed seperately in the ") + nozzle_name + " nozzle.\nPlease adjust the filament group accordingly.");
|
||||||
else {
|
throw Slic3r::RuntimeError(exception_str);
|
||||||
throw Slic3r::RuntimeError(std::string("Auto grouping error: TPU can only be placed in a nozzle alone."));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1923,12 +1923,10 @@ void Print::process(std::unordered_map<std::string, long long>* slice_time, bool
|
||||||
// check map valid both in auto and mannual mode
|
// check map valid both in auto and mannual mode
|
||||||
std::transform(filament_maps.begin(), filament_maps.end(), filament_maps.begin(), [](int value) {return value - 1; });
|
std::transform(filament_maps.begin(), filament_maps.end(), filament_maps.begin(), [](int value) {return value - 1; });
|
||||||
if (!ToolOrdering::check_tpu_group(used_filaments, filament_maps, &m_config)) {
|
if (!ToolOrdering::check_tpu_group(used_filaments, filament_maps, &m_config)) {
|
||||||
if (map_mode == FilamentMapMode::fmmManual) {
|
int master_extruder_id = m_config.master_extruder_id.value - 1; // to 0 based
|
||||||
throw Slic3r::RuntimeError(std::string("Manual grouping error: TPU can only be placed in a nozzle alone."));
|
std::string nozzle_name = master_extruder_id == 0 ? "left" : "right";
|
||||||
}
|
std::string exception_str = L(std::string("TPU is incompatible with AMS and must be printed seperately in the ") + nozzle_name + " nozzle.\nPlease adjust the filament group accordingly.");
|
||||||
else {
|
throw Slic3r::RuntimeError(exception_str);
|
||||||
throw Slic3r::RuntimeError(std::string("Auto grouping error: TPU can only be placed in a nozzle alone."));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// print_object_instances_ordering = sort_object_instances_by_max_z(print);
|
// print_object_instances_ordering = sort_object_instances_by_max_z(print);
|
||||||
|
|
|
@ -53,8 +53,8 @@ FilamentGroupPopup::FilamentGroupPopup(wxWindow *parent) : PopupWindow(parent, w
|
||||||
const wxString AutoForMatchLabel = _L("Convenience Mode");
|
const wxString AutoForMatchLabel = _L("Convenience Mode");
|
||||||
const wxString ManualLabel = _L("Custom Mode");
|
const wxString ManualLabel = _L("Custom Mode");
|
||||||
|
|
||||||
const wxString AutoForFlushDetail = _L("Recommends filament grouping for the left and right nozzles based on the most filament-saving principles to minimize waste");
|
const wxString AutoForFlushDetail = _L("Generates filament grouping for the left and right nozzles based on the most filament-saving principles to minimize waste");
|
||||||
const wxString AutoForMatchDetail = _L("Recommends filament grouping for the left and right nozzles based on the printer's actual filament status, reducing the need for manual filament adjustment");
|
const wxString AutoForMatchDetail = _L("Generates filament grouping for the left and right nozzles based on the printer's actual filament status, reducing the need for manual filament adjustment");
|
||||||
const wxString ManualDetail = _L("Manually assign filament to the left or right nozzle");
|
const wxString ManualDetail = _L("Manually assign filament to the left or right nozzle");
|
||||||
|
|
||||||
const wxString AutoForFlushDesp = ""; //_L("(Post-slicing arrangement)");
|
const wxString AutoForFlushDesp = ""; //_L("(Post-slicing arrangement)");
|
||||||
|
|
|
@ -37,14 +37,13 @@ extern std::string& get_left_extruder_unprintable_text();
|
||||||
extern std::string& get_right_extruder_unprintable_text();
|
extern std::string& get_right_extruder_unprintable_text();
|
||||||
|
|
||||||
|
|
||||||
bool try_pop_up_before_slice(bool is_slice_all, Plater* plater_ref, PartPlate* partplate_ref)
|
bool try_pop_up_before_slice(bool is_slice_all, Plater* plater_ref, PartPlate* partplate_ref, bool force_pop_up)
|
||||||
{
|
{
|
||||||
auto full_config = wxGetApp().preset_bundle->full_config();
|
auto full_config = wxGetApp().preset_bundle->full_config();
|
||||||
const auto nozzle_diameters = full_config.option<ConfigOptionFloatsNullable>("nozzle_diameter");
|
const auto nozzle_diameters = full_config.option<ConfigOptionFloatsNullable>("nozzle_diameter");
|
||||||
if (nozzle_diameters->size() <= 1)
|
if (nozzle_diameters->size() <= 1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
bool force_pop_up = get_pop_up_remind_flag();
|
|
||||||
bool sync_plate = true;
|
bool sync_plate = true;
|
||||||
|
|
||||||
std::vector<std::string> filament_colors = full_config.option<ConfigOptionStrings>("filament_colour")->values;
|
std::vector<std::string> filament_colors = full_config.option<ConfigOptionStrings>("filament_colour")->values;
|
||||||
|
@ -52,7 +51,7 @@ bool try_pop_up_before_slice(bool is_slice_all, Plater* plater_ref, PartPlate* p
|
||||||
std::vector<int> applied_maps = get_applied_map(full_config, plater_ref, partplate_ref, sync_plate);
|
std::vector<int> applied_maps = get_applied_map(full_config, plater_ref, partplate_ref, sync_plate);
|
||||||
applied_maps.resize(filament_colors.size(), 1);
|
applied_maps.resize(filament_colors.size(), 1);
|
||||||
|
|
||||||
if (applied_mode != fmmManual)
|
if (!force_pop_up && applied_mode != fmmManual)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
std::vector<int> filament_lists;
|
std::vector<int> filament_lists;
|
||||||
|
|
|
@ -27,7 +27,7 @@ class PartPlate;
|
||||||
* @param partplate_ref Partplate to get/set plate filament map mode
|
* @param partplate_ref Partplate to get/set plate filament map mode
|
||||||
* @return whether continue slicing
|
* @return whether continue slicing
|
||||||
*/
|
*/
|
||||||
bool try_pop_up_before_slice(bool is_slice_all, Plater* plater_ref, PartPlate* partplate_ref);
|
bool try_pop_up_before_slice(bool is_slice_all, Plater* plater_ref, PartPlate* partplate_ref, bool force_pop_up = false);
|
||||||
|
|
||||||
|
|
||||||
class FilamentMapDialog : public wxDialog
|
class FilamentMapDialog : public wxDialog
|
||||||
|
|
|
@ -282,9 +282,9 @@ void GUI::FilamentMapBtnPanel::Show()
|
||||||
|
|
||||||
FilamentMapAutoPanel::FilamentMapAutoPanel(wxWindow *parent, FilamentMapMode mode, bool machine_synced) : wxPanel(parent)
|
FilamentMapAutoPanel::FilamentMapAutoPanel(wxWindow *parent, FilamentMapMode mode, bool machine_synced) : wxPanel(parent)
|
||||||
{
|
{
|
||||||
const wxString AutoForFlushDetail = _L("Recommends filament grouping for the left and right nozzles based on the most filament-saving principles to minimize waste");
|
const wxString AutoForFlushDetail = _L("Generates filament grouping for the left and right nozzles based on the most filament-saving principles to minimize waste");
|
||||||
|
|
||||||
const wxString AutoForMatchDetail = _L("Recommends filament grouping for the left and right nozzles based on the printer's actual filament status, reducing the need for manual filament adjustment");
|
const wxString AutoForMatchDetail = _L("Generates filament grouping for the left and right nozzles based on the printer's actual filament status, reducing the need for manual filament adjustment");
|
||||||
|
|
||||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
m_flush_panel = new FilamentMapBtnPanel(this, _L("Filament-Saving Mode"), AutoForFlushDetail, "flush_mode_panel_icon");
|
m_flush_panel = new FilamentMapBtnPanel(this, _L("Filament-Saving Mode"), AutoForFlushDetail, "flush_mode_panel_icon");
|
||||||
|
|
|
@ -2806,7 +2806,7 @@ void NotificationManager::bbl_show_filament_map_invalid_notification_before_slic
|
||||||
auto callback = [](wxEvtHandler*) {
|
auto callback = [](wxEvtHandler*) {
|
||||||
auto plater = wxGetApp().plater();
|
auto plater = wxGetApp().plater();
|
||||||
auto partplate = plater->get_partplate_list().get_curr_plate();
|
auto partplate = plater->get_partplate_list().get_curr_plate();
|
||||||
try_pop_up_before_slice(false, plater, partplate); // ignore the return value
|
try_pop_up_before_slice(false, plater, partplate, true); // ignore the return value
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue