This commit is contained in:
enricoturri1966 2020-12-04 14:19:08 +01:00
commit 75a1a699a7
12 changed files with 5197 additions and 3630 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
#define FLAVOR_IS(val) this->config.gcode_flavor == val #define FLAVOR_IS(val) this->config.gcode_flavor == val
#define FLAVOR_IS_NOT(val) this->config.gcode_flavor != val #define FLAVOR_IS_NOT(val) this->config.gcode_flavor != val
#define COMMENT(comment) if (this->config.gcode_comments && !comment.empty()) gcode << " ; " << comment; #define COMMENT(comment) if (this->config.gcode_comments && !comment.empty()) gcode << " ; " << comment;
#define PRECISION(val, precision) std::fixed << std::setprecision(precision) << val #define PRECISION(val, precision) std::fixed << std::setprecision(precision) << (val)
#define XYZF_NUM(val) PRECISION(val, 3) #define XYZF_NUM(val) PRECISION(val, 3)
#define E_NUM(val) PRECISION(val, 5) #define E_NUM(val) PRECISION(val, 5)
@ -458,7 +458,7 @@ std::string GCodeWriter::_retract(double length, double restart_extra, const std
gcode << "G10 ; retract\n"; gcode << "G10 ; retract\n";
} else { } else {
gcode << "G1 " << m_extrusion_axis << E_NUM(m_extruder->E()) gcode << "G1 " << m_extrusion_axis << E_NUM(m_extruder->E())
<< " F" << float(m_extruder->retract_speed() * 60.); << " F" << XYZF_NUM(m_extruder->retract_speed() * 60.);
COMMENT(comment); COMMENT(comment);
gcode << "\n"; gcode << "\n";
} }
@ -488,7 +488,7 @@ std::string GCodeWriter::unretract()
} else { } else {
// use G1 instead of G0 because G0 will blend the restart with the previous travel move // use G1 instead of G0 because G0 will blend the restart with the previous travel move
gcode << "G1 " << m_extrusion_axis << E_NUM(m_extruder->E()) gcode << "G1 " << m_extrusion_axis << E_NUM(m_extruder->E())
<< " F" << float(m_extruder->deretract_speed() * 60.); << " F" << XYZF_NUM(m_extruder->deretract_speed() * 60.);
if (this->config.gcode_comments) gcode << " ; unretract"; if (this->config.gcode_comments) gcode << " ; unretract";
gcode << "\n"; gcode << "\n";
} }

View File

@ -5,6 +5,7 @@
#include "GUI.hpp" #include "GUI.hpp"
#include "GUI_App.hpp" #include "GUI_App.hpp"
#include "MainFrame.hpp" #include "MainFrame.hpp"
#include "format.hpp"
namespace Slic3r { namespace Slic3r {
namespace GUI { namespace GUI {
@ -150,9 +151,8 @@ wxString CopyrightsDialog::get_html_text()
, entry.link, entry.lib_name); , entry.link, entry.lib_name);
if (!entry.copyright.empty()) if (!entry.copyright.empty())
text += wxString::Format( text += format_wxstr(
"%s %s" "%1% %2%<br/><br/>"
"<br/><br/>"
, copyright_str, entry.copyright); , copyright_str, entry.copyright);
} }

View File

@ -1217,9 +1217,11 @@ wxString Control::get_tooltip(int tick/*=-1*/)
return _L("Jump to move") + " (Shift + G)"; return _L("Jump to move") + " (Shift + G)";
else else
return m_mode == MultiAsSingle ? return m_mode == MultiAsSingle ?
GUI::from_u8((boost::format(_u8L("Jump to height %s Set ruler mode\n or " GUI::from_u8((boost::format(_u8L("Jump to height %s\n"
"Set extruder sequence for the entire print")) % " (Shift + G)\n").str()) : "Set ruler mode\n"
GUI::from_u8((boost::format(_u8L("Jump to height %s or Set ruler mode")) % " (Shift + G)\n").str()); "or Set extruder sequence for the entire print")) % "(Shift + G)").str()) :
GUI::from_u8((boost::format(_u8L("Jump to height %s\n"
"or Set ruler mode")) % "(Shift + G)").str());
} }
if (m_focus == fiColorBand) if (m_focus == fiColorBand)
return m_mode != SingleExtruder ? "" : return m_mode != SingleExtruder ? "" :
@ -1844,7 +1846,7 @@ void Control::show_cog_icon_context_menu()
wxMenu* ruler_mode_menu = new wxMenu(); wxMenu* ruler_mode_menu = new wxMenu();
if (ruler_mode_menu) { if (ruler_mode_menu) {
append_menu_check_item(ruler_mode_menu, wxID_ANY, _L("None"), _L("Supprese show the ruler"), append_menu_check_item(ruler_mode_menu, wxID_ANY, _L("None"), _L("Hide ruler"),
[this](wxCommandEvent&) { if (m_extra_style != 0) m_extra_style = 0; }, ruler_mode_menu, [this](wxCommandEvent&) { if (m_extra_style != 0) m_extra_style = 0; }, ruler_mode_menu,
[]() { return true; }, [this]() { return m_extra_style == 0; }, GUI::wxGetApp().plater()); []() { return true; }, [this]() { return m_extra_style == 0; }, GUI::wxGetApp().plater());

View File

@ -3983,7 +3983,7 @@ bool GLCanvas3D::_render_arrange_menu(float pos_x)
imgui->text(_L("Use CTRL+left mouse key to enter text edit mode:")); imgui->text(_L("Use CTRL+left mouse key to enter text edit mode:"));
if (imgui->slider_float(_L("Clearance size"), &settings.distance, dist_min, 100.0f, "%5.2f") || dist_min > settings.distance) { if (imgui->slider_float(_L("Spacing"), &settings.distance, dist_min, 100.0f, "%5.2f") || dist_min > settings.distance) {
settings.distance = std::max(dist_min, settings.distance); settings.distance = std::max(dist_min, settings.distance);
settings_out.distance = settings.distance; settings_out.distance = settings.distance;
appcfg->set("arrange", dist_key.c_str(), std::to_string(settings_out.distance)); appcfg->set("arrange", dist_key.c_str(), std::to_string(settings_out.distance));

View File

@ -204,15 +204,15 @@ void KBShortcutsDialog::fill_shortcuts()
Shortcuts preview_shortcuts = { Shortcuts preview_shortcuts = {
#if ENABLE_ARROW_KEYS_WITH_SLIDERS #if ENABLE_ARROW_KEYS_WITH_SLIDERS
{ L("Arrow Up"), L("Move vertical slider current thumb Up") }, { L("Arrow Up"), L("Vertical slider - Move active thumb Up") },
{ L("Arrow Down"), L("Move vertical slider current thumb Down") }, { L("Arrow Down"), L("Vertical slider - Move active thumb Down") },
{ L("Arrow Left"), L("Move horizontal slider current thumb Left") }, { L("Arrow Left"), L("Horizontal slider - Move active thumb Left") },
{ L("Arrow Right"), L("Move horizontal slider current thumb Right") }, { L("Arrow Right"), L("Horizontal slider - Move active thumb Right") },
{ "W", L("Move vertical slider current thumb Up") }, { "W", L("Vertical slider - Move active thumb Up") },
{ "S", L("Move vertical slider current thumb Down") }, { "S", L("Vertical slider - Move active thumb Down") },
{ "A", L("Move horizontal slider current thumb Left") }, { "A", L("Horizontal slider - Move active thumb Left") },
{ "D", L("Move horizontal slider current thumb Right") }, { "D", L("Horizontal slider - Move active thumb Right") },
{ "X", L("Toggle vertical slider one layer mode ON/OFF") }, { "X", L("On/Off one layer mode of the vertical slider") },
{ "L", L("Show/Hide Legend and Estimated printing time") }, { "L", L("Show/Hide Legend and Estimated printing time") },
#else #else
{ L("Arrow Up"), L("Upper layer") }, { L("Arrow Up"), L("Upper layer") },
@ -227,16 +227,16 @@ void KBShortcutsDialog::fill_shortcuts()
Shortcuts layers_slider_shortcuts = { Shortcuts layers_slider_shortcuts = {
#if ENABLE_ARROW_KEYS_WITH_SLIDERS #if ENABLE_ARROW_KEYS_WITH_SLIDERS
{ L("Arrow Up"), L("Vertical slider - Move current thumb Up") }, { L("Arrow Up"), L("Vertical slider - Move active thumb Up") },
{ L("Arrow Down"), L("Vertical slider - Move current thumb Down") }, { L("Arrow Down"), L("Vertical slider - Move active thumb Down") },
{ L("Arrow Left"), L("Vertical slider - Set upper thumb to current thumb") }, { L("Arrow Left"), L("Vertical slider - Set upper thumb as active") },
{ L("Arrow Right"), L("Vertical slider - Set lower thumb to current thumb") }, { L("Arrow Right"), L("Vertical slider - Set lower thumb as active") },
{ "+", L("Vertical slider - Add color change marker for current layer") }, { "+", L("Vertical slider - Add color change marker for current layer") },
{ "-", L("Vertical slider - Delete color change marker for current layer") }, { "-", L("Vertical slider - Delete color change marker for current layer") },
{ L("Arrow Up"), L("Horizontal slider - Set left thumb to current thumb") }, { L("Arrow Up"), L("Horizontal slider - Set left thumb as active") },
{ L("Arrow Down"), L("Horizontal slider - Set right thumb to current thumb") }, { L("Arrow Down"), L("Horizontal slider - Set right thumb as active") },
{ L("Arrow Left"), L("Horizontal slider - Move current thumb Left") }, { L("Arrow Left"), L("Horizontal slider - Move active thumb Left") },
{ L("Arrow Right"), L("Horizontal slider - Move current thumb Right") }, { L("Arrow Right"), L("Horizontal slider - Move active thumb Right") },
#else #else
{ L("Arrow Up"), L("Move current slider thumb Up") }, { L("Arrow Up"), L("Move current slider thumb Up") },
{ L("Arrow Down"), L("Move current slider thumb Down") }, { L("Arrow Down"), L("Move current slider thumb Down") },
@ -252,8 +252,8 @@ void KBShortcutsDialog::fill_shortcuts()
m_full_shortcuts.push_back(std::make_pair(_L("Layers Slider"), layers_slider_shortcuts)); m_full_shortcuts.push_back(std::make_pair(_L("Layers Slider"), layers_slider_shortcuts));
Shortcuts sequential_slider_shortcuts = { Shortcuts sequential_slider_shortcuts = {
{ L("Arrow Left"), L("Move current slider thumb Left") }, { L("Arrow Left"), L("Move active slider thumb Left") },
{ L("Arrow Right"), L("Move current slider thumb Right") }, { L("Arrow Right"), L("Move active slider thumb Right") },
{ "Shift+", L("Press to speed up 5 times while moving thumb\nwith arrow keys or mouse wheel") }, { "Shift+", L("Press to speed up 5 times while moving thumb\nwith arrow keys or mouse wheel") },
{ ctrl, L("Press to speed up 5 times while moving thumb\nwith arrow keys or mouse wheel") }, { ctrl, L("Press to speed up 5 times while moving thumb\nwith arrow keys or mouse wheel") },
}; };

View File

@ -623,7 +623,7 @@ void PhysicalPrinterDialog::DeletePreset(PresetForPrinter* preset_for_printer)
{ {
if (m_presets.size() == 1) { if (m_presets.size() == 1) {
wxString msg_text = _L("It's not possible to delete the last related preset for the printer."); wxString msg_text = _L("It's not possible to delete the last related preset for the printer.");
wxMessageDialog dialog(nullptr, msg_text, _L("Infornation"), wxICON_INFORMATION | wxOK); wxMessageDialog dialog(nullptr, msg_text, _L("Information"), wxICON_INFORMATION | wxOK);
dialog.ShowModal(); dialog.ShowModal();
return; return;
} }

View File

@ -1192,7 +1192,7 @@ void Sidebar::update_sliced_info_sizer()
double spool_weight = filament_preset->config.opt_float("filament_spool_weight", 0); double spool_weight = filament_preset->config.opt_float("filament_spool_weight", 0);
if (spool_weight != 0.0) { if (spool_weight != 0.0) {
new_label += "\n " + _L("(weight with spool)"); new_label += "\n " + _L("(including spool)");
info_text += wxString::Format(" (%.2f)\n", filament_weight + spool_weight); info_text += wxString::Format(" (%.2f)\n", filament_weight + spool_weight);
} }
} }

View File

@ -9,6 +9,7 @@
#include <wx/intl.h> #include <wx/intl.h>
#include "GUI.hpp" #include "GUI.hpp"
#include "format.hpp"
#include "I18N.hpp" #include "I18N.hpp"
namespace Slic3r { namespace Slic3r {
@ -44,7 +45,7 @@ std::string PresetHints::cooling_description(const Preset &preset)
int disable_fan_first_layers = preset.config.opt_int("disable_fan_first_layers", 0); int disable_fan_first_layers = preset.config.opt_int("disable_fan_first_layers", 0);
int min_fan_speed = preset.config.opt_int("min_fan_speed", 0); int min_fan_speed = preset.config.opt_int("min_fan_speed", 0);
if (full_fan_speed_layer > fan_below_layer_time + 1) if (full_fan_speed_layer > disable_fan_first_layers + 1)
out += GUI::format(_L("Fan speed will be ramped from zero at layer %1% to %2%%% at layer %3%."), disable_fan_first_layers, min_fan_speed, full_fan_speed_layer); out += GUI::format(_L("Fan speed will be ramped from zero at layer %1% to %2%%% at layer %3%."), disable_fan_first_layers, min_fan_speed, full_fan_speed_layer);
else { else {
out += GUI::format(cooling ? _L("During the other layers, fan will always run at %1%%%") : _L("Fan will always run at %1%%%"), min_fan_speed) + " "; out += GUI::format(cooling ? _L("During the other layers, fan will always run at %1%%%") : _L("Fan will always run at %1%%%"), min_fan_speed) + " ";

View File

@ -19,6 +19,7 @@
#include "I18N.hpp" #include "I18N.hpp"
#include "../Utils/PrintHost.hpp" #include "../Utils/PrintHost.hpp"
#include "wxExtensions.hpp" #include "wxExtensions.hpp"
#include "MainFrame.hpp"
#include "libslic3r/AppConfig.hpp" #include "libslic3r/AppConfig.hpp"
namespace fs = boost::filesystem; namespace fs = boost::filesystem;
@ -31,7 +32,7 @@ static const char *CONFIG_KEY_PRINT = "printhost_print";
static const char *CONFIG_KEY_GROUP = "printhost_group"; static const char *CONFIG_KEY_GROUP = "printhost_group";
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, bool can_start_print, const wxArrayString &groups) PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, bool can_start_print, const wxArrayString &groups)
: MsgDialog(nullptr, _L("Send G-Code to printer host"), _L("Upload to Printer Host with the following filename:"), wxID_NONE) : MsgDialog(static_cast<wxWindow*>(wxGetApp().mainframe), _L("Send G-Code to printer host"), _L("Upload to Printer Host with the following filename:"), wxID_NONE)
, txt_filename(new wxTextCtrl(this, wxID_ANY)) , txt_filename(new wxTextCtrl(this, wxID_ANY))
, box_print(can_start_print ? new wxCheckBox(this, wxID_ANY, _L("Start printing after upload")) : nullptr) , box_print(can_start_print ? new wxCheckBox(this, wxID_ANY, _L("Start printing after upload")) : nullptr)
, combo_groups(!groups.IsEmpty() ? new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, groups, wxCB_READONLY) : nullptr) , combo_groups(!groups.IsEmpty() ? new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, groups, wxCB_READONLY) : nullptr)
@ -77,6 +78,7 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, bool can_start_pr
txt_filename->SetFocus(); txt_filename->SetFocus();
Fit(); Fit();
CenterOnParent();
Bind(wxEVT_SHOW, [=](const wxShowEvent &) { Bind(wxEVT_SHOW, [=](const wxShowEvent &) {
// Another similar case where the function only works with EVT_SHOW + CallAfter, // Another similar case where the function only works with EVT_SHOW + CallAfter,

View File

@ -1586,7 +1586,7 @@ void TabPrint::build()
page = add_options_page(L("Output options"), "output+page_white"); page = add_options_page(L("Output options"), "output+page_white");
optgroup = page->new_optgroup(L("Sequential printing")); optgroup = page->new_optgroup(L("Sequential printing"));
optgroup->append_single_option_line("complete_objects", "sequential-printing_124589"); optgroup->append_single_option_line("complete_objects", "sequential-printing_124589");
line = { L("Extruder clearance (mm)"), "" }; line = { L("Extruder clearance"), "" };
line.append_option(optgroup->get_option("extruder_clearance_radius")); line.append_option(optgroup->get_option("extruder_clearance_radius"));
line.append_option(optgroup->get_option("extruder_clearance_height")); line.append_option(optgroup->get_option("extruder_clearance_height"));
optgroup->append_line(line); optgroup->append_line(line);