Merge remote-tracking branch 'upstream/main' into dev/p2s-pr

# Conflicts:
#	src/slic3r/GUI/Plater.cpp
#	src/slic3r/GUI/PrePrintChecker.cpp
#	src/slic3r/GUI/StatusPanel.cpp
This commit is contained in:
Noisyfox
2025-11-18 09:17:13 +08:00
77 changed files with 1760 additions and 2059 deletions
+15 -5
View File
@@ -1529,12 +1529,22 @@ void Layer::make_ironing()
if (ironing_params.extruder != -1) {
//TODO just_infill is currently not used.
ironing_params.just_infill = false;
ironing_params.line_spacing = config.ironing_spacing;
ironing_params.inset = config.ironing_inset;
ironing_params.height = default_layer_height * 0.01 * config.ironing_flow;
ironing_params.speed = config.ironing_speed;
// Get filament-specific overrides if configured, otherwise use default values
size_t extruder_idx = ironing_params.extruder - 1;
ironing_params.line_spacing = (!config.filament_ironing_spacing.is_nil(extruder_idx)
? config.filament_ironing_spacing.get_at(extruder_idx)
: config.ironing_spacing);
ironing_params.inset = (!config.filament_ironing_inset.is_nil(extruder_idx)
? config.filament_ironing_inset.get_at(extruder_idx)
: config.ironing_inset);
ironing_params.height = default_layer_height * 0.01 * (!config.filament_ironing_flow.is_nil(extruder_idx)
? config.filament_ironing_flow.get_at(extruder_idx)
: config.ironing_flow);
ironing_params.speed = (!config.filament_ironing_speed.is_nil(extruder_idx)
? config.filament_ironing_speed.get_at(extruder_idx)
: config.ironing_speed);
ironing_params.angle = (config.ironing_angle_fixed ? 0 : calculate_infill_rotation_angle(this->object(), this->id(), config.solid_infill_direction.value, config.solid_infill_rotate_template.value)) + config.ironing_angle * M_PI / 180.;
ironing_params.fixed_angle = config.ironing_angle_fixed || !config.solid_infill_rotate_template.value.empty();
ironing_params.fixed_angle = config.ironing_angle_fixed || !config.solid_infill_rotate_template.value.empty();
ironing_params.pattern = config.ironing_pattern;
ironing_params.layerm = layerm;
by_extruder.emplace_back(ironing_params);
+3 -2
View File
@@ -349,8 +349,9 @@ std::pair<double, double> adaptive_fill_line_spacing(const PrintObject &print_ob
} else
return 0.;
};
adaptive_line_spacing = to_line_spacing(adaptive_cnt, adaptive_fill_density, adaptive_infill_extrusion_width);
support_line_spacing = to_line_spacing(support_cnt, support_fill_density, support_infill_extrusion_width);
const int n_multiline = print_object.printing_region(0).config().fill_multiline.value;
adaptive_line_spacing = to_line_spacing(adaptive_cnt, adaptive_fill_density, adaptive_infill_extrusion_width) * n_multiline;
support_line_spacing = to_line_spacing(support_cnt, support_fill_density, support_infill_extrusion_width) * n_multiline;
}
return std::make_pair(adaptive_line_spacing, support_line_spacing);
+2
View File
@@ -1,3 +1,4 @@
#include "../ClipperUtils.hpp"
#include "../Print.hpp"
#include "../ShortestPath.hpp"
#include "FillBase.hpp"
@@ -19,6 +20,7 @@ void Filler::_fill_surface_single(
// Apply multiline offset if needed
multiline_fill(fill_lines, params, spacing);
fill_lines = Slic3r::intersection_pl(std::move(fill_lines), expolygon);
chain_or_connect_infill(std::move(fill_lines), expolygon, polylines_out, this->spacing, params);
}
+2 -3
View File
@@ -2998,7 +2998,6 @@ bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillPar
assert(sweep_params.size() >= 1);
assert(!params.full_infill());
params.density /= double(sweep_params.size());
int n_multilines = params.multiline;
assert(params.density > 0.0001f && params.density <= 1.f);
ExPolygonWithOffset poly_with_offset_base(surface->expolygon, 0, float(scale_(this->overlap - 0.5 * this->spacing)));
@@ -3014,9 +3013,9 @@ bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillPar
// Rotate polygons so that we can work with vertical lines here
float angle = rotate_vector.first + sweep.angle_base;
//Fill Multiline
for (int i = 0; i < n_multilines; ++i) {
for (int i = 0; i < params.multiline; ++i) {
coord_t group_offset = i * line_spacing;
coord_t internal_offset = (i - (n_multilines - 1) / 2.0f) * line_width;
coord_t internal_offset = (i - (params.multiline - 1) / 2.0f) * line_width;
coord_t total_offset = group_offset + internal_offset;
coord_t pattern_shift = scale_(sweep.pattern_shift + unscale_(total_offset));
+2 -1
View File
@@ -70,6 +70,7 @@ Generator::Generator(const PrintObject &print_object, const std::function<void()
const PrintRegionConfig &region_config = print_object.shared_regions()->all_regions.front()->config();
const std::vector<double> &nozzle_diameters = print_config.nozzle_diameter.values;
double max_nozzle_diameter = *std::max_element(nozzle_diameters.begin(), nozzle_diameters.end());
const int n_multiline = region_config.fill_multiline.value;
// const int infill_extruder = region_config.infill_extruder.value;
const double default_infill_extrusion_width = Flow::auto_extrusion_width(FlowRole::frInfill, float(max_nozzle_diameter));
// Note: There's not going to be a layer below the first one, so the 'initial layer height' doesn't have to be taken into account.
@@ -86,7 +87,7 @@ Generator::Generator(const PrintObject &print_object, const std::function<void()
object_config.line_width.get_abs_value(max_nozzle_diameter)
);
m_supporting_radius = coord_t(m_infill_extrusion_width) * 100 / region_config.sparse_infill_density;
m_supporting_radius = coord_t(m_infill_extrusion_width) * 100 * n_multiline / region_config.sparse_infill_density;
const double lightning_infill_overhang_angle = M_PI / 4; // 45 degrees
const double lightning_infill_prune_angle = M_PI / 4; // 45 degrees
+2
View File
@@ -974,6 +974,8 @@ static std::vector<std::string> s_Preset_filament_options {/*"filament_colour",
//SoftFever
"enable_pressure_advance", "pressure_advance","adaptive_pressure_advance","adaptive_pressure_advance_model","adaptive_pressure_advance_overhangs", "adaptive_pressure_advance_bridges","chamber_temperature", "filament_shrink","filament_shrinkage_compensation_z", "support_material_interface_fan_speed","internal_bridge_fan_speed", "filament_notes" /*,"filament_seam_gap"*/,
"ironing_fan_speed",
// Filament ironing overrides
"filament_ironing_flow", "filament_ironing_spacing", "filament_ironing_inset", "filament_ironing_speed",
"filament_loading_speed", "filament_loading_speed_start",
"filament_unloading_speed", "filament_unloading_speed_start", "filament_toolchange_delay", "filament_cooling_moves", "filament_stamping_loading_speed", "filament_stamping_distance",
"filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters",
+48 -4
View File
@@ -1143,7 +1143,7 @@ void PrintConfigDef::init_fff_params()
// xgettext:no-c-format, no-boost-format
def->tooltip = L("Bridging angle override. If left to zero, the bridging angle will be calculated "
"automatically. Otherwise the provided angle will be used for external bridges. "
"Use 180°for zero angle.");
"Use 180° for zero angle.");
def->sidetext = u8"°"; // degrees, don't need translation
def->min = 0;
def->mode = comAdvanced;
@@ -1155,7 +1155,7 @@ void PrintConfigDef::init_fff_params()
def->category = L("Strength");
def->tooltip = L("Internal bridging angle override. If left to zero, the bridging angle will be calculated "
"automatically. Otherwise the provided angle will be used for internal bridges. "
"Use 180°for zero angle.\n\nIt is recommended to leave it at 0 unless there is a specific model need not to.");
"Use 180° for zero angle.\n\nIt is recommended to leave it at 0 unless there is a specific model need not to.");
def->sidetext = u8"°"; // degrees, don't need translation
def->min = 0;
def->mode = comAdvanced;
@@ -1168,7 +1168,7 @@ void PrintConfigDef::init_fff_params()
"Lower density external bridges can help improve reliability as there is more space for air to circulate "
"around the extruded bridge, improving its cooling speed. Minimum is 10%.\n\n"
"Higher densities can produce smoother bridge surfaces, as overlapping lines provide "
"additional support during printing. Maximum is 120%. \n"
"additional support during printing. Maximum is 120%.\n"
"Note: Bridge density that is too high can cause warping or overextrusion.");
def->sidetext = "%";
def->min = 10;
@@ -3150,6 +3150,50 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInts{ -1 });
// Filament ironing overrides
def = this->add("filament_ironing_flow", coPercents);
def->label = L("Ironing flow");
def->tooltip = L("Filament-specific override for ironing flow. This allows you to customize the ironing flow "
"for each filament type. Too high value results in overextrusion on the surface.");
def->sidetext = "%";
def->min = 0;
def->max = 100;
def->mode = comAdvanced;
def->nullable = true;
def->set_default_value(new ConfigOptionPercentsNullable{ ConfigOptionPercentsNullable::nil_value() });
def = this->add("filament_ironing_spacing", coFloats);
def->label = L("Ironing line spacing");
def->tooltip = L("Filament-specific override for ironing line spacing. This allows you to customize the spacing "
"between ironing lines for each filament type.");
def->sidetext = "mm";
def->min = 0;
def->max = 1;
def->mode = comAdvanced;
def->nullable = true;
def->set_default_value(new ConfigOptionFloatsNullable{ ConfigOptionFloatsNullable::nil_value() });
def = this->add("filament_ironing_inset", coFloats);
def->label = L("Ironing inset");
def->tooltip = L("Filament-specific override for ironing inset. This allows you to customize the distance to keep "
"from the edges when ironing for each filament type.");
def->sidetext = "mm";
def->min = 0;
def->max = 100;
def->mode = comAdvanced;
def->nullable = true;
def->set_default_value(new ConfigOptionFloatsNullable{ ConfigOptionFloatsNullable::nil_value() });
def = this->add("filament_ironing_speed", coFloats);
def->label = L("Ironing speed");
def->tooltip = L("Filament-specific override for ironing speed. This allows you to customize the print speed "
"of ironing lines for each filament type.");
def->sidetext = "mm/s";
def->min = 1;
def->mode = comAdvanced;
def->nullable = true;
def->set_default_value(new ConfigOptionFloatsNullable{ ConfigOptionFloatsNullable::nil_value() });
def = this->add("fuzzy_skin", coEnum);
def->label = L("Fuzzy Skin");
def->category = L("Others");
@@ -3535,7 +3579,7 @@ void PrintConfigDef::init_fff_params()
"Advanced syntax is supported: '+5' rotates +5° every layer; '+5#5' rotates +5° every 5 layers. See the Wiki for details. "
"When a template is set, the standard infill direction setting is ignored. "
"Note: some infill patterns (e.g., Gyroid) control rotation themselves; use with care.");
def->sidetext = L("°");
def->sidetext = u8"°"; // degrees, don't need translation
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionString(""));
+5
View File
@@ -1087,6 +1087,11 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, ironing_speed))
((ConfigOptionFloat, ironing_angle))
((ConfigOptionBool, ironing_angle_fixed))
// Filament Ironing
((ConfigOptionPercentsNullable, filament_ironing_flow))
((ConfigOptionFloatsNullable, filament_ironing_spacing))
((ConfigOptionFloatsNullable, filament_ironing_inset))
((ConfigOptionFloatsNullable, filament_ironing_speed))
// Detect bridging perimeters
((ConfigOptionBool, detect_overhang_wall))
((ConfigOptionInt, wall_filament))
+1 -1
View File
@@ -845,7 +845,7 @@ NewCalibrationHistoryDialog::NewCalibrationHistoryDialog(wxWindow *parent, const
panel_sizer->AddSpacer(FromDIP(25));
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
Button * ok_btn = new Button(top_panel, _L("Ok"));
Button * ok_btn = new Button(top_panel, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
ok_btn->SetBackgroundColour(*wxWHITE);
@@ -897,7 +897,7 @@ void CalibrationPresetPage::create_filament_list_panel(wxWindow* parent)
{
auto panel_sizer = new wxBoxSizer(wxVERTICAL);
m_filament_list_tips = new Label(parent, _L("Tips for calibration material: \n- Materials that can share same hot bed temperature\n- Different filament brand and family (Brand = Bambu, Family = Basic, Matte)"));
m_filament_list_tips = new Label(parent, _L("Tips for calibration material:\n- Materials that can share same hot bed temperature\n- Different filament brand and family (Brand = Bambu, Family = Basic, Matte)"));
m_filament_list_tips->Hide();
m_filament_list_tips->SetFont(Label::Body_13);
m_filament_list_tips->SetForegroundColour(wxColour(145, 145, 145));
@@ -1037,7 +1037,7 @@ void CalibrationPresetPage::create_multi_extruder_filament_list_panel(wxWindow *
m_filament_list_tips = new Label(
parent,
_L("Tips for calibration material: \n- Materials that can share same hot bed temperature\n- Different filament brand and family(Brand = Bambu, Family = Basic, Matte)"));
_L("Tips for calibration material:\n- Materials that can share same hot bed temperature\n- Different filament brand and family (Brand = Bambu, Family = Basic, Matte)"));
m_filament_list_tips->Hide();
m_filament_list_tips->SetFont(Label::Body_13);
m_filament_list_tips->SetForegroundColour(wxColour(145, 145, 145));
@@ -1833,7 +1833,7 @@ void CalibrationPresetPage::show_status(CaliPresetPageStatus status)
Fit();
}
else if (status == CaliPresetPageStatus::CaliPresetStatusNoUserLogin) {
wxString msg_text = _L("No login account, only printers in LAN mode are displayed");
wxString msg_text = _L("No login account, only printers in LAN mode are displayed.");
update_print_status_msg(msg_text, false);
Enable_Send_Button(false);
}
@@ -1842,22 +1842,22 @@ void CalibrationPresetPage::show_status(CaliPresetPageStatus status)
Enable_Send_Button(false);
}
else if (status == CaliPresetPageStatus::CaliPresetStatusConnectingServer) {
wxString msg_text = _L("Connecting to server");
wxString msg_text = _L("Connecting to server...");
update_print_status_msg(msg_text, true);
Enable_Send_Button(false);
}
else if (status == CaliPresetPageStatus::CaliPresetStatusInUpgrading) {
wxString msg_text = _L("Cannot send the print job when the printer is updating firmware");
wxString msg_text = _L("Cannot send a print job while the printer is updating firmware.");
update_print_status_msg(msg_text, true);
Enable_Send_Button(false);
}
else if (status == CaliPresetPageStatus::CaliPresetStatusInSystemPrinting) {
wxString msg_text = _L("The printer is executing instructions. Please restart printing after it ends");
wxString msg_text = _L("The printer is executing instructions. Please restart printing after it ends.");
update_print_status_msg(msg_text, true);
Enable_Send_Button(false);
}
else if (status == CaliPresetPageStatus::CaliPresetStatusInPrinting) {
wxString msg_text = _L("The printer is busy on other print job");
wxString msg_text = _L("The printer is busy with another print job.");
update_print_status_msg(msg_text, true);
Enable_Send_Button(false);
}
@@ -1891,7 +1891,7 @@ void CalibrationPresetPage::show_status(CaliPresetPageStatus status)
Enable_Send_Button(false);
}
else if (status == CaliPresetPageStatus::CaliPresetStatusInConnecting) {
wxString msg_text = _L("Connecting to printer");
wxString msg_text = _L("Connecting to printer...");
update_print_status_msg(msg_text, true);
Enable_Send_Button(false);
}
+20 -17
View File
@@ -595,8 +595,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool have_infill = config->option<ConfigOptionPercent>("sparse_infill_density")->value > 0;
// sparse_infill_filament uses the same logic as in Print::extruders()
for (auto el : { "sparse_infill_pattern", "infill_combination",
"minimum_sparse_infill_area", "sparse_infill_filament", "infill_anchor_max","infill_shift_step","sparse_infill_rotate_template","symmetric_infill_y_axis"})
for (auto el : { "sparse_infill_pattern", "infill_combination", "fill_multiline","infill_direction",
"minimum_sparse_infill_area", "sparse_infill_filament", "infill_anchor", "infill_anchor_max","infill_shift_step","sparse_infill_rotate_template","symmetric_infill_y_axis"})
toggle_line(el, have_infill);
bool have_combined_infill = config->opt_bool("infill_combination") && have_infill;
@@ -606,23 +606,26 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
InfillPattern pattern = config->opt_enum<InfillPattern>("sparse_infill_pattern");
bool have_multiline_infill_pattern = pattern == ipGyroid || pattern == ipGrid || pattern == ipRectilinear || pattern == ipTpmsD || pattern == ipTpmsFK || pattern == ipCrossHatch || pattern == ipHoneycomb || pattern == ipLateralLattice || pattern == ipLateralHoneycomb ||
pattern == ipCubic || pattern == ipStars || pattern == ipAlignedRectilinear || pattern == ipLightning || pattern == ip3DHoneycomb || pattern == ipAdaptiveCubic || pattern == ipSupportCubic;
toggle_line("fill_multiline", have_multiline_infill_pattern);
// If the infill pattern does not support multiline infill, set fill_multiline to 1.
if (!have_multiline_infill_pattern) {
DynamicPrintConfig new_conf = *config;
new_conf.set_key_value("fill_multiline", new ConfigOptionInt(1));
apply(config, &new_conf);
// If there is infill, enable/disable fill_multiline according to whether the pattern supports multiline infill.
if (have_infill) {
toggle_field("fill_multiline", have_multiline_infill_pattern);
// If the infill pattern does not support multiline fill_multiline is changed to 1.
// Necessary when the pattern contains params.multiline (for example, triangles because they belong to the rectilinear class)
if (!have_multiline_infill_pattern) {
DynamicPrintConfig new_conf = *config;
new_conf.set_key_value("fill_multiline", new ConfigOptionInt(1));
apply(config, &new_conf);
}
// Hide infill anchor max if sparse_infill_pattern is not line or if sparse_infill_pattern is line but infill_anchor_max is 0.
bool infill_anchor = config->opt_enum<InfillPattern>("sparse_infill_pattern") != ipLine;
toggle_field("infill_anchor_max", infill_anchor);
// Only allow configuration of open anchors if the anchoring is enabled.
bool has_infill_anchors = infill_anchor && config->option<ConfigOptionFloatOrPercent>("infill_anchor_max")->value > 0;
toggle_field("infill_anchor", has_infill_anchors);
}
// Hide infill anchor max if sparse_infill_pattern is not line or if sparse_infill_pattern is line but infill_anchor_max is 0.
bool infill_anchor = config->opt_enum<InfillPattern>("sparse_infill_pattern") != ipLine;
toggle_field("infill_anchor_max",infill_anchor);
// Only allow configuration of open anchors if the anchoring is enabled.
bool has_infill_anchors = have_infill && config->option<ConfigOptionFloatOrPercent>("infill_anchor_max")->value > 0 && infill_anchor;
toggle_field("infill_anchor", has_infill_anchors);
//cross zag
bool is_cross_zag = config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipCrossZag;
bool is_locked_zig = config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value == InfillPattern::ipLockedZag;
@@ -649,7 +652,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
toggle_field("top_surface_density", has_top_shell);
toggle_field("bottom_surface_density", has_bottom_shell);
for (auto el : { "infill_direction", "sparse_infill_line_width", "fill_multiline","gap_fill_target","filter_out_gap_fill","infill_wall_overlap",
for (auto el : { "infill_direction", "sparse_infill_line_width", "gap_fill_target","filter_out_gap_fill","infill_wall_overlap",
"sparse_infill_speed", "bridge_speed", "internal_bridge_speed", "bridge_angle", "internal_bridge_angle",
"solid_infill_direction", "solid_infill_rotate_template", "internal_solid_infill_pattern", "solid_infill_filament",
})
+2 -2
View File
@@ -2983,7 +2983,7 @@ int MachineObject::parse_json(std::string tunnel, std::string payload, bool key_
}
} else {
if (jj["errno"].get<int>() == -2) {
wxString text = _L("The current chamber temperature or the target chamber temperature exceeds 45\u2103. In order to avoid extruder clogging,low temperature filament(PLA/PETG/TPU) is not allowed to be loaded.");
wxString text = _L("The current chamber temperature or the target chamber temperature exceeds 45\u2103. In order to avoid extruder clogging, low temperature filament(PLA/PETG/TPU) is not allowed to be loaded.");
GUI::wxGetApp().push_notification(this, text);
}
}
@@ -2996,7 +2996,7 @@ int MachineObject::parse_json(std::string tunnel, std::string payload, bool key_
if (jj["errno"].is_number()) {
wxString text;
if (jj["errno"].get<int>() == -2) {
text = _L("Low temperature filament(PLA/PETG/TPU) is loaded in the extruder.In order to avoid extruder clogging,it is not allowed to set the chamber temperature.");
text = _L("Low temperature filament(PLA/PETG/TPU) is loaded in the extruder. In order to avoid extruder clogging, it is not allowed to set the chamber temperature.");
}
else if (jj["errno"].get<int>() == -4) {
text = _L("When you set the chamber temperature below 40\u2103, the chamber temperature control will not be activated, "
+2 -2
View File
@@ -62,8 +62,8 @@ FilamentGroupPopup::FilamentGroupPopup(wxWindow *parent) : PopupWindow(parent, w
const wxString AutoForMatchLabel = _L("Convenience Mode");
const wxString ManualLabel = _L("Custom Mode");
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("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 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("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 AutoForFlushDesp = ""; //_L("(Post-slicing arrangement)");
+2 -2
View File
@@ -288,9 +288,9 @@ void GUI::FilamentMapBtnPanel::Show()
FilamentMapAutoPanel::FilamentMapAutoPanel(wxWindow *parent, FilamentMapMode mode, bool machine_synced) : wxPanel(parent)
{
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 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("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 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);
m_flush_panel = new FilamentMapBtnPanel(this, _L("Filament-Saving Mode"), AutoForFlushDetail, "flush_mode_panel_icon");
+3 -3
View File
@@ -864,14 +864,14 @@ void MenuFactory::append_menu_item_reload_from_disk(wxMenu* menu)
void MenuFactory::append_menu_item_replace_with_stl(wxMenu *menu)
{
append_menu_item(menu, wxID_ANY, _L("Replace with STL") + dots, _L("Replace the selected part with new STL."),
append_menu_item(menu, wxID_ANY, _L("Replace with STL") + dots, _L("Replace the selected part with new STL"),
[](wxCommandEvent &) { plater()->replace_with_stl(); }, "", menu,
[]() { return plater()->can_replace_with_stl(); }, m_parent);
}
void MenuFactory::append_menu_item_replace_all_with_stl(wxMenu *menu)
{
append_menu_item(menu, wxID_ANY, _L("Replace all with STL") + dots, _L("Replace all selected parts with STL from folder."),
append_menu_item(menu, wxID_ANY, _L("Replace all with STL") + dots, _L("Replace all selected parts with STL from folder"),
[](wxCommandEvent &) { plater()->replace_all_with_stl(); }, "", menu,
[]() { return plater()->can_replace_all_with_stl(); }, m_parent);
}
@@ -1382,7 +1382,7 @@ void MenuFactory::create_sla_object_menu()
m_sla_object_menu.AppendSeparator();
// Add the automatic rotation sub-menu
append_menu_item(&m_sla_object_menu, wxID_ANY, _L("Auto orientation"), _L("Auto orient the object to improve print quality."),
append_menu_item(&m_sla_object_menu, wxID_ANY, _L("Auto orientation"), _L("Auto orient the object to improve print quality"),
[](wxCommandEvent&) { plater()->optimize_rotation(); });
}
+1 -1
View File
@@ -265,7 +265,7 @@ void GLGizmoFuzzySkin::on_render_input_window(float x, float y, float bottom_lim
ImGui::AlignTextToFramePadding();
m_imgui->text(m_desc["smart_fill_angle"]);
std::string format_str = std::string("%.f") +
I18N::translate_utf8("°", "Degree sign to use in the respective slider in fuzzy skin gizmo,"
I18N::translate_utf8("°", "Degree sign to use in the respective slider in fuzzy skin gizmo, "
"placed after the number with no whitespace in between.");
ImGui::SameLine(sliders_left_width);
ImGui::PushItemWidth(sliders_width);
+28 -6
View File
@@ -20,23 +20,32 @@ namespace Slic3r { namespace GUI {
ImageDPIFrame::ImageDPIFrame()
: DPIFrame(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, "", wxDefaultPosition, wxDefaultSize, !wxCAPTION | !wxCLOSE_BOX | wxBORDER_NONE)
{
m_image_px = 280;
m_image_px = 240;
int width = 270;
//SetTransparent(0);
SetMinSize(wxSize(FromDIP(width), -1));
SetMaxSize(wxSize(FromDIP(width), -1));
SetBackgroundColour(wxColour(242, 242, 242, 255));
SetBackgroundColour(wxColour(255, 255, 255, 255));
#ifdef __APPLE__
SetWindowStyleFlag(GetWindowStyleFlag() | wxSTAY_ON_TOP);
#endif
m_sizer_main = new wxBoxSizer(wxVERTICAL);
m_title = new wxStaticText(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
m_title->SetFont(Label::Head_14);
m_title->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#262E30")));
m_title->SetMaxSize(wxSize(FromDIP(width), -1));
auto image_sizer = new wxBoxSizer(wxVERTICAL);
auto imgsize = FromDIP(width);
m_bitmap = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("printer_preview_C13", this, m_image_px), wxDefaultPosition, wxSize(imgsize, imgsize * 0.94), 0);
image_sizer->Add(m_bitmap, 0, wxALIGN_CENTER | wxALL, FromDIP(0));
m_bitmap = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("printer_preview_C13", this, m_image_px), wxDefaultPosition, FromDIP(wxSize(m_image_px, m_image_px)), 0);
image_sizer->Add(m_bitmap, 0, wxALIGN_CENTER | wxALL, FromDIP(10));
m_sizer_main->Add(m_title, 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, FromDIP(10));
m_sizer_main->Add(image_sizer, FromDIP(0), wxALIGN_CENTER, FromDIP(0));
wxGetApp().UpdateDarkUI(this); // ORCA fix white bg on dark mode
Bind(wxEVT_CLOSE_WINDOW, [this](auto &e) {
on_hide();
});
@@ -62,12 +71,24 @@ void ImageDPIFrame::set_bitmap(const wxBitmap &bit_map) {
}
}
void ImageDPIFrame::set_title(const wxString& title) {
m_title->Show(!title.empty());
if(!title.empty())
m_title->SetLabel(title);
Layout();
}
void ImageDPIFrame::on_dpi_changed(const wxRect &suggested_rect)
{
// m_image->Rescale();
//m_bitmap->Rescale();
}
void ImageDPIFrame::sys_color_changed()
{
wxGetApp().UpdateDarkUI(this);
}
void ImageDPIFrame::init_timer()
{
m_refresh_timer = new wxTimer();
@@ -78,7 +99,7 @@ void ImageDPIFrame::init_timer()
void ImageDPIFrame::on_timer(wxTimerEvent &event)
{
if (!IsShown()) {//after 1s to show Frame
if (m_timer_count >= 50) {
if (m_timer_count >= 20) { // ORCA show frame faster to maatch time with tooltips
Show();
Raise();
}
@@ -125,6 +146,7 @@ void ImageDPIFrame::on_hide()
wxGetApp().mainframe->Raise();
}
}
set_title(""); // reset title on hide
}
} // namespace GUI
+4
View File
@@ -12,12 +12,14 @@ public:
ImageDPIFrame();
~ImageDPIFrame() override;
void on_dpi_changed(const wxRect &suggested_rect) override;
void sys_color_changed();
void on_show();
void on_hide();
bool Show(bool show = true) override;
void set_bitmap(const wxBitmap& bit_map);
int get_image_px() { return m_image_px; }
void set_title(const wxString& title);
private:
void init_timer();
@@ -27,6 +29,8 @@ private:
wxStaticBitmap *m_bitmap = nullptr;
wxBoxSizer *m_sizer_main{nullptr};
int m_image_px;
wxString m_title_str;
wxStaticText* m_title;
wxTimer * m_refresh_timer{nullptr};
float m_timer_count = 0;
};
+37 -37
View File
@@ -2514,7 +2514,7 @@ void MainFrame::init_menubar_as_editor()
append_menu_item(export_menu, wxID_ANY, _L("Export all objects as STLs") + dots, _L("Export all objects as STLs"),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_stl(false, false, true); }, "menu_export_stl", nullptr,
[this](){return can_export_model(); }, this);
append_menu_item(export_menu, wxID_ANY, _L("Export Generic 3MF") + dots/* + "\t" + ctrl + "G"*/, _L("Export 3MF file without using some 3mf-extensions."),
append_menu_item(export_menu, wxID_ANY, _L("Export Generic 3MF") + dots/* + "\t" + ctrl + "G"*/, _L("Export 3MF file without using some 3mf-extensions"),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_core_3mf(); }, "menu_export_sliced_file", nullptr,
[this](){return can_export_model(); }, this);
// BBS export .gcode.3mf
@@ -3025,6 +3025,24 @@ void MainFrame::init_menubar_as_editor()
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Max Volumetric Speed
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Max flowrate"), _L("Max flowrate"),
[this](wxCommandEvent&) {
if (!m_vol_test_dlg)
m_vol_test_dlg = new MaxVolumetricSpeed_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_vol_test_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Pressure Advance
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Pressure advance"), _L("Pressure advance"),
[this](wxCommandEvent&) {
if (!m_pa_calib_dlg)
m_pa_calib_dlg = new PA_Calibration_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_pa_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Flow rate (with submenu)
auto flowrate_menu = new wxMenu();
append_menu_item(
@@ -3043,15 +3061,6 @@ void MainFrame::init_menubar_as_editor()
[this]() {return m_plater->is_view3D_shown();; }, this);
m_topbar->GetCalibMenu()->AppendSubMenu(flowrate_menu, _L("Flow rate"));
// Pressure Advance
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Pressure advance"), _L("Pressure advance"),
[this](wxCommandEvent&) {
if (!m_pa_calib_dlg)
m_pa_calib_dlg = new PA_Calibration_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_pa_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Retraction test
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Retraction test"), _L("Retraction test"),
[this](wxCommandEvent&) {
@@ -3061,15 +3070,6 @@ void MainFrame::init_menubar_as_editor()
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Max Volumetric Speed
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Max flowrate"), _L("Max flowrate"),
[this](wxCommandEvent&) {
if (!m_vol_test_dlg)
m_vol_test_dlg = new MaxVolumetricSpeed_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_vol_test_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Cornering
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Cornering"), _L("Cornering calibration"),
[this](wxCommandEvent&) {
@@ -3143,6 +3143,24 @@ void MainFrame::init_menubar_as_editor()
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Max Volumetric Speed
append_menu_item(calib_menu, wxID_ANY, _L("Max flowrate"), _L("Max flowrate"),
[this](wxCommandEvent&) {
if (!m_vol_test_dlg)
m_vol_test_dlg = new MaxVolumetricSpeed_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_vol_test_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Pressure Advance
append_menu_item(calib_menu, wxID_ANY, _L("Pressure advance"), _L("Pressure advance"),
[this](wxCommandEvent&) {
if (!m_pa_calib_dlg)
m_pa_calib_dlg = new PA_Calibration_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_pa_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Flowrate (with submenu)
auto flowrate_menu = new wxMenu();
append_menu_item(flowrate_menu, wxID_ANY, _L("Pass 1"), _L("Flow rate test - Pass 1"),
@@ -3161,15 +3179,6 @@ void MainFrame::init_menubar_as_editor()
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(true, 2); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Pressure Advance
append_menu_item(calib_menu, wxID_ANY, _L("Pressure advance"), _L("Pressure advance"),
[this](wxCommandEvent&) {
if (!m_pa_calib_dlg)
m_pa_calib_dlg = new PA_Calibration_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_pa_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Retraction test
append_menu_item(calib_menu, wxID_ANY, _L("Retraction test"), _L("Retraction test"),
[this](wxCommandEvent&) {
@@ -3179,15 +3188,6 @@ void MainFrame::init_menubar_as_editor()
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Max Volumetric Speed
append_menu_item(calib_menu, wxID_ANY, _L("Max flowrate"), _L("Max flowrate"),
[this](wxCommandEvent&) {
if (!m_vol_test_dlg)
m_vol_test_dlg = new MaxVolumetricSpeed_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_vol_test_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Cornering
append_menu_item(calib_menu, wxID_ANY, _L("Cornering"), _L("Cornering calibration"),
[this](wxCommandEvent&) {
+1 -1
View File
@@ -276,7 +276,7 @@ PartSkipDialog::PartSkipDialog(wxWindow *parent) : DPIDialog(parent, wxID_ANY, _
m_loading_icon = new AnimaIcon(m_book_first_panel, wxID_ANY, list, "refresh_printer", 100);
m_loading_icon->SetMinSize(wxSize(FromDIP(25), FromDIP(25)));
m_loading_label = new Label(m_book_first_panel, _L("Loading ..."));
m_loading_label = new Label(m_book_first_panel, _L("Loading..."));
m_loading_label->Wrap(-1);
m_loading_label->SetBackgroundColour(*wxWHITE);
+325 -104
View File
@@ -212,8 +212,8 @@ wxDEFINE_EVENT(EVT_DEL_FILAMENT, SimpleEvent);
wxDEFINE_EVENT(EVT_ADD_CUSTOM_FILAMENT, ColorEvent);
wxDEFINE_EVENT(EVT_NOTICE_CHILDE_SIZE_CHANGED, SimpleEvent);
wxDEFINE_EVENT(EVT_NOTICE_FULL_SCREEN_CHANGED, IntEvent);
#define PRINTER_THUMBNAIL_SIZE (wxSize(FromDIP(48), FromDIP(48)))
#define PRINTER_PANEL_SIZE (wxSize(FromDIP(96), FromDIP(98)))
#define PRINTER_THUMBNAIL_SIZE (wxSize(40, 40)) // ORCA
#define PRINTER_PANEL_SIZE ( wxSize(70, 60)) // ORCA
#define BTN_SYNC_SIZE (wxSize(FromDIP(96), FromDIP(98)))
static string get_diameter_string(float diameter)
@@ -245,12 +245,12 @@ void Plater::show_illegal_characters_warning(wxWindow* parent)
}
static std::map<BedType, std::string> bed_type_thumbnails = {
{BedType::btPC, "bed_cool"},
{BedType::btEP, "bed_engineering"},
{BedType::btPEI, "bed_high_templ"},
{BedType::btPTE, "bed_pei"},
{BedType::btPCT, "bed_pei"}, // TODO: Orca hack
{BedType::btSuperTack, "bed_cool_supertack"}
{BedType::btPC, "bed_plate_cool_smooth" }, //"bed_cool"},
{BedType::btEP, "bed_plate_engineering" }, //"bed_engineering"},
{BedType::btPEI, "bed_plate_high_temp_smooth"}, //"bed_high_templ"},
{BedType::btPTE, "bed_plate_pei" }, //"bed_pei"},
{BedType::btPCT, "bed_plate_cool_textured" }, //"bed_pei"}, // TODO: Orca hack
{BedType::btSuperTack, "bed_plate_cool_supertack" } //"bed_cool_supertack"}
};
enum SlicedInfoIdx
@@ -411,12 +411,21 @@ struct Sidebar::priv
// Printer
wxSizer * vsizer_printer = nullptr;
wxBoxSizer * extruder_dual_sizer = nullptr;
wxBoxSizer * extruder_single_sizer = nullptr;
// Printer - preset
StaticBox * panel_printer_preset = nullptr;
wxStaticBitmap * image_printer = nullptr;
PlaterPresetComboBox *combo_printer = nullptr;
ScalableButton * btn_edit_printer = nullptr;
ScalableButton * btn_connect_printer = nullptr;
// Nozzle diameter
StaticBox * panel_nozzle_dia = nullptr;
Label * label_nozzle_title= nullptr;
ComboBox * combo_nozzle_dia = nullptr;
Label * label_nozzle_type = nullptr;
// Printer - bed
StaticBox * panel_printer_bed = nullptr;
wxStaticBitmap *image_printer_bed = nullptr;
@@ -424,7 +433,7 @@ struct Sidebar::priv
ImageDPIFrame *big_bed_image_popup = nullptr;
// Printer - sync
Button *btn_sync_printer;
//Button *btn_sync_printer;
std::shared_ptr<int> counter_sync_printer = std::make_shared<int>();
wxTimer * timer_sync_printer = new wxTimer();
// Printer - ams
@@ -470,6 +479,8 @@ struct Sidebar::priv
// BBS printer config
StaticBox* m_panel_printer_title = nullptr;
ScalableButton* m_printer_icon = nullptr;
ScalableButton* m_printer_connect = nullptr;
ScalableButton* m_printer_bbl_sync = nullptr;
ScalableButton* m_printer_setting = nullptr;
wxStaticText * m_text_printer_settings = nullptr;
wxPanel* m_panel_printer_content = nullptr;
@@ -511,22 +522,15 @@ void Sidebar::priv::layout_printer(bool isBBL, bool isDual)
// Printer - preset
if (auto sizer = static_cast<wxBoxSizer *>(panel_printer_preset->GetSizer());
sizer == nullptr /*|| isBBL != (sizer->GetOrientation() == wxVERTICAL)*/) {
wxBoxSizer *hsizer_printer_btn = new wxBoxSizer(wxHORIZONTAL);
hsizer_printer_btn->AddStretchSpacer(1);
hsizer_printer_btn->Add(btn_edit_printer, 0);
hsizer_printer_btn->Add(btn_connect_printer, 0, wxALIGN_CENTER | wxLEFT, FromDIP(4));
combo_printer->SetWindowStyle(combo_printer->GetWindowStyle() & ~wxALIGN_MASK | wxALIGN_CENTER_HORIZONTAL);
//if (isBBL) {
wxBoxSizer *vsizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *hsizer = new wxBoxSizer(wxHORIZONTAL);
hsizer->AddStretchSpacer(1);
hsizer->Add(image_printer, 0, wxEXPAND | wxTOP, FromDIP(8));
hsizer->Add(hsizer_printer_btn, 1, wxEXPAND, 0);
hsizer->AddSpacer(FromDIP(6));
vsizer->AddSpacer(FromDIP(4));
vsizer->Add(hsizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(8));
vsizer->Add(combo_printer, 0, wxEXPAND | wxALL, FromDIP(4));
panel_printer_preset->SetSizer(vsizer);
hsizer->Add(image_printer, 0, wxLEFT | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, FromDIP(10));
hsizer->Add(combo_printer, 1, wxEXPAND | wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, FromDIP(2));
hsizer->AddSpacer(FromDIP(2));
hsizer->Add(btn_edit_printer, 0, wxRIGHT | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(SidebarProps::IconSpacing()));
//hsizer->Add(btn_connect_printer, 0, wxRIGHT | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(SidebarProps::IconSpacing()));
panel_printer_preset->SetSizer(hsizer);
//} else {
// wxBoxSizer *hsizer = new wxBoxSizer(wxHORIZONTAL);
// hsizer->Add(image_printer, 0, wxLEFT | wxALIGN_CENTER, FromDIP(4));
@@ -540,31 +544,45 @@ void Sidebar::priv::layout_printer(bool isBBL, bool isDual)
if (vsizer_printer->GetItemCount() == 0) {
wxBoxSizer *hsizer_printer = new wxBoxSizer(wxHORIZONTAL);
hsizer_printer->Add(panel_printer_preset, 1, wxEXPAND, 0);
hsizer_printer->Add(panel_printer_bed, 0, wxLEFT | wxEXPAND, FromDIP(4));
hsizer_printer->Add(btn_sync_printer, 0, wxLEFT | wxEXPAND, FromDIP(4));
vsizer_printer->Add(hsizer_printer, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, FromDIP(4));
vsizer_printer->AddSpacer(FromDIP(4));
hsizer_printer->Add(panel_nozzle_dia , 0, wxLEFT, FromDIP(4));
hsizer_printer->Add(panel_printer_bed, 0, wxLEFT, FromDIP(4));
//hsizer_printer->Add(btn_sync_printer , 0, wxLEFT, FromDIP(4));
vsizer_printer->AddSpacer(FromDIP(8));
vsizer_printer->Add(hsizer_printer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(SidebarProps::ContentMargin()));
vsizer_printer->AddSpacer(FromDIP(8));
// Printer - extruder
// double
auto hsizer_extruder = new wxBoxSizer(wxHORIZONTAL);
hsizer_extruder->Add(left_extruder->sizer, 1, wxEXPAND, 0);
hsizer_extruder->AddSpacer(FromDIP(4));
hsizer_extruder->Add(right_extruder->sizer, 1, wxEXPAND, 0);
extruder_dual_sizer = new wxBoxSizer(wxHORIZONTAL);
extruder_dual_sizer->Add(left_extruder->sizer, 1, wxEXPAND, 0);
extruder_dual_sizer->AddSpacer(FromDIP(4));
extruder_dual_sizer->Add(right_extruder->sizer, 1, wxEXPAND, 0);
// single
vsizer_printer->Add(hsizer_extruder, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(4));
vsizer_printer->Add(single_extruder->sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(4));
extruder_single_sizer = single_extruder->sizer;
wxBoxSizer * extruder_sizer = new wxBoxSizer(wxVERTICAL);
extruder_sizer->Add(extruder_dual_sizer , 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(SidebarProps::ContentMargin()));
extruder_sizer->Add(extruder_single_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(SidebarProps::ContentMargin()));
vsizer_printer->AddSpacer(FromDIP(4));
vsizer_printer->Add(extruder_sizer, 1, wxEXPAND | wxBOTTOM, FromDIP(8));
}
btn_connect_printer->Show(!isBBL);
btn_sync_printer->Show(isBBL);
panel_printer_bed->Show(true); // Orca: always show bed type selector
vsizer_printer->GetItem(2)->GetSizer()->GetItem(1)->Show(isDual);
vsizer_printer->GetItem(2)->Show(isDual); // Orca: always show diameter selection
vsizer_printer->GetItem(3)->Show(!isDual);
//btn_connect_printer->Show(!isBBL);
m_printer_connect->Show(!isBBL);
//btn_sync_printer->Show(isBBL);
m_printer_bbl_sync->Show(isBBL);
// ORCA show plate type combo box only when its supported
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
auto cfg = preset_bundle.printers.get_edited_preset().config;
panel_printer_bed->Show(isBBL || cfg.opt_bool("support_multi_bed_types"));
extruder_dual_sizer->Show(isDual);
// NEEDFIX requires AMS check or any type of ???
// Single nozzle & non ams
panel_nozzle_dia->Show(!isDual);
extruder_single_sizer->Show(false);
}
void Sidebar::priv::flush_printer_sync(bool restart)
@@ -573,7 +591,8 @@ void Sidebar::priv::flush_printer_sync(bool restart)
*counter_sync_printer = 6;
timer_sync_printer->Start(500);
}
btn_sync_printer->SetBackgroundColorNormal((*counter_sync_printer & 1) ? "#F8F8F8" :"#009688");
//btn_sync_printer->SetBackgroundColorNormal((*counter_sync_printer & 1) ? "#F8F8F8" :"#009688");
m_printer_bbl_sync->SetBitmap_((*counter_sync_printer & 1) ? "printer_sync_not" : "printer_sync_ok");
if (--*counter_sync_printer <= 0)
timer_sync_printer->Stop();
}
@@ -982,13 +1001,13 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
// Nozzle
wxStaticText *label_diameter = new wxStaticText(this, wxID_ANY, _L("Diameter"));
label_diameter->SetFont(Label::Body_14);
label_diameter->SetForegroundColour("#262E30");
label_diameter->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#262E30")));
if (index >= 0) label_diameter->SetMinSize({FromDIP(80), -1});
auto combo_diameter = new ComboBox(this, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
this->combo_diameter = combo_diameter;
wxStaticText *label_flow = new wxStaticText(this, wxID_ANY, _L("Flow"));
label_flow->SetFont(Label::Body_14);
label_flow->SetForegroundColour("#262E30");
label_flow->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#262E30")));
if (index >= 0) label_flow->SetMinSize({FromDIP(80), -1});
auto combo_flow = new ComboBox(this, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
combo_flow->GetDropDown().SetUseContentWidth(true);
@@ -1003,7 +1022,7 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
// AMS
wxStaticText *label_ams = new wxStaticText(this, wxID_ANY, _L("AMS"));
label_ams->SetFont(Label::Body_14);
label_ams->SetForegroundColour("#262E30");
label_ams->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#262E30")));
//label_ams->SetMinSize({FromDIP(70), -1});
if (index >= 0) {
btn_edit = new ScalableButton(this, wxID_ANY, "dot");
@@ -1032,7 +1051,7 @@ ExtruderGroup::ExtruderGroup(wxWindow * parent, int index, wxString const &title
// AMS not installed message
ams_not_installed_msg = new wxStaticText(this, wxID_ANY, _L("Not installed"));
ams_not_installed_msg->SetFont(Label::Body_14);
ams_not_installed_msg->SetForegroundColour("#262E30");
ams_not_installed_msg->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#262E30")));
// AMS group
for (size_t i = 0; i < 4; ++i) {
@@ -1191,7 +1210,7 @@ bool Sidebar::priv::switch_diameter(bool single)
auto diameter_right = right_extruder->combo_diameter->GetValue();
if (diameter_left != diameter_right) {
MessageDialog dlg(this->plater,
_L("The software does not support using different diameter of nozzles for one print. "
_L("The software does not support using different diameter of nozzles for one print. "
"If the left and right nozzles are inconsistent, we can only proceed with single-head printing. "
"Please confirm which nozzle you would like to use for this project."),
_L("Switch diameter"), wxYES_NO | wxNO_DEFAULT);
@@ -1351,8 +1370,9 @@ void Sidebar::priv::update_sync_status(const MachineObject *obj)
right_extruder->sync_ams(nullptr, {}, {});
single_extruder->ShowBadge(false);
single_extruder->sync_ams(nullptr, {}, {});
btn_sync_printer->SetBorderColor(not_synced_colour);
btn_sync_printer->SetIcon("printer_sync");
//btn_sync_printer->SetBorderColor(not_synced_colour);
//btn_sync_printer->SetIcon("printer_sync");
m_printer_bbl_sync->SetBitmap_("printer_sync_not");
};
if (!obj || !obj->is_info_ready()) {
@@ -1504,12 +1524,14 @@ void Sidebar::priv::update_sync_status(const MachineObject *obj)
StateColor synced_colour(std::pair<wxColour, int>(wxColour("#CECECE"), StateColor::Normal));
bool all_extruder_synced = std::all_of(extruder_synced.begin(), extruder_synced.end(), [](bool value) { return value; });
if (printer_synced && all_extruder_synced) {
btn_sync_printer->SetBorderColor(synced_colour);
btn_sync_printer->SetIcon("ams_nozzle_sync");
// btn_sync_printer->SetBorderColor(synced_colour);
// btn_sync_printer->SetIcon("ams_nozzle_sync");
m_printer_bbl_sync->SetBitmap_("printer_sync_ok");
}
else {
btn_sync_printer->SetBorderColor(not_synced_colour);
btn_sync_printer->SetIcon("printer_sync");
// btn_sync_printer->SetBorderColor(not_synced_colour);
// btn_sync_printer->SetIcon("printer_sync");
m_printer_bbl_sync->SetBitmap_("printer_sync_not");
}
}
@@ -1517,7 +1539,8 @@ void Sidebar::update_sync_ams_btn_enable(wxUpdateUIEvent &e)
{
if (m_last_slice_state != p->plater->is_background_process_slicing()) {
m_last_slice_state = p->plater->is_background_process_slicing();
btn_sync->Enable(!m_last_slice_state);
//btn_sync->Enable(!m_last_slice_state);
p->m_printer_bbl_sync->Enable(!m_last_slice_state);
ams_btn->Enable(!m_last_slice_state);
Refresh();
}
@@ -1583,6 +1606,20 @@ Sidebar::Sidebar(Plater *parent)
//wizard_t->run(ConfigWizard::RR_USER, ConfigWizard::SP_CUSTOM);
});
// ORCA use connect button on titlebar
p->m_printer_connect = new ScalableButton(p->m_panel_printer_title, wxID_ANY, "monitor_signal_strong");
p->m_printer_connect->SetToolTip(_L("Connection"));
p->m_printer_connect->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
PhysicalPrinterDialog dlg(this->GetParent());
dlg.ShowModal();
});
// ORCA use sync button on titlebar
p->m_printer_bbl_sync = new ScalableButton(p->m_panel_printer_title, wxID_ANY, "printer_sync_not");
p->m_printer_bbl_sync->SetToolTip(_L("Synchronize nozzle information and the number of AMS"));
p->m_printer_bbl_sync->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
deal_btn_sync();
});
p->m_printer_setting = new ScalableButton(p->m_panel_printer_title, wxID_ANY, "settings");
p->m_printer_setting->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
@@ -1597,6 +1634,8 @@ Sidebar::Sidebar(Plater *parent)
h_sizer_title->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
h_sizer_title->Add(p->m_text_printer_settings, 0, wxALIGN_CENTER);
h_sizer_title->AddStretchSpacer();
h_sizer_title->Add(p->m_printer_connect , 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20)); // used larger margin to prevent accidental clicks
h_sizer_title->Add(p->m_printer_bbl_sync, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20)); // used larger margin to prevent accidental clicks
h_sizer_title->Add(p->m_printer_setting, 0, wxALIGN_CENTER);
h_sizer_title->AddSpacer(FromDIP(SidebarProps::TitlebarMargin()));
h_sizer_title->SetMinSize(-1, 3 * em);
@@ -1627,22 +1666,33 @@ Sidebar::Sidebar(Plater *parent)
/*************************** 2. add printer content ************************/
p->m_panel_printer_content = new wxPanel(p->scrolled, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
p->m_panel_printer_content->SetBackgroundColour(wxColour(255, 255, 255));
StateColor panel_bd_col(std::pair<wxColour, int>(wxColour("#009688"), StateColor::Pressed),
std::pair<wxColour, int>(wxColour("#009688"), StateColor::Hovered),
std::pair<wxColour, int>(wxColour("#EEEEEE"), StateColor::Normal));
std::pair<wxColour, int>(wxColour("#DBDBDB"), StateColor::Normal));
p->panel_printer_preset = new StaticBox(p->m_panel_printer_content);
p->panel_printer_preset->SetCornerRadius(8);
p->panel_printer_preset->SetCornerRadius(FromDIP(8));
p->panel_printer_preset->SetBorderColor(panel_bd_col);
p->panel_printer_preset->SetMinSize(PRINTER_PANEL_SIZE);
p->panel_printer_preset->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
p->panel_printer_preset->Bind(wxEVT_LEFT_DOWN, [this](auto & evt) {
p->combo_printer->wxEvtHandler::ProcessEvent(evt);
});
// ORCA Hide Cover automatically if there is not enough space
p->panel_printer_preset->Bind(wxEVT_SIZE, [this](auto & e) {
bool is_narrow = e.GetSize().GetWidth() < p->scrolled->FromDIP(235);
if(is_narrow && p->image_printer->IsShown())
p->image_printer->Hide();
else if(!is_narrow && !p->image_printer->IsShown())
p->image_printer->Show();
e.Skip();
});
ScalableButton *edit_btn = new ScalableButton(p->panel_printer_preset, wxID_ANY, "dot");
ScalableButton *edit_btn = new ScalableButton(p->panel_printer_preset, wxID_ANY, "edit");
edit_btn->SetToolTip(_L("Click to edit preset"));
edit_btn->Hide(); // hide for first launch
edit_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent)
{
p->editing_filament = -1;
@@ -1650,17 +1700,33 @@ Sidebar::Sidebar(Plater *parent)
p->editing_filament = 0;
});
p->btn_edit_printer = edit_btn;
ScalableBitmap bitmap_printer(p->panel_printer_preset, "printer_placeholder", 48);
p->image_printer = new wxStaticBitmap(p->panel_printer_preset, wxID_ANY, bitmap_printer.bmp(), wxDefaultPosition, PRINTER_THUMBNAIL_SIZE, 0);
ScalableBitmap bitmap_printer(p->panel_printer_preset, "printer_placeholder", PRINTER_THUMBNAIL_SIZE.GetHeight());
p->image_printer = new wxStaticBitmap(p->panel_printer_preset, wxID_ANY, bitmap_printer.bmp(), wxDefaultPosition, FromDIP(PRINTER_THUMBNAIL_SIZE), 0);
p->image_printer->Bind(wxEVT_LEFT_DOWN, [this](auto &evt) {
p->combo_printer->wxEvtHandler::ProcessEvent(evt);
});
PlaterPresetComboBox *combo_printer = new PlaterPresetComboBox(p->panel_printer_preset, Preset::TYPE_PRINTER);
combo_printer->SetWindowStyle(combo_printer->GetWindowStyle() & ~wxALIGN_MASK | wxALIGN_CENTER_HORIZONTAL);
//combo_printer->SetWindowStyle(combo_printer->GetWindowStyle() & ~wxALIGN_MASK | wxALIGN_CENTER_HORIZONTAL);
combo_printer->SetBorderWidth(0);
p->combo_printer = combo_printer;
// ORCA paint whole combobox on focus
auto printer_focus_bg = [this, panel_bd_col](bool focused){
auto bg_color = StateColor::darkModeColorFor(wxColour(focused ? "#E5F0EE" : "#FFFFFF"));
auto panel = p->panel_printer_preset;
panel->SetBackgroundColor(bg_color);
if(focused)
panel->SetBorderColor(wxColour("#009688"));
else
panel->SetBorderColor(panel_bd_col);
p->btn_edit_printer->SetBackgroundColour(bg_color);
p->image_printer->SetBackgroundColour(bg_color);
p->combo_printer->SetBackgroundColour(bg_color); // paints margins instead combo background
};
combo_printer->Bind(wxEVT_SET_FOCUS, [this, printer_focus_bg](auto& e) {printer_focus_bg(true ); e.Skip();});
combo_printer->Bind(wxEVT_KILL_FOCUS, [this, printer_focus_bg](auto& e) {printer_focus_bg(false); e.Skip();});
/* ORCA This part moved to titlebar
p->btn_connect_printer = new ScalableButton(p->panel_printer_preset, wxID_ANY, "monitor_signal_strong");
p->btn_connect_printer->SetBackgroundColour(wxColour(255, 255, 255));
p->btn_connect_printer->SetToolTip(_L("Connection"));
@@ -1669,30 +1735,107 @@ Sidebar::Sidebar(Plater *parent)
PhysicalPrinterDialog dlg(this->GetParent());
dlg.ShowModal();
});
*/
{
auto hovered = std::make_shared<wxWindow *>();
for (wxWindow *w : std::initializer_list<wxWindow *>{p->panel_printer_preset, edit_btn, p->image_printer, combo_printer}) {
w->Bind(wxEVT_ENTER_WINDOW, [w, hovered, edit_btn](wxMouseEvent &evt) { *hovered = w; edit_btn->SetBitmap_("edit"); });
w->Bind(wxEVT_LEAVE_WINDOW, [w, hovered, edit_btn](wxMouseEvent &evt) { if (*hovered == w) { edit_btn->SetBitmap_("dot"); *hovered = nullptr; } });
// ORCA use Show/Hide to gain text area instead using blank icon
for (wxWindow *w : std::initializer_list<wxWindow *>{p->panel_printer_preset, p->btn_edit_printer, p->image_printer, p->combo_printer}) {
w->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent &e) {
if(!p->combo_printer->HasFocus())
p->panel_printer_preset->SetBorderColor(wxColour("#009688"));
if(!p->btn_edit_printer->IsShown()){
p->btn_edit_printer->Show();
p->panel_printer_preset->Layout();
}
e.Skip();
});
w->Bind(wxEVT_LEAVE_WINDOW, [this, panel_bd_col](wxMouseEvent &e) {
wxWindow* next_w = wxFindWindowAtPoint(wxGetMousePosition());
if (!next_w || (next_w != p->panel_printer_preset && next_w != p->btn_edit_printer && next_w != p->image_printer && next_w != p->combo_printer)){
if(!p->combo_printer->HasFocus())
p->panel_printer_preset->SetBorderColor(panel_bd_col);
p->btn_edit_printer->Hide();
p->panel_printer_preset->Layout();
}
e.Skip();
});
}
}
// ORCA unified Nozzle diameter selection
p->panel_nozzle_dia = new StaticBox(p->m_panel_printer_content);
p->panel_nozzle_dia->SetCornerRadius(FromDIP(8));
p->panel_nozzle_dia->SetBorderColor(panel_bd_col);
p->panel_nozzle_dia->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
p->panel_nozzle_dia->Bind(wxEVT_LEFT_DOWN, [this](auto & evt) {
p->combo_nozzle_dia->wxEvtHandler::ProcessEvent(evt);
});
p->label_nozzle_title = new Label(p->panel_nozzle_dia, _L("Nozzle"));
p->label_nozzle_title->SetFont(Label::Body_10);
p->label_nozzle_title->Bind(wxEVT_LEFT_DOWN, [this](auto & evt) {
p->combo_nozzle_dia->wxEvtHandler::ProcessEvent(evt);
});
p->combo_nozzle_dia = new ComboBox(p->panel_nozzle_dia, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
p->combo_nozzle_dia->SetBorderWidth(0);
p->combo_nozzle_dia->GetDropDown().SetUseContentWidth(true);
p->combo_nozzle_dia->SetMinSize(FromDIP(wxSize(PRINTER_PANEL_SIZE.GetWidth() - 4, 26))); // requires a static value in here
p->combo_nozzle_dia->SetMaxSize(FromDIP(wxSize(PRINTER_PANEL_SIZE.GetWidth() - 4, 26))); // using -1 with wxEXPAND has issues
p->combo_nozzle_dia->Bind(wxEVT_COMBOBOX, [this](auto &e) {
auto evt_combo = (*p->single_extruder).combo_diameter;
evt_combo->SetSelection(e.GetSelection());
wxCommandEvent evt(wxEVT_COMBOBOX, evt_combo->GetId());
evt.SetEventObject(evt_combo);
evt.SetInt(e.GetSelection());
wxPostEvent(evt_combo, evt);
e.Skip();
});
// ORCA paint whole combobox on focus
auto nozzle_focus_bg = [this, panel_bd_col](bool focused){
auto bg_color = StateColor::darkModeColorFor(wxColour(focused ? "#E5F0EE" : "#FFFFFF"));
auto panel = p->panel_nozzle_dia;
panel->SetBackgroundColor(bg_color);
if(focused)
panel->SetBorderColor(wxColour("#009688"));
else
panel->SetBorderColor(panel_bd_col);
p->label_nozzle_title->SetBackgroundColour(bg_color);
p->label_nozzle_type->SetBackgroundColour(bg_color);
p->combo_nozzle_dia->SetBackgroundColour(bg_color); // paints margins instead combo background
};
p->combo_nozzle_dia->Bind(wxEVT_SET_FOCUS, [this, nozzle_focus_bg](auto& e) {nozzle_focus_bg(true ); e.Skip();});
p->combo_nozzle_dia->Bind(wxEVT_KILL_FOCUS, [this, nozzle_focus_bg](auto& e) {nozzle_focus_bg(false); e.Skip();});
p->label_nozzle_type = new Label(p->panel_nozzle_dia, "Brass", wxST_ELLIPSIZE_END | wxALIGN_CENTRE_HORIZONTAL);
p->label_nozzle_type->SetFont(Label::Body_10);
p->label_nozzle_type->SetMinSize(FromDIP(wxSize(56, -1)));
p->label_nozzle_type->SetMaxSize(FromDIP(wxSize(56, -1)));
p->label_nozzle_type->Bind(wxEVT_LEFT_DOWN, [this](auto & evt) {
p->combo_nozzle_dia->wxEvtHandler::ProcessEvent(evt);
});
wxGridSizer *nozzle_dia_sizer = new wxGridSizer(3, 1, FromDIP(2), 0);
nozzle_dia_sizer->Add(p->label_nozzle_title, 0, wxALIGN_CENTER | wxTOP, FromDIP(4));
nozzle_dia_sizer->Add(p->combo_nozzle_dia , 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, FromDIP(2));
nozzle_dia_sizer->Add(p->label_nozzle_type , 0, wxALIGN_CENTER);
p->panel_nozzle_dia->SetSizer(nozzle_dia_sizer);
// Bed type selection
p->panel_printer_bed = new StaticBox(p->m_panel_printer_content);
p->panel_printer_bed->SetCornerRadius(8);
p->panel_printer_bed->SetCornerRadius(FromDIP(8));
p->panel_printer_bed->SetBorderColor(panel_bd_col);
p->panel_printer_bed->SetMinSize(PRINTER_PANEL_SIZE);
p->panel_printer_bed->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
p->panel_printer_bed->Bind(wxEVT_LEFT_DOWN, [this](auto &evt) {
p->combo_printer_bed->wxEvtHandler::ProcessEvent(evt);
});
ScalableButton *wiki_bed = new ScalableButton(p->panel_printer_bed, wxID_ANY, "help");
wiki_bed->Bind(wxEVT_BUTTON, [](wxCommandEvent) {
wxLaunchDefaultBrowser("https://wiki.bambulab.com/en/x1/manual/compatibility-and-parameter-settings-of-filaments");
});
//ScalableButton *wiki_bed = new ScalableButton(p->panel_printer_bed, wxID_ANY, "help");
//wiki_bed->Bind(wxEVT_BUTTON, [](wxCommandEvent) {
// wxLaunchDefaultBrowser("https://wiki.bambulab.com/en/x1/manual/compatibility-and-parameter-settings-of-filaments");
//});
ScalableBitmap bitmap_bed(p->panel_printer_bed, "printer_placeholder", 32);
ScalableBitmap bitmap_bed(p->panel_printer_bed, "printer_placeholder", PRINTER_THUMBNAIL_SIZE.GetHeight());
p->image_printer_bed = new wxStaticBitmap(p->panel_printer_bed, wxID_ANY, bitmap_bed.bmp(), wxDefaultPosition, wxDefaultSize, 0);
p->image_printer_bed->Bind(wxEVT_LEFT_DOWN, [this](auto &evt) {
p->image_printer_bed->Unbind(wxEVT_LEAVE_WINDOW, &Sidebar::on_leave_image_printer_bed, this);
@@ -1702,17 +1845,20 @@ Sidebar::Sidebar(Plater *parent)
p->combo_printer_bed->wxEvtHandler::ProcessEvent(evt);
});
p->combo_printer_bed = new ComboBox(p->panel_printer_bed, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY | wxALIGN_CENTER_HORIZONTAL);
p->combo_printer_bed = new ComboBox(p->panel_printer_bed, wxID_ANY, wxString(""), wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
p->combo_printer_bed->SetBorderWidth(0);
p->combo_printer_bed->GetDropDown().SetUseContentWidth(true);
p->combo_printer_bed->SetMinSize(FromDIP(wxSize(18,-1))); // ORCA show only arrow
p->combo_printer_bed->SetMaxSize(FromDIP(wxSize(18,-1))); // ORCA show only arrow
reset_bed_type_combox_choices(true);
p->combo_printer_bed->Bind(wxEVT_COMBOBOX, [this](auto &e) {
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
auto image_path = get_cur_select_bed_image();
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, 48));
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, PRINTER_THUMBNAIL_SIZE.GetHeight()));
if (p->big_bed_image_popup) {
p->big_bed_image_popup->set_bitmap(create_scaled_bitmap("big_" + image_path, p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
p->big_bed_image_popup->set_title(p->combo_printer_bed->GetString(p->combo_printer_bed->GetSelection()));
}
e.Skip(); // fix bug:Event spreads to sidebar
});
@@ -1723,17 +1869,26 @@ Sidebar::Sidebar(Plater *parent)
});
p->image_printer_bed->Bind(wxEVT_ENTER_WINDOW, &Sidebar::on_enter_image_printer_bed, this);
wxBoxSizer *bed_type_vsizer = new wxBoxSizer(wxVERTICAL);
bed_type_vsizer->AddStretchSpacer(1);
wxBoxSizer *bed_type_hsizer = new wxBoxSizer(wxHORIZONTAL);
bed_type_hsizer->AddStretchSpacer(1);
bed_type_hsizer->Add(p->image_printer_bed, 1, wxEXPAND | wxTOP, FromDIP(8));
bed_type_hsizer->Add(wiki_bed, 1, wxTOP, FromDIP(2));
bed_type_vsizer->Add(bed_type_hsizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(8));
bed_type_vsizer->Add(p->combo_printer_bed, 0, wxEXPAND | wxALL, FromDIP(2));
bed_type_vsizer->AddStretchSpacer(1);
// ORCA paint whole combobox on focus
auto bed_focus_bg = [this, panel_bd_col](bool focused){
auto bg_color = StateColor::darkModeColorFor(wxColour(focused ? "#E5F0EE" : "#FFFFFF"));
auto panel = p->panel_printer_bed;
panel->SetBackgroundColor(bg_color);
if(focused)
panel->SetBorderColor(wxColour("#009688"));
else
panel->SetBorderColor(panel_bd_col);
p->image_printer_bed->SetBackgroundColour(bg_color);
p->combo_printer_bed->SetBackgroundColour(bg_color); // paints margins instead combo background
};
p->combo_printer_bed->Bind(wxEVT_SET_FOCUS, [this, bed_focus_bg](auto& e) {bed_focus_bg(true ); e.Skip();});
p->combo_printer_bed->Bind(wxEVT_KILL_FOCUS, [this, bed_focus_bg](auto& e) {bed_focus_bg(false); e.Skip();});
p->panel_printer_bed->SetSizer(bed_type_vsizer);
wxBoxSizer *bed_type_sizer = new wxBoxSizer(wxHORIZONTAL);
bed_type_sizer->Add(p->combo_printer_bed, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(2));
bed_type_sizer->Add(p->image_printer_bed, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(2));
p->panel_printer_bed->SetSizer(bed_type_sizer);
AppConfig *app_config = wxGetApp().app_config;
std::string str_bed_type = app_config->get("curr_bed_type");
@@ -1757,6 +1912,7 @@ Sidebar::Sidebar(Plater *parent)
BedType bed_type = (BedType)bed_type_value;
project_config.set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(bed_type));
/* ORCA THIS PART MOVED TO TITLEBAR
// Sync printer information
btn_sync = new Button(p->m_panel_printer_content, _L("Sync info"), "printer_sync", 0, 32);
//btn_sync->SetFont(Label::Body_8);
@@ -1781,10 +1937,12 @@ Sidebar::Sidebar(Plater *parent)
btn_sync->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
deal_btn_sync();
});
p->btn_sync_printer = btn_sync;
*/
p->timer_sync_printer->Bind(wxEVT_TIMER, [this] (wxTimerEvent & e) {
p->flush_printer_sync();
});
p->btn_sync_printer = btn_sync;
p->left_extruder = new ExtruderGroup(p->m_panel_printer_content, 0, _L("Left Nozzle"));
p->right_extruder = new ExtruderGroup(p->m_panel_printer_content, 1, _L("Right Nozzle"));
@@ -2058,6 +2216,7 @@ void Sidebar::on_enter_image_printer_bed(wxMouseEvent &evt) {
auto image_path = get_cur_select_bed_image();
p->big_bed_image_popup->set_bitmap(create_scaled_bitmap("big_" + image_path, p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
}
p->big_bed_image_popup->set_title(p->combo_printer_bed->GetString(p->combo_printer_bed->GetSelection()));
p->big_bed_image_popup->SetCanFocus(false);
p->big_bed_image_popup->SetPosition(temp_pos);
p->big_bed_image_popup->on_show();
@@ -2195,13 +2354,15 @@ void Sidebar::update_all_preset_comboboxes()
if (preset_bundle.use_bbl_network()) {
//only show connection button for not-BBL printer
p->btn_connect_printer->Hide();
//p->btn_connect_printer->Hide();
p->m_printer_connect->Hide();
//only show sync-ams button for BBL printer
p->m_bpButton_ams_filament->Show();
//update print button default value for bbl or third-party printer
p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::ePrintPlate);
} else {
p->btn_connect_printer->Show();
//p->btn_connect_printer->Show();
p->m_printer_connect->Show();
p->m_bpButton_ams_filament->Hide();
auto print_btn_type = MainFrame::PrintSelectType::eExportGcode;
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
@@ -2267,6 +2428,9 @@ void Sidebar::update_all_preset_comboboxes()
p->combo_printer_bed->Disable();
}
// ORCA Hide plate selector if not supported by printer
p->panel_printer_bed->Show(is_bbl_vendor || cfg.opt_bool("support_multi_bed_types"));
// Update the print choosers to only contain the compatible presets, update the dirty flags.
//BBS
@@ -2391,12 +2555,38 @@ void Sidebar::update_presets(Preset::Type preset_type)
update_extruder_diameter(*p->left_extruder);
update_extruder_diameter(*p->right_extruder);
//}
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, 48));
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, PRINTER_THUMBNAIL_SIZE.GetHeight()));
} else {
AMSCountPopupWindow::UpdateAMSCount(0, p->single_extruder);
//if (!p->is_switching_diameter)
update_extruder_diameter(*p->single_extruder);
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, 48));
// ORCA sync unified nozzle combo box
p->combo_nozzle_dia->Clear();
for (size_t i = 0; i < diameters.size(); ++i)
p->combo_nozzle_dia->Append(diameters[i], {});
p->combo_nozzle_dia->SetSelection((*p->single_extruder).combo_diameter->GetSelection());
// ORCA update nozzle type
const auto& full_config = wxGetApp().preset_bundle->full_config();
wxString nozzle_type = "-";
const ConfigOptionEnumsGenericNullable* cfg_nozzle_type = full_config.option<ConfigOptionEnumsGenericNullable>("nozzle_type");
if(cfg_nozzle_type != nullptr){
std::vector<NozzleType> nozzle_types(cfg_nozzle_type->size());
for (size_t idx = 0; idx < cfg_nozzle_type->size(); ++idx)
nozzle_types[idx] = NozzleType(cfg_nozzle_type->values[idx]);
nozzle_type = _L( // NEEDFIX this part can be replaced with shorter names
nozzle_types[0] == ntHardenedSteel ? "Hardened Steel" :
nozzle_types[0] == ntStainlessSteel ? "Stainless Steel" :
nozzle_types[0] == ntTungstenCarbide ? "Tungsten Carbide" :
nozzle_types[0] == ntBrass ? "Brass"
: "-" // Undefined
);
}
p->label_nozzle_type->SetLabel(nozzle_type);
p->label_nozzle_type->SetToolTip(nozzle_type == "-" ? "" : nozzle_type);
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, PRINTER_THUMBNAIL_SIZE.GetHeight()));
}
if (GUI::wxGetApp().plater())
@@ -2460,8 +2650,8 @@ BedType Sidebar::get_cur_select_bed_type() {
std::string Sidebar::get_cur_select_bed_image()
{
auto select_bed_type = get_cur_select_bed_type();
auto series_suffix_str = m_cur_image_bed_type.empty() ? "" : ("_" + m_cur_image_bed_type);
auto image_path = bed_type_thumbnails[select_bed_type] + series_suffix_str;
//auto series_suffix_str = m_cur_image_bed_type.empty() ? "" : ("_" + m_cur_image_bed_type);
auto image_path = bed_type_thumbnails[select_bed_type];// + series_suffix_str;
return image_path;
}
@@ -2542,12 +2732,36 @@ void Sidebar::msw_rescale()
p->m_panel_filament_title->GetSizer()
->SetMinSize(-1, 3 * wxGetApp().em_unit());
p->m_printer_icon->msw_rescale();
p->m_printer_connect->msw_rescale();
p->m_printer_bbl_sync->msw_rescale();
p->m_printer_icon->msw_rescale();
p->m_printer_setting->msw_rescale();
p->panel_printer_preset->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
p->panel_printer_preset->SetCornerRadius(FromDIP(8));
p->image_printer->SetSize(FromDIP(PRINTER_THUMBNAIL_SIZE));
update_printer_thumbnail();
p->combo_printer->Rescale();
p->btn_edit_printer->msw_rescale();
p->image_printer->SetSize(PRINTER_THUMBNAIL_SIZE);
p->panel_nozzle_dia->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
p->panel_nozzle_dia->SetCornerRadius(FromDIP(8));
p->combo_nozzle_dia->Rescale();
p->panel_printer_bed->SetMinSize(FromDIP(PRINTER_PANEL_SIZE));
p->panel_printer_bed->SetCornerRadius(FromDIP(8));
p->combo_printer_bed->Rescale();
p->combo_printer_bed->SetMinSize(FromDIP(wxSize(18,-1))); // ORCA show only arrow
p->combo_printer_bed->SetMaxSize(FromDIP(wxSize(18,-1))); // ORCA show only arrow
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
auto image_path = get_cur_select_bed_image();
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, 48));
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, PRINTER_THUMBNAIL_SIZE.GetHeight()));
if (p->big_bed_image_popup){ // ORCA force rebuild frame. current wxwidget version not supports wxBITMAP_SCALE_FILL flag on wxStaticBitmap
// also wxImage scaledImage = bit_map.ConvertToImage(); scaledImage.Rescale(FromDIP(m_image_px), FromDIP(m_image_px), wxIMAGE_QUALITY_HIGH);
// didnt worked as expected and it requires use on set_bitmap. so that will try to scale everytime
p->big_bed_image_popup->Destroy();
p->big_bed_image_popup = nullptr;
}
p->m_filament_icon->msw_rescale();
p->m_bpButton_add_filament->msw_rescale();
@@ -2556,16 +2770,13 @@ void Sidebar::msw_rescale()
p->m_bpButton_set_filament->msw_rescale();
p->m_flushing_volume_btn->Rescale();
//BBS
p->combo_printer_bed->Rescale();
p->combo_printer_bed->SetMinSize({-1, 3 * wxGetApp().em_unit()});
p->left_extruder->Rescale();
p->right_extruder->Rescale();
p->single_extruder->Rescale();
p->btn_sync_printer->SetPaddingSize({FromDIP(6), FromDIP(12)});
p->btn_sync_printer->SetMinSize(BTN_SYNC_SIZE);
p->panel_printer_bed->SetMinSize(PRINTER_PANEL_SIZE);
p->btn_sync_printer->Rescale();
//p->btn_sync_printer->SetPaddingSize({FromDIP(6), FromDIP(12)});
//p->btn_sync_printer->SetMinSize(BTN_SYNC_SIZE);
//p->btn_sync_printer->Rescale();
#if 0
if (p->mode_sizer)
p->mode_sizer->msw_rescale();
@@ -2577,7 +2788,7 @@ void Sidebar::msw_rescale()
// //p->combo_printer
// } )
// combo->msw_rescale();
p->combo_printer->msw_rescale();
for (PlaterPresetComboBox* combo : p->combos_filament)
combo->msw_rescale();
@@ -2624,7 +2835,9 @@ void Sidebar::sys_color_changed()
for (wxWindow* win : std::vector<wxWindow*>{ p->scrolled, p->presets_panel })
wxGetApp().UpdateAllStaticTextDarkUI(win);
#endif
p->btn_sync_printer->SetIcon("printer_sync");
//p->btn_sync_printer->SetIcon("printer_sync");
p->m_printer_bbl_sync->msw_rescale();
p->m_printer_connect->msw_rescale();
// for (wxWindow* btn : std::vector<wxWindow*>{ p->btn_reslice, p->btn_export_gcode })
// wxGetApp().UpdateDarkUI(btn, true);
p->m_printer_icon->msw_rescale();
@@ -2657,6 +2870,13 @@ void Sidebar::sys_color_changed()
for (PlaterPresetComboBox* combo : p->combos_filament)
combo->sys_color_changed();
if (p->big_bed_image_popup) // ORCA
p->big_bed_image_popup->sys_color_changed();
p->btn_edit_printer->msw_rescale();
p->image_printer->SetSize(FromDIP(PRINTER_THUMBNAIL_SIZE));
p->image_printer_bed->SetSize(FromDIP(PRINTER_THUMBNAIL_SIZE));
// BBS
obj_list()->sys_color_changed();
obj_layers()->sys_color_changed();
@@ -3592,7 +3812,7 @@ void Sidebar::update_printer_thumbnail()
Preset & selected_preset = preset_bundle->printers.get_edited_preset();
std::string printer_type = selected_preset.get_current_printer_type(preset_bundle);
if (printer_thumbnails.find(printer_type) != printer_thumbnails.end()) // Use known cache first
p->image_printer->SetBitmap(create_scaled_bitmap(printer_thumbnails[printer_type], this, 48));
p->image_printer->SetBitmap(create_scaled_bitmap(printer_thumbnails[printer_type], this, PRINTER_THUMBNAIL_SIZE.GetHeight()));
else {
try {
// No cache, try dedicated printer preview
@@ -3614,7 +3834,7 @@ void Sidebar::update_printer_thumbnail()
.make_preferred();
if (boost::filesystem::exists(cover_path)) {
try {
p->image_printer->SetBitmap(create_scaled_bitmap(cover_path.string(), this, 48));
p->image_printer->SetBitmap(create_scaled_bitmap(cover_path.string(), this, PRINTER_THUMBNAIL_SIZE.GetHeight()));
printer_thumbnails[printer_type] = cover_path.string(); // Cache the path so we don't look up again
return;
} catch (...) {}
@@ -3622,7 +3842,7 @@ void Sidebar::update_printer_thumbnail()
}
}
}
p->image_printer->SetBitmap(create_scaled_bitmap("printer_placeholder", this, 48));
p->image_printer->SetBitmap(create_scaled_bitmap("printer_placeholder", this, PRINTER_THUMBNAIL_SIZE.GetHeight()));
printer_thumbnails[printer_type] = "printer_placeholder"; // Avoid unnecessary try
}
}
@@ -12350,6 +12570,7 @@ void Plater::calib_retraction(const Calib_Params& params)
obj->config.set_key_value("layer_height", new ConfigOptionFloat(layer_height));
obj->config.set_key_value("alternate_extra_wall", new ConfigOptionBool(false));
obj->config.set_key_value("seam_position", new ConfigOptionEnum<SeamPosition>(spAligned));
obj->config.set_key_value("wall_sequence", new ConfigOptionEnum<WallSequence>(WallSequence::InnerOuter));
changed_objects({ 0 });
+11 -11
View File
@@ -68,29 +68,29 @@ std::string PrePrintChecker::get_print_status_info(PrintDialogStatus status)
wxString PrePrintChecker::get_pre_state_msg(PrintDialogStatus status)
{
switch (status) {
case PrintStatusNoUserLogin: return _L("No login account, only printers in LAN mode are displayed");
case PrintStatusConnectingServer: return _L("Connecting to server");
case PrintStatusReading: return _L("Synchronizing device information");
case PrintStatusReadingTimeout: return _L("Synchronizing device information time out");
case PrintStatusModeNotFDM: return _L("Cannot send the print job when the printer is not at FDM mode");
case PrintStatusInUpgrading: return _L("Cannot send the print job when the printer is updating firmware");
case PrintStatusInSystemPrinting: return _L("The printer is executing instructions. Please restart printing after it ends");
case PrintStatusInPrinting: return _L("The printer is busy on other print job");
case PrintStatusNoUserLogin: return _L("No login account, only printers in LAN mode are displayed.");
case PrintStatusConnectingServer: return _L("Connecting to server...");
case PrintStatusReading: return _L("Synchronizing device information...");
case PrintStatusReadingTimeout: return _L("Synchronizing device information timed out.");
case PrintStatusModeNotFDM: return _L("Cannot send a print job when the printer is not at FDM mode.");
case PrintStatusInUpgrading: return _L("Cannot send a print job while the printer is updating firmware.");
case PrintStatusInSystemPrinting: return _L("The printer is executing instructions. Please restart printing after it ends.");
case PrintStatusInPrinting: return _L("The printer is busy with another print job.");
case PrintStatusAmsOnSettingup: return _L("AMS is setting up. Please try again later.");
case PrintStatusAmsMappingInvalid: return _L("Not all filaments used in slicing are mapped to the printer. Please check the mapping of filaments.");
case PrintStatusAmsMappingMixInvalid: return _L("Please do not mix-use the Ext with AMS");
case PrintStatusAmsMappingMixInvalid: return _L("Please do not mix-use the Ext with AMS.");
case PrintStatusNozzleDataInvalid: return _L("Invalid nozzle information, please refresh or manually set nozzle information.");
case PrintStatusLanModeNoSdcard: return _L("Storage needs to be inserted before printing via LAN.");
case PrintStatusLanModeSDcardNotAvailable: return _L("Storage is in abnormal state or is in read-only mode.");
case PrintStatusNoSdcard: return _L("Storage needs to be inserted before printing.");
case PrintStatusNeedForceUpgrading: return _L("Cannot send the print job to a printer whose firmware is required to get updated.");
case PrintStatusNeedConsistencyUpgrading: return _L("Cannot send the print job to a printer whose firmware is required to get updated.");
case PrintStatusBlankPlate: return _L("Cannot send the print job for empty plate");
case PrintStatusBlankPlate: return _L("Cannot send a print job for an empty plate.");
case PrintStatusTimelapseNoSdcard: return _L("Storage needs to be inserted to record timelapse.");
case PrintStatusMixAmsAndVtSlotWarning: return _L("You have selected both external and AMS filaments for an extruder. You will need to manually switch the external filament during printing.");
case PrintStatusTPUUnsupportAutoCali: return _L("TPU 90A/TPU 85A is too soft and does not support automatic Flow Dynamics calibration.");
case PrintStatusWarningKvalueNotUsed: return _L("Set dynamic flow calibration to 'OFF' to enable custom dynamic flow value.");
case PrintStatusNotSupportedPrintAll: return _L("This printer does not support printing all plates");
case PrintStatusNotSupportedPrintAll: return _L("This printer does not support printing all plates.");
case PrintStatusColorQuantityExceed: return _L("The current firmware supports a maximum of 16 materials. You can either reduce the number of materials to 16 or fewer on the Preparation Page, or try updating the firmware. If you are still restricted after the update, please wait for subsequent firmware support.");
}
return wxEmptyString;
+3 -3
View File
@@ -1209,7 +1209,7 @@ void PreferencesDialog::create_items()
auto item_gcodes_warning = create_item_checkbox(_L("Don't warn when loading 3MF with modified G-code"), "", "no_warn_when_modified_gcodes");
g_sizer->Add(item_gcodes_warning);
auto item_step_dialog = create_item_checkbox(_L("Show options when importing STEP file"), _L("If enabled,a parameter settings dialog will appear during STEP file import."), "enable_step_mesh_setting");
auto item_step_dialog = create_item_checkbox(_L("Show options when importing STEP file"), _L("If enabled, a parameter settings dialog will appear during STEP file import."), "enable_step_mesh_setting");
g_sizer->Add(item_step_dialog);
auto item_backup = create_item_backup(_L("Auto backup"), _L("Backup your project periodically for restoring from the occasional crash."));
@@ -1251,7 +1251,7 @@ void PreferencesDialog::create_items()
std::vector<wxString> FlushOptionLabels = {_L("All"),_L("Color"),_L("None")};
std::vector<std::string> FlushOptionValues = { "all","color change","disabled" };
auto item_auto_flush = create_item_combobox(_L("Auto flush after changing ..."), _L("Auto calculate flushing volumes when selected values changed"), "auto_calculate_flush", FlushOptionLabels, FlushOptionValues);
auto item_auto_flush = create_item_combobox(_L("Auto flush after changing..."), _L("Auto calculate flushing volumes when selected values changed"), "auto_calculate_flush", FlushOptionLabels, FlushOptionValues);
g_sizer->Add(item_auto_flush);
auto item_auto_arrange = create_item_checkbox(_L("Auto arrange plate after cloning"), "", "auto_arrange");
@@ -1280,7 +1280,7 @@ void PreferencesDialog::create_items()
g_sizer->Add(reverse_mouse_zoom);
//// CONTROL > Clear my choice on ...
g_sizer->Add(create_item_title(_L("Clear my choice on ...")), 1, wxEXPAND);
g_sizer->Add(create_item_title(_L("Clear my choice on...")), 1, wxEXPAND);
auto item_save_choise = create_item_button(_L("Unsaved projects"), _L("Clear"), "", _L("Clear my choice on the unsaved projects."), []() {
wxGetApp().app_config->set("save_project_choise", "");
+3 -3
View File
@@ -75,9 +75,9 @@ void SelectMachineDialog::init_machine_bed_types()
if (MACHINE_BED_TYPE_STRING.size() == 0) {
MACHINE_BED_TYPE_STRING = {//_L("Auto"),
_L("Bambu Cool Plate") + " / " + _L("PLA Plate"),
_L("Bamabu Engineering Plate"),
_L("Bamabu Smooth PEI Plate") + "/" + _L("High temperature Plate"),
_L("Bamabu Textured PEI Plate"),
_L("Bambu Engineering Plate"),
_L("Bambu Smooth PEI Plate") + "/" + _L("High temperature Plate"),
_L("Bambu Textured PEI Plate"),
_L("Bambu Cool Plate SuperTack")
};
MachineBedTypeString = {//"auto",
+3 -3
View File
@@ -1438,13 +1438,13 @@ void SendToPrinterDialog::show_status(PrintDialogStatus status, std::vector<wxSt
Enable_Refresh_Button(true);
}
else if (status == PrintDialogStatus::PrintStatusConnectingServer) {
wxString msg_text = _L("Connecting to server");
wxString msg_text = _L("Connecting to server...");
update_print_status_msg(msg_text, true, true);
Enable_Send_Button(true);
Enable_Refresh_Button(true);
}
else if (status == PrintDialogStatus::PrintStatusReading) {
wxString msg_text = _L("Synchronizing device information");
wxString msg_text = _L("Synchronizing device information...");
update_print_status_msg(msg_text, false, true);
Enable_Send_Button(false);
Enable_Refresh_Button(false);
@@ -1456,7 +1456,7 @@ void SendToPrinterDialog::show_status(PrintDialogStatus status, std::vector<wxSt
Enable_Refresh_Button(true);
}
else if (status == PrintDialogStatus::PrintStatusReadingTimeout) {
wxString msg_text = _L("Synchronizing device information time out");
wxString msg_text = _L("Synchronizing device information timed out.");
update_print_status_msg(msg_text, true, true);
Enable_Send_Button(true);
Enable_Refresh_Button(true);
+7 -7
View File
@@ -3505,8 +3505,8 @@ void StatusPanel::update_ams_control_state(std::string ams_id, std::string slot_
wxString load_error_info, unload_error_info;
if (obj->is_in_printing() && !obj->can_resume()) {
load_error_info = _L("The printer is busy on other print job");
unload_error_info = _L("The printer is busy on other print job");
load_error_info = _L("The printer is busy with another print job.");
unload_error_info = _L("The printer is busy with another print job.");
} else if (obj->can_resume() && !devPrinterUtil::IsVirtualSlot(ams_id)) {
load_error_info = _L("When printing is paused, filament loading and unloading are only supported for external slots.");
unload_error_info = _L("When printing is paused, filament loading and unloading are only supported for external slots.");
@@ -3521,8 +3521,8 @@ void StatusPanel::update_ams_control_state(std::string ams_id, std::string slot_
}
if (in_switch_filament) {
load_error_info = _L("Current extruder is busy changing filament");
unload_error_info = _L("Current extruder is busy changing filament");
load_error_info = _L("Current extruder is busy changing filament.");
unload_error_info = _L("Current extruder is busy changing filament.");
}
if (ams_id.empty() || slot_id.empty()) {
@@ -3532,14 +3532,14 @@ void StatusPanel::update_ams_control_state(std::string ams_id, std::string slot_
for (auto ext : obj->GetExtderSystem()->GetExtruders()) {
if (ext.GetSlotNow().ams_id == ams_id && ext.GetSlotNow().slot_id == slot_id)
{
load_error_info = _L("Current slot has already been loaded");
load_error_info = _L("Current slot has already been loaded.");
}
}
} else {
for (auto ext : obj->GetExtderSystem()->GetExtruders()) {
if (ext.GetSlotNow().ams_id == ams_id && ext.GetSlotNow().slot_id == slot_id)
{
load_error_info = _L("Current slot has already been loaded");
load_error_info = _L("Current slot has already been loaded.");
}
}
@@ -5004,7 +5004,7 @@ void StatusPanel::on_nozzle_selected(wxCommandEvent &event)
/*Enable switch head while printing is paused STUDIO-9789*/
if ((obj->is_in_printing() && !obj->is_in_printing_pause()) || obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) {
MessageDialog dlg(nullptr, _L("The printer is busy on other print job"), _L("Error"), wxICON_WARNING | wxOK);
MessageDialog dlg(nullptr, _L("The printer is busy with another print job."), _L("Error"), wxICON_WARNING | wxOK);
dlg.ShowModal();
return;
}
+9 -9
View File
@@ -1734,31 +1734,31 @@ void SyncAmsInfoDialog::show_status(PrintDialogStatus status, std::vector<wxStri
} else if (status == PrintDialogStatus::PrintStatusInvalidPrinter) {
update_print_status_msg(wxEmptyString, true, true);
} else if (status == PrintDialogStatus::PrintStatusConnectingServer) {
wxString msg_text = _L("Connecting to server");
wxString msg_text = _L("Connecting to server...");
update_print_status_msg(msg_text, true, true);
} else if (status == PrintDialogStatus::PrintStatusReading) {
wxString msg_text = _L("Synchronizing device information");
wxString msg_text = _L("Synchronizing device information...");
update_print_status_msg(msg_text, false, true);
} else if (status == PrintDialogStatus::PrintStatusReadingFinished) {
update_print_status_msg(wxEmptyString, false, true);
} else if (status == PrintDialogStatus::PrintStatusReadingTimeout) {
wxString msg_text = _L("Synchronizing device information time out");
wxString msg_text = _L("Synchronizing device information timed out.");
update_print_status_msg(msg_text, true, true);
} else if (status == PrintDialogStatus::PrintStatusInUpgrading) {
wxString msg_text = _L("Cannot send the print job when the printer is updating firmware");
wxString msg_text = _L("Cannot send a print job while the printer is updating firmware.");
update_print_status_msg(msg_text, true, true);
} else if (status == PrintDialogStatus::PrintStatusInSystemPrinting) {
wxString msg_text = _L("The printer is executing instructions. Please restart printing after it ends");
wxString msg_text = _L("The printer is executing instructions. Please restart printing after it ends.");
update_print_status_msg(msg_text, true, true);
} else if (status == PrintDialogStatus::PrintStatusInPrinting) {
wxString msg_text = _L("The printer is busy on other print job");
wxString msg_text = _L("The printer is busy with another print job.");
update_print_status_msg(msg_text, true, true);
} else if (status == PrintDialogStatus::PrintStatusAmsMappingSuccess) {
update_print_status_msg(wxEmptyString, false, false);
} else if (status == PrintDialogStatus::PrintStatusAmsMappingInvalid) {
update_print_status_msg(wxEmptyString, true, false);
} else if (status == PrintDialogStatus::PrintStatusAmsMappingMixInvalid) {
wxString msg_text = _L("Please do not mix-use the Ext with AMS");
wxString msg_text = _L("Please do not mix-use the Ext with AMS.");
update_print_status_msg(msg_text, true, false);
} else if (status == PrintDialogStatus::PrintStatusNozzleDataInvalid) {
wxString msg_text = _L("Invalid nozzle information, please refresh or manually set nozzle information.");
@@ -1827,10 +1827,10 @@ void SyncAmsInfoDialog::show_status(PrintDialogStatus status, std::vector<wxStri
wxString msg_text = _L("Cannot send the print job to a printer whose firmware is required to get updated.");
update_print_status_msg(msg_text, true, true);
} else if (status == PrintDialogStatus::PrintStatusBlankPlate) {
wxString msg_text = _L("Cannot send the print job for empty plate");
wxString msg_text = _L("Cannot send a print job for an empty plate.");
update_print_status_msg(msg_text, true, true);
} else if (status == PrintDialogStatus::PrintStatusNotSupportedPrintAll) {
wxString msg_text = _L("This printer does not support printing all plates");
wxString msg_text = _L("This printer does not support printing all plates.");
update_print_status_msg(msg_text, true, true);
} else if (status == PrintDialogStatus::PrintStatusTimelapseWarning) {
wxString msg_text;
+140 -17
View File
@@ -39,6 +39,7 @@
#include "UnsavedChangesDialog.hpp"
#include "SavePresetDialog.hpp"
#include "EditGCodeDialog.hpp"
#include "MsgDialog.hpp"
#include "Notebook.hpp"
@@ -252,7 +253,7 @@ void Tab::create_preset_tab()
m_btn_delete_preset->Hide();
/*add_scaled_button(panel, &m_question_btn, "question");
m_question_btn->SetToolTip(_(L("Hover the cursor over buttons to find more information \n"
m_question_btn->SetToolTip(_(L("Hover the cursor over buttons to find more information\n"
"or click this button.")));
add_scaled_button(panel, &m_search_btn, "search");
@@ -1696,8 +1697,8 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
int filament_id = m_config->opt_int("support_filament") - 1; // the displayed id is based from 1, while internal id is based from 0
int interface_filament_id = m_config->opt_int("support_interface_filament") - 1;
if (is_support_filament(filament_id, false) && !is_soluble_filament(filament_id) && !has_filaments({"TPU", "TPU-AMS"})) {
wxString msg_text = _L("Non-soluble support materials are not recommended for support base. \n"
"Are you sure to use them for support base? \n");
wxString msg_text = _L("Non-soluble support materials are not recommended for support base.\n"
"Are you sure to use them for support base?\n");
MessageDialog dialog(wxGetApp().plater(), msg_text, "", wxICON_WARNING | wxYES | wxNO);
DynamicPrintConfig new_conf = *m_config;
if (dialog.ShowModal() == wxID_NO) {
@@ -1728,7 +1729,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
msg_text = _L("When using soluble material for the support interface, we recommend the following settings:\n"
"0 top Z distance, 0 interface spacing, interlaced rectilinear pattern, disable independent support layer height\n"
"and use soluble materials for both support interface and support base.");
msg_text += "\n\n" + _L("Change these settings automatically? \n"
msg_text += "\n\n" + _L("Change these settings automatically?\n"
"Yes - Change these settings automatically\n"
"No - Do not change these settings for me");
}
@@ -3546,15 +3547,16 @@ void TabFilament::add_filament_overrides_page()
{
//BBS
PageShp page = add_options_page(L("Setting Overrides"), "custom-gcode_setting_override"); // ORCA: icon only visible on placeholders
ConfigOptionsGroupShp optgroup = page->new_optgroup(L("Retraction"), L"param_retraction");
auto append_single_option_line = [optgroup, this](const std::string& opt_key, int opt_index)
const int extruder_idx = 0; // #ys_FIXME
ConfigOptionsGroupShp retraction_optgroup = page->new_optgroup(L("Retraction"), L"param_retraction");
auto append_retraction_option = [this, retraction_optgroup](const std::string& opt_key, int opt_index)
{
Line line {"",""};
//BBS
line = optgroup->create_single_option_line(optgroup->get_option(opt_key));
line = retraction_optgroup->create_single_option_line(retraction_optgroup->get_option(opt_key));
line.near_label_widget = [this, optgroup_wk = ConfigOptionsGroupWkp(optgroup), opt_key, opt_index](wxWindow* parent) {
line.near_label_widget = [this, optgroup_wk = ConfigOptionsGroupWkp(retraction_optgroup), opt_key, opt_index](wxWindow* parent) {
auto check_box = new ::CheckBox(parent); // ORCA modernize checkboxes
check_box->Bind(wxEVT_TOGGLEBUTTON, [this, optgroup_wk, opt_key, opt_index](wxCommandEvent& evt) {
const bool is_checked = evt.IsChecked();
@@ -3565,8 +3567,7 @@ void TabFilament::add_filament_overrides_page()
if (is_checked) {
field->update_na_value(_(L("N/A")));
field->set_last_meaningful_value();
}
else {
} else {
const std::string printer_opt_key = opt_key.substr(strlen("filament_"));
const auto printer_config = m_preset_bundle->printers.get_edited_preset().config;
const boost::any printer_config_value = optgroup_sh->get_config_value(printer_config, printer_opt_key, opt_index);
@@ -3581,11 +3582,9 @@ void TabFilament::add_filament_overrides_page()
return check_box;
};
optgroup->append_line(line);
retraction_optgroup->append_line(line);
};
const int extruder_idx = 0; // #ys_FIXME
for (const std::string opt_key : { "filament_retraction_length",
"filament_z_hop",
"filament_z_hop_types",
@@ -3606,7 +3605,93 @@ void TabFilament::add_filament_overrides_page()
//SoftFever
// "filament_seam_gap"
})
append_single_option_line(opt_key, extruder_idx);
append_retraction_option(opt_key, extruder_idx);
ConfigOptionsGroupShp ironing_optgroup = page->new_optgroup(L("Ironing"), L"param_ironing");
auto append_ironing_option = [this, ironing_optgroup](const std::string& opt_key, int opt_index)
{
Line line {"",""};
line = ironing_optgroup->create_single_option_line(ironing_optgroup->get_option(opt_key));
line.near_label_widget = [this, optgroup_wk = ConfigOptionsGroupWkp(ironing_optgroup), opt_key, opt_index](wxWindow* parent) {
auto check_box = new ::CheckBox(parent); // ORCA modernize checkboxes
check_box->Bind(wxEVT_TOGGLEBUTTON, [this, optgroup_wk, opt_key, opt_index](wxCommandEvent& evt) {
const bool is_checked = evt.IsChecked();
if (auto optgroup_sh = optgroup_wk.lock(); optgroup_sh) {
if (Field *field = optgroup_sh->get_fieldc(opt_key, opt_index); field != nullptr) {
field->toggle(is_checked);
const std::string process_opt_key = opt_key.substr(strlen("filament_"));
const auto process_config = m_preset_bundle->prints.get_edited_preset().config;
const ConfigOption *process_option = process_config.option(process_opt_key);
const auto *process_vector = dynamic_cast<const ConfigOptionVectorBase*>(process_option);
const size_t target_index = opt_index < 0 ? 0 : static_cast<size_t>(opt_index);
bool has_process_value = process_option != nullptr;
if (has_process_value) {
if (process_vector != nullptr) {
has_process_value = target_index < process_vector->size() && !process_vector->is_nil(target_index);
} else {
has_process_value = !process_option->is_nil();
}
}
if (is_checked) {
bool applied_value = false;
if (has_process_value && process_option != nullptr) {
if (ConfigOption *filament_option = m_config->option(opt_key)) {
if (auto filament_vector = dynamic_cast<ConfigOptionVectorBase*>(filament_option)) {
std::unique_ptr<ConfigOption> process_clone(process_option->clone());
size_t source_index = 0;
if (process_vector != nullptr)
source_index = target_index;
filament_vector->set_at(process_clone.get(), target_index, source_index);
const boost::any filament_config_value = optgroup_sh->get_config_value(*m_config, opt_key, opt_index);
field->set_value(filament_config_value, false);
field->update_na_value(_(L("N/A")));
applied_value = true;
}
}
}
if (applied_value)
field->set_last_meaningful_value();
else {
field->update_na_value(_(L("N/A")));
field->set_na_value();
}
} else {
if (has_process_value) {
const boost::any process_config_value = optgroup_sh->get_config_value(process_config, process_opt_key, opt_index);
field->update_na_value(process_config_value);
} else {
field->update_na_value(_(L("N/A")));
}
field->set_na_value();
if (ConfigOption *filament_option = m_config->option(opt_key)) {
if (auto filament_vector = dynamic_cast<ConfigOptionVectorBase*>(filament_option))
filament_vector->set_at_to_nil(target_index);
}
}
}
}
}, check_box->GetId());
m_overrides_options[opt_key] = check_box;
return check_box;
};
ironing_optgroup->append_line(line);
};
for (const std::string opt_key : { "filament_ironing_flow",
"filament_ironing_spacing",
"filament_ironing_inset",
"filament_ironing_speed"
})
append_ironing_option(opt_key, extruder_idx);
}
void TabFilament::update_filament_overrides_page(const DynamicPrintConfig* printers_config)
@@ -3688,6 +3773,44 @@ void TabFilament::update_filament_overrides_page(const DynamicPrintConfig* print
field->toggle(is_checked);
}
}
// Handle ironing overrides
const auto og_ironing_it = std::find_if(page->m_optgroups.begin(), page->m_optgroups.end(), [](const ConfigOptionsGroupShp og) { return og->title == "Ironing"; });
if (og_ironing_it != page->m_optgroups.end())
{
ConfigOptionsGroupShp ironing_optgroup = *og_ironing_it;
std::vector<std::string> ironing_opt_keys = {
"filament_ironing_flow",
"filament_ironing_spacing",
"filament_ironing_inset",
"filament_ironing_speed"
};
for (const std::string& opt_key : ironing_opt_keys)
{
if (m_overrides_options.find(opt_key) == m_overrides_options.end())
continue;
bool is_checked = !dynamic_cast<ConfigOptionVectorBase*>(m_config->option(opt_key))->is_nil(extruder_idx);
m_overrides_options[opt_key]->Enable(true);
m_overrides_options[opt_key]->SetValue(is_checked);
Field* field = ironing_optgroup->get_fieldc(opt_key, 0);
if (field == nullptr) continue;
if (!is_checked) {
// Get the default value from the process config (ironing_* without filament_ prefix)
const std::string process_opt_key = opt_key.substr(strlen("filament_"));
const auto process_config = m_preset_bundle->prints.get_edited_preset().config;
const boost::any process_config_value = ironing_optgroup->get_config_value(process_config, process_opt_key, 0);
field->update_na_value(process_config_value);
field->set_value(process_config_value, false);
}
field->toggle(is_checked);
}
}
}
void TabFilament::build()
@@ -4713,7 +4836,7 @@ if (is_marlin_flavor)
// if value is differs from first nozzle diameter value
if (fabs(cur_diam - frst_diam) > EPSILON) {
const wxString msg_text = _(
L("Single Extruder Multi Material is selected, \n"
L("Single Extruder Multi Material is selected,\n"
"and all extruders must have the same diameter.\n"
"Do you want to change the diameter for all extruders to first extruder nozzle diameter value?"));
MessageDialog dialog(parent(), msg_text, _(L("Nozzle diameter")), wxICON_WARNING | wxYES_NO);
@@ -6424,7 +6547,7 @@ void Tab::delete_preset()
}
if (is_base_preset && (current_preset.type == Preset::Type::TYPE_FILAMENT) && action == _utf8(L("Delete"))) {
msg += from_u8(_u8L("Are you sure to delete the selected preset? \nIf the preset corresponds to a filament currently in use on your printer, please reset the filament information for that slot."));
msg += from_u8(_u8L("Are you sure to delete the selected preset?\nIf the preset corresponds to a filament currently in use on your printer, please reset the filament information for that slot."));
} else {
msg += from_u8((boost::format(_u8L("Are you sure to %1% the selected preset?")) % action).str());
}
+8 -8
View File
@@ -195,7 +195,7 @@ static bool is_same_nozzle_diameters(const DynamicPrintConfig &full_config, cons
if (config_nozzle_diameters.size() != machine_nozzle_diameters.size()) {
wxString nozzle_in_preset = wxString::Format(_L("nozzle size in preset: %d"), config_nozzle_diameters.size());
wxString nozzle_in_printer = wxString::Format(_L("nozzle size memorized: %d"), machine_nozzle_diameters.size());
error_msg = _L("The size of nozzle type in preset is not consistent with memorized nozzle.Did you change your nozzle lately ? ") + "\n " + nozzle_in_preset +
error_msg = _L("The size of nozzle type in preset is not consistent with memorized nozzle. Did you change your nozzle lately?") + "\n " + nozzle_in_preset +
"\n " + nozzle_in_printer + "\n";
return false;
}
@@ -204,7 +204,7 @@ static bool is_same_nozzle_diameters(const DynamicPrintConfig &full_config, cons
if (config_nozzle_diameters[idx] != machine_nozzle_diameters[idx]) {
wxString nozzle_in_preset = wxString::Format(_L("nozzle[%d] in preset: %.1f"), idx, config_nozzle_diameters[idx]);
wxString nozzle_in_printer = wxString::Format(_L("nozzle[%d] memorized: %.1f"), idx, machine_nozzle_diameters[idx]);
error_msg = _L("Your nozzle type in preset is not consistent with memorized nozzle.Did you change your nozzle lately ? ") + "\n " + nozzle_in_preset +
error_msg = _L("Your nozzle type in preset is not consistent with memorized nozzle. Did you change your nozzle lately?") + "\n " + nozzle_in_preset +
"\n " + nozzle_in_printer + "\n";
return false;
}
@@ -1755,15 +1755,15 @@ void CalibUtils::send_to_print(const CalibInfo &calib_info, wxString &error_mess
}
if (obj_->is_in_upgrading()) {
error_message = _L("Cannot send the print job when the printer is updating firmware");
error_message = _L("Cannot send a print job while the printer is updating firmware.");
return;
}
else if (obj_->is_system_printing()) {
error_message = _L("The printer is executing instructions. Please restart printing after it ends");
error_message = _L("The printer is executing instructions. Please restart printing after it ends.");
return;
}
else if (obj_->is_in_printing()) {
error_message = _L("The printer is busy on other print job");
error_message = _L("The printer is busy with another print job.");
return;
}
@@ -1863,13 +1863,13 @@ void CalibUtils::send_to_print(const std::vector<CalibInfo> &calib_infos, wxStri
}
if (obj_->is_in_upgrading()) {
error_message = _L("Cannot send the print job when the printer is updating firmware");
error_message = _L("Cannot send a print job while the printer is updating firmware.");
return;
} else if (obj_->is_system_printing()) {
error_message = _L("The printer is executing instructions. Please restart printing after it ends");
error_message = _L("The printer is executing instructions. Please restart printing after it ends.");
return;
} else if (obj_->is_in_printing()) {
error_message = _L("The printer is busy on other print job");
error_message = _L("The printer is busy with another print job.");
return;
}