This commit is contained in:
enricoturri1966 2020-12-01 08:33:20 +01:00
commit dc736f7855
8 changed files with 12936 additions and 13 deletions

View file

@ -360,6 +360,7 @@ namespace Slic3r {
// Otherwise, leave control to the user completely.
std::string toolchange_gcode_str;
const std::string& toolchange_gcode = gcodegen.config().toolchange_gcode.value;
// m_max_layer_z = std::max(m_max_layer_z, tcr.print_z);
if (! toolchange_gcode.empty()) {
DynamicConfig config;
int previous_extruder_id = gcodegen.writer().extruder() ? (int)gcodegen.writer().extruder()->id() : -1;
@ -367,6 +368,7 @@ namespace Slic3r {
config.set_key_value("next_extruder", new ConfigOptionInt((int)new_extruder_id));
config.set_key_value("layer_num", new ConfigOptionInt(gcodegen.m_layer_index));
config.set_key_value("layer_z", new ConfigOptionFloat(tcr.print_z));
// config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
toolchange_gcode_str = gcodegen.placeholder_parser_process("toolchange_gcode", toolchange_gcode, new_extruder_id, &config);
check_add_eol(toolchange_gcode_str);
}
@ -1011,11 +1013,12 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled);
// resets analyzer's tracking data
m_last_height = 0.0f;
m_last_layer_z = 0.0f;
m_last_height = 0.f;
m_last_layer_z = 0.f;
m_max_layer_z = 0.f;
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
m_last_mm3_per_mm = 0.0;
m_last_width = 0.0f;
m_last_mm3_per_mm = 0.;
m_last_width = 0.f;
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
// How many times will be change_layer() called?
@ -1376,6 +1379,7 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
DynamicConfig config;
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
config.set_key_value("layer_z", new ConfigOptionFloat(m_writer.get_position()(2) - m_config.z_offset.value));
config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
if (print.config().single_extruder_multi_material) {
// Process the end_filament_gcode for the active filament only.
int extruder_id = m_writer.extruder()->id();
@ -1877,13 +1881,15 @@ void GCode::process_layer(
gcode += buf;
// update caches
m_last_layer_z = static_cast<float>(print_z);
m_max_layer_z = std::max(m_max_layer_z, m_last_layer_z);
m_last_height = height;
// Set new layer - this will change Z and force a retraction if retract_layer_change is enabled.
if (! print.config().before_layer_gcode.value.empty()) {
DynamicConfig config;
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index + 1));
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index + 1));
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
gcode += this->placeholder_parser_process("before_layer_gcode",
print.config().before_layer_gcode.value, m_writer.extruder()->id(), &config)
+ "\n";
@ -1897,6 +1903,7 @@ void GCode::process_layer(
gcode += this->placeholder_parser_process("layer_gcode",
print.config().layer_gcode.value, m_writer.extruder()->id(), &config)
+ "\n";
config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
}
if (! first_layer && ! m_second_layer_things_done) {
@ -2898,6 +2905,7 @@ std::string GCode::set_extruder(unsigned int extruder_id, double print_z)
config.set_key_value("next_extruder", new ConfigOptionInt((int)extruder_id));
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
toolchange_gcode_parsed = placeholder_parser_process("toolchange_gcode", toolchange_gcode, extruder_id, &config);
gcode += toolchange_gcode_parsed;
check_add_eol(gcode);

View file

@ -351,6 +351,7 @@ private:
// Support for G-Code Processor
float m_last_height{ 0.0f };
float m_last_layer_z{ 0.0f };
float m_max_layer_z{ 0.0f };
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
double m_last_mm3_per_mm;
float m_last_width{ 0.0f };

View file

@ -128,8 +128,8 @@ void Field::PostInitialize()
}
// Values of width to alignments of fields
int Field::def_width() { return wxOSX ? 8 : 7; }
int Field::def_width_wider() { return 14; }
int Field::def_width() { return 8; }
int Field::def_width_wider() { return 16; }
int Field::def_width_thinner() { return 4; }
void Field::on_kill_focus()

View file

@ -3901,11 +3901,14 @@ bool GLCanvas3D::_render_arrange_menu(float pos_x)
bool settings_changed = false;
if (imgui->slider_float(_L("Gap size"), &settings.distance, 0.f, 100.f)) {
if (ImGui::DragFloat(_L("Gal size").ToUTF8().data(), &settings.distance, .01f, 0.0f, 100.0f, "%5.2f")) {
m_arrange_settings.distance = settings.distance;
settings_changed = true;
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", _L("Use CTRL+Left mouse button to enter text edit mode.\nUse SHIFT key to increase stepping.").ToUTF8().data());
if (imgui->checkbox(_L("Enable rotations (slow)"), settings.enable_rotation)) {
m_arrange_settings.enable_rotation = settings.enable_rotation;
settings_changed = true;

View file

@ -1278,6 +1278,11 @@ bool GUI_App::select_language()
wxArrayString translations = wxTranslations::Get()->GetAvailableTranslations(SLIC3R_APP_KEY);
std::vector<const wxLanguageInfo*> language_infos;
language_infos.emplace_back(wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH));
#ifdef __linux__
// wxWidgets consider the default English locale to be en_GB, which is often missing on Linux.
// Thus we offer en_US on Linux as well.
language_infos.emplace_back(wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH_US));
#endif // __linux__
for (size_t i = 0; i < translations.GetCount(); ++ i) {
const wxLanguageInfo *langinfo = wxLocale::FindLanguageInfo(translations[i]);
if (langinfo != nullptr)
@ -1306,6 +1311,13 @@ bool GUI_App::select_language()
if (language_infos[i]->CanonicalName.BeforeFirst('_') == "en")
// This will be the default selection if the active language does not match any dictionary.
init_selection_default = i;
#ifdef __linux__
// wxWidgets consider the default English locale to be en_GB, which is often missing on Linux.
// Thus we make the distintion between "en_US" and "en_GB" clear.
if (language_infos[i]->CanonicalName == "en_GB" && language_infos[i]->Description == "English")
names.Add("English (U.K.)");
else
#endif // __linux__
names.Add(language_infos[i]->Description);
}
if (init_selection == -1)

View file

@ -24,6 +24,12 @@
using boost::optional;
#ifdef __Linux__
#define wxLinux true
#else
#define wxLinux false
#endif
namespace Slic3r {
namespace GUI {
@ -586,7 +592,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection* dependent_
m_tree->AssociateModel(m_tree_model);
m_tree_model->SetAssociatedControl(m_tree);
m_tree->AppendToggleColumn(L"\u2714", UnsavedChangesModel::colToggle, wxDATAVIEW_CELL_ACTIVATABLE, 6 * em);//2610,11,12 //2714
m_tree->AppendToggleColumn(L"\u2714", UnsavedChangesModel::colToggle, wxDATAVIEW_CELL_ACTIVATABLE, (wxLinux ? 8 : 6) * em);
auto append_bmp_text_column = [this](const wxString& label, unsigned model_column, int width, bool set_expander = false)
{