Merge branch 'main' into weilun/speed_dial

# Conflicts:
#	src/slic3r/GUI/Tab.cpp
This commit is contained in:
Lam Wei Lun
2026-09-14 10:37:16 +08:00
136 changed files with 1439 additions and 557 deletions
+1
View File
@@ -1,6 +1,7 @@
#include "AMSDryControl.hpp"
#include "slic3r/GUI/DeviceCore/DevFilaSystem.h"
#include "GUI_App.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "I18N.hpp"
#include "slic3r/GUI/DeviceCore/DevExtruderSystem.h"
+1
View File
@@ -14,6 +14,7 @@
//Previous defintions
class wxGrid;
class ProgressBar;
namespace Slic3r {
+2
View File
@@ -2,6 +2,8 @@
#include "ExtrusionCalibration.hpp"
#include "MsgDialog.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "libslic3r/Preset.hpp"
#include "I18N.hpp"
#include <algorithm>
+1
View File
@@ -11,6 +11,7 @@
#include "MainFrame.hpp"
#include "format.hpp"
#include "Widgets/ProgressDialog.hpp"
#include <wx/tooltip.h>
#include "Widgets/RoundedRectangle.hpp"
#include "Widgets/StaticBox.hpp"
@@ -5,8 +5,10 @@
#include <thread>
#include "GUI_App.hpp"
#include "GUI_Utils.hpp"
#include <wx/timer.h>
class Button;
class Label;
class CheckBox;
namespace Slic3r { namespace GUI {
class CapsuleButton;
+1
View File
@@ -1,6 +1,7 @@
#include "CalibrationWizard.hpp"
#include "I18N.hpp"
#include "GUI_App.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "MsgDialog.hpp"
#include "CalibrationWizardPage.hpp"
#include "../../libslic3r/calib.hpp"
@@ -1,5 +1,7 @@
#include <regex>
#include "CalibrationWizardPresetPage.hpp"
#include "GUI.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "I18N.hpp"
#include "Widgets/Label.hpp"
#include "MsgDialog.hpp"
@@ -1,4 +1,5 @@
#include "CalibrationWizardSavePage.hpp"
#include "GUI.hpp"
#include "I18N.hpp"
#include "Widgets/Label.hpp"
#include "MsgDialog.hpp"
+1
View File
@@ -1,5 +1,6 @@
#include "GUI_App.hpp"
#include "CapsuleButton.hpp"
#include "Widgets/StateColor.hpp"
#include <wx/dcbuffer.h>
#include "wx/graphics.h"
#include "Widgets/Label.hpp"
+1
View File
@@ -1,4 +1,5 @@
#include "ColorDecomposeSupport.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "MixedFilamentDialog.hpp"
#include "GUI_App.hpp"
#include "MsgDialog.hpp"
+1
View File
@@ -2,6 +2,7 @@
#include "ConfigManipulation.hpp"
#include "I18N.hpp"
#include "GUI_App.hpp"
#include "DeviceCore/DevConfigUtil.h"
#include "format.hpp"
#include "libslic3r/Config.hpp"
#include "libslic3r/Model.hpp"
+1
View File
@@ -1,4 +1,5 @@
#include "DailyTips.hpp"
#include "slic3r/GUI/Widgets/Label.hpp"
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
+2
View File
@@ -1,5 +1,7 @@
#include <boost/log/trivial.hpp>
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
#include "slic3r/GUI/UserNotification.hpp"
#include "libslic3r/PrintConfig.hpp"
@@ -4,6 +4,8 @@
#include <set>
#include "DevFilaBlackList.h"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
#include "DevFilaSystem.h"
#include "DevManager.h"
#include "DevConfigUtil.h"
@@ -1,5 +1,6 @@
#include <nlohmann/json.hpp>
#include "DevFilaSystem.h"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "DevNozzleSystem.h" // DevNozzle / DevNozzleSystem for GetNozzleFlowStringByAmsId
// TODO: remove this include
+2
View File
@@ -1,5 +1,7 @@
#include "libslic3r/libslic3r.h"
#include "DeviceManager.hpp"
#include "HMS.hpp"
#include "I18N.hpp"
#include "libslic3r/Time.hpp"
#include "libslic3r/Thread.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
+1
View File
@@ -1,6 +1,7 @@
#include "wgtMsgPanel.h"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/Widgets/Label.hpp"
#include "slic3r/GUI/Widgets/StateColor.hpp"
#include "slic3r/GUI/wxExtensions.hpp"
+1
View File
@@ -1,6 +1,7 @@
#include "DragCanvas.hpp"
#include "wxExtensions.hpp"
#include "GUI_App.hpp"
#include "Widgets/StateColor.hpp"
namespace Slic3r { namespace GUI {
+3
View File
@@ -1,7 +1,10 @@
#include "EncodedFilament.hpp"
#include <nlohmann/json.hpp>
#include "GUI_App.hpp"
using json = nlohmann::json;
namespace Slic3r
{
@@ -1,4 +1,5 @@
#include "ExportPresetBundleDialog.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "GUI_App.hpp"
#include "ConfigWizard.hpp"
#include "I18N.hpp"
@@ -12,7 +13,11 @@
#include <libslic3r/PresetBundle.hpp>
#include <wx/string.h>
#include <miniz.h>
#include <nlohmann/json.hpp>
#include <slic3r/GUI/MsgDialog.hpp>
using json = nlohmann::json;
namespace Slic3r { namespace GUI {
ExportPresetBundleDialog::ExportPresetBundleDialog(
+1
View File
@@ -1,6 +1,7 @@
#include "ExtraRenderers.hpp"
#include "wxExtensions.hpp"
#include "GUI.hpp"
#include "I18N.hpp"
#include "BitmapComboBox.hpp"
#include "Plater.hpp"
#include "Widgets/ComboBox.hpp"
+1
View File
@@ -1,5 +1,6 @@
#include "ExtrusionCalibration.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "MsgDialog.hpp"
#include "libslic3r/Preset.hpp"
#include <algorithm>
+84 -39
View File
@@ -11,6 +11,7 @@
#include "libslic3r/PrintConfig.hpp"
#include <algorithm>
#include <cmath>
#include <regex>
#include <utility>
#include <cstdint>
@@ -540,51 +541,95 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
case coStrings:
case coFloatOrPercent:
case coFloatsOrPercents: {
if ((m_opt.type == coFloatOrPercent || m_opt.type == coFloatsOrPercents) && !str.IsEmpty() && str.Last() != '%')
{
if ((m_opt.type == coFloatOrPercent || m_opt.type == coFloatsOrPercents) && !str.IsEmpty() &&
!(m_opt.nullable && str == m_na_value)) {
bool update_control = false;
wxString numeric_str = str;
double val = 0.;
const char dec_sep = is_decimal_separator_point() ? '.' : ',';
const char dec_sep_alt = dec_sep == '.' ? ',' : '.';
// Replace the first incorrect separator in decimal number.
if (str.Replace(dec_sep_alt, dec_sep, false) != 0)
set_value(str, false);
// Orca: normalize the decimal separator and optional unit before
// detecting the percentage suffix and parsing the numeric part.
update_control |= numeric_str.Replace(dec_sep_alt, dec_sep, false) != 0;
update_control |= numeric_str.Replace(" ", "", true) != 0;
const bool has_literal_unit = numeric_str.EndsWith("mm");
if (has_literal_unit) {
numeric_str.RemoveLast(2);
update_control = true;
}
bool is_percent = !numeric_str.IsEmpty() && numeric_str.Last() == '%';
if (is_percent)
numeric_str.RemoveLast();
// remove space and "mm" substring, if any exists
str.Replace(" ", "", true);
str.Replace("m", "", true);
if (!str.ToDouble(&val))
{
if ((has_literal_unit && is_percent) || !numeric_str.ToDouble(&val) || !std::isfinite(val)) {
if (!check_value) {
m_value.clear();
break;
}
show_error(m_parent, _L("Invalid numeric."));
set_value(double_to_string(val), true);
}
else if (((m_opt.sidetext.rfind("mm/s") != std::string::npos && val > m_opt.max) ||
(m_opt.sidetext.rfind("mm ") != std::string::npos && val > /*1*/m_opt.max_literal)) &&
(m_value.empty() || into_u8(str) != boost::any_cast<std::string>(m_value)))
{
if (!check_value) {
m_value.clear();
break;
numeric_str = double_to_string(std::clamp(0., double(m_opt.min), double(m_opt.max)));
is_percent = false;
update_control = true;
} else {
const bool looks_like_missing_percent = !is_percent && !has_literal_unit &&
((m_opt.sidetext.rfind("mm/s") != std::string::npos && val > m_opt.max) ||
(m_opt.sidetext.rfind("mm ") != std::string::npos && val > m_opt.max_literal));
// Orca: validate explicit percentages and literal values before
// asking whether an otherwise valid literal was meant as a percentage.
const bool out_of_range = !m_opt.is_value_valid(val);
if (out_of_range) {
if (!check_value) {
m_value.clear();
break;
}
show_error(m_parent, _L("Value is out of range."));
val = std::clamp(val, double(m_opt.min), double(m_opt.max));
// Orca: retain the inferred percent unit when clamping a
// suspicious unitless value, so 2000 becomes 100%, not 100 mm.
is_percent |= looks_like_missing_percent;
numeric_str = double_to_string(val);
update_control = true;
} else {
const bool value_changed = m_value.empty() || into_u8(str) != boost::any_cast<std::string>(m_value);
if (looks_like_missing_percent && value_changed) {
if (!check_value) {
m_value.clear();
break;
}
const std::string sidetext = m_opt.sidetext.rfind("mm/s") != std::string::npos ? "mm/s" : "mm";
const wxString stVal = numeric_str;
const wxString msg_text = from_u8((boost::format(_utf8(L("Is it %s%% or %s %s?"))) %
stVal % stVal % sidetext).str());
WarningDialog dialog(m_parent, msg_text, _L("Parameter validation") + ": " + m_opt_id, wxYES | wxNO);
dialog.SetButtonLabel(wxID_YES, stVal + _L("%"));
dialog.SetButtonLabel(wxID_NO, stVal + " " + _L(sidetext));
dialog.GetSizer()->SetSizeHints(&dialog);
dialog.Fit();
dialog.CenterOnParent();
is_percent = dialog.ShowModal() == wxID_YES;
update_control = true;
}
}
const std::string sidetext = m_opt.sidetext.rfind("mm/s") != std::string::npos ? "mm/s" : "mm";
const wxString stVal = double_to_string(val, 2);
const wxString msg_text = from_u8((boost::format(_utf8(L("Is it %s%% or %s %s?\n"
"YES for %s%%, \n"
"NO for %s %s."))) %
stVal % stVal % sidetext % stVal % stVal % sidetext)
.str());
WarningDialog dialog(m_parent, msg_text, _L("Parameter validation") + ": " + m_opt_id, wxYES | wxNO);
if ((val > 100) && dialog.ShowModal() == wxID_YES) {
set_value(from_u8((boost::format("%s%%") % stVal).str()), false /*true*/);
str += "%%";
} else
set_value(stVal, false); // it's no needed but can be helpful, when inputted value contained "," instead of "."
// Orca: also enforce the literal limit after clamping an explicit mm input.
if (!is_percent && m_opt.sidetext.rfind("mm ") != std::string::npos && val > m_opt.max_literal) {
if (!check_value) {
m_value.clear();
break;
}
if (!out_of_range)
show_error(m_parent, _L("Value is out of range."));
val = m_opt.max_literal;
numeric_str = double_to_string(val);
update_control = true;
}
}
if (update_control) {
str = numeric_str + (is_percent ? "%" : "");
set_value(str, true);
}
}
if (m_opt.opt_key == "thumbnails") {
@@ -2805,11 +2850,11 @@ void PointCtrl::BUILD()
//temp->Add(static_text_y, 0, wxALIGN_CENTER_VERTICAL, 0);
temp->Add(y_input);
x_textctrl->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e) { propagate_value(x_textctrl); }), x_textctrl->GetId());
y_textctrl->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e) { propagate_value(y_textctrl); }), y_textctrl->GetId());
x_textctrl->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e) { propagate_input_value(x_textctrl); }), x_textctrl->GetId());
y_textctrl->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e) { propagate_input_value(y_textctrl); }), y_textctrl->GetId());
x_textctrl->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { e.Skip(); propagate_value(x_textctrl); }), x_textctrl->GetId());
y_textctrl->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { e.Skip(); propagate_value(y_textctrl); }), y_textctrl->GetId());
x_textctrl->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { e.Skip(); propagate_input_value(x_textctrl); }), x_textctrl->GetId());
y_textctrl->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { e.Skip(); propagate_input_value(y_textctrl); }), y_textctrl->GetId());
// // recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(x_input);
@@ -2858,7 +2903,7 @@ bool PointCtrl::value_was_changed(wxTextCtrl* win)
return boost::any_cast<Vec2d>(m_value) != boost::any_cast<Vec2d>(val);
}
void PointCtrl::propagate_value(wxTextCtrl* win)
void PointCtrl::propagate_input_value(wxTextCtrl* win)
{
if (win->GetValue().empty())
on_kill_focus();
+1 -1
View File
@@ -650,7 +650,7 @@ public:
void BUILD() override;
bool value_was_changed(wxTextCtrl* win);
// Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER
void propagate_value(wxTextCtrl* win);
void propagate_input_value(wxTextCtrl* win);
void set_value(const Vec2d& value, bool change_event = false);
void set_value(const boost::any& value, bool change_event = false) override;
boost::any& get_value() override;
+1
View File
@@ -1,5 +1,6 @@
#include "FilamentMapPanel.hpp"
#include "GUI_App.hpp"
#include "I18N.hpp"
#include "Plater.hpp"
#include "Widgets/MultiNozzleSync.hpp" // manuallySetNozzleCount producer for extruder_nozzle_stats
#include <algorithm>
+44 -94
View File
@@ -1077,56 +1077,36 @@ const double GLCanvas3D::DefaultCameraZoomToPlateMarginFactor = 1.25;
void GLCanvas3D::load_arrange_settings()
{
std::string dist_fff_str =
wxGetApp().app_config->get("arrange", "min_object_distance_fff");
// Each key must match what _render_arrange_menu writes, which appends a per-mode
// postfix to the base name.
auto load_float = [](const char *key, float &out) {
// The menu writes these with float_to_string_decimal_point, so parse them back
// the same way rather than with anything locale-dependent.
std::string value = wxGetApp().app_config->get("arrange", key);
size_t parsed = 0;
double number = string_to_double_decimal_point(value, &parsed);
if (parsed > 0)
out = float(number);
};
auto load_bool = [](const char *key, bool &out) {
std::string value = wxGetApp().app_config->get("arrange", key);
if (!value.empty())
out = (value == "1" || value == "true");
};
std::string dist_fff_seq_print_str =
wxGetApp().app_config->get("arrange", "min_object_distance_seq_print_fff");
load_float("min_object_distance_fff", m_arrange_settings_fff.distance);
load_float("min_object_distance_fff_seq_print", m_arrange_settings_fff_seq_print.distance);
load_float("min_object_distance_sla", m_arrange_settings_sla.distance);
std::string dist_sla_str =
wxGetApp().app_config->get("arrange", "min_object_distance_sla");
load_bool("enable_rotation_fff", m_arrange_settings_fff.enable_rotation);
load_bool("enable_rotation_fff_seq_print", m_arrange_settings_fff_seq_print.enable_rotation);
load_bool("enable_rotation_sla", m_arrange_settings_sla.enable_rotation);
std::string en_rot_fff_str =
wxGetApp().app_config->get("arrange", "enable_rotation_fff");
std::string en_rot_fff_seqp_str =
wxGetApp().app_config->get("arrange", "enable_rotation_seq_print");
std::string en_rot_sla_str =
wxGetApp().app_config->get("arrange", "enable_rotation_sla");
std::string en_allow_multiple_materials_str =
wxGetApp().app_config->get("arrange", "allow_multi_materials_on_same_plate");
std::string en_avoid_region_str =
wxGetApp().app_config->get("arrange", "avoid_extrusion_cali_region");
if (!dist_fff_str.empty())
m_arrange_settings_fff.distance = std::stof(dist_fff_str);
if (!dist_fff_seq_print_str.empty())
m_arrange_settings_fff_seq_print.distance = std::stof(dist_fff_seq_print_str);
if (!dist_sla_str.empty())
m_arrange_settings_sla.distance = std::stof(dist_sla_str);
if (!en_rot_fff_str.empty())
m_arrange_settings_fff.enable_rotation = (en_rot_fff_str == "1" || en_rot_fff_str == "true");
if (!en_allow_multiple_materials_str.empty())
m_arrange_settings_fff.allow_multi_materials_on_same_plate = (en_allow_multiple_materials_str == "1" || en_allow_multiple_materials_str == "true");
if (!en_rot_fff_seqp_str.empty())
m_arrange_settings_fff_seq_print.enable_rotation = (en_rot_fff_seqp_str == "1" || en_rot_fff_seqp_str == "true");
if(!en_avoid_region_str.empty())
m_arrange_settings_fff.avoid_extrusion_cali_region = (en_avoid_region_str == "1" || en_avoid_region_str == "true");
if (!en_rot_sla_str.empty())
m_arrange_settings_sla.enable_rotation = (en_rot_sla_str == "1" || en_rot_sla_str == "true");
// These two keys carry no postfix, so the one stored value covers both FFF modes.
load_bool("allow_multi_materials_on_same_plate", m_arrange_settings_fff.allow_multi_materials_on_same_plate);
load_bool("allow_multi_materials_on_same_plate", m_arrange_settings_fff_seq_print.allow_multi_materials_on_same_plate);
load_bool("avoid_extrusion_cali_region", m_arrange_settings_fff.avoid_extrusion_cali_region);
load_bool("avoid_extrusion_cali_region", m_arrange_settings_fff_seq_print.avoid_extrusion_cali_region);
//BBS: add specific arrange settings
m_arrange_settings_fff_seq_print.is_seq_print = true;
@@ -5953,7 +5933,7 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa
}
//BBS: GUI refactor: adjust main toolbar position
bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, float top)
void GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, float top)
{
ImGuiWrapper *imgui = wxGetApp().imgui();
@@ -5978,7 +5958,6 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
imgui->begin(_L("Arrange options"), ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar);
ArrangeSettings settings = get_arrange_settings();
ArrangeSettings &settings_out = get_arrange_settings();
const float slider_icon_width = imgui->get_slider_icon_size().x;
const float cursor_slider_left = imgui->calc_text_size(_L("Spacing")).x + imgui->scaled(1.5f);
@@ -5987,13 +5966,9 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
auto &appcfg = wxGetApp().app_config;
PrinterTechnology ptech = current_printer_technology();
bool settings_changed = false;
float dist_min = 0.f; // 0 means auto
std::string dist_key = "min_object_distance", rot_key = "enable_rotation";
std::string bed_shrink_x_key = "bed_shrink_x", bed_shrink_y_key = "bed_shrink_y";
std::string multi_material_key = "allow_multi_materials_on_same_plate";
std::string avoid_extrusion_key = "avoid_extrusion_cali_region";
std::string align_to_y_axis_key = "align_to_y_axis";
std::string postfix;
//BBS:
bool seq_print = false;
@@ -6001,59 +5976,41 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
if (ptech == ptSLA) {
postfix = "_sla";
} else if (ptech == ptFFF) {
seq_print = &settings == &m_arrange_settings_fff_seq_print;
if (seq_print) {
postfix = "_fff_seq_print";
} else {
postfix = "_fff";
}
seq_print = wxGetApp().global_print_sequence() == PrintSequence::ByObject;
postfix = seq_print ? "_fff_seq_print" : "_fff";
}
dist_key += postfix;
rot_key += postfix;
bed_shrink_x_key += postfix;
bed_shrink_y_key += postfix;
ImGui::AlignTextToFramePadding();
imgui->text(_L("Spacing"));
ImGui::SameLine(1.2 * cursor_slider_left);
ImGui::PushItemWidth(window_width - slider_icon_width);
bool b_Spacing = imgui->bbl_slider_float_style("##Spacing", &settings.distance, dist_min, 100.0f, "%5.2f") || dist_min > settings.distance;
bool b_Spacing = imgui->bbl_slider_float_style("##Spacing", &settings_out.distance, 0.f, 100.0f, "%5.2f", 1.0f, /*clamp=*/false);
ImGui::SameLine(window_width - slider_icon_width + 1.3 * cursor_slider_left);
ImGui::PushItemWidth(1.5 * slider_icon_width);
bool b_spacing_input = ImGui::BBLDragFloat("##spacing_input", &settings.distance, 0.05f, 0.0f, 0.0f, "%.2f");
if (b_Spacing || b_spacing_input)
{
settings.distance = std::max(dist_min, settings.distance);
settings_out.distance = settings.distance;
bool b_spacing_input = ImGui::BBLDragFloat("##spacing_input", &settings_out.distance, 0.05f, 0.0f, 0.0f, "%.2f");
if (b_Spacing || b_spacing_input) {
settings_out.distance = std::max(0.f, settings_out.distance);
appcfg->set("arrange", dist_key.c_str(), float_to_string_decimal_point(settings_out.distance));
settings_changed = true;
}
imgui->text(_L("0 means auto spacing."));
ImGui::Separator();
if (imgui->bbl_checkbox(_L("Auto rotate for arrangement"), settings.enable_rotation)) {
settings_out.enable_rotation = settings.enable_rotation;
if (imgui->bbl_checkbox(_L("Auto rotate for arrangement"), settings_out.enable_rotation))
appcfg->set("arrange", rot_key.c_str(), settings_out.enable_rotation);
settings_changed = true;
}
if (imgui->bbl_checkbox(_L("Allow multiple materials on same plate"), settings.allow_multi_materials_on_same_plate)) {
settings_out.allow_multi_materials_on_same_plate = settings.allow_multi_materials_on_same_plate;
appcfg->set("arrange", multi_material_key.c_str(), settings_out.allow_multi_materials_on_same_plate );
settings_changed = true;
}
if (imgui->bbl_checkbox(_L("Allow multiple materials on same plate"), settings_out.allow_multi_materials_on_same_plate))
appcfg->set("arrange", multi_material_key.c_str(), settings_out.allow_multi_materials_on_same_plate);
// only show this option if the printer has micro Lidar and can do first layer scan
DynamicPrintConfig &current_config = wxGetApp().preset_bundle->printers.get_edited_preset().config;
const bool has_lidar = wxGetApp().preset_bundle->is_bbl_vendor();
auto op = current_config.option("scan_first_layer");
if (has_lidar && op && op->getBool()) {
if (imgui->bbl_checkbox(_L("Avoid extrusion calibration region"), settings.avoid_extrusion_cali_region)) {
settings_out.avoid_extrusion_cali_region = settings.avoid_extrusion_cali_region;
appcfg->set("arrange", avoid_extrusion_key.c_str(), settings_out.avoid_extrusion_cali_region ? "1" : "0");
settings_changed = true;
}
if (imgui->bbl_checkbox(_L("Avoid extrusion calibration region"), settings_out.avoid_extrusion_cali_region))
appcfg->set("arrange", avoid_extrusion_key.c_str(), settings_out.avoid_extrusion_cali_region);
} else {
settings_out.avoid_extrusion_cali_region = false;
}
@@ -6065,11 +6022,7 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
settings_out.align_to_y_axis = false;
}
if (imgui->bbl_checkbox(_L("Align to Y axis"), settings.align_to_y_axis)) {
settings_out.align_to_y_axis = settings.align_to_y_axis;
appcfg->set("arrange", align_to_y_axis_key, settings_out.align_to_y_axis ? "1" : "0");
settings_changed = true;
}
imgui->bbl_checkbox(_L("Align to Y axis"), settings_out.align_to_y_axis);
if (settings_out.enable_rotation == true) { imgui->disabled_end(); }
}
@@ -6085,7 +6038,6 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
if (imgui->button(_L("Reset"))) {
settings_out = ArrangeSettings{};
settings_out.distance = std::max(dist_min, settings_out.distance);
//BBS: add specific arrange settings
if (seq_print) settings_out.is_seq_print = true;
@@ -6095,18 +6047,16 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
else
settings_out.align_to_y_axis = false;
appcfg->set("arrange", dist_key, float_to_string_decimal_point(settings_out.distance));
appcfg->set("arrange", rot_key, settings_out.enable_rotation ? "1" : "0");
appcfg->set("arrange", align_to_y_axis_key, settings_out.align_to_y_axis ? "1" : "0");
settings_changed = true;
appcfg->erase("arrange", dist_key);
appcfg->erase("arrange", rot_key);
appcfg->erase("arrange", multi_material_key);
appcfg->erase("arrange", avoid_extrusion_key);
}
ImGui::PopStyleVar(1);
imgui->end();
//BBS
ImGuiWrapper::pop_toolbar_style();
return settings_changed;
}
static const float cameraProjection[16] = {1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f};
+2 -17
View File
@@ -655,11 +655,7 @@ public:
}
void load_arrange_settings();
ArrangeSettings& get_arrange_settings();// { return get_arrange_settings(this); }
ArrangeSettings& get_arrange_settings(PrintSequence print_seq) {
return (print_seq == PrintSequence::ByObject) ? m_arrange_settings_fff_seq_print
: m_arrange_settings_fff;
}
ArrangeSettings& get_arrange_settings();
class SequentialPrintClearance
{
@@ -1162,17 +1158,6 @@ public:
void highlight_toolbar_item(const std::string& item_name);
void highlight_gizmo(const std::string& gizmo_name);
ArrangeSettings get_arrange_settings() const {
const ArrangeSettings &settings = get_arrange_settings();
ArrangeSettings ret = settings;
if (&settings == &m_arrange_settings_fff_seq_print) {
ret.distance = std::max(ret.distance,
float(min_object_distance(*m_config)));
}
return ret;
}
// Timestamp for FPS calculation and notification fade-outs.
static int64_t timestamp_now() {
#ifdef _WIN32
@@ -1307,7 +1292,7 @@ private:
void _render_selection_sidebar_hints() { m_selection.render_sidebar_hints(m_sidebar_field, m_gizmos.get_uniform_scaling()); }
//BBS: GUI refactor: adjust main toolbar position
bool _render_orient_menu(float left, float right, float bottom, float top);
bool _render_arrange_menu(float left, float right, float bottom, float top);
void _render_arrange_menu(float left, float right, float bottom, float top);
void _render_3d_navigator();
void _update_volumes_hover_state();
+2
View File
@@ -9,6 +9,7 @@
#include "3DScene.hpp"
#include "OpenGLManager.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "GLModel.hpp"
#include <glad/gl.h>
@@ -31,6 +32,7 @@
#include "GUI_App.hpp"
#include <boost/log/trivial.hpp>
#include <wx/dcgraph.h>
#include <wx/dcmemory.h>
namespace Slic3r {
namespace GUI {
+9 -1
View File
@@ -3,6 +3,14 @@
#include "libslic3r/Technologies.hpp"
#include "libslic3r/Platform.hpp"
#include "GUI_App.hpp"
#include "BindDialog.hpp"
#include "DeviceManager.hpp"
#include "HMS.hpp"
#include "PresetBundleDialog.hpp"
#include "WebUserLoginDialog.hpp"
#include "WebViewDialog.hpp"
#include "slic3r/Utils/BBLCloudServiceAgent.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "GUI_Init.hpp"
#include "GUI_ObjectList.hpp"
#include "slic3r/GUI/UserManager.hpp"
@@ -9276,7 +9284,7 @@ int GUI_App::filaments_cnt() const
PrintSequence GUI_App::global_print_sequence() const
{
PrintSequence global_print_seq = PrintSequence::ByDefault;
auto curr_preset_config = preset_bundle->prints.get_edited_preset().config;
const auto &curr_preset_config = preset_bundle->prints.get_edited_preset().config;
if (curr_preset_config.has("print_sequence"))
global_print_seq = curr_preset_config.option<ConfigOptionEnum<PrintSequence>>("print_sequence")->value;
return global_print_seq;
+10 -9
View File
@@ -1,23 +1,17 @@
#ifndef slic3r_GUI_App_hpp_
#define slic3r_GUI_App_hpp_
#include <functional>
#include <memory>
#include <string>
#include "ActionRegistry.hpp"
#include "ImGuiWrapper.hpp"
#include "ConfigWizard.hpp"
#include "OpenGLManager.hpp"
#include "PresetBundleDialog.hpp"
#include "libslic3r/Preset.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
#include "slic3r/GUI/UserNotification.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "slic3r/Utils/BBLCloudServiceAgent.hpp"
#include "slic3r/GUI/WebViewDialog.hpp"
#include "slic3r/GUI/WebUserLoginDialog.hpp"
#include "slic3r/GUI/BindDialog.hpp"
#include "slic3r/GUI/HMS.hpp"
#include "slic3r/Utils/CloudProvider.hpp"
#include "slic3r/GUI/Jobs/UpgradeNetworkJob.hpp"
#include "slic3r/GUI/HttpServer.hpp"
#include "../Utils/PrintHost.hpp"
@@ -64,9 +58,14 @@ class ModelObject;
class Model;
class UserManager;
class DeviceManager;
class MachineObject;
class NetworkAgent;
class IPrinterAgent;
class TaskManager;
// Same typedef as in bambu_networking.hpp, so this header need not include it.
typedef std::function<bool()> WasCancelledFn;
namespace GUI{
class RemovableDriveManager;
@@ -85,6 +84,8 @@ class ParamsDialog;
class HMSQuery;
class ModelMallDialog;
class PingCodeBindDialog;
class PresetBundleDialog;
class ZUserLogin;
class NetworkErrorDialog;
class PluginsDialog;
class SpeedDialWebDialog;
@@ -837,7 +838,7 @@ wxDECLARE_EVENT(EVT_UPDATE_BUNDLE_COMPLETE, wxCommandEvent);
bool is_support_filament(int extruder_id, bool strict_check = true);
bool is_soluble_filament(int extruder_id);
// check if the filament for model is in the list
bool has_filaments(const std::vector<string>& model_filaments);
bool has_filaments(const std::vector<std::string>& model_filaments);
} // namespace GUI
} // Slic3r
+2 -20
View File
@@ -1410,7 +1410,7 @@ void MenuFactory::create_default_menu()
{
wxMenu* sub_menu_primitives = append_submenu_add_generic(&m_default_menu, ModelVolumeType::INVALID);
wxMenu* sub_menu_handy = append_submenu_add_handy_model(&m_default_menu, ModelVolumeType::INVALID);
#ifdef __WINDOWS__
append_submenu(&m_default_menu, sub_menu_primitives, wxID_ANY, _L("Add Primitive"), "", "menu_add_part",
[]() {return true; }, m_parent);
append_submenu(&m_default_menu, sub_menu_handy, wxID_ANY, _L("Add Handy models"), "", "menu_add_part",
@@ -1418,15 +1418,6 @@ void MenuFactory::create_default_menu()
append_menu_item(&m_default_menu, wxID_ANY, _L("Add Models"), "", // ORCA: Add Models
[](wxCommandEvent&) { plater()->add_file(); }, "menu_add_part", &m_default_menu,
[]() {return wxGetApp().plater()->can_add_model(); }, m_parent);
#else
append_submenu(&m_default_menu, sub_menu_primitives, wxID_ANY, _L("Add Primitive"), "", "",
[]() {return true; }, m_parent);
append_submenu(&m_default_menu, sub_menu_handy, wxID_ANY, _L("Add Handy models"), "", "",
[]() {return true; }, m_parent);
append_menu_item(&m_default_menu, wxID_ANY, _L("Add Models"), "", // ORCA: Add Models
[](wxCommandEvent&) { plater()->add_file(); }, "", &m_default_menu,
[]() {return wxGetApp().plater()->can_add_model(); }, m_parent);
#endif
m_default_menu.AppendSeparator();
@@ -1807,7 +1798,6 @@ void MenuFactory::create_plate_menu()
wxMenu* sub_menu_primitives = append_submenu_add_generic(menu, ModelVolumeType::INVALID);
wxMenu* sub_menu_handy = append_submenu_add_handy_model(menu, ModelVolumeType::INVALID);
#ifdef __WINDOWS__
append_submenu(menu, sub_menu_primitives, wxID_ANY, _L("Add Primitive"), "", "menu_add_part",
[]() {return true; }, m_parent);
append_submenu(menu, sub_menu_handy, wxID_ANY, _L("Add Handy models"), "", "menu_add_part",
@@ -1815,15 +1805,7 @@ void MenuFactory::create_plate_menu()
append_menu_item(menu, wxID_ANY, _L("Add Models"), "", // ORCA: Add Models
[](wxCommandEvent&) { plater()->add_file(); }, "menu_add_part", menu,
[]() {return wxGetApp().plater()->can_add_model(); }, m_parent);
#else
append_submenu(menu, sub_menu_primitives, wxID_ANY, _L("Add Primitive"), "", "",
[]() {return true; }, m_parent);
append_submenu(menu, sub_menu_handy, wxID_ANY, _L("Add Handy models"), "", "",
[]() {return true; }, m_parent);
append_menu_item(menu, wxID_ANY, _L("Add Models"), "", // ORCA: Add Models
[](wxCommandEvent&) { plater()->add_file(); }, "", menu,
[]() {return wxGetApp().plater()->can_add_model(); }, m_parent);
#endif
append_menu_item_replace_all_with_stl(menu);
+2 -2
View File
@@ -2578,7 +2578,7 @@ void ObjectGridTable::OnSelectCell(int row, int col)
return;
m_panel->m_side_window->Freeze();
if (row == 0 || col == col_filaments) {
m_panel->m_object_settings->UpdateAndShow(row, false, false, false, nullptr, nullptr, std::string());
m_panel->m_object_settings->UpdateAndShowRow(row, false, false, false, nullptr, nullptr, std::string());
}
else {
ObjectGridRow* grid_row = m_grid_data[row - 1];
@@ -2588,7 +2588,7 @@ void ObjectGridTable::OnSelectCell(int row, int col)
//m_panel->m_object_settings->get_og()->set_name(GUI::from_u8(grid_row->name.value));
//m_panel->m_page_text->SetLabel(GUI::from_u8(grid_row->name.value));
m_panel->m_object_settings->UpdateAndShow(row, true, is_object, false, object, grid_row->config, grid_col->category);
m_panel->m_object_settings->UpdateAndShowRow(row, true, is_object, false, object, grid_row->config, grid_col->category);
std::vector<ObjectVolumeID> object_volume_ids;
ObjectVolumeID object_volume_id;
+1 -1
View File
@@ -463,7 +463,7 @@ void ObjectTableSettings::update_config_values(bool is_object, ModelObject* obje
m_table->reload_cell_data(m_current_row, category);
}
void ObjectTableSettings::UpdateAndShow(int row, const bool show, bool is_object, bool is_multiple_selection, ModelObject* object, ModelConfig* config, const std::string& category)
void ObjectTableSettings::UpdateAndShowRow(int row, const bool show, bool is_object, bool is_multiple_selection, ModelObject* object, ModelConfig* config, const std::string& category)
{
m_current_row = row;
m_current_category = category;
+1 -1
View File
@@ -71,7 +71,7 @@ public:
//return visible count
int update_extra_column_visible_status(ConfigOptionsGroup* option_group, const std::vector<SimpleSettingData>& option_keys, ModelConfig* config);
void update_config_values(bool is_object, ModelObject* object, ModelConfig* config, const std::string& category, const std::string& changed_opt_key = "");
void UpdateAndShow(int row, const bool show, bool is_object, bool is_multiple_selection, ModelObject* object, ModelConfig* config, const std::string& category);
void UpdateAndShowRow(int row, const bool show, bool is_object, bool is_multiple_selection, ModelObject* object, ModelConfig* config, const std::string& category);
void ValueChanged(int row, bool is_object, ModelObject* object, ModelConfig* config, const std::string& category, const std::string& key);
void resetAllValues(int row, bool is_object, ModelObject* object, ModelConfig* config, const std::string& category);
void msw_rescale();
@@ -1,5 +1,7 @@
// Include GLGizmoBase.hpp before I18N.hpp as it includes some libigl code, which overrides our localization "L" macro.
#include "GLGizmoAdvancedCut.hpp"
#include "slic3r/GUI/Widgets/ProgressDialog.hpp"
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include <glad/gl.h>
@@ -1,6 +1,7 @@
#include "GLGizmoBrimEars.hpp"
#include <glad/gl.h>
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/GUI/Camera.hpp"
#include "slic3r/GUI/Gizmos/GLGizmosCommon.hpp"
#include "slic3r/GUI/GUI_App.hpp"
@@ -4,6 +4,7 @@
#include "libslic3r/Print.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/GUI_ObjectList.hpp"
#include "slic3r/GUI/ImGuiWrapper.hpp"
+1
View File
@@ -1,4 +1,5 @@
#include "GLGizmoMeasure.hpp"
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/Plater.hpp"
+2
View File
@@ -32,6 +32,8 @@
*/
using namespace std::string_view_literals;
namespace Slic3r::GUI::GLGizmoUtils {
void render_tooltip_button(
+4
View File
@@ -4,6 +4,10 @@
#include "slic3r/Utils/Http.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "slic3r/Utils/BBLNetworkPlugin.hpp"
#include "libslic3r/Thread.hpp"
#include <nlohmann/json.hpp>
using json = nlohmann::json;
namespace Slic3r {
namespace GUI {
+1
View File
@@ -1,6 +1,7 @@
#include "IMSlider.hpp"
#include "libslic3r/GCode.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "NotificationManager.hpp"
#include "Widgets/StateColor.hpp"
#ifndef IMGUI_DEFINE_MATH_OPERATORS
+2
View File
@@ -3,6 +3,8 @@
#include "GUI_App.hpp"
#include "GUI_Utils.hpp"
#include <wx/stattext.h>
#include <wx/timer.h>
class wxStaticBitmap;
namespace Slic3r { namespace GUI {
+1 -1
View File
@@ -521,7 +521,7 @@ void ImageGrid::render(wxDC& dc)
if (!m_status_msg.IsEmpty()) {
auto si = m_status_icon.GetBmpSize();
auto st = dc.GetMultiLineTextExtent(m_status_msg);
auto rect = wxRect{0, 0, max(st.x, si.x), si.y + 26 + st.y}.CenterIn(wxRect({0, 0}, size));
auto rect = wxRect{0, 0, std::max(st.x, si.x), si.y + 26 + st.y}.CenterIn(wxRect({0, 0}, size));
dc.DrawBitmap(m_status_icon.bmp(), rect.x + (rect.width - si.x) / 2, rect.y);
dc.SetTextForeground(wxColor(0x909090));
dc.DrawText(m_status_msg, rect.x + (rect.width - st.x) / 2, rect.GetBottom() - st.y);
+4 -1
View File
@@ -114,7 +114,10 @@ namespace instance_check_internal
if (my_instance_hash == other_instance_hash) {
BOOST_LOG_TRIVIAL(debug) << "win enum - found correct instance";
orca_slicer_hwnd = hwnd;
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
// Do not alter the window state when opening a file in the existing instance.
// A minimized window still needs restoring before it can receive focus.
if (IsIconic(hwnd))
ShowWindow(hwnd, SW_RESTORE);
SetForegroundWindow(hwnd);
return false;
}
-1
View File
@@ -87,7 +87,6 @@ private:
std::condition_variable m_thread_stop_condition;
mutable std::mutex m_thread_stop_mutex;
bool m_stop{ false };
bool m_start{ true };
// background thread method
void listen();
+4
View File
@@ -3,6 +3,10 @@
#include "slic3r/GUI/Plater.hpp"
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
#include "slic3r/GUI/HMS.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "slic3r/GUI/DeviceCore/DevManager.h"
+2
View File
@@ -1,4 +1,6 @@
#include "SendJob.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "libslic3r/MTUtils.hpp"
#include "libslic3r/Model.hpp"
#include "libslic3r/PresetBundle.hpp"
@@ -2,6 +2,7 @@
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/Utils/Http.hpp"
namespace Slic3r {
+1
View File
@@ -66,6 +66,7 @@ class Tab;
class PrintHostQueueDialog;
class Plater;
class MainFrame;
class WebViewPanel;
class ParamsDialog;
#ifdef __WXGTK__
class ResizeEdgePanel;
+3
View File
@@ -2,6 +2,9 @@
#include "ImageGrid.h"
#include "I18N.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "DeviceManager.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "Plater.hpp"
#include "Widgets/Button.hpp"
#include "Widgets/SwitchButton.hpp"
+6
View File
@@ -3,6 +3,11 @@
#include "Widgets/CheckBox.hpp"
#include "Widgets/Label.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "DeviceManager.hpp"
#include "DeviceCore/DevConfigUtil.h"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "libslic3r/Thread.hpp"
#include "libslic3r/AppConfig.hpp"
#include "I18N.hpp"
#include "MsgDialog.hpp"
@@ -13,6 +18,7 @@
#include <boost/lexical_cast.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/cstdio.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/nowide/utf8_codecvt.hpp>
#undef pid_t
#include <boost/process.hpp>
+1
View File
@@ -1,6 +1,7 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/PresetBundle.hpp"
#include "Mouse3DController.hpp"
#include "GUI.hpp"
#include "Camera.hpp"
#include "GUI_App.hpp"
+3 -5
View File
@@ -804,11 +804,9 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
#endif
else if (opt_key == "printer_agent")
{
// why: printer_agent is a coString kept out of m_opt_map. The generic non-opt_map revert
// below restores the edited config from get_value(), but a deregistered/"(missing)" saved
// id has no selectable row, so the field yields no value and the edited config keeps the
// user's interim pick -> stuck dirty. Restore the SAVED id straight into the edited config
// (displayable or not; config is the saved or system baseline), then repaint and notify.
// A deregistered/"(missing)" saved id has no selectable row, so the field yields no
// value. Restore the saved id directly instead of letting the generic revert path read
// the field value back into the edited config.
const std::string saved_id = config.opt_string("printer_agent");
set_value(opt_key, saved_id);
this->change_opt_value(opt_key, saved_id);
+1
View File
@@ -17,6 +17,7 @@
#include <boost/log/trivial.hpp>
#include <boost/nowide/convert.hpp>
#include <boost/nowide/cstdio.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include "libslic3r/libslic3r.h"
+1
View File
@@ -1,5 +1,6 @@
#include "GUI_Utils.hpp"
#include "GUI_App.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
+1
View File
@@ -9,6 +9,7 @@
#include <boost/regex.hpp>
#include <wx/sizer.h>
#include <wx/tooltip.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
+1
View File
@@ -42,6 +42,7 @@ class Button;
namespace Slic3r {
class BuildVolume;
class MachineObject;
enum class BuildVolume_Type : char;
class Model;
class ModelObject;
+1
View File
@@ -1,6 +1,7 @@
#include "PluginsConfigDialog.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "I18N.hpp"
#include "format.hpp"
+1
View File
@@ -2,6 +2,7 @@
#include "GUI.hpp"
#include "GUI_App.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "I18N.hpp"
#include "OrcaCloudServiceAgent.hpp"
#include "slic3r/plugin/PluginConfig.hpp"
+1
View File
@@ -2,6 +2,7 @@
#include "OptionsGroup.hpp"
#include "GUI_App.hpp"
#include "MainFrame.hpp"
#include "WebViewDialog.hpp"
#include "Plater.hpp"
#include "GLCanvas3D.hpp" // ORCA: for live preview refresh when toggling "Dim lower layers"
#include "MsgDialog.hpp"
+1
View File
@@ -1,5 +1,6 @@
#include "PrivacyUpdateDialog.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "BitmapCache.hpp"
#include <wx/dcgraph.h>
#include <slic3r/GUI/I18N.hpp>
+1
View File
@@ -7,6 +7,7 @@
#include "GUI.hpp"
#include "GUI_App.hpp"
#include "I18N.hpp"
#include "Widgets/StateColor.hpp"
wxDEFINE_EVENT(EVT_WIPE_TOWER_CHART_CHANGED, wxCommandEvent);
+1
View File
@@ -35,6 +35,7 @@
#include "Widgets/CheckBox.hpp"
#include "Widgets/ComboBox.hpp"
#include "Widgets/ScrolledWindow.hpp"
#include "Widgets/HyperLink.hpp"
#include <wx/hashmap.h>
#include <wx/webview.h>
+2
View File
@@ -183,7 +183,9 @@ private:
HyperLink* m_hyperlink{nullptr}; // ORCA
wxBoxSizer * m_sizer_my_devices{nullptr};
wxBoxSizer * m_sizer_other_devices{nullptr};
#if defined(__WINDOWS__)
wxBoxSizer * m_sizer_search_bar{nullptr};
#endif
wxSearchCtrl* m_search_bar{nullptr};
wxScrolledWindow * m_scrolledWindow{nullptr};
wxTimer * m_refresh_timer{nullptr};
+1
View File
@@ -3,6 +3,7 @@
#include "I18N.hpp"
#include "GUI_App.hpp"
#include "slic3r/Utils/bambu_networking.hpp"
#include "MainFrame.hpp"
#include "Widgets/RadioBox.hpp"
#include <wx/listimpl.cpp>
+3
View File
@@ -15,6 +15,9 @@
#include "SelectMachine.hpp"
namespace Slic3r {
struct PrintParams;
namespace GUI {
#define SEND_LEFT_PADDING_LEFT 15
#define SEND_LEFT_PRINTABLE 40
+5 -39
View File
@@ -5029,28 +5029,12 @@ void TabPrinter::build_fff()
auto registered_printer_agents = NetworkAgentFactory::get_registered_printer_agents();
if (!registered_printer_agents.empty())
{
ConfigOptionDef def;
def.type = coString;
def.gui_type = ConfigOptionDef::GUIType::printer_agent_select;
def.width = 3 * Field::def_width_wider() / 2;
def.label = L("Printer Agent");
def.tooltip = L("Select the network agent implementation for printer communication. "
option = optgroup->get_option("printer_agent");
option.opt.gui_type = ConfigOptionDef::GUIType::printer_agent_select;
option.opt.width = 3 * Field::def_width_wider() / 2;
option.opt.tooltip = L("Select the network agent implementation for printer communication. "
"Available agents are registered at startup.");
def.mode = comAdvanced;
// Create the field without get_option() so it is not registered in m_opt_map.
// ConfigOptionsGroup handles printer_agent before the generic mapped write path.
Line agent_line = optgroup->create_single_option_line(Option(def, "printer_agent"));
optgroup->append_line(agent_line);
if (Field* agent_field = get_field("printer_agent"))
{
if (auto* choice = dynamic_cast<PrinterAgentChoice*>(agent_field); choice && choice->getWindow())
choice->set_value(m_config->opt_string("printer_agent"), false);
}
// Register by hand so the UnsavedChanges dialog can render a row for it.
wxGetApp().sidebar().settings_index().add_key("printer_agent", m_type, optgroup->title,
optgroup->config_category(), optgroup->icon);
optgroup->append_single_option_line(option);
}
}
@@ -5912,15 +5896,6 @@ void TabPrinter::reload_config()
if (m_active_page && m_active_page->title() == "Multimaterial")
m_active_page->set_value("extruders_count", int(m_extruders_count));
// m_opt_map-driven reload does not cover printer_agent, so sync this custom field explicitly.
if (Field* agent_field = get_field("printer_agent"))
{
if (auto* choice = dynamic_cast<PrinterAgentChoice*>(agent_field); choice && choice->getWindow())
{
const std::string selected_agent = m_config->opt_string("printer_agent");
choice->set_value(selected_agent, false);
}
}
}
void TabPrinter::activate_selected_page(std::function<void()> throw_if_canceled)
@@ -5932,15 +5907,6 @@ void TabPrinter::activate_selected_page(std::function<void()> throw_if_canceled)
if (m_active_page && m_active_page->title() == "Multimaterial")
m_active_page->set_value("extruders_count", int(m_extruders_count));
// m_opt_map-driven reload does not cover printer_agent, so sync this custom field explicitly.
if (Field* agent_field = get_field("printer_agent"))
{
if (auto* choice = dynamic_cast<PrinterAgentChoice*>(agent_field); choice && choice->getWindow())
{
const std::string selected_agent = m_config->opt_string("printer_agent");
choice->set_value(selected_agent, false);
}
}
}
void TabPrinter::clear_pages()
+2
View File
@@ -134,7 +134,9 @@ public:
}
private:
#if defined(__WXMSW__) || defined(__APPLE__)
int m_suspended_count = 0;
#endif
};
static bool needs_filament_swatch_border(const wxColour& colour)
+2
View File
@@ -6,6 +6,8 @@
#include "GUI_App.hpp"
#include "MainFrame.hpp"
#include <wx/filename.h>
#include <wx/stdpaths.h>
#include <wx/display.h>
#include <wx/wfstream.h>
#include "wx/clipbrd.h"
+2
View File
@@ -1,9 +1,11 @@
#include "libslic3r/libslic3r.h"
#include "UserManager.hpp"
#include "DeviceManager.hpp"
#include "BindDialog.hpp"
#include "NetworkAgent.hpp"
#include "GUI.hpp"
#include "GUI_App.hpp"
#include "I18N.hpp"
#include "MsgDialog.hpp"
#include "DeviceCore/DevManager.h"
+2
View File
@@ -43,6 +43,8 @@ namespace Slic3r { namespace GUI {
class GuideFrame : public DPIDialog
{
public:
using json = nlohmann::json;
GuideFrame(GUI_App *pGUI, long style = wxCAPTION | wxCLOSE_BOX | wxSYSTEM_MENU);
virtual ~GuideFrame();
+1
View File
@@ -1,6 +1,7 @@
#include "CheckList.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/I18N.hpp"
CheckList::CheckList(
wxWindow* parent,
@@ -20,6 +20,8 @@
#include <set>
#include <wx/choice.h>
#include <wx/filename.h>
#include <wx/filesys.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
+7 -1
View File
@@ -1,9 +1,13 @@
#include "WebView.hpp"
#include "slic3r/GUI/Widgets/StateColor.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/Utils/MacDarkMode.hpp"
#include <boost/log/trivial.hpp>
#include <chrono>
#include <thread>
#include <wx/webviewarchivehandler.h>
#include <wx/webviewfshandler.h>
#if wxUSE_WEBVIEW_EDGE
@@ -12,6 +16,8 @@
#include <wx/osx/webview_webkit.h>
#endif
#include <wx/uri.h>
#include <wx/filename.h>
#include <wx/stdpaths.h>
#if defined(__WIN32__) || defined(__WXMAC__)
#include "wx/private/jsscriptwrapper.h"
#endif
@@ -73,7 +79,7 @@ DWORD DownloadAndInstallWV2RT() {
})
.perform_sync();
// Sleep for 1 second to wait for the buffer writen into disk
std::this_thread::sleep_for(1000ms);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
if (downloaded) {
// Either Package the WebView2 Bootstrapper with your app or download it using fwlink
// Then invoke install at Runtime.
+1
View File
@@ -6,6 +6,7 @@
#include "GUI.hpp"
#include "I18N.hpp"
#include "GUI_App.hpp"
#include "WebViewDialog.hpp"
#include "MsgDialog.hpp"
#include "format.hpp"
#include "libslic3r/Color.hpp"
+3
View File
@@ -8,6 +8,7 @@
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <nlohmann/json.hpp>
#include <wx/progdlg.h>
#include <wx/string.h>
@@ -30,6 +31,8 @@
#include <wx/busyinfo.h>
using json = nlohmann::json;
namespace fs = boost::filesystem;
namespace pt = boost::property_tree;
@@ -8,6 +8,9 @@
#include <sstream>
#include <boost/algorithm/string/replace.hpp>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
namespace Slic3r {
+1
View File
@@ -3,6 +3,7 @@
#include "../GUI/GUI_App.hpp"
#include "../GUI/DeviceCore/DevStorage.h"
#include "../GUI/DeviceManager.hpp"
#include "NetworkAgent.hpp"
#include "../GUI/Jobs/ProgressIndicator.hpp"
#include "../GUI/PartPlate.hpp"
#include "libslic3r/CutUtils.hpp"
+11
View File
@@ -0,0 +1,11 @@
#pragma once
#include <string>
namespace Slic3r {
// Identifiers of the cloud services an ICloudServiceAgent can stand for.
static const std::string ORCA_CLOUD_PROVIDER("orca");
static const std::string BBL_CLOUD_PROVIDER("bbl");
} // namespace Slic3r
+2
View File
@@ -12,6 +12,8 @@
#include <map>
#include <set>
using json = nlohmann::json;
namespace Slic3r {
namespace {
+1 -3
View File
@@ -2,6 +2,7 @@
#define __I_CLOUD_SERVICE_AGENT_HPP__
#include "bambu_networking.hpp"
#include "CloudProvider.hpp"
#include "../../libslic3r/ProjectTask.hpp"
#include <string>
#include <string_view>
@@ -37,9 +38,6 @@ namespace Slic3r {
* implementation.
*/
static const std::string ORCA_CLOUD_PROVIDER("orca");
static const std::string BBL_CLOUD_PROVIDER("bbl");
struct CloudEvent {
std::string provider; // ORCA_CLOUD_PROVIDER or BBL_CLOUD_PROVIDER
};
@@ -3,6 +3,7 @@
#include "libslic3r/Preset.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
#include "slic3r/GUI/DeviceCore/DevFilaSystem.h"
#include "slic3r/GUI/DeviceCore/DevManager.h"
#include "../GUI/DeviceCore/DevStorage.h"
@@ -16,6 +16,7 @@
#include <iostream>
#include <libslic3r/Platform.hpp>
#include <memory>
#include <nlohmann/json.hpp>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
+1
View File
@@ -42,6 +42,7 @@
#include "slic3r/GUI/format.hpp"
#include "slic3r/GUI/NotificationManager.hpp"
#include "slic3r/Utils/Http.hpp"
#include "slic3r/Utils/bambu_networking.hpp"
#include "slic3r/Config/Version.hpp"
#include "slic3r/Config/Snapshot.hpp"
#include "slic3r/GUI/MarkdownTip.hpp"
+1
View File
@@ -21,6 +21,7 @@
#include <boost/process/args.hpp>
#endif
#include <wx/filename.h>
#include <wx/stdpaths.h>
namespace Slic3r {
+2
View File
@@ -9,6 +9,8 @@
#include <cctype>
#include <sstream>
using json = nlohmann::json;
namespace Slic3r {
namespace {
+2
View File
@@ -331,7 +331,9 @@ void Serial::set_baud_rate(unsigned baud_rate)
speed_t c_ispeed;
speed_t c_ospeed;
};
#ifndef BOTHER
#define BOTHER CBAUDEX
#endif
termios2 ios;
handle_errno(::ioctl(handle, TCGETS2, &ios));
@@ -6,6 +6,8 @@
#include "nlohmann/json.hpp"
#include <boost/log/trivial.hpp>
using json = nlohmann::json;
namespace Slic3r {
namespace {
+1
View File
@@ -3,6 +3,7 @@
#include "PluginManager.hpp"
#include "../Utils/Http.hpp"
#include "../Utils/OrcaCloudServiceAgent.hpp"
#include "../Utils/NetworkAgent.hpp"
#include "../GUI/GUI.hpp"
#include "../GUI/GUI_App.hpp"
#include "../GUI/I18N.hpp"