post changes after merging BS1.7.4

Remove tracking etc..
This commit is contained in:
SoftFever 2023-08-26 18:24:13 +08:00
parent e65b11a831
commit 2a478ab4f9
615 changed files with 46215 additions and 54844 deletions

View file

@ -18,7 +18,12 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/log/trivial.hpp>
#if BOOST_VERSION >= 107800
#include <boost/timer/timer.hpp>
#else
#include <boost/timer.hpp>
#endif
static const float GROUND_Z = -0.04f;
static const std::array<float, 4> DEFAULT_MODEL_COLOR = { 0.3255f, 0.337f, 0.337f, 1.0f };
@ -338,7 +343,6 @@ void Bed3D::render_internal(GLCanvas3D& canvas, bool bottom, float scale_factor,
if (show_axes)
render_axes();
glsafe(::glEnable(GL_DEPTH_TEST));
m_model.set_color(-1, m_is_dark ? DEFAULT_MODEL_COLOR_DARK : DEFAULT_MODEL_COLOR);
@ -604,7 +608,7 @@ void Bed3D::render_system(GLCanvas3D& canvas, bool bottom) const
void Bed3D::update_model_offset() const
{
// move the model so that its origin (0.0, 0.0, 0.0) goes into the bed shape center and a bit down to avoid z-fighting with the texture quad
Vec3d shift = m_build_volume.bounding_volume().center();
Vec3d shift = m_extended_bounding_box.center();
shift(2) = -0.03;
Vec3d* model_offset_ptr = const_cast<Vec3d*>(&m_model_offset);
*model_offset_ptr = shift;
@ -613,8 +617,8 @@ void Bed3D::update_model_offset() const
{
(*model_offset_ptr)(0) -= m_bed_shape[2].x() / 2.0f;
(*model_offset_ptr)(1) -= m_bed_shape[2].y() / 2.0f;
(*model_offset_ptr)(2) = -0.41 + GROUND_Z;
}
(*model_offset_ptr)(2) = -0.41 + GROUND_Z;
// update extended bounding box
const_cast<BoundingBoxf3&>(m_extended_bounding_box) = calc_extended_bounding_box();
@ -631,9 +635,9 @@ GeometryBuffer Bed3D::update_bed_triangles() const
BoundingBoxf3 build_volume;
if (!m_build_volume.valid()) return new_triangles;
(*model_offset_ptr)(0) = m_build_volume.bounding_volume2d().min.x();
(*model_offset_ptr)(1) = m_build_volume.bounding_volume2d().min.y();
auto bed_ext = get_extents(m_bed_shape);
(*model_offset_ptr)(0) = m_build_volume.bounding_volume2d().min.x() - bed_ext.min.x();
(*model_offset_ptr)(1) = m_build_volume.bounding_volume2d().min.y() - bed_ext.min.y();
(*model_offset_ptr)(2) = -0.41 + GROUND_Z;
std::vector<Vec2d> new_bed_shape;

View file

@ -34,10 +34,10 @@ void AMSMaterialsSetting::create()
m_sizer_button->Add(0, 0, 1, wxEXPAND, 0);
m_button_confirm = new Button(this, _L("Confirm"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
m_btn_bg_green = StateColor(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));
m_button_confirm->SetBackgroundColor(m_btn_bg_green);
m_button_confirm->SetBorderColor(wxColour(0, 174, 66));
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(wxColour("#FFFFFE"));
m_button_confirm->SetMinSize(AMS_MATERIALS_SETTING_BUTTON_SIZE);
m_button_confirm->SetCornerRadius(FromDIP(12));
@ -138,7 +138,7 @@ void AMSMaterialsSetting::create_panel_normal(wxWindow* parent)
m_sizer_filament->Add(m_comboBox_filament, 1, wxALIGN_CENTER, 0);
m_readonly_filament = new TextInput(parent, wxEmptyString, "", "", wxDefaultPosition, AMS_MATERIALS_SETTING_COMBOX_WIDTH, wxTE_READONLY | wxRIGHT);
m_readonly_filament->SetBorderColor(StateColor(std::make_pair(0xDBDBDB, (int)StateColor::Focused), std::make_pair(0x00AE42, (int)StateColor::Hovered),
m_readonly_filament->SetBorderColor(StateColor(std::make_pair(0xDBDBDB, (int)StateColor::Focused), std::make_pair(0x009688, (int)StateColor::Hovered),
std::make_pair(0xDBDBDB, (int)StateColor::Normal)));
m_readonly_filament->SetFont(::Label::Body_14);
m_readonly_filament->SetLabelColor(AMS_MATERIALS_SETTING_GREY800);
@ -984,7 +984,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
}
else {
m_button_confirm->SetBackgroundColor(m_btn_bg_green);
m_button_confirm->SetBorderColor(wxColour(0, 174, 66));
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(wxColour("#FFFFFE"));
m_button_confirm->Enable(true);
}

View file

@ -869,7 +869,7 @@ AmsHumidityTipPopup::AmsHumidityTipPopup(wxWindow* parent)
main_sizer->Add(m_staticText_note, 0, wxALL | wxLEFT | wxRIGHT, 22);
m_button_confirm = new Button(this, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Pressed), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_confirm->SetBackgroundColor(btn_bg_green);
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(wxColour(0xFFFFFE));
@ -1189,7 +1189,7 @@ void AmsReplaceMaterialDialog::create()
auto label_title = new Label(this, _L("Auto Refill"));
label_title->SetFont(Label::Head_14);
label_title->SetForegroundColour(0x00AE42);
label_title->SetForegroundColour(0x009688);
label_txt = new Label(this, _L("When the current material run out, the printer will continue to print in the following order."));
label_txt->SetFont(Label::Body_13);
label_txt->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#323A3C")));
@ -1224,7 +1224,7 @@ void AmsReplaceMaterialDialog::create()
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_sizer->Add( 0, 0, 1, wxEXPAND, 0 );
m_main_sizer->Add(0,0,0, wxTOP, FromDIP(12));

View file

@ -403,12 +403,6 @@ void BBLTopbar::OnPublishClicked(wxAuiToolBarEvent& event)
return;
}
// record
json j;
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent)
agent->track_event("enter_model_mall", j.dump());
//no more check
//if (GUI::wxGetApp().plater()->model().objects.empty()) return;

View file

@ -120,7 +120,7 @@ public:
// Get the current print. It is either m_fff_print or m_sla_print.
const PrintBase* current_print() const { return m_print; }
const Print* fff_print() const { return m_fff_print; }
Print * fff_print() { return m_fff_print; }
Print* fff_print() { return m_fff_print; }
const SLAPrint* sla_print() const { return m_sla_print; }
// Take the project path (if provided), extract the name of the project, run it through the macro processor and save it next to the project file.
// If the project_path is empty, just run output_filepath().

View file

@ -59,7 +59,7 @@ wxString get_fail_reason(int code)
SetDoubleBuffered(true);
#endif //__WINDOWS__
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -183,7 +183,7 @@ wxString get_fail_reason(int code)
m_link_Terms_title->SetFont(Label::Head_13);
m_link_Terms_title->SetMaxSize(wxSize(FromDIP(450), -1));
m_link_Terms_title->Wrap(FromDIP(450));
m_link_Terms_title->SetForegroundColour(wxColour(0x00AE42));
m_link_Terms_title->SetForegroundColour(wxColour(0x009688));
m_link_Terms_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
wxString txt = _L("Thank you for purchasing a Bambu Lab device.Before using your Bambu Lab device, please read the termsand conditions.By clicking to agree to use your Bambu Lab device, you agree to abide by the Privacy Policyand Terms of Use(collectively, the \"Terms\"). If you do not comply with or agree to the Bambu Lab Privacy Policy, please do not use Bambu Lab equipment and services.");
ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Terms and Conditions"), ConfirmBeforeSendDialog::ButtonStyle::ONLY_CONFIRM);
@ -202,7 +202,7 @@ wxString get_fail_reason(int code)
m_link_privacy_title->SetFont(Label::Head_13);
m_link_privacy_title->SetMaxSize(wxSize(FromDIP(450), -1));
m_link_privacy_title->Wrap(FromDIP(450));
m_link_privacy_title->SetForegroundColour(wxColour(0x00AE42));
m_link_privacy_title->SetForegroundColour(wxColour(0x009688));
m_link_privacy_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
std::string url;
std::string country_code = Slic3r::GUI::wxGetApp().app_config->get_country_code();
@ -242,7 +242,7 @@ wxString get_fail_reason(int code)
m_link_notice_title->SetFont(Label::Head_13);
m_link_notice_title->SetMaxSize(wxSize(FromDIP(450), -1));
m_link_notice_title->Wrap(FromDIP(450));
m_link_notice_title->SetForegroundColour(wxColour(0x00AE42));
m_link_notice_title->SetForegroundColour(wxColour(0x009688));
m_link_notice_title->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
m_link_notice_title->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
m_link_notice_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
@ -297,7 +297,7 @@ wxString get_fail_reason(int code)
m_sw_bind_failed_info->SetSizer( m_sizer_bind_failed_info );
m_link_network_state = new Label(m_sw_bind_failed_info, _L("Check the status of current system services"));
m_link_network_state->SetForegroundColour(0x00AE42);
m_link_network_state->SetForegroundColour(0x009688);
m_link_network_state->SetFont(::Label::Body_12);
m_link_network_state->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_network_check(); });
m_link_network_state->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_HAND); });
@ -380,9 +380,9 @@ wxString get_fail_reason(int code)
m_button_bind = new Button(button_panel, _L("Confirm"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
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));
m_button_bind->SetBackgroundColor(btn_bg_green);
m_button_bind->SetBorderColor(*wxWHITE);
m_button_bind->SetTextColor(wxColour("#FFFFFE"));
@ -667,7 +667,7 @@ void BindMachineDialog::on_show(wxShowEvent &event)
UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Log out printer"), wxDefaultPosition, wxDefaultSize, wxCAPTION)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -740,10 +740,10 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/)
m_sizer_button->Add(0, 0, 1, wxEXPAND, 5);
m_button_unbind = new Button(this, _L("Confirm"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_unbind->SetBackgroundColor(btn_bg_green);
m_button_unbind->SetBorderColor(wxColour(0, 174, 66));
m_button_unbind->SetBorderColor(wxColour(0, 150, 136));
m_button_unbind->SetTextColor(wxColour("#FFFFFE"));
m_button_unbind->SetSize(BIND_DIALOG_BUTTON_SIZE);
m_button_unbind->SetMinSize(BIND_DIALOG_BUTTON_SIZE);

View file

@ -322,7 +322,7 @@ wxBitmap* BitmapCache::load_svg(const std::string &bitmap_name, unsigned target_
// map of color replaces
std::map<std::string, std::string> replaces;
replaces["\"#00AE42\""] = "\"#009688\"";
replaces["\"#0x00AE42\""] = "\"#009688\"";
replaces["\"#00FF00\""] = "\"#52c7b8\"";
if (dark_mode) {
replaces["\"#262E30\""] = "\"#EFEFF0\"";

View file

@ -84,7 +84,7 @@ BonjourDialog::BonjourDialog(wxWindow *parent, Slic3r::PrinterTechnology tech)
auto button_sizer = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),

View file

@ -273,12 +273,12 @@ void HistoryWindow::sync_history_data() {
});
auto edit_button = new Button(m_history_data_panel, _L("Edit"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
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));
edit_button->SetBackgroundColour(*wxWHITE);
edit_button->SetBackgroundColor(btn_bg_green);
edit_button->SetBorderColor(wxColour(0, 174, 66));
edit_button->SetBorderColor(wxColour(0, 150, 136));
edit_button->SetTextColor(wxColour("#FFFFFE"));
edit_button->SetMinSize(wxSize(-1, FromDIP(24)));
edit_button->SetCornerRadius(FromDIP(12));
@ -407,12 +407,12 @@ EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(wxWindow* parent, con
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
Button* save_btn = new Button(top_panel, _L("Save"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
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));
save_btn->SetBackgroundColour(*wxWHITE);
save_btn->SetBackgroundColor(btn_bg_green);
save_btn->SetBorderColor(wxColour(0, 174, 66));
save_btn->SetBorderColor(wxColour(0, 150, 136));
save_btn->SetTextColor(wxColour("#FFFFFE"));
save_btn->SetMinSize(wxSize(-1, FromDIP(24)));
save_btn->SetCornerRadius(FromDIP(12));

View file

@ -599,23 +599,6 @@ void CalibrationPanel::show_status(int status)
{
if (!m_initialized) return;
if (last_status == status)return;
if (last_status & (int)MonitorStatus::MONITOR_CONNECTING != 0) {
NetworkAgent* agent = wxGetApp().getAgent();
json j;
j["dev_id"] = obj ? obj->dev_id : "obj_nullptr";
if (status & (int)MonitorStatus::MONITOR_DISCONNECTED != 0) {
j["result"] = "failed";
if (agent) {
agent->track_event("connect_dev", j.dump());
}
}
else if (status & (int)MonitorStatus::MONITOR_NORMAL != 0) {
j["result"] = "success";
if (agent) {
agent->track_event("connect_dev", j.dump());
}
}
}
last_status = status;
BOOST_LOG_TRIVIAL(info) << "monitor: show_status = " << status;

View file

@ -10,7 +10,7 @@ namespace Slic3r { namespace GUI {
#define SELECT_MACHINE_GREY900 wxColour(38, 46, 48)
#define SELECT_MACHINE_GREY600 wxColour(144,144,144)
#define SELECT_MACHINE_GREY400 wxColour(206, 206, 206)
#define SELECT_MACHINE_BRAND wxColour(0, 174, 66)
#define SELECT_MACHINE_BRAND wxColour(0, 150, 136)
#define SELECT_MACHINE_REMIND wxColour(255,111,0)
#define SELECT_MACHINE_LIGHT_GREEN wxColour(219, 253, 231)

View file

@ -3,7 +3,7 @@
#include "GUI_App.hpp"
#include "MsgDialog.hpp"
#include "CalibrationWizardPage.hpp"
#include "../../libslic3r/Calib.hpp"
#include "../../libslic3r/calib.hpp"
#include "Tabbook.hpp"
#include "CaliHistoryDialog.hpp"

View file

@ -142,9 +142,9 @@ CaliPageButton::CaliPageButton(wxWindow* parent, CaliPageActionType type, wxStri
Button(parent, text)
{
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
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));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
@ -152,7 +152,7 @@ CaliPageButton::CaliPageButton(wxWindow* parent, CaliPageActionType type, wxStri
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Enabled));
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Enabled));
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));

View file

@ -11,7 +11,7 @@
#include "PresetComboBoxes.hpp"
#include "../slic3r/Utils/CalibUtils.hpp"
#include "../../libslic3r/Calib.hpp"
#include "../../libslic3r/calib.hpp"
namespace Slic3r { namespace GUI {

View file

@ -86,7 +86,7 @@ void Camera::set_zoom(double zoom)
void Camera::select_view(const std::string& direction)
{
if (direction == "iso")
set_iso_orientation();
set_default_orientation();
else if (direction == "left")
look_at(m_target - m_distance * Vec3d::UnitX(), m_target, Vec3d::UnitZ());
else if (direction == "right")
@ -574,19 +574,6 @@ void Camera::set_default_orientation()
m_view_matrix.fromPositionOrientationScale(m_view_rotation * (-camera_pos), m_view_rotation, Vec3d::Ones());
}
void Camera::set_iso_orientation()
{
m_zenit = 45.0f;
const double theta_rad = Geometry::deg2rad(-(double)m_zenit);
const double phi_rad = Geometry::deg2rad(45.0);
const double sin_theta = ::sin(theta_rad);
const Vec3d camera_pos = m_target + m_distance * Vec3d(sin_theta * ::sin(phi_rad), sin_theta * ::cos(phi_rad), ::cos(theta_rad));
m_view_rotation = Eigen::AngleAxisd(theta_rad, Vec3d::UnitX()) * Eigen::AngleAxisd(phi_rad, Vec3d::UnitZ());
m_view_rotation.normalize();
m_view_matrix.fromPositionOrientationScale(m_view_rotation * (-camera_pos), m_view_rotation, Vec3d::Ones());
}
Vec3d Camera::validate_target(const Vec3d& target) const
{
BoundingBoxf3 test_box = m_scene_box;
@ -604,15 +591,15 @@ Vec3d Camera::validate_target(const Vec3d& target) const
void Camera::update_zenit()
{
m_zenit = Geometry::rad2deg(0.5 * M_PI - std::acos(std::clamp(-get_dir_forward().dot(Vec3d::UnitZ()), -1.0, 1.0))); }
m_zenit = Geometry::rad2deg(0.5 * M_PI - std::acos(std::clamp(-get_dir_forward().dot(Vec3d::UnitZ()), -1.0, 1.0)));
}
void Camera::update_target() {
Vec3d temptarget = get_position() + m_distance * get_dir_forward();
if (!(temptarget-m_target).isApprox(Vec3d::Zero())){
m_target = temptarget;
}
}
}
} // GUI
} // Slic3r

View file

@ -163,7 +163,6 @@ private:
void set_distance(double distance);
void set_default_orientation();
void set_iso_orientation();
Vec3d validate_target(const Vec3d& target) const;
void update_zenit();
void update_target();

View file

@ -173,10 +173,11 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
return;
// layer_height shouldn't be equal to zero
auto gpreset = GUI::wxGetApp().preset_bundle->printers.get_edited_preset();
if (config->opt_float("layer_height") < EPSILON)
{
const wxString msg_text = _(L("Too small layer height.\nReset to 0.2"));
MessageDialog dialog(m_msg_dlg_parent, msg_text,"", wxICON_WARNING | wxOK);
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
DynamicPrintConfig new_conf = *config;
is_msg_dlg_already_exist = true;
dialog.ShowModal();
@ -186,14 +187,15 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
}
//BBS: limite the max layer_herght
if (config->opt_float("layer_height") > 0.6 + EPSILON)
auto max_lh = gpreset.config.opt_float("max_layer_height",0);
if (max_lh > 0.2 && config->opt_float("layer_height") > max_lh+ EPSILON)
{
const wxString msg_text = _(L("Too large layer height.\nReset to 0.2"));
const wxString msg_text = wxString::Format(L"Too large layer height.\nReset to %0.3f", max_lh);
MessageDialog dialog(nullptr, msg_text, "", wxICON_WARNING | wxOK);
DynamicPrintConfig new_conf = *config;
is_msg_dlg_already_exist = true;
dialog.ShowModal();
new_conf.set_key_value("layer_height", new ConfigOptionFloat(0.2));
new_conf.set_key_value("layer_height", new ConfigOptionFloat(max_lh));
apply(config, &new_conf);
is_msg_dlg_already_exist = false;
}
@ -319,37 +321,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
is_msg_dlg_already_exist = false;
}
//BBS
//if (config->opt_enum<PerimeterGeneratorType>("wall_generator") == PerimeterGeneratorType::Arachne &&
// config->opt_bool("enable_overhang_speed"))
//{
// wxString msg_text = _(L("Arachne engine only works when overhang slowing down is disabled.\n"
// "This may cause decline in the quality of overhang surface when print fastly")) + "\n";
// if (is_global_config)
// msg_text += "\n" + _(L("Disable overhang slowing down automatically? \n"
// "Yes - Enable arachne and disable overhang slowing down\n"
// "No - Give up using arachne this time"));
// MessageDialog dialog(m_msg_dlg_parent, msg_text, "",
// wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK));
// DynamicPrintConfig new_conf = *config;
// is_msg_dlg_already_exist = true;
// auto answer = dialog.ShowModal();
// bool enable_overhang_slow_down = true;
// if (!is_global_config || answer == wxID_YES) {
// new_conf.set_key_value("enable_overhang_speed", new ConfigOptionBool(false));
// enable_overhang_slow_down = false;
// }
// else {
// new_conf.set_key_value("wall_generator", new ConfigOptionEnum<PerimeterGeneratorType>(PerimeterGeneratorType::Classic));
// }
// apply(config, &new_conf);
// if (cb_value_change) {
// if (!enable_overhang_slow_down)
// cb_value_change("enable_overhang_speed", false);
// }
// is_msg_dlg_already_exist = false;
//}
// BBS
int filament_cnt = wxGetApp().preset_bundle->filament_presets.size();
#if 0
@ -508,7 +479,8 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::vector<std::string> const &keys, std::map<ObjectBase *, ModelConfig *> const &configs)
{
for (auto &k : keys) {
if (/*k == "adaptive_layer_height" || */k == "independent_support_layer_height" || k == "enable_support" || k == "detect_thin_wall")
if (/*k == "adaptive_layer_height" || */ k == "independent_support_layer_height" || k == "enable_support" ||
k == "detect_thin_wall" || k == "tree_support_adaptive_layer_height")
config->set_key_value(k, new ConfigOptionBool(true));
else if (k == "wall_loops")
config->set_key_value(k, new ConfigOptionInt(0));
@ -531,20 +503,25 @@ void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::
void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, const bool is_global_config)
{
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
//SoftFever
auto gcflavor = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
bool have_perimeters = config->opt_int("wall_loops") > 0;
for (auto el : { "ensure_vertical_shell_thickness", "detect_thin_wall", "detect_overhang_wall",
"seam_position","seam_gap","wipe_speed", "wall_infill_order", "outer_wall_line_width",
"inner_wall_speed", "outer_wall_speed" })
"seam_position", "staggered_inner_seams", "wall_infill_order", "outer_wall_line_width",
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold" })
toggle_field(el, have_perimeters);
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", "sparse_infill_anchor_max", "infill_combination",
"minimum_sparse_infill_area", "sparse_infill_filament"})
for (auto el : { "sparse_infill_pattern", "infill_combination",
"minimum_sparse_infill_area", "sparse_infill_filament", "infill_anchor_max"})
toggle_line(el, have_infill);
// Only allow configuration of open anchors if the anchoring is enabled.
bool has_infill_anchors = have_infill && config->option<ConfigOptionFloatOrPercent>("sparse_infill_anchor_max")->value > 0;
toggle_line("sparse_infill_anchor", has_infill_anchors);
bool has_infill_anchors = have_infill && config->option<ConfigOptionFloatOrPercent>("infill_anchor_max")->value > 0;
toggle_field("infill_anchor", has_infill_anchors);
bool has_spiral_vase = config->opt_bool("spiral_mode");
bool has_top_solid_infill = config->opt_int("top_shell_layers") > 0;
@ -554,8 +531,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
for (auto el : { "top_surface_pattern", "bottom_surface_pattern", "internal_solid_infill_pattern", "solid_infill_filament"})
toggle_field(el, has_solid_infill);
for (auto el : { "infill_direction", "sparse_infill_line_width", "bridge_angle",
"sparse_infill_speed", "bridge_speed" })
for (auto el : { "infill_direction", "sparse_infill_line_width",
"sparse_infill_speed", "bridge_speed", "internal_bridge_speed", "bridge_angle" })
toggle_field(el, have_infill || has_solid_infill);
toggle_field("top_shell_thickness", ! has_spiral_vase && has_top_solid_infill);
@ -569,19 +546,14 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool have_default_acceleration = config->opt_float("default_acceleration") > 0;
//BBS
for (auto el : { "initial_layer_acceleration", "outer_wall_acceleration", "top_surface_acceleration", "inner_wall_acceleration", "sparse_infill_acceleration" })
for (auto el : {"outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration",
"top_surface_acceleration", "travel_acceleration", "bridge_acceleration", "sparse_infill_acceleration", "internal_solid_infill_acceleration"})
toggle_field(el, have_default_acceleration);
if (is_BBL_Printer) {
for (auto el : {"default_jerk", "outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk", "travel_jerk"})
toggle_line(el, false);
} else {
for (auto el : {"default_jerk", "outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk", "travel_jerk"})
toggle_line(el, true);
bool quality_default_jerk = config->opt_float("default_jerk") > 0;
for (auto el : {"outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk", "travel_jerk"})
toggle_field(el, quality_default_jerk);
}
bool have_default_jerk = config->opt_float("default_jerk") > 0;
for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "top_surface_jerk","travel_jerk", "infill_jerk"})
toggle_field(el, have_default_jerk);
bool have_skirt = config->opt_int("skirt_loops") > 0;
toggle_field("skirt_height", have_skirt && config->opt_enum<DraftShield>("draft_shield") != dsEnabled);
@ -595,6 +567,15 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
// wall_filament uses the same logic as in Print::extruders()
toggle_field("wall_filament", have_perimeters || have_brim);
bool have_brim_ear = (config->opt_enum<BrimType>("brim_type") == btEar);
const auto brim_width = config->opt_float("brim_width");
// disable brim_ears_max_angle and brim_ears_detection_length if brim_width is 0
toggle_field("brim_ears_max_angle", brim_width > 0.0f);
toggle_field("brim_ears_detection_length", brim_width > 0.0f);
// hide brim_ears_max_angle and brim_ears_detection_length if brim_ear is not selected
toggle_line("brim_ears_max_angle", have_brim_ear);
toggle_line("brim_ears_detection_length", have_brim_ear);
bool have_raft = config->opt_int("raft_layers") > 0;
bool have_support_material = config->opt_bool("enable_support") || have_raft;
// BBS
@ -607,22 +588,23 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
"support_interface_pattern", "support_interface_top_layers", "support_interface_bottom_layers",
"bridge_no_support", "max_bridge_length", "support_top_z_distance", "support_bottom_z_distance",
//BBS: add more support params to dependent of enable_support
"support_type", "support_on_build_plate_only",
"support_remove_small_overhang",
"support_type", "support_on_build_plate_only", "support_critical_regions_only",
"support_object_xy_distance"/*, "independent_support_layer_height"*/})
toggle_field(el, have_support_material);
toggle_field("support_threshold_angle", have_support_material && is_auto(support_type));
//toggle_field("support_closing_radius", have_support_material && support_style == smsSnug);
bool support_is_tree = config->opt_bool("enable_support") && is_tree(support_type);
for (auto el : {"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance", "tree_support_branch_diameter","tree_support_brim_width"})
for (auto el : {"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance",
"tree_support_branch_diameter", "tree_support_adaptive_layer_height", "tree_support_auto_brim", "tree_support_brim_width"})
toggle_field(el, support_is_tree);
// hide tree support settings when normal is selected
for (auto el : {"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance", "tree_support_branch_diameter", "max_bridge_length","tree_support_brim_width" })
for (auto el : {"tree_support_branch_angle", "tree_support_wall_count", "tree_support_branch_distance",
"tree_support_branch_diameter", "max_bridge_length", "tree_support_adaptive_layer_height", "tree_support_auto_brim", "tree_support_brim_width"})
toggle_line(el, support_is_tree);
toggle_line("support_critical_regions_only", is_auto(support_type) && support_is_tree);
toggle_field("tree_support_brim_width", support_is_tree && !config->opt_bool("tree_support_auto_brim"));
// tree support use max_bridge_length instead of bridge_no_support
toggle_line("bridge_no_support", !support_is_tree);
@ -647,7 +629,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
toggle_line(el, have_raft);
bool has_ironing = (config->opt_enum<IroningType>("ironing_type") != IroningType::NoIroning);
for (auto el : {"ironing_pattern", "ironing_flow", "ironing_spacing", "ironing_speed"})
for (auto el : { "ironing_flow", "ironing_spacing", "ironing_speed" })
toggle_line(el, has_ironing);
// bool have_sequential_printing = (config->opt_enum<PrintSequence>("print_sequence") == PrintSequence::ByObject);
@ -664,11 +646,16 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
for (auto el : {"flush_into_infill", "flush_into_support", "flush_into_objects"})
toggle_field(el, have_prime_tower);
// BBS: MusangKing - Hide "Independent support layer height" option
toggle_line("independent_support_layer_height", have_support_material && !have_prime_tower);
bool have_avoid_crossing_perimeters = config->opt_bool("reduce_crossing_wall");
toggle_line("max_travel_detour_distance", have_avoid_crossing_perimeters);
bool has_overhang_speed = config->opt_bool("enable_overhang_speed");
for (auto el : { "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed"})
for (auto el :
{"overhang_speed_classic", "overhang_1_4_speed",
"overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed"})
toggle_line(el, has_overhang_speed);
toggle_line("flush_into_objects", !is_global_config);
@ -682,22 +669,24 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
"min_feature_size", "min_bead_width", "wall_distribution_count" })
toggle_line(el, have_arachne);
toggle_field("detect_thin_wall", !have_arachne);
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
// OrcaSlicer
auto gcflavor = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
if( gcflavor != gcfKlipper )
{
for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"})
toggle_line(el, false);
}
else {
for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"})
toggle_line(el, true);
// Orca
auto is_role_based_wipe_speed = config->opt_bool("role_based_wipe_speed");
toggle_field("wipe_speed",!is_role_based_wipe_speed);
for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"})
toggle_line(el, gcflavor == gcfKlipper);
if(gcflavor == gcfKlipper)
toggle_field("accel_to_decel_factor", config->opt_bool("accel_to_decel_enable"));
}
bool have_make_overhang_printable = config->opt_bool("make_overhang_printable");
toggle_line("make_overhang_printable_angle", have_make_overhang_printable);
toggle_line("make_overhang_printable_hole_size", have_make_overhang_printable);
toggle_line("exclude_object", gcflavor == gcfKlipper);
toggle_line("min_width_top_surface",config->opt_bool("only_one_wall_top"));
}
void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/)

View file

@ -1620,29 +1620,12 @@ int MachineObject::command_go_home()
int MachineObject::command_control_fan(FanType fan_type, bool on_off)
{
std::string gcode = (boost::format("M106 P%1% S%2% \n") % (int)fan_type % (on_off ? 255 : 0)).str();
try {
json j;
j["fan_control"] = "fan_control";
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_event("printer_control", j.dump());
}
catch (...) {}
return this->publish_gcode(gcode);
}
int MachineObject::command_control_fan_val(FanType fan_type, int val)
{
std::string gcode = (boost::format("M106 P%1% S%2% \n") % (int)fan_type % (val)).str();
try {
json j;
j["fan_control"] = "fan_control_val";
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_event("printer_control", j.dump());
}
catch (...) {}
return this->publish_gcode(gcode);
}
@ -1680,29 +1663,12 @@ int MachineObject::command_task_resume()
int MachineObject::command_set_bed(int temp)
{
std::string gcode_str = (boost::format("M140 S%1%\n") % temp).str();
try {
json j;
j["temp_control"] = "bed_temp";
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_event("printer_control", j.dump());
}
catch (...) {}
return this->publish_gcode(gcode_str);
}
int MachineObject::command_set_nozzle(int temp)
{
std::string gcode_str = (boost::format("M104 S%1%\n") % temp).str();
try {
json j;
j["temp_control"] = "nozzle_temp";
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_event("printer_control", j.dump());
}
catch (...) {}
return this->publish_gcode(gcode_str);
}
@ -1971,7 +1937,6 @@ int MachineObject::command_axis_control(std::string axis, double unit, double va
j["axis_control"] = axis;
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_event("printer_control", j.dump());
}
catch (...) {}
@ -3759,12 +3724,6 @@ int MachineObject::parse_json(std::string payload)
} else if (jj["command"].get<std::string>() == "gcode_line") {
//ack of gcode_line
BOOST_LOG_TRIVIAL(debug) << "parse_json, ack of gcode_line = " << j.dump(4);
if (m_agent && is_studio_cmd(sequence_id)) {
json t;
t["dev_id"] = this->dev_id;
t["signal"] = this->wifi_signal;
m_agent->track_event("ack_cmd_gcode_line", t.dump());
}
} else if (jj["command"].get<std::string>() == "project_file") {
//ack of project file
BOOST_LOG_TRIVIAL(debug) << "parse_json, ack of project_file = " << j.dump(4);
@ -3773,7 +3732,6 @@ int MachineObject::parse_json(std::string payload)
json t;
t["dev_id"] = this->dev_id;
t["signal"] = this->wifi_signal;
m_agent->track_event("ack_cmd_project_file", t.dump());
}
std::string result;
@ -4262,13 +4220,6 @@ int MachineObject::publish_gcode(std::string gcode_str)
j["print"]["param"] = gcode_str;
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
if (m_agent) {
j["print"]["user_id"] = m_agent->get_user_id();
json t;
t["dev_id"] = this->dev_id;
t["signal"] = this->wifi_signal;
m_agent->track_event("cmd_gcode_line", t.dump());
}
return publish_json(j.dump());
}

View file

@ -12,7 +12,7 @@
#include "slic3r/Utils/json_diff.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "CameraPopup.hpp"
#include "libslic3r/Calib.hpp"
#include "libslic3r/calib.hpp"
#define USE_LOCAL_SOCKET_BIND 0

View file

@ -49,9 +49,9 @@ DownloadProgressDialog::DownloadProgressDialog(wxString title)
m_simplebook_status = new wxSimplebook(this);
m_simplebook_status->SetSize(wxSize(FromDIP(400), -1));
m_simplebook_status->SetMinSize(wxSize(FromDIP(400), -1));
m_simplebook_status->SetMaxSize(wxSize(FromDIP(400), -1));
m_simplebook_status->SetSize(wxSize(FromDIP(400), FromDIP(70)));
m_simplebook_status->SetMinSize(wxSize(FromDIP(400), FromDIP(70)));
m_simplebook_status->SetMaxSize(wxSize(FromDIP(400), FromDIP(70)));
//mode normal
m_status_bar = std::make_shared<BBLStatusBarSend>(m_simplebook_status);

View file

@ -169,7 +169,7 @@ void ExtrusionCalibration::create()
m_error_text->Hide();
m_button_cali = new Button(m_step_1_panel, _L("Start calibration"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Disabled), std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Disabled), 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));
m_button_cali->SetBackgroundColor(m_btn_bg_green);
m_button_cali->SetFont(Label::Body_13);
@ -180,7 +180,7 @@ void ExtrusionCalibration::create()
m_button_cali->Bind(wxEVT_BUTTON, &ExtrusionCalibration::on_click_cali, this);
m_cali_cancel = new Button(m_step_1_panel, _L("Cancel"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
m_btn_bg_green = StateColor(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));
m_cali_cancel->SetBackgroundColor(m_btn_bg_green);
m_cali_cancel->SetBorderColor(wxColour(0, 150, 136));
@ -255,7 +255,7 @@ void ExtrusionCalibration::create()
// save button
m_button_save_result = new Button(m_step_2_panel, _L("Save"));
m_btn_bg_green = StateColor(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
m_btn_bg_green = StateColor(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));
m_button_save_result->SetBackgroundColor(m_btn_bg_green);
m_button_save_result->SetFont(Label::Body_13);

View file

@ -385,7 +385,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
wxString y_str = thumbnail.GetNextToken();
if (y_str.ToDouble(&y) && !thumbnail.HasMoreTokens()) {
if (m_opt_id == "bed_exclude_area") {
if (0 <= x && x <= 256 && 0 <= y && y <= 256) {
if (0 <= x && 0 <= y) {
out_values.push_back(Vec2d(x, y));
continue;
}
@ -511,7 +511,7 @@ void TextCtrl::BUILD() {
m_combine_side_text = !m_opt.multiline;
if (parent_is_custom_ctrl && m_opt.height < 0)
opt_height = (double) text_ctrl->GetSize().GetHeight() / m_em_unit;
if (m_opt.is_code) // BBS
if (m_opt.is_code)
temp->SetFont(Slic3r::GUI::wxGetApp().normal_font());
@ -1383,8 +1383,7 @@ boost::any& Choice::get_value()
{
if (m_opt.nullable && field->GetSelection() == -1)
m_value = ConfigOptionEnumsGenericNullable::nil_value();
else if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "internal_solid_infill_pattern" || m_opt_id == "sparse_infill_pattern" ||
m_opt_id == "support_style") {
else if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "internal_solid_infill_pattern" || m_opt_id == "sparse_infill_pattern" || m_opt_id == "support_style") {
const std::string& key = m_opt.enum_values[field->GetSelection()];
m_value = int(m_opt.enum_keys_map->at(key));
}

View file

@ -327,7 +327,7 @@ void GCodeViewer::SequentialRangeCap::reset() {
void GCodeViewer::SequentialView::Marker::init(std::string filename)
{
if (filename.empty()) {
m_model.init_from(stilized_arrow(16, 1.5f, 3.0f, 0.8f, 3.0f));
//m_model.init_from(stilized_arrow(16, 1.5f, 3.0f, 0.8f, 3.0f));
} else {
m_model.init_from_file(filename);
}
@ -1160,9 +1160,6 @@ void GCodeViewer::refresh(const GCodeProcessorResult& gcode_result, const std::v
for (auto item : m_tools.m_tool_visibles) item = true;
}
for (int i = 0; i < m_tools.m_tool_colors.size(); i++) {
m_tools.m_tool_colors[i] = adjust_color_for_rendering(m_tools.m_tool_colors[i]);
}
// ensure there are enough colors defined
while (m_tools.m_tool_colors.size() < std::max(size_t(1), gcode_result.extruders_count)) {
m_tools.m_tool_colors.push_back(decode_color("#FF8000"));
@ -1188,7 +1185,7 @@ void GCodeViewer::refresh(const GCodeProcessorResult& gcode_result, const std::v
m_extrusions.ranges.temperature.update_from(curr.temperature);
if (curr.extrusion_role != erCustom || is_visible(erCustom))
m_extrusions.ranges.volumetric_rate.update_from(round_to_bin(curr.volumetric_rate()));
if (curr.layer_duration > 0.f) {
m_extrusions.ranges.layer_duration.update_from(curr.layer_duration);
m_extrusions.ranges.layer_duration_log.update_from(curr.layer_duration);
@ -1226,7 +1223,7 @@ void GCodeViewer::refresh_render_paths()
void GCodeViewer::update_shells_color_by_extruder(const DynamicPrintConfig* config)
{
if (config != nullptr)
m_shells.volumes.update_colors_by_extruder(config,false);
m_shells.volumes.update_colors_by_extruder(config);
}
//BBS: always load shell at preview
@ -3842,7 +3839,7 @@ void GCodeViewer::render_toolpaths()
#if ENABLE_GCODE_VIEWER_STATISTICS
this
#endif // ENABLE_GCODE_VIEWER_STATISTICS
](std::vector<RenderPath>::reverse_iterator it_path, std::vector<RenderPath>::reverse_iterator it_end, GLShaderProgram& shader, int uniform_color) {
](std::vector<RenderPath>::iterator it_path, std::vector<RenderPath>::iterator it_end, GLShaderProgram& shader, int uniform_color) {
glsafe(::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE));
glsafe(::glEnable(GL_POINT_SPRITE));
@ -3869,7 +3866,7 @@ void GCodeViewer::render_toolpaths()
#if ENABLE_GCODE_VIEWER_STATISTICS
this
#endif // ENABLE_GCODE_VIEWER_STATISTICS
](std::vector<RenderPath>::reverse_iterator it_path, std::vector<RenderPath>::reverse_iterator it_end, GLShaderProgram& shader, int uniform_color) {
](std::vector<RenderPath>::iterator it_path, std::vector<RenderPath>::iterator it_end, GLShaderProgram& shader, int uniform_color) {
for (auto it = it_path; it != it_end && it_path->ibuffer_id == it->ibuffer_id; ++it) {
const RenderPath& path = *it;
// Some OpenGL drivers crash on empty glMultiDrawElements, see GH #7415.
@ -3887,7 +3884,7 @@ void GCodeViewer::render_toolpaths()
#if ENABLE_GCODE_VIEWER_STATISTICS
this
#endif // ENABLE_GCODE_VIEWER_STATISTICS
](std::vector<RenderPath>::reverse_iterator it_path, std::vector<RenderPath>::reverse_iterator it_end, GLShaderProgram& shader, int uniform_color) {
](std::vector<RenderPath>::iterator it_path, std::vector<RenderPath>::iterator it_end, GLShaderProgram& shader, int uniform_color) {
for (auto it = it_path; it != it_end && it_path->ibuffer_id == it->ibuffer_id; ++it) {
const RenderPath& path = *it;
// Some OpenGL drivers crash on empty glMultiDrawElements, see GH #7415.
@ -4017,15 +4014,13 @@ void GCodeViewer::render_toolpaths()
default: break;
}
int uniform_color = shader->get_uniform_location("uniform_color");
auto it_path = buffer.render_paths.rbegin();
auto it_path = buffer.render_paths.begin();
//BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":buffer indices size %1%, render_path size %2% ")%buffer.indices.size() %buffer.render_paths.size();
unsigned int indices_count = static_cast<unsigned int>(buffer.indices.size());
for (unsigned int index = 0; index < indices_count; ++index) {
unsigned int ibuffer_id = indices_count - index - 1;
for (unsigned int ibuffer_id = 0; ibuffer_id < static_cast<unsigned int>(buffer.indices.size()); ++ibuffer_id) {
const IBuffer& i_buffer = buffer.indices[ibuffer_id];
// Skip all paths with ibuffer_id < ibuffer_id.
for (; it_path != buffer.render_paths.rend() && it_path->ibuffer_id > ibuffer_id; ++ it_path) ;
if (it_path == buffer.render_paths.rend() || it_path->ibuffer_id < ibuffer_id)
for (; it_path != buffer.render_paths.end() && it_path->ibuffer_id < ibuffer_id; ++ it_path) ;
if (it_path == buffer.render_paths.end() || it_path->ibuffer_id > ibuffer_id)
// Not found. This shall not happen.
continue;
@ -4044,16 +4039,16 @@ void GCodeViewer::render_toolpaths()
switch (buffer.render_primitive_type)
{
case TBuffer::ERenderPrimitiveType::Point: {
render_as_points(it_path, buffer.render_paths.rend(), *shader, uniform_color);
render_as_points(it_path, buffer.render_paths.end(), *shader, uniform_color);
break;
}
case TBuffer::ERenderPrimitiveType::Line: {
glsafe(::glLineWidth(static_cast<GLfloat>(line_width(zoom))));
render_as_lines(it_path, buffer.render_paths.rend(), *shader, uniform_color);
render_as_lines(it_path, buffer.render_paths.end(), *shader, uniform_color);
break;
}
case TBuffer::ERenderPrimitiveType::Triangle: {
render_as_triangles(it_path, buffer.render_paths.rend(), *shader, uniform_color);
render_as_triangles(it_path, buffer.render_paths.end(), *shader, uniform_color);
break;
}
default: { break; }
@ -4176,10 +4171,6 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
std::vector<float> filament_densities = gcode_result_list.front()->filament_densities;
std::vector<Color> filament_colors = decode_colors(wxGetApp().plater()->get_extruder_colors_from_plater_config(gcode_result_list.back()));
for (int i = 0; i < filament_colors.size(); i++) {
filament_colors[i] = adjust_color_for_rendering(filament_colors[i]);
}
bool imperial_units = wxGetApp().app_config->get("use_inches") == "1";
float window_padding = 4.0f * m_scale;
const float icon_size = ImGui::GetTextLineHeight() * 0.7;
@ -4323,20 +4314,18 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
columns_offsets.push_back({ std::to_string(it->first + 1), offsets[0] });
char buf[64];
double unit_conver = imperial_units ? GizmoObjectManipulation::oz_to_g : 1.0;
if (show_detailed_statistics_page) {
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", model_used_filaments_m_all_plates[i], model_used_filaments_g_all_plates[i] / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", model_used_filaments_m_all_plates[i], model_used_filaments_g_all_plates[i]);
columns_offsets.push_back({ buf, offsets[1] });
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", flushed_filaments_m_all_plates[i], flushed_filaments_g_all_plates[i] / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", flushed_filaments_m_all_plates[i], flushed_filaments_g_all_plates[i]);
columns_offsets.push_back({ buf, offsets[2] });
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", (model_used_filaments_m_all_plates[i] + flushed_filaments_m_all_plates[i]),
(model_used_filaments_g_all_plates[i] + flushed_filaments_g_all_plates[i]) / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", model_used_filaments_m_all_plates[i] + flushed_filaments_m_all_plates[i], model_used_filaments_g_all_plates[i] + flushed_filaments_g_all_plates[i]);
columns_offsets.push_back({ buf, offsets[3] });
}
else {
::sprintf(buf, imperial_units ? "%.2f in %.2f oz" : "%.2f m %.2f g", model_used_filaments_m_all_plates[i], model_used_filaments_g_all_plates[i] / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in %.2f oz" : "%.2f m %.2f g", model_used_filaments_m_all_plates[i], model_used_filaments_g_all_plates[i]);
columns_offsets.push_back({ buf, offsets[2] });
}
@ -4430,21 +4419,21 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
default:
case EItemType::Rect: {
draw_list->AddRectFilled({ pos.x + 1.0f * m_scale, pos.y + 3.0f * m_scale }, { pos.x + icon_size - 1.0f * m_scale, pos.y + icon_size + 1.0f * m_scale },
ImGui::GetColorU32({color[0], color[1], color[2], color[3]}));
ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }));
break;
}
case EItemType::Circle: {
ImVec2 center(0.5f * (pos.x + pos.x + icon_size), 0.5f * (pos.y + pos.y + icon_size + 5.0f));
draw_list->AddCircleFilled(center, 0.5f * icon_size, ImGui::GetColorU32({color[0], color[1], color[2], color[3]}), 16);
draw_list->AddCircleFilled(center, 0.5f * icon_size, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 16);
break;
}
case EItemType::Hexagon: {
ImVec2 center(0.5f * (pos.x + pos.x + icon_size), 0.5f * (pos.y + pos.y + icon_size + 5.0f));
draw_list->AddNgonFilled(center, 0.5f * icon_size, ImGui::GetColorU32({color[0], color[1], color[2], color[3]}), 6);
draw_list->AddNgonFilled(center, 0.5f * icon_size, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 6);
break;
}
case EItemType::Line: {
draw_list->AddLine({pos.x + 1, pos.y + icon_size + 2}, {pos.x + icon_size - 1, pos.y + 4}, ImGui::GetColorU32({color[0], color[1], color[2], color[3]}), 3.0f);
draw_list->AddLine({ pos.x + 1, pos.y + icon_size + 2 }, { pos.x + icon_size - 1, pos.y + 4 }, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 3.0f);
break;
case EItemType::None:
break;
@ -4959,7 +4948,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
columns_offsets.push_back({ std::to_string(extruder_idx + 1), offsets[0] });
char buf[64];
::sprintf(buf, imperial_units ? "%.2f in %.2f oz" : "%.2f m %.2f g", model_used_filaments_m[0], model_used_filaments_g[0] / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in %.2f oz" : "%.2f m %.2f g", model_used_filaments_m[0] , model_used_filaments_g[0]);
columns_offsets.push_back({ buf, offsets[2] });
append_item(EItemType::Rect, m_tools.m_tool_colors[extruder_idx], columns_offsets, false);
@ -4993,20 +4982,19 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
char buf[64];
if (show_flushed_filaments) {
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", model_used_filaments_m[i], model_used_filaments_g[i] / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", model_used_filaments_m[i], model_used_filaments_g[i]);
columns_offsets.push_back({ buf, offsets[1] });
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", flushed_filaments_m[i], flushed_filaments_g[i] / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", flushed_filaments_m[i], flushed_filaments_g[i]);
columns_offsets.push_back({ buf, offsets[2] });
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", (model_used_filaments_m[i] + flushed_filaments_m[i]),
(model_used_filaments_g[i] + flushed_filaments_g[i]) / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", model_used_filaments_m[i] + flushed_filaments_m[i], model_used_filaments_g[i] + flushed_filaments_g[i]);
columns_offsets.push_back({ buf, offsets[3] });
}
else {
char buf[64];
::sprintf(buf, imperial_units ? "%.2f in %.2f oz" : "%.2f m %.2f g", model_used_filaments_m[i], model_used_filaments_g[i] / unit_conver);
columns_offsets.push_back({buf, offsets[2]});
::sprintf(buf, imperial_units ? "%.2f in %.2f oz" : "%.2f m %.2f g", model_used_filaments_m[i], model_used_filaments_g[i]);
columns_offsets.push_back({ buf, offsets[2] });
}
append_item(EItemType::Rect, m_tools.m_tool_colors[extruder_idx], columns_offsets, false, filament_visible, [this, extruder_idx]() {
@ -5055,20 +5043,20 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
std::vector<std::pair<std::string, float>> columns_offsets;
columns_offsets.push_back({ _u8L("Total"), offsets[0] });
if (!show_flushed_filaments) {
::sprintf(buf, imperial_units ? "%.2f in %.2f oz" : "%.2f m %.2f g", total_model_used_filament_m, total_model_used_filament_g / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in %.2f oz" : "%.2f m %.2f g", total_model_used_filament_m, total_model_used_filament_g);
columns_offsets.push_back({ buf, offsets[2] });
append_item(EItemType::None, m_tools.m_tool_colors[0], columns_offsets);
}
else {
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", total_model_used_filament_m, total_model_used_filament_g / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", total_model_used_filament_m, total_model_used_filament_g);
columns_offsets.push_back({ buf, offsets[1] });
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", total_flushed_filament_m, total_flushed_filament_g / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", total_flushed_filament_m, total_flushed_filament_g);
columns_offsets.push_back({ buf, offsets[2] });
bool imperial_units = wxGetApp().app_config->get("use_inches") == "1";
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", total_model_used_filament_m + total_flushed_filament_m, (total_model_used_filament_g + total_flushed_filament_g) / unit_conver);
::sprintf(buf, imperial_units ? "%.2f in\n%.2f oz" : "%.2f m\n%.2f g", (total_model_used_filament_m + total_flushed_filament_m) * 1000 / /*1000*/koef, (total_model_used_filament_g + total_flushed_filament_g) / unit_conver);
columns_offsets.push_back({ buf, offsets[3] });
append_item(EItemType::None, m_tools.m_tool_colors[0], columns_offsets);

View file

@ -492,7 +492,7 @@ class GCodeViewer
std::vector<Endpoints>& get_endpoints() { return m_endpoints; }
double get_z_at(unsigned int id) const { return (id < m_zs.size()) ? m_zs[id] : 0.0; }
Endpoints get_endpoints_at(unsigned int id) const { return (id < m_endpoints.size()) ? m_endpoints[id] : Endpoints(); }
int get_l_at(float z) const
int get_l_at(double z) const
{
auto iter = std::upper_bound(m_zs.begin(), m_zs.end(), z);
return std::distance(m_zs.begin(), iter);
@ -737,6 +737,7 @@ public:
//BBS
ConflictResultOpt m_conflict_result;
private:
std::vector<int> m_plater_extruder;
bool m_gl_data_initialized{ false };

View file

@ -119,7 +119,7 @@ RetinaHelper::~RetinaHelper() {}
float RetinaHelper::get_scale_factor() { return float(m_window->GetContentScaleFactor()); }
#endif // __WXGTK3__
// Fixed the collision between BuildVolume::Type::Convex and macro Convex defined inside /usr/include/X11/X.h that is included by WxWidgets 3.0.
// Fixed the collision between BuildVolume_Type::Convex and macro Convex defined inside /usr/include/X11/X.h that is included by WxWidgets 3.0.
#if defined(__linux__) && defined(Convex)
#undef Convex
#endif
@ -287,7 +287,7 @@ void GLCanvas3D::LayersEditing::render_variable_layer_height_dialog(const GLCanv
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(238 / 255.0f, 238 / 255.0f, 238 / 255.0f, 0.00f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(238 / 255.0f, 238 / 255.0f, 238 / 255.0f, 0.00f));
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0.81f, 0.81f, 0.81f, 1.0f));
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(0.00f, 0.68f, 0.26f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(0.00f, 0.59f, 0.53f, 1.00f));
if(ImGui::BBLSliderScalar("##radius_slider", ImGuiDataType_S32, &radius, &v_min, &v_max)){
radius = std::clamp(radius, 1, 10);
m_smooth_params.radius = (unsigned int)radius;
@ -298,9 +298,9 @@ void GLCanvas3D::LayersEditing::render_variable_layer_height_dialog(const GLCanv
input_align = std::max(input_align, ImGui::GetCursorPosX());
ImGui::SetCursorPosX(input_align);
ImGui::PushItemWidth(input_box_width);
ImGui::PushStyleColor(ImGuiCol_BorderActive, ImVec4(0.00f, 0.68f, 0.26f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.00f, 0.68f, 0.26f, 0.00f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.00f, 0.68f, 0.26f, 0.00f));
ImGui::PushStyleColor(ImGuiCol_BorderActive, ImVec4(0.00f, 0.59f, 0.53f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(0.00f, 0.59f, 0.53f, 0.00f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(0.00f, 0.59f, 0.53f, 0.00f));
ImGui::BBLDragScalar("##radius_input", ImGuiDataType_S32, &radius, 1, &v_min, &v_max);
ImGui::PopStyleColor(3);
@ -1047,22 +1047,30 @@ const double GLCanvas3D::DefaultCameraZoomToPlateMarginFactor = 1.25;
void GLCanvas3D::load_arrange_settings()
{
std::string dist_fff_str =
wxGetApp().app_config->get("arrange", "min_object_distance");
wxGetApp().app_config->get("arrange", "min_object_distance_fff");
std::string dist_fff_seq_print_str =
wxGetApp().app_config->get("arrange", "min_object_distance_seq_print");
wxGetApp().app_config->get("arrange", "min_object_distance_seq_print_fff");
std::string dist_sla_str =
wxGetApp().app_config->get("arrange", "min_object_distance_sla");
std::string en_rot_fff_str =
wxGetApp().app_config->get("arrange", "enable_rotation");
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);
@ -1074,13 +1082,20 @@ void GLCanvas3D::load_arrange_settings()
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 == "yes");
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 == "yes");
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 == "yes");
m_arrange_settings_sla.enable_rotation = (en_rot_sla_str == "1" || en_rot_sla_str == "true");
//BBS: add specific arrange settings
m_arrange_settings_fff_seq_print.is_seq_print = true;
@ -3118,12 +3133,15 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
case WXK_BACK: { post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE)); break; }
#endif
case WXK_ESCAPE: { deselect_all(); break; }
//case WXK_F5: {
// if ((wxGetApp().is_editor() && !wxGetApp().plater()->model().objects.empty()) ||
// (wxGetApp().is_gcode_viewer() && !wxGetApp().plater()->get_last_loaded_gcode().empty()))
// post_event(SimpleEvent(EVT_GLCANVAS_RELOAD_FROM_DISK));
// break;
//}
case WXK_F5: {
if (wxGetApp().mainframe->is_printer_view())
wxGetApp().mainframe->load_printer_url();
//if ((wxGetApp().is_editor() && !wxGetApp().plater()->model().objects.empty()) ||
// (wxGetApp().is_gcode_viewer() && !wxGetApp().plater()->get_last_loaded_gcode().empty()))
// post_event(SimpleEvent(EVT_GLCANVAS_RELOAD_FROM_DISK));
break;
}
// BBS: use keypad to change extruder
case '1':
@ -3175,10 +3193,8 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
}
//case 'B':
//case 'b': { zoom_to_bed(); break; }
#if !BBL_RELEASE_TO_PUBLIC
case 'C':
case 'c': { m_gcode_viewer.toggle_gcode_window_visibility(); m_dirty = true; request_extra_frame(); break; }
#endif
//case 'G':
//case 'g': {
// if ((evt.GetModifiers() & shiftMask) != 0) {
@ -3376,7 +3392,11 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
else if (m_tab_down && keyCode == WXK_TAB && !evt.HasAnyModifiers()) {
// Enable switching between 3D and Preview with Tab
// m_canvas->HandleAsNavigationKey(evt); // XXX: Doesn't work in some cases / on Linux
//post_event(SimpleEvent(EVT_GLCANVAS_TAB));
post_event(SimpleEvent(EVT_GLCANVAS_TAB));
}
else if (keyCode == WXK_TAB && evt.ShiftDown() && !evt.ControlDown() && ! wxGetApp().is_gcode_viewer()) {
// Collapse side-panel with Shift+Tab
post_event(SimpleEvent(EVT_GLCANVAS_COLLAPSE_SIDEBAR));
}
else if (keyCode == WXK_SHIFT) {
translationProcessor.process(evt);
@ -5044,7 +5064,7 @@ void GLCanvas3D::update_sequential_clearance()
// the results are then cached for following displacements
if (m_sequential_print_clearance_first_displacement) {
m_sequential_print_clearance.m_hull_2d_cache.clear();
float shrink_factor = static_cast<float>(scale_(0.5 * fff_print()->config().extruder_clearance_max_radius.value - EPSILON));
float shrink_factor = static_cast<float>(scale_(0.5 * fff_print()->config().extruder_clearance_radius.value - EPSILON));
double mitter_limit = scale_(0.1);
m_sequential_print_clearance.m_hull_2d_cache.reserve(m_model->objects.size());
for (size_t i = 0; i < m_model->objects.size(); ++i) {
@ -5395,20 +5415,22 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
ImGui::Separator();
if (imgui->bbl_checkbox(_L("Auto rotate for arrangement"), settings.enable_rotation)) {
settings_out.enable_rotation = settings.enable_rotation;
appcfg->set("arrange", rot_key.c_str(), settings_out.enable_rotation? "1" : "0");
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 ? "1" : "0");
appcfg->set("arrange", multi_material_key.c_str(), settings_out.allow_multi_materials_on_same_plate );
settings_changed = true;
}
// 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;
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
const bool has_lidar = preset_bundle->printers.get_edited_preset().has_lidar(preset_bundle);
auto op = current_config.option("scan_first_layer");
if (op && op->getBool()) {
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");
@ -5567,25 +5589,19 @@ void GLCanvas3D::render_thumbnail_internal(ThumbnailData& thumbnail_data, const
//camera.select_view("top");
}
else {
//camera.zoom_to_box(volumes_box);
//const Vec3d& target = camera.get_target();
//double distance = camera.get_distance();
//camera.look_at(target - 0.707 * distance * Vec3d::UnitY() + 0.3 * distance * Vec3d::UnitZ(), target, Vec3d::UnitY() + Vec3d::UnitZ());
//BBS: use original iso view for thumbnail
camera.select_view("iso");
camera.zoom_to_box(volumes_box);
const Vec3d& target = camera.get_target();
double distance = camera.get_distance();
camera.select_view("iso");
camera.apply_view_matrix();
camera.apply_projection(plate_build_volume);
}
camera.apply_view_matrix();
camera.apply_projection(plate_build_volume);
//double near_z = -1.0;
//double far_z = -1.0;
//camera.apply_projection(volumes_box, near_z, far_z);
//GLShaderProgram* shader = wxGetApp().get_shader("gouraud_light");
if (!for_picking && (shader == nullptr)) {
BOOST_LOG_TRIVIAL(info) << boost::format("render_thumbnail with no picking: shader is null, return directly");
@ -5593,17 +5609,8 @@ void GLCanvas3D::render_thumbnail_internal(ThumbnailData& thumbnail_data, const
}
//if (thumbnail_params.transparent_background)
if (for_picking)
glsafe(::glClearColor(0.f, 0.f, 0.f, 0.f));
else {
//glsafe(::glClearColor(0.906f, 0.906f, 0.906f, 1.0f));
//glsafe(::glClearColor(0.50f, 0.5f, 0.5f, 1.0f));
//glsafe(::glClearColor(0.121568f, 0.121568f, 0.121568f, 1.0f));
//glsafe(::glClearColor(0.17647f, 0.17647f, 0.17647f, 1.0f));
//glsafe(::glClearColor(0.906f, 0.906f, 0.906f, 1.0f));
//glsafe(::glClearColor(0.37647f, 0.37647f, 0.37647f, 0.5f)); too lite
glsafe(::glClearColor(0.0f, 0.0f, 0.0f, 0.0f));
}
glsafe(::glClearColor(0.f, 0.f, 0.f, 0.f));
glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
glsafe(::glEnable(GL_DEPTH_TEST));
@ -6105,12 +6112,7 @@ bool GLCanvas3D::_init_main_toolbar()
item.icon_filename = m_is_dark ? "toolbar_arrange_dark.svg" : "toolbar_arrange.svg";
item.tooltip = _utf8(L("Arrange all objects")) + " [A]\n" + _utf8(L("Arrange objects on selected plates")) + " [Shift+A]";
item.sprite_id++;
item.left.action_callback = [this]() {
if (m_canvas != nullptr) {
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("auto_arrange", std::to_string(++auto_arrange_count));
}
};
item.left.action_callback = []() {};
item.enabling_callback = []()->bool { return wxGetApp().plater()->can_arrange(); };
item.left.toggable = true;
//BBS: GUI refactor: adjust the main toolbar position
@ -6135,13 +6137,7 @@ bool GLCanvas3D::_init_main_toolbar()
item.tooltip = _utf8(L("Split to objects"));
item.sprite_id++;
item.left.render_callback = nullptr;
item.left.action_callback = [this]() {
if (m_canvas != nullptr) {
wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_SPLIT_OBJECTS));
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("split_to_objects", std::to_string(++split_to_objects_count));
}
};
item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_SPLIT_OBJECTS)); };
item.visibility_callback = GLToolbarItem::Default_Visibility_Callback;
item.enabling_callback = []()->bool { return wxGetApp().plater()->can_split_to_objects(); };
if (!m_main_toolbar.add_item(item))
@ -6151,13 +6147,7 @@ bool GLCanvas3D::_init_main_toolbar()
item.icon_filename = m_is_dark ? "split_parts_dark.svg" : "split_parts.svg";
item.tooltip = _utf8(L("Split to parts"));
item.sprite_id++;
item.left.action_callback = [this]() {
if (m_canvas != nullptr) {
wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_SPLIT_VOLUMES));
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("split_to_part", std::to_string(++split_to_part_count));
}
};
item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_SPLIT_VOLUMES)); };
item.visibility_callback = GLToolbarItem::Default_Visibility_Callback;
item.enabling_callback = []()->bool { return wxGetApp().plater()->can_split_to_volumes(); };
if (!m_main_toolbar.add_item(item))
@ -6167,13 +6157,7 @@ bool GLCanvas3D::_init_main_toolbar()
item.icon_filename = m_is_dark ? "toolbar_variable_layer_height_dark.svg" : "toolbar_variable_layer_height.svg";
item.tooltip = _utf8(L("Variable layer height"));
item.sprite_id++;
item.left.action_callback = [this]() {
if (m_canvas != nullptr) {
wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_LAYERSEDITING));
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("custom_height", std::to_string(++custom_height_count));
}
};
item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_LAYERSEDITING)); };
item.visibility_callback = [this]()->bool {
bool res = current_printer_technology() == ptFFF;
// turns off if changing printer technology
@ -6197,6 +6181,7 @@ bool GLCanvas3D::_init_select_plate_toolbar()
bool result = item->image_texture.load_from_svg_file(path + "im_all_plates_stats.svg", false, false, false, 128);
result = result && item->image_texture_transparent.load_from_svg_file(path + "im_all_plates_stats_transparent.svg", false, false, false, 128);
m_sel_plate_toolbar.m_all_plates_stats_item = item;
return result;
}
@ -6276,13 +6261,7 @@ bool GLCanvas3D::_init_assemble_view_toolbar()
item.tooltip = _utf8(L("Assembly View"));
item.sprite_id = 1;
item.left.toggable = false;
item.left.action_callback = [this]() {
if (m_canvas != nullptr) {
wxPostEvent(m_canvas, SimpleEvent(EVT_GLVIEWTOOLBAR_ASSEMBLE)); m_gizmos.reset_all_states(); wxGetApp().plater()->get_assmeble_canvas3D()->get_gizmos_manager().reset_all_states();
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) agent->track_update_property("custom_painting", std::to_string(++custom_painting_count));
}
};
item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLVIEWTOOLBAR_ASSEMBLE)); };
item.left.render_callback = GLToolbarItem::Default_Render_Callback;
item.visible = true;
item.visibility_callback = [this]()->bool { return true; };
@ -6751,22 +6730,22 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with
if (const BuildVolume &build_volume = m_bed.build_volume(); build_volume.valid()) {
switch (build_volume.type()) {
case BuildVolume::Type::Rectangle: {
case BuildVolume_Type::Rectangle: {
const BoundingBox3Base<Vec3d> bed_bb = build_volume.bounding_volume().inflated(BuildVolume::SceneEpsilon);
m_volumes.set_print_volume({ 0, // Rectangle
{ float(bed_bb.min.x()), float(bed_bb.min.y()), float(bed_bb.max.x()), float(bed_bb.max.y()) },
{ 0.0f, float(build_volume.printable_height()) } });
break;
}
case BuildVolume::Type::Circle: {
case BuildVolume_Type::Circle: {
m_volumes.set_print_volume({ 1, // Circle
{ unscaled<float>(build_volume.circle().center.x()), unscaled<float>(build_volume.circle().center.y()), unscaled<float>(build_volume.circle().radius + BuildVolume::SceneEpsilon), 0.0f },
{ 0.0f, float(build_volume.printable_height() + BuildVolume::SceneEpsilon) } });
break;
}
default:
case BuildVolume::Type::Convex:
case BuildVolume::Type::Custom: {
case BuildVolume_Type::Convex:
case BuildVolume_Type::Custom: {
m_volumes.set_print_volume({ static_cast<int>(type),
{ -FLT_MAX, -FLT_MAX, FLT_MAX, FLT_MAX },
{ -FLT_MAX, FLT_MAX } }
@ -8999,8 +8978,8 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
std::string objName2 = m_gcode_viewer.m_conflict_result.value()._objName2;
double height = m_gcode_viewer.m_conflict_result.value()._height;
int layer = m_gcode_viewer.m_conflict_result.value().layer;
text = (boost::format(_u8L("Conflicts of gcode paths have been found at layer %d. Please separate the conflicted objects farther (%s <-> %s).")) % (layer + 1) %
objName1 % objName2)
text = (boost::format(_u8L("Conflicts of gcode paths have been found at layer %d, z = %.2lf mm. Please separate the conflicted objects farther (%s <-> %s).")) % layer %
height % objName1 % objName2)
.str();
prevConflictText = text;
const PrintObject *obj2 = reinterpret_cast<const PrintObject *>(m_gcode_viewer.m_conflict_result.value()._obj2);

View file

@ -414,7 +414,6 @@ class GLCanvas3D
void render(const std::vector<const ModelInstance*>& sorted_instances) const;
};
class Tooltip
{
std::string m_text;
@ -597,7 +596,6 @@ private:
Labels m_labels;
Tooltip m_tooltip;
bool m_tooltip_enabled{ true };
Slope m_slope;
OrientSettings m_orient_settings_fff, m_orient_settings_sla;

View file

@ -516,9 +516,11 @@ bool GLTexture::generate_from_text(const std::string &text_str, wxFont &font, wx
// prepare buffer
std::vector<unsigned char> data(4 * m_width * m_height, 0);
const unsigned char* src = image.GetData();
//for debug use
//image.SaveFile(text_str+"_test.png", wxBITMAP_TYPE_PNG);
/* for debug use
std::ofstream fout;
fout.open(text_str+std::to_string(m_width)+"_"+std::to_string(m_height)+".rgb", std::ios::out);
fout.write((const char*)src, 3 * m_width * m_height);
fout.close();*/
for (int h = 0; h < m_height; ++h) {
unsigned char* dst = data.data() + 4 * h * m_width;
for (int w = 0; w < m_width; ++w) {

View file

@ -32,7 +32,6 @@ wxDEFINE_EVENT(EVT_GLTOOLBAR_PRINT_SELECT, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER_ALL, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_ADD, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_DELETE, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_DELETE_ALL, SimpleEvent);

View file

@ -32,7 +32,6 @@ wxDECLARE_EVENT(EVT_GLTOOLBAR_PRINT_SELECT, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER_ALL, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_ADD, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_DELETE, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_DELETE_ALL, SimpleEvent);

View file

@ -554,7 +554,7 @@ void desktop_open_any_folder( const std::string path )
#elif __APPLE__
openFolderForFile(from_u8(path));
#else
const char *argv[] = {"nautilus", path.data(), nullptr};
const char *argv[] = {"xdg-open", path.data(), nullptr};
// Check if we're running in an AppImage container, if so, we need to remove AppImage's env vars,
// because they may mess up the environment expected by the file manager.

View file

@ -188,7 +188,7 @@ bool is_associate_files(std::wstring extend)
wchar_t app_path[MAX_PATH];
::GetModuleFileNameW(nullptr, app_path, sizeof(app_path));
std::wstring prog_id = L" Bambu.Studio.1";
std::wstring prog_id = L" Orca.Slicer.1";
std::wstring reg_base = L"Software\\Classes";
std::wstring reg_extension = reg_base + L"\\." + extend;
@ -298,14 +298,13 @@ public:
memDc.SetTextForeground(StateColor::darkModeColorFor(wxColor(134, 134, 134)));
memDc.DrawLabel(m_constant_text.version, version_rect, wxALIGN_LEFT | wxALIGN_BOTTOM);
#if BBL_INTERNAL_TESTING
wxSize text_rect = memDc.GetTextExtent("Internal Version");
int start_x = (title_rect.GetLeft() + version_rect.GetRight()) / 2 - text_rect.GetWidth();
auto bs_version = wxString::Format("Based on BambuStudio and PrusaSlicer").ToStdString();
memDc.SetFont(Label::Body_12);
wxSize text_rect = memDc.GetTextExtent(bs_version);
int start_x = (title_rect.GetLeft() + version_rect.GetRight()) / 2 - text_rect.GetWidth()/2;
int start_y = version_rect.GetBottom() + 10;
wxRect internal_sign_rect(wxPoint(start_x, start_y), wxSize(text_rect));
memDc.SetFont(m_constant_text.title_font);
memDc.DrawLabel("Internal Version", internal_sign_rect, wxALIGN_TOP | wxALIGN_LEFT);
#endif
memDc.DrawLabel(bs_version, internal_sign_rect, wxALIGN_RIGHT);
// load bitmap for logo
BitmapCache bmp_cache;
@ -573,12 +572,11 @@ private:
title = wxGetApp().is_editor() ? SLIC3R_APP_FULL_NAME : GCODEVIEWER_APP_NAME;
// dynamically get the version to display
auto version_text = GUI_App::format_display_version();
#if BBL_INTERNAL_TESTING
version = _L("Internal Version") + " " + std::string(version_text);
#else
version = _L("Version") + " " + std::string(version_text);
#endif
// #if BBL_INTERNAL_TESTING
// version = _L("Internal Version") + " " + std::string(SLIC3R_VERSION);
// #else
// version = _L("") + " " + std::string(SoftFever_VERSION);
// #endif
// credits infornation
credits = title;
@ -738,7 +736,7 @@ static const FileWildcards file_wildcards_by_type[FT_SIZE] = {
/* FT_OBJ */ { "OBJ files"sv, { ".obj"sv } },
/* FT_AMF */ { "AMF files"sv, { ".amf"sv, ".zip.amf"sv, ".xml"sv } },
/* FT_3MF */ { "3MF files"sv, { ".3mf"sv } },
/* FT_GCODE */ { "G-code files"sv, { ".gcode"sv } },
/* FT_GCODE */ { "G-code files"sv, { ".gcode"sv, ".3mf"sv } },
/* FT_MODEL */ {"Supported files"sv, {".3mf"sv, ".stl"sv, ".stp"sv, ".step"sv, ".svg"sv, ".amf"sv, ".obj"sv }},
/* FT_PROJECT */ { "Project files"sv, { ".3mf"sv} },
/* FT_GALLERY */ { "Known files"sv, { ".stl"sv, ".obj"sv } },
@ -962,22 +960,22 @@ static void generic_exception_handle()
// and terminate the app so it is at least certain to happen now.
BOOST_LOG_TRIVIAL(error) << boost::format("std::bad_alloc exception: %1%") % ex.what();
flush_logs();
wxString errmsg = wxString::Format(_L("BambuStudio will terminate because of running out of memory."
wxString errmsg = wxString::Format(_L("OrcaSlicer will terminate because of running out of memory."
"It may be a bug. It will be appreciated if you report the issue to our team."));
wxMessageBox(errmsg + "\n\n" + wxString(ex.what()), _L("Fatal error"), wxOK | wxICON_ERROR);
std::terminate();
//throw;
} catch (const boost::io::bad_format_string& ex) {
BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what();
flush_logs();
wxString errmsg = _L("BambuStudio will terminate because of a localization error. "
BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what();
flush_logs();
wxString errmsg = _L("OrcaSlicer will terminate because of a localization error. "
"It will be appreciated if you report the specific scenario this issue happened.");
wxMessageBox(errmsg + "\n\n" + wxString(ex.what()), _L("Critical error"), wxOK | wxICON_ERROR);
std::terminate();
//throw;
} catch (const std::exception& ex) {
wxLogError(format_wxstr(_L("BambuStudio got an unhandled exception: %1%"), ex.what()));
wxLogError(format_wxstr(_L("OrcaSlicer got an unhandled exception: %1%"), ex.what()));
BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what();
flush_logs();
throw;
@ -1014,29 +1012,26 @@ void GUI_App::post_init()
bool switch_to_3d = false;
if (!this->init_params->input_files.empty()) {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", init with input files, size %1%, input_gcode %2%")
%this->init_params->input_files.size() %this->init_params->input_gcode;
if (this->init_params->input_files.size() == 1 &&
boost::starts_with(this->init_params->input_files.front(), "bambustudio://open")) {
std::string download_params_url = url_decode(this->init_params->input_files.front());
auto input_str_arr = split_str(download_params_url, "file=");
std::string download_url;
for (auto input_str : input_str_arr) {
if ( boost::starts_with(input_str, "http://") || boost::starts_with(input_str, "https://")) {
download_url = input_str;
}
boost::starts_with(this->init_params->input_files.front(), "orcaslicer://open")) {
auto input_str_arr = split_str(this->init_params->input_files.front(), "orcaslicer://open/?file=");
std::string download_origin_url;
for (auto input_str:input_str_arr) {
if (!input_str.empty()) download_origin_url = input_str;
}
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format("download_url %1%") % download_url;
if (!download_url.empty()) {
m_download_file_url = from_u8(download_url).ToStdString();
std::string download_file_url = url_decode(download_origin_url);
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << download_file_url;
if (!download_file_url.empty() && ( boost::starts_with(download_file_url, "http://") || boost::starts_with(download_file_url, "https://")) ) {
request_model_download(download_origin_url);
}
}
else {
switch_to_3d = true;
@ -1048,12 +1043,19 @@ void GUI_App::post_init()
else {
mainframe->select_tab(size_t(MainFrame::tp3DEditor));
plater_->select_view_3D("3D");
wxArrayString input_files;
for (auto & file : this->init_params->input_files) {
input_files.push_back(wxString::FromUTF8(file));
Plater::TakeSnapshot snapshot(this->plater(), "Load Project", UndoRedo::SnapshotType::ProjectSeparator);
const std::vector<size_t> res = this->plater()->load_files(this->init_params->input_files);
if (!res.empty()) {
if (this->init_params->input_files.size() == 1) {
// Update application titlebar when opening a project file
const std::string& filename = this->init_params->input_files.front();
this->plater()->up_to_date(true, false);
this->plater()->up_to_date(true, true);
//BBS: remove amf logic as project
if (boost::algorithm::iends_with(filename, ".3mf"))
this->plater()->set_project_filename(from_u8(filename));
}
}
this->plater()->set_project_filename(_L("Untitled"));
this->plater()->load_files(input_files);
}
}
}
@ -1153,39 +1155,10 @@ void GUI_App::post_init()
}
#endif
//BBS: check crash log
auto log_dir_path = boost::filesystem::path(data_dir()) / "log";
if (boost::filesystem::exists(log_dir_path))
{
boost::filesystem::directory_iterator end_iter;
for (boost::filesystem::directory_iterator iter(log_dir_path); iter != end_iter; ++iter)
{
std::string file_name = iter->path().stem().string();
if (boost::starts_with(file_name, "crash")) {
if (file_name.find("done") == std::string::npos) {
std::ifstream ifs(iter->path().string(), ios::in);
std::stringstream data;
data << ifs.rdbuf();
ifs.close();
NetworkAgent* agent = wxGetApp().getAgent();
json j;
j["time"] = file_name.substr(file_name.find("crash") + strlen("crash") + 1);
j["verion"] = std::string(SLIC3R_VERSION);
j["content"] = decode_path(data.str().c_str());
try {
if (agent) {
agent->track_event("studio_crash", j.dump());
}
}
catch (...) {}
std::string new_file_name = file_name.append("_done");
boost::filesystem::rename(iter->path(), iter->path().parent_path() / boost::filesystem::path(new_file_name + iter->path().extension().string()));
}
}
}
}
if (app_config->get("stealth_mode") == "false")
hms_query = new HMSQuery();
m_show_gcode_window = app_config->get("show_gcode_window") == "true";
if (m_networking_need_update) {
//updating networking
int ret = updating_bambu_networking();
@ -1215,17 +1188,17 @@ void GUI_App::post_init()
bool sys_preset = app_config->get("sync_system_preset") == "true";
this->preset_updater->sync(http_url, language, network_ver, sys_preset ? preset_bundle : nullptr);
//BBS: check new version
this->check_new_version();
//BBS: check privacy version
if (is_user_login()) {
this->check_privacy_version(0);
this->check_track_enable();
this->check_new_version_sf();
if (is_user_login() && app_config->get("stealth_mode") == "false") {
// this->check_privacy_version(0);
request_user_handle(0);
}
});
}
if (is_user_login())
request_user_handle(0);
if(!m_networking_need_update && m_agent) {
m_agent->set_on_ssdp_msg_fn(
[this](std::string json_str) {
@ -1316,11 +1289,10 @@ GUI_App::GUI_App()
, m_app_mode(EAppMode::Editor)
, m_em_unit(10)
, m_imgui(new ImGuiWrapper())
, hms_query(new HMSQuery())
, m_removable_drive_manager(std::make_unique<RemovableDriveManager>())
//, m_other_instance_message_handler(std::make_unique<OtherInstanceMessageHandler>())
{
//app config initializes early becasuse it is used in instance checking in BambuStudio.cpp
//app config initializes early becasuse it is used in instance checking in OrcaSlicer.cpp
this->init_app_config();
this->init_download_path();
@ -1454,9 +1426,6 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install
if (!app_config) {
j["result"] = "failed";
j["error_msg"] = "app_config is nullptr";
if (m_agent) {
m_agent->track_event("networkplugin_download", j.dump());
}
return -1;
}
@ -1528,9 +1497,6 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install
if (result < 0) {
j["result"] = "failed";
j["error_msg"] = err_msg;
if (m_agent) {
m_agent->track_event("networkplugin_download", j.dump());
}
if (pro_fn) pro_fn(InstallStatusDownloadFailed, 0, cancel);
return result;
}
@ -1541,9 +1507,6 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install
if (pro_fn) pro_fn(InstallStatusDownloadFailed, 0, cancel);
j["result"] = "failed";
j["error_msg"] = "[download_plugin 1]: no available plugin found for this app version: " + std::string(SLIC3R_VERSION);
if (m_agent) {
m_agent->track_event("networkplugin_download", j.dump());
}
return -1;
}
else if (pro_fn) {
@ -1554,9 +1517,6 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install
BOOST_LOG_TRIVIAL(info) << boost::format("[download_plugin 1]: %1%, cancelled by user") % __LINE__;
j["result"] = "failed";
j["error_msg"] = (boost::format("[download_plugin 1]: %1%, cancelled by user") % __LINE__).str();
if (m_agent) {
m_agent->track_event("networkplugin_download", j.dump());
}
return -1;
}
BOOST_LOG_TRIVIAL(info) << "[download_plugin] get_url = " << download_url;
@ -1605,9 +1565,6 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install
http.perform_sync();
j["result"] = result < 0 ? "failed" : "success";
j["error_msg"] = err_msg;
if (m_agent) {
m_agent->track_event("networkplugin_download", j.dump());
}
return result;
}
@ -2057,9 +2014,12 @@ static boost::optional<Semver> parse_semver_from_ini(std::string path)
std::stringstream buffer;
buffer << stream.rdbuf();
std::string body = buffer.str();
size_t start = body.find("BambuStudio ");
if (start == std::string::npos)
return boost::none;
size_t start = body.find("OrcaSlicer ");
if (start == std::string::npos) {
start = body.find("OrcaSlicer ");
if (start == std::string::npos)
return boost::none;
}
body = body.substr(start + 12);
size_t end = body.find_first_of(" \n");
if (end < body.size())
@ -2099,12 +2059,11 @@ void GUI_App::init_app_config()
// Mac : "~/Library/Application Support/Slic3r"
if (data_dir().empty()) {
boost::filesystem::path data_dir_path;
#ifndef __linux__
std::string data_dir = wxStandardPaths::Get().GetUserDataDir().ToUTF8().data();
//BBS create folder if not exists
boost::filesystem::path data_dir_path(data_dir);
if (!boost::filesystem::exists(data_dir_path))
boost::filesystem::create_directory(data_dir_path);
data_dir_path = boost::filesystem::path(data_dir);
set_data_dir(data_dir);
#else
// Since version 2.3, config dir on Linux is in ${XDG_CONFIG_HOME}.
@ -2113,10 +2072,19 @@ void GUI_App::init_app_config()
if (! wxGetEnv(wxS("XDG_CONFIG_HOME"), &dir) || dir.empty() )
dir = wxFileName::GetHomeDir() + wxS("/.config");
set_data_dir((dir + "/" + GetAppName()).ToUTF8().data());
boost::filesystem::path data_dir_path(data_dir());
if (!boost::filesystem::exists(data_dir_path))
boost::filesystem::create_directory(data_dir_path);
data_dir_path = boost::filesystem::path(data_dir());
#endif
if (!boost::filesystem::exists(data_dir_path)){
auto older_data_dir = data_dir_path.parent_path() / "BambuStudio-SoftFever";
if(boost::filesystem::exists(older_data_dir)){
copy_directory_recursively(older_data_dir,data_dir_path);
boost::system::error_code ec;
boost::filesystem::rename(data_dir_path / "BambuStudio.conf", data_dir_path / "OrcaSlicer.conf", ec);
boost::filesystem::rename(data_dir_path / "BambuStudio.conf.bak", data_dir_path / "OrcaSlicer.conf.bak", ec);
}
else
boost::filesystem::create_directory(data_dir_path);
}
} else {
m_datadir_redefined = true;
}
@ -2146,7 +2114,7 @@ void GUI_App::init_app_config()
if (!error.empty()) {
// Error while parsing config file. We'll customize the error message and rethrow to be displayed.
throw Slic3r::RuntimeError(
_u8L("BambuStudio configuration file may be corrupted and is not abled to be parsed."
_u8L("OrcaSlicer configuration file may be corrupted and is not abled to be parsed."
"Please delete the file and try again.") +
"\n\n" + app_config->config_path() + "\n\n" + error);
}
@ -2366,7 +2334,7 @@ bool GUI_App::on_init_inner()
RichMessageDialog
dlg(nullptr,
wxString::Format(_L("%s\nDo you want to continue?"), msg),
"BambuStudio", wxICON_QUESTION | wxYES_NO);
"OrcaSlicer", wxICON_QUESTION | wxYES_NO);
dlg.ShowCheckBox(_L("Remember my choice"));
if (dlg.ShowModal() != wxID_YES) return false;
@ -2440,8 +2408,9 @@ bool GUI_App::on_init_inner()
}
}
app_config->set("version", SLIC3R_VERSION);
app_config->save();
if(app_config->get("version") != SLIC3R_VERSION) {
app_config->set("version", SLIC3R_VERSION);
}
BBLSplashScreen * scrn = nullptr;
const bool show_splash_screen = true;
@ -2500,7 +2469,7 @@ bool GUI_App::on_init_inner()
/* wxString tips = wxString::Format(_L("Click to download new version in default browser: %s"), version_info.version_str);
DownloadDialog dialog(this->mainframe,
tips,
_L("New version of Bambu Studio"),
_L("New version of Orca Slicer"),
false,
wxCENTER | wxICON_INFORMATION);
@ -2548,7 +2517,7 @@ bool GUI_App::on_init_inner()
wxString tips = wxString::Format(_L("Click to download new version in default browser: %s"), version_str);
DownloadDialog dialog(this->mainframe,
tips,
_L("The Bambu Studio needs an upgrade"),
_L("The Orca Slicer needs an upgrade"),
false,
wxCENTER | wxICON_INFORMATION);
dialog.SetExtendedMessage(description_text);
@ -2721,14 +2690,12 @@ bool GUI_App::on_init_inner()
if (m_agent) {
json j = json::object();
m_agent->start_subscribe("app");
m_agent->track_event("mqtt_active", j.dump());
}
} else {
BOOST_LOG_TRIVIAL(info) << "studio is inactive, stop to subscribe";
if (m_agent) {
json j = json::object();
m_agent->stop_subscribe("app");
m_agent->track_event("mqtt_inactive", j.dump());
}
}
m_studio_active = curr_studio_active;
@ -2738,9 +2705,6 @@ bool GUI_App::on_init_inner()
if (! plater_)
return;
if (app_config->dirty())
app_config->save();
// BBS
//this->obj_manipul()->update_if_dirty();
@ -2764,10 +2728,11 @@ bool GUI_App::on_init_inner()
request_model_download(m_download_file_url);
m_download_file_url = "";
}
update_publish_status();
}
if (m_post_initialized && app_config->dirty())
app_config->save();
});
m_initialized = true;
@ -3089,7 +3054,7 @@ void GUI_App::UpdateDarkUI(wxWindow* window, bool highlited/* = false*/, bool ju
/*if (m_is_dark_mode != dark_mode() )
m_is_dark_mode = dark_mode();*/
if (m_is_dark_mode) {
auto original_col = window->GetBackgroundColour();
@ -3218,7 +3183,7 @@ void GUI_App::init_fonts()
// wxSYS_OEM_FIXED_FONT and wxSYS_ANSI_FIXED_FONT use the same as
// DEFAULT in wxGtk. Use the TELETYPE family as a work-around
m_code_font = wxFont(wxFontInfo().Family(wxFONTFAMILY_TELETYPE));
m_code_font.SetPointSize(m_normal_font.GetPointSize());
m_code_font.SetPointSize(m_small_font.GetPointSize());
}
void GUI_App::update_fonts(const MainFrame *main_frame)
@ -3235,7 +3200,7 @@ void GUI_App::update_fonts(const MainFrame *main_frame)
m_bold_font = m_normal_font.Bold();
m_link_font = m_bold_font.Underlined();
m_em_unit = main_frame->em_unit();
m_code_font.SetPointSize(m_normal_font.GetPointSize());
m_code_font.SetPointSize(m_small_font.GetPointSize());
}
void GUI_App::set_label_clr_modified(const wxColour& clr)
@ -3653,7 +3618,7 @@ void GUI_App::load_gcode(wxWindow* parent, wxString& input_file) const
{
input_file.Clear();
wxFileDialog dialog(parent ? parent : GetTopWindow(),
_L("Choose one file (gcode/.gco/.g/.ngc/ngc):"),
_L("Choose one file (gcode/3mf):"),
app_config->get_last_dir(), "",
file_wildcards(FT_GCODE), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
@ -4037,32 +4002,21 @@ void GUI_App::on_http_error(wxCommandEvent &evt)
wxString result;
if (status >= 400 && status < 500) {
try {
wxString body_str = evt.GetString();
bool found_json = false;
for (int i = 0; i < body_str.size(); i++) {
if (body_str[i] == '{') {
found_json = true;
break;
}
}
if (found_json) {
json j = json::parse(body_str);
if (j.contains("code")) {
if (!j["code"].is_null())
code = j["code"].get<int>();
}
if (j.contains("error")) {
if (!j["error"].is_null())
error = j["error"].get<std::string>();
}
}
json j = json::parse(evt.GetString());
if (j.contains("code")) {
if (!j["code"].is_null())
code = j["code"].get<int>();
}
if (j.contains("error"))
if (!j["error"].is_null())
error = j["error"].get<std::string>();
}
catch (...) {}
}
// Version limit
if (code == HttpErrorVersionLimited) {
MessageDialog msg_dlg(nullptr, _L("The version of Bambu studio is too low and needs to be updated to the latest version before it can be used normally"), "", wxAPPLY | wxOK);
MessageDialog msg_dlg(nullptr, _L("The version of Orca Slicer is too low and needs to be updated to the latest version before it can be used normally"), "", wxAPPLY | wxOK);
if (msg_dlg.ShowModal() == wxOK) {
return;
}
@ -4134,6 +4088,8 @@ void GUI_App::on_user_login_handle(wxCommandEvent &evt)
void GUI_App::check_track_enable()
{
// Orca: alaways disable track event
return;
if (app_config && app_config->get("firstguide", "privacyuse") == "true") {
//enable track event
json header_json;
@ -4150,9 +4106,6 @@ void GUI_App::check_track_enable()
/* record studio start event */
json j;
j["user_mode"] = this->get_mode_str();
if (m_agent) {
m_agent->track_event("studio_launch", j.dump());
}
}
}
@ -4268,6 +4221,108 @@ void GUI_App::check_new_version(bool show_tips, int by_user)
}).perform();
}
//parse the string, if it doesn't contain a valid version string, return invalid version.
Semver get_version(const std::string& str, const std::regex& regexp) {
std::smatch match;
if (std::regex_match(str, match, regexp)) {
std::string version_cleaned = match[0];
const boost::optional<Semver> version = Semver::parse(version_cleaned);
if (version.has_value()) {
return *version;
}
}
return Semver::invalid();
}
void GUI_App::check_new_version_sf(bool show_tips, int by_user)
{
AppConfig* app_config = wxGetApp().app_config;
auto version_check_url = app_config->version_check_url();
Http::get(version_check_url)
.on_error([&](std::string body, std::string error, unsigned http_status) {
(void)body;
BOOST_LOG_TRIVIAL(error) << format("Error getting: `%1%`: HTTP %2%, %3%", "check_new_version_sf", http_status,
error);
})
.timeout_connect(1)
.on_complete([&](std::string body, unsigned http_status) {
// Http response OK
if (http_status != 200)
return;
try {
boost::trim(body);
// SoftFever: parse github release, ported from SS
boost::property_tree::ptree root;
std::stringstream json_stream(body);
boost::property_tree::read_json(json_stream, root);
bool i_am_pre = false;
// at least two number, use '.' as separator. can be followed by -Az23 for prereleased and +Az42 for
// metadata
std::regex matcher("[0-9]+\\.[0-9]+(\\.[0-9]+)*(-[A-Za-z0-9]+)?(\\+[A-Za-z0-9]+)?");
Semver current_version = get_version(SoftFever_VERSION, matcher);
Semver best_pre(1, 0, 0);
Semver best_release(1, 0, 0);
std::string best_pre_url;
std::string best_release_url;
std::string best_release_content;
std::string best_pre_content;
const std::regex reg_num("([0-9]+)");
for (auto json_version : root) {
std::string tag = json_version.second.get<std::string>("tag_name");
if (tag[0] == 'v')
tag.erase(0, 1);
for (std::regex_iterator it = std::sregex_iterator(tag.begin(), tag.end(), reg_num);
it != std::sregex_iterator(); ++it) {
}
Semver tag_version = get_version(tag, matcher);
if (current_version == tag_version)
i_am_pre = json_version.second.get<bool>("prerelease");
if (json_version.second.get<bool>("prerelease")) {
if (best_pre < tag_version) {
best_pre = tag_version;
best_pre_url = json_version.second.get<std::string>("html_url");
best_pre_content = json_version.second.get<std::string>("body");
best_pre.set_prerelease("Preview");
}
} else {
if (best_release < tag_version) {
best_release = tag_version;
best_release_url = json_version.second.get<std::string>("html_url");
best_release_content = json_version.second.get<std::string>("body");
}
}
}
// if release is more recent than beta, use release anyway
if (best_pre < best_release) {
best_pre = best_release;
best_pre_url = best_release_url;
best_pre_content = best_release_content;
}
// if we're the most recent, don't do anything
if ((i_am_pre ? best_pre : best_release) <= current_version)
return;
// BOOST_LOG_TRIVIAL(info) << format("Got %1% online version: `%2%`. Sending to GUI thread...",
// SLIC3R_APP_NAME, i_am_pre ? best_pre.to_string(): best_release.to_string());
version_info.url = i_am_pre ? best_pre_url : best_release_url;
version_info.version_str = i_am_pre ? best_pre.to_string() : best_release.to_string_sf();
version_info.description = i_am_pre ? best_pre_content : best_release_content;
version_info.force_upgrade = false;
wxCommandEvent *evt = new wxCommandEvent(EVT_SLIC3R_VERSION_ONLINE);
evt->SetString((i_am_pre ? best_pre : best_release).to_string());
GUI::wxGetApp().QueueEvent(evt);
} catch (...) {
}
})
.perform();
}
//BBS pop up a dialog and download files
void GUI_App::request_new_version(int by_user)
@ -4301,12 +4356,10 @@ void GUI_App::show_check_privacy_dlg(wxCommandEvent& evt)
privacy_dlg.Bind(EVT_PRIVACY_UPDATE_CONFIRM, [this, online_login](wxCommandEvent &e) {
app_config->set("privacy_version", privacy_version_info.version_str);
app_config->set_bool("privacy_update_checked", true);
app_config->save();
request_user_handle(online_login);
});
privacy_dlg.Bind(EVT_PRIVACY_UPDATE_CANCEL, [this](wxCommandEvent &e) {
app_config->set_bool("privacy_update_checked", false);
app_config->save();
if (m_agent) {
m_agent->user_logout();
}
@ -4861,7 +4914,6 @@ bool GUI_App::select_language()
// m_wxLocale->GetCanonicalName()
// 3) new_language_info->CanonicalName is a safe bet. It points to a valid dictionary name.
app_config->set("language", new_language_info->CanonicalName.ToUTF8().data());
app_config->save();
return true;
}
}
@ -4937,7 +4989,7 @@ bool GUI_App::load_language(wxString language, bool initial)
}
if (language_info != nullptr && language_info->LayoutDirection == wxLayout_RightToLeft) {
BOOST_LOG_TRIVIAL(info) << boost::format("The following language code requires right to left layout, which is not supported by BambuStudio: %1%") % language_info->CanonicalName.ToUTF8().data();
BOOST_LOG_TRIVIAL(trace) << boost::format("The following language code requires right to left layout, which is not supported by OrcaSlicer: %1%") % language_info->CanonicalName.ToUTF8().data();
language_info = nullptr;
}
@ -4951,7 +5003,7 @@ bool GUI_App::load_language(wxString language, bool initial)
language_info = wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH_US);
}
BOOST_LOG_TRIVIAL(info) << boost::format("Switching wxLocales to %1%") % language_info->CanonicalName.ToUTF8().data();
BOOST_LOG_TRIVIAL(trace) << boost::format("Switching wxLocales to %1%") % language_info->CanonicalName.ToUTF8().data();
// Select language for locales. This language may be different from the language of the dictionary.
//if (language_info == m_language_info_best || language_info == m_language_info_system) {
@ -5022,14 +5074,14 @@ bool GUI_App::load_language(wxString language, bool initial)
if (! wxLocale::IsAvailable(language_info->Language)) {
// Loading the language dictionary failed.
wxString message = "Switching Bambu Studio to language " + language_info->CanonicalName + " failed.";
wxString message = "Switching Orca Slicer to language " + language_info->CanonicalName + " failed.";
#if !defined(_WIN32) && !defined(__APPLE__)
// likely some linux system
message += "\nYou may need to reconfigure the missing locales, likely by running the \"locale-gen\" and \"dpkg-reconfigure locales\" commands.\n";
#endif
if (initial)
message + "\n\nApplication will close.";
wxMessageBox(message, "Bambu Studio - Switching language failed", wxOK | wxICON_ERROR);
wxMessageBox(message, "Orca Slicer - Switching language failed", wxOK | wxICON_ERROR);
if (initial)
std::exit(EXIT_FAILURE);
else
@ -5096,7 +5148,6 @@ void GUI_App::save_mode(const /*ConfigOptionMode*/int mode)
mode == comSimple ? "simple" :
mode == comDevelop ? "develop" : "simple";
app_config->set("user_mode", mode_str);
app_config->save();
update_mode();
}
@ -5110,6 +5161,7 @@ void GUI_App::update_mode()
mainframe->m_param_panel->update_mode();
if (mainframe->m_param_dialog)
mainframe->m_param_dialog->panel()->update_mode();
mainframe->m_webview->update_mode();
#ifdef _MSW_DARK_MODE
if (!wxGetApp().tabs_as_menu())
@ -5682,7 +5734,7 @@ void GUI_App::OSXStoreOpenFiles(const wxArrayString &fileNames)
if (is_gcode_file(into_u8(filename)))
++ num_gcodes;
if (fileNames.size() == num_gcodes) {
// Opening PrusaSlicer by drag & dropping a G-Code onto BambuStudio icon in Finder,
// Opening PrusaSlicer by drag & dropping a G-Code onto OrcaSlicer icon in Finder,
// just G-codes were passed. Switch to G-code viewer mode.
m_app_mode = EAppMode::GCodeViewer;
unlock_lockfile(get_instance_hash_string() + ".lock", data_dir() + "/cache/");
@ -5698,8 +5750,8 @@ void GUI_App::MacOpenURL(const wxString& url)
{
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "get mac url " << url;
if (!url.empty() && boost::starts_with(url, "bambustudioopen://")) {
auto input_str_arr = split_str(url.ToStdString(), "bambustudioopen://");
if (!url.empty() && boost::starts_with(url, "orcasliceropen://")) {
auto input_str_arr = split_str(url.ToStdString(), "orcasliceropen://");
std::string download_origin_url;
for (auto input_str : input_str_arr) {
@ -6343,8 +6395,8 @@ void GUI_App::associate_files(std::wstring extend)
::GetModuleFileNameW(nullptr, app_path, sizeof(app_path));
std::wstring prog_path = L"\"" + std::wstring(app_path) + L"\"";
std::wstring prog_id = L" Bambu.Studio.1";
std::wstring prog_desc = L"BambuStudio";
std::wstring prog_id = L" Orca.Slicer.1";
std::wstring prog_desc = L"OrcaSlicer";
std::wstring prog_command = prog_path + L" \"%1\"";
std::wstring reg_base = L"Software\\Classes";
std::wstring reg_extension = reg_base + L"\\." + extend;
@ -6366,8 +6418,8 @@ void GUI_App::disassociate_files(std::wstring extend)
::GetModuleFileNameW(nullptr, app_path, sizeof(app_path));
std::wstring prog_path = L"\"" + std::wstring(app_path) + L"\"";
std::wstring prog_id = L" Bambu.Studio.1";
std::wstring prog_desc = L"BambuStudio";
std::wstring prog_id = L" Orca.Slicer.1";
std::wstring prog_desc = L"OrcaSlicer";
std::wstring prog_command = prog_path + L" \"%1\"";
std::wstring reg_base = L"Software\\Classes";
std::wstring reg_extension = reg_base + L"\\." + extend;

View file

@ -115,9 +115,9 @@ enum ConfigMenuIDs {
ConfigMenuCnt,
};
enum BambuStudioMenuIDs {
BambuStudioMenuAbout,
BambuStudioMenuPreferences,
enum OrcaSlicerMenuIDs {
OrcaSlicerMenuAbout,
OrcaSlicerMenuPreferences,
};
enum CameraMenuIDs {
@ -294,10 +294,10 @@ private:
bool m_side_popup_status{false};
wxString m_info_dialog_content;
HttpServer m_http_server;
bool m_show_gcode_window{true};
boost::thread m_check_network_thread;
public:
//try again when subscription fails
public:
//try again when subscription fails
void on_start_subscribe_again(std::string dev_id);
void check_filaments_in_blacklist(std::string tag_supplier, std::string tag_material, bool& in_blacklist, std::string& action, std::string& info);
std::string get_local_models_path();
@ -311,7 +311,6 @@ public:
//explicit GUI_App(EAppMode mode = EAppMode::Editor);
~GUI_App() override;
void show_message_box(std::string msg) { wxMessageBox(msg); }
EAppMode get_app_mode() const { return m_app_mode; }
Slic3r::DeviceManager* getDeviceManager() { return m_device_manager; }
@ -320,7 +319,12 @@ public:
bool is_editor() const { return m_app_mode == EAppMode::Editor; }
bool is_gcode_viewer() const { return m_app_mode == EAppMode::GCodeViewer; }
bool is_recreating_gui() const { return m_is_recreating_gui; }
std::string logo_name() const { return is_editor() ? "BambuStudio" : "BambuStudio-gcodeviewer"; }
std::string logo_name() const { return is_editor() ? "OrcaSlicer" : "OrcaSlicer-gcodeviewer"; }
// SoftFever
bool show_gcode_window() const { return m_show_gcode_window; }
void set_show_gcode_window(bool val) { m_show_gcode_window = val; }
wxString get_inf_dialog_contect () {return m_info_dialog_content;};
std::vector<std::string> split_str(std::string src, std::string separator);
@ -440,6 +444,7 @@ public:
void check_update(bool show_tips, int by_user);
void check_new_version(bool show_tips = false, int by_user = 0);
void check_new_version_sf(bool show_tips = false, int by_user = 0);
void request_new_version(int by_user);
void enter_force_upgrade();
void set_skip_version(bool skip = true);

View file

@ -74,9 +74,10 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
{
{ L("Quality"), {{"layer_height", "",1},
//{"initial_layer_print_height", "",2},
{"seam_position", "",2}, {"seam_gap", "",3}, {"wipe_speed", "",4},
{"slice_closing_radius", "",5}, {"resolution", "",6},
{"xy_hole_compensation", "",7}, {"xy_contour_compensation", "",8}, {"elefant_foot_compensation", "",9}
{"seam_position", "",2},
{"slice_closing_radius", "",3}, {"resolution", "",4},
{"xy_hole_compensation", "",5}, {"xy_contour_compensation", "",6}, {"elefant_foot_compensation", "",7},
{"make_overhang_printable_angle","", 8},{"make_overhang_printable_hole_size","",9}
}},
{ L("Support"), {{"brim_type", "",1},{"brim_width", "",2},{"brim_object_gap", "",3},
{"enable_support", "",4},{"support_type", "",5},{"support_threshold_angle", "",6},{"support_on_build_plate_only", "",7},
@ -92,16 +93,16 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::OBJECT_C
std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::PART_CATEGORY_SETTINGS=
{
{ L("Quality"), {{"ironing_type", "",8},{"ironing_flow", "",9},{"ironing_spacing", "",10},{"bridge_flow", "",11}
{ L("Quality"), {{"ironing_type", "",8},{"ironing_flow", "",9},{"ironing_spacing", "",10},{"bridge_flow", "",11},{"make_overhang_printable", "",11},{"bridge_density", "", 1}
}},
{ L("Strength"), {{"wall_loops", "",1},{"top_shell_layers", "",1},{"top_shell_thickness", "",1},
{"bottom_shell_layers", "",1}, {"bottom_shell_thickness", "",1}, {"sparse_infill_density", "",1},
{"sparse_infill_pattern", "",1},{"sparse_infill_anchor", "",1},{"sparse_infill_anchor_max", "",1}, {"top_surface_pattern", "",1},{"bottom_surface_pattern", "",1}, {"internal_solid_infill_pattern", "",1},
{"infill_combination", "",1}, {"infill_wall_overlap", "",1}, {"infill_direction", "",1}, {"bridge_angle", "",1},{"minimum_sparse_infill_area", "",1}
{ L("Strength"), {{"wall_loops", "",1},{"top_shell_layers", L("Top Solid Layers"),1},{"top_shell_thickness", L("Top Minimum Shell Thickness"),1},
{"bottom_shell_layers", L("Bottom Solid Layers"),1}, {"bottom_shell_thickness", L("Bottom Minimum Shell Thickness"),1},
{"sparse_infill_density", "",1},{"sparse_infill_pattern", "",1},{"infill_anchor", "",1},{"infill_anchor_max", "",1},{"top_surface_pattern", "",1},{"bottom_surface_pattern", "",1}, {"internal_solid_infill_pattern", "",1},
{"infill_combination", "",1}, {"infill_wall_overlap", "",1}, {"infill_direction", "",1}, {"bridge_angle", "",1}, {"minimum_sparse_infill_area", "",1}
}},
{ L("Speed"), {{"outer_wall_speed", "",1},{"inner_wall_speed", "",2},{"sparse_infill_speed", "",3},{"top_surface_speed", "",4}, {"internal_solid_infill_speed", "",5},
{"enable_overhang_speed", "",6}, {"overhang_1_4_speed", "",7}, {"overhang_2_4_speed", "",8}, {"overhang_3_4_speed", "",9}, {"overhang_4_4_speed", "",10},
{"bridge_speed", "",11}, {"gap_infill_speed", "",12}
{"enable_overhang_speed", "",6}, {"overhang_speed_classic", "",6}, {"overhang_1_4_speed", "",7}, {"overhang_2_4_speed", "",8}, {"overhang_3_4_speed", "",9}, {"overhang_4_4_speed", "",10},
{"bridge_speed", "",11}, {"gap_infill_speed", "",12}, {"internal_bridge_speed", "", 13}
}}
};
@ -141,7 +142,7 @@ std::vector<SimpleSettingData> SettingsFactory::get_visible_options(const std::s
//Quality
"layer_height", "initial_layer_print_height", "adaptive_layer_height", "seam_position", "xy_hole_compensation", "xy_contour_compensation", "elefant_foot_compensation", "support_line_width",
//Support
"enable_support", "support_type", "support_threshold_angle", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers","support_remove_small_overhang",
"enable_support", "support_type", "support_threshold_angle", "support_on_build_plate_only", "support_critical_regions_only", "enforce_support_layers",
//tree support
"tree_support_wall_count",
//support
@ -484,18 +485,38 @@ wxMenu* MenuFactory::append_submenu_add_generic(wxMenu* menu, ModelVolumeType ty
sub_menu->AppendSeparator();
}
for (auto &item : {L("Cube"), L("Cylinder"), L("Sphere"), L("Cone")})
{
append_menu_item(sub_menu, wxID_ANY, _(item), "",
[type, item](wxCommandEvent&) { obj_list()->load_generic_subobject(item, type); }, "", menu);
for (auto &item : {L("Orca Cube"), L("3DBenchy"), L("Autodesk FDM Test"),
L("Voron Cube")}) {
append_menu_item(
sub_menu, wxID_ANY, _(item), "",
[type, item](wxCommandEvent &) {
std::vector<boost::filesystem::path> input_files;
std::string file_name = item;
if (file_name == L("Orca Cube"))
file_name = "OrcaCube_v2.3mf";
else if (file_name == L("3DBenchy"))
file_name = "3DBenchy.stl";
else if (file_name == L("Autodesk FDM Test"))
file_name = "ksr_fdmtest_v4.stl";
else if (file_name == L("Voron Cube"))
file_name = "Voron_Design_Cube_v7.stl";
else
return;
input_files.push_back(
(boost::filesystem::path(Slic3r::resources_dir()) /
"handy_models" / file_name));
plater()->load_files(input_files, LoadStrategy::LoadModel);
},
"", menu);
}
if (type == ModelVolumeType::INVALID) {
sub_menu->AppendSeparator();
for (auto &item : {L("Bambu Cube"), L("Bambu Cube V2"), L("3DBenchy"), L("ksr FDMTest")}) {
append_menu_item(
sub_menu, wxID_ANY, _(item), "", [type, item](wxCommandEvent &) { obj_list()->load_generic_subobject(item, type); }, "", menu);
}
sub_menu->AppendSeparator();
for (auto &item : {L("Cube"), L("Cylinder"), L("Sphere"), L("Cone")}) {
append_menu_item(
sub_menu, wxID_ANY, _(item), "",
[type, item](wxCommandEvent &) {
obj_list()->load_generic_subobject(item, type);
},
"", menu);
}
return sub_menu;
@ -636,6 +657,13 @@ wxMenuItem* MenuFactory::append_menu_item_instance_to_object(wxMenu* menu)
return menu_item;
}
void MenuFactory::append_menu_item_fill_bed(wxMenu *menu)
{
append_menu_item(
menu, wxID_ANY, _L("Fill bed with copies"), _L("Fill the remaining area of bed with copies of the selected object"),
[](wxCommandEvent &) { plater()->fill_bed_with_instances(); }, "", nullptr, []() { return plater()->can_increase_instances(); }, m_parent);
}
wxMenuItem* MenuFactory::append_menu_item_printable(wxMenu* menu)
{
// BBS: to be checked
@ -1041,7 +1069,7 @@ void MenuFactory::create_object_menu()
// "Add (volumes)" popupmenu will be added later in append_menu_items_add_volume()
}
void MenuFactory::create_bbl_object_menu()
void MenuFactory::create_extra_object_menu()
{
append_menu_item_fill_bed(&m_object_menu);
// Object Clone
@ -1266,7 +1294,7 @@ void MenuFactory::init(wxWindow* parent)
create_sla_object_menu();
//create_part_menu();
create_bbl_object_menu();
create_extra_object_menu();
create_bbl_part_menu();
create_bbl_assemble_object_menu();
create_bbl_assemble_part_menu();
@ -1383,6 +1411,8 @@ wxMenu* MenuFactory::multi_selection_menu()
append_submenu(menu, split_menu, wxID_ANY, _L("Split"), _L("Split the selected object"), "",
[]() { return plater()->can_split(true); }, m_parent);
}
menu->AppendSeparator();
append_menu_item_change_filament(menu);
}
return menu;
}
@ -1658,12 +1688,6 @@ void MenuFactory::append_menu_item_locked(wxMenu* menu)
}, item->GetId());
}
void MenuFactory::append_menu_item_fill_bed(wxMenu *menu)
{
append_menu_item(
menu, wxID_ANY, _L("Fill bed with copies"), _L("Fill the remaining area of bed with copies of the selected object"),
[](wxCommandEvent &) { plater()->fill_bed_with_instances(); }, "", nullptr, []() { return plater()->can_increase_instances(); }, m_parent);
}
void MenuFactory::append_menu_item_plate_name(wxMenu *menu)
{
wxString name= _L("Edit Plate Name");

View file

@ -108,7 +108,7 @@ private:
//BBS: add part plate related logic
void create_plate_menu();
//BBS: add bbl object menu
void create_bbl_object_menu();
void create_extra_object_menu();
void create_bbl_part_menu();
void create_bbl_assemble_object_menu();
void create_bbl_assemble_part_menu();

View file

@ -1272,7 +1272,7 @@ void ObjectList::show_context_menu(const bool evt_context_menu)
const auto item = GetSelection();
if (item)
{
const ItemType type = m_objects_model->GetItemType(item);
const ItemType type = m_objects_model->GetItemType(item);
if (!(type & (itPlate | itObject | itVolume | itInstance)))
return;
@ -2020,32 +2020,24 @@ static TriangleMesh create_mesh(const std::string& type_name, const BoundingBoxf
{
const double side = wxGetApp().plater()->canvas3D()->get_size_proportional_to_max_bed_size(0.1);
TriangleMesh mesh;
indexed_triangle_set mesh;
if (type_name == "Cube")
// Sitting on the print bed, left front front corner at (0, 0).
mesh = TriangleMesh(its_make_cube(side, side, side));
mesh = its_make_cube(side, side, side);
else if (type_name == "Cylinder")
// Centered around 0, sitting on the print bed.
// The cylinder has the same volume as the box above.
mesh = TriangleMesh(its_make_cylinder(0.5 * side, side));
mesh = its_make_cylinder(0.5 * side, side);
else if (type_name == "Sphere")
// Centered around 0, half the sphere below the print bed, half above.
// The sphere has the same volume as the box above.
mesh = TriangleMesh(its_make_sphere(0.5 * side, PI / 18));
mesh = its_make_sphere(0.5 * side, PI / 18);
else if (type_name == "Slab")
// Sitting on the print bed, left front front corner at (0, 0).
mesh = TriangleMesh(its_make_cube(bb.size().x() * 1.5, bb.size().y() * 1.5, bb.size().z() * 0.5));
mesh = its_make_cube(bb.size().x() * 1.5, bb.size().y() * 1.5, bb.size().z() * 0.5);
else if (type_name == "Cone")
mesh = TriangleMesh(its_make_cone(0.5 * side, side));
else if (type_name == "Bambu Cube")
mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/Bambu_Cube.stl").c_str(), true, nullptr);
else if (type_name == "Bambu Cube V2")
mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/Bambu_Cube_V2.stl").c_str(), true, nullptr);
else if (type_name == "3DBenchy")
mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/3DBenchy.stl").c_str(), true, nullptr);
else if (type_name == "ksr FDMTest")
mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/ksr_FDMTest.stl").c_str(), true, nullptr);
return mesh;
mesh = its_make_cone(0.5 * side, side);
return TriangleMesh(mesh);
}
void ObjectList::load_generic_subobject(const std::string& type_name, const ModelVolumeType type)
@ -3611,7 +3603,6 @@ void ObjectList::update_info_items(size_t obj_idx, wxDataViewItemArray* selectio
}
}
void ObjectList::add_objects_to_list(std::vector<size_t> obj_idxs, bool call_selection_changed, bool notify_partplate, bool do_info_update)
{
#ifdef __WXOSX__
@ -3625,6 +3616,7 @@ void ObjectList::add_objects_to_list(std::vector<size_t> obj_idxs, bool call_sel
#endif
}
void ObjectList::add_object_to_list(size_t obj_idx, bool call_selection_changed, bool notify_partplate, bool do_info_update)
{
auto model_object = (*m_objects)[obj_idx];

View file

@ -358,7 +358,7 @@ void ObjectSettings::update_config_values(ModelConfig* config)
ConfigManipulation config_manipulation(load_config, toggle_field, nullptr, nullptr, &(config->get()));
// BBS: whether the preset is Bambu Lab printer
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
bool is_BBL_printer = preset_bundle.printers.get_edited_preset().is_bbl_vendor_preset(&preset_bundle);
bool is_BBL_printer = preset_bundle.printers.get_edited_preset().has_lidar(&preset_bundle);
config_manipulation.set_is_BBL_Printer(is_BBL_printer);
if (!is_object_settings)

View file

@ -1874,6 +1874,7 @@ void ObjectGridTable::init_cols(ObjectGrid *object_grid)
col = new ObjectGridCol(coBool, "support_reset", L("Support"), true, true, false, false, wxALIGN_CENTRE);
m_col_data.push_back(col);
// orca merge todo:
//Bed Adhesion
col = new ObjectGridCol(coEnum, "brim_type", L("Support"), true, false, true, true, wxALIGN_LEFT);
col->size = object_grid->GetTextExtent(L("Auto Brim")).x + 8; //add 8 for border

View file

@ -298,7 +298,8 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
ConfigManipulation config_manipulation(nullptr, toggle_field, toggle_line, nullptr, &m_current_config);
// BBS: whether the preset is Bambu Lab printer
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
bool is_BBL_printer = preset_bundle.printers.get_edited_preset().is_bbl_vendor_preset(&preset_bundle);
bool is_BBL_printer = preset_bundle.printers.get_edited_preset().has_lidar(&preset_bundle);
// orca merge todo:
config_manipulation.set_is_BBL_Printer(is_BBL_printer);
printer_technology == ptFFF ? config_manipulation.toggle_print_fff_options(&m_current_config) :
@ -403,7 +404,7 @@ void ObjectTableSettings::update_config_values(bool is_object, ModelObject* obje
ConfigManipulation config_manipulation(nullptr, toggle_field, toggle_line, nullptr, &m_current_config);
// BBS: whether the preset is Bambu Lab printer
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
bool is_BBL_printer = preset_bundle.printers.get_edited_preset().is_bbl_vendor_preset(&preset_bundle);
bool is_BBL_printer = preset_bundle.printers.get_edited_preset().has_lidar(&preset_bundle);
config_manipulation.set_is_BBL_Printer(is_BBL_printer);
printer_technology == ptFFF ? config_manipulation.update_print_fff_config(&main_config) :

View file

@ -132,7 +132,7 @@ void GLGizmoMeshBoolean::on_render()
}
float src_color[3] = { 1.0f, 1.0f, 1.0f };
float tool_color[3] = { 0.0f, 174.0f / 255.0f, 66.0f / 255.0f };
float tool_color[3] = { 0.0f, 150.0f / 255.0f, 136.0f / 255.0f };
m_parent.get_selection().render_bounding_box(src_bb, src_color, m_parent.get_scale());
m_parent.get_selection().render_bounding_box(tool_bb, tool_color, m_parent.get_scale());
}
@ -179,12 +179,17 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
GizmoImguiSetNextWIndowPos(x, y, ImGuiCond_Always, 0.0f, 0.0f);
GizmoImguiBegin("MeshBoolean", ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar);
const int max_tab_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(_L("Union").c_str()).x,
std::max(ImGui::CalcTextSize(_L("Difference").c_str()).x, ImGui::CalcTextSize(_L("Intersection").c_str()).x));
const int max_cap_length = ImGui::GetStyle().WindowPadding.x + ImGui::GetStyle().ItemSpacing.x + std::max(ImGui::CalcTextSize(_L("Source Volume").c_str()).x, ImGui::CalcTextSize(_L("Tool Volume").c_str()).x);
const int select_btn_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(("1 " + _L("selected")).c_str()).x, ImGui::CalcTextSize(_L("Select").c_str()).x);
const int max_tab_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(_u8L("Union").c_str()).x,
std::max(ImGui::CalcTextSize(_u8L("Difference").c_str()).x, ImGui::CalcTextSize(_u8L("Intersection").c_str()).x));
const int max_cap_length = ImGui::GetStyle().WindowPadding.x + ImGui::GetStyle().ItemSpacing.x +
std::max({ImGui::CalcTextSize(_u8L("Source Volume").c_str()).x,
ImGui::CalcTextSize(_u8L("Tool Volume").c_str()).x,
ImGui::CalcTextSize(_u8L("Subtract from").c_str()).x,
ImGui::CalcTextSize(_u8L("Subtract with").c_str()).x});
auto selectable = [this](const wxString& label, bool selected, const ImVec2& size_arg) {
const int select_btn_length = 2 * ImGui::GetStyle().FramePadding.x + std::max(ImGui::CalcTextSize(("1 " + _u8L("selected")).c_str()).x, ImGui::CalcTextSize(_u8L("Select").c_str()).x);
auto selectable = [this](const std::string& label, bool selected, const ImVec2& size_arg) {
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 0,0 });
ImGuiWindow* window = ImGui::GetCurrentWindow();
@ -195,13 +200,13 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
if (selected || hovered) {
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.0f));
ImGui::PushStyleColor(ImGuiCol_Button, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_Button, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
}
else {
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 174.0f / 255.0f, 66.0f / 255.0f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 150.0f / 255.0f, 136.0f / 255.0f, 1.0f });
}
bool res = ImGui::Button(label.c_str(), size_arg);
@ -240,15 +245,15 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
};
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0);
if (selectable(_L("Union").c_str(), m_operation_mode == MeshBooleanOperation::Union, ImVec2(max_tab_length, 0.0f))) {
if (selectable(_u8L("Union"), m_operation_mode == MeshBooleanOperation::Union, ImVec2(max_tab_length, 0.0f))) {
m_operation_mode = MeshBooleanOperation::Union;
}
ImGui::SameLine(0, 0);
if (selectable(_L("Difference").c_str(), m_operation_mode == MeshBooleanOperation::Difference, ImVec2(max_tab_length, 0.0f))) {
if (selectable(_u8L("Difference"), m_operation_mode == MeshBooleanOperation::Difference, ImVec2(max_tab_length, 0.0f))) {
m_operation_mode = MeshBooleanOperation::Difference;
}
ImGui::SameLine(0, 0);
if (selectable(_L("Intersection").c_str(), m_operation_mode == MeshBooleanOperation::Intersection, ImVec2(max_tab_length, 0.0f))) {
if (selectable(_u8L("Intersection"), m_operation_mode == MeshBooleanOperation::Intersection, ImVec2(max_tab_length, 0.0f))) {
m_operation_mode = MeshBooleanOperation::Intersection;
}
ImGui::PopStyleVar();
@ -257,10 +262,10 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
std::string cap_str1 = m_operation_mode != MeshBooleanOperation::Difference ? _u8L("Part 1") : _u8L("Subtract from");
m_imgui->text(cap_str1);
ImGui::SameLine(max_cap_length);
wxString select_src_str = m_src.mv ? "1 " + _L("selected") : _L("Select");
select_src_str << "##select_source_volume";
std::string select_src_str = m_src.mv ? "1 " + _u8L("selected") : _u8L("Select");
select_src_str += "##select_source_volume";
ImGui::PushItemWidth(select_btn_length);
if (selectable(select_src_str.c_str(), m_selecting_state == MeshBooleanSelectingState::SelectSource, ImVec2(select_btn_length, 0)))
if (selectable(select_src_str, m_selecting_state == MeshBooleanSelectingState::SelectSource, ImVec2(select_btn_length, 0)))
m_selecting_state = MeshBooleanSelectingState::SelectSource;
ImGui::PopItemWidth();
if (m_src.mv) {
@ -285,10 +290,10 @@ void GLGizmoMeshBoolean::on_render_input_window(float x, float y, float bottom_l
std::string cap_str2 = m_operation_mode != MeshBooleanOperation::Difference ? _u8L("Part 2") : _u8L("Subtract with");
m_imgui->text(cap_str2);
ImGui::SameLine(max_cap_length);
wxString select_tool_str = m_tool.mv ? "1 " + _L("selected") : _L("Select");
select_tool_str << "##select_tool_volume";
std::string select_tool_str = m_tool.mv ? "1 " + _u8L("selected") : _u8L("Select");
select_tool_str += "##select_tool_volume";
ImGui::PushItemWidth(select_btn_length);
if (selectable(select_tool_str.c_str(), m_selecting_state == MeshBooleanSelectingState::SelectTool, ImVec2(select_btn_length, 0)))
if (selectable(select_tool_str, m_selecting_state == MeshBooleanSelectingState::SelectTool, ImVec2(select_btn_length, 0)))
m_selecting_state = MeshBooleanSelectingState::SelectTool;
ImGui::PopItemWidth();
if (m_tool.mv) {

View file

@ -498,7 +498,9 @@ void ArrangeJob::process()
auto& print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
const Slic3r::DynamicPrintConfig& global_config = wxGetApp().preset_bundle->full_config();
if (params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
const bool has_lidar = preset_bundle->printers.get_edited_preset().has_lidar(preset_bundle);
if (has_lidar && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES);
update_arrange_params(params, *m_plater, m_selected);
@ -736,7 +738,7 @@ arrangement::ArrangeParams init_arrange_params(Plater *p)
params.clearance_height_to_rod = print.config().extruder_clearance_height_to_rod.value;
params.clearance_height_to_lid = print.config().extruder_clearance_height_to_lid.value;
params.cleareance_radius = print.config().extruder_clearance_max_radius.value;
params.cleareance_radius = print.config().extruder_clearance_radius.value;
params.printable_height = print.config().printable_height.value;
params.allow_rotations = settings.enable_rotation;
params.allow_multi_materials_on_same_plate = settings.allow_multi_materials_on_same_plate;

View file

@ -211,7 +211,9 @@ void FillBedJob::process()
auto &partplate_list = m_plater->get_partplate_list();
auto &print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
const Slic3r::DynamicPrintConfig& global_config = wxGetApp().preset_bundle->full_config();
if (params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
const bool has_lidar = preset_bundle->printers.get_edited_preset().has_lidar(preset_bundle);
if (has_lidar && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES);
update_selected_items_inflation(m_selected, *m_plater, params);
@ -231,7 +233,7 @@ void FillBedJob::process()
do_stop = ap.bed_idx > 0 && ap.priority == 0;
};
// final align用的是凸包在有fixed item的情况下可能找到的参考点位置是错的这里就不做了。见STUDIO-3265
params.do_final_align = false;
params.do_final_align = !has_lidar;
arrangement::arrange(m_selected, m_unselected, m_bedpts, params);

View file

@ -12,6 +12,7 @@
//#include <wx/glcanvas.h>
#include <wx/filename.h>
#include <wx/debug.h>
#include <wx/utils.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/log/trivial.hpp>
@ -92,10 +93,10 @@ enum class ERescaleTarget
};
#ifdef __APPLE__
class BambuStudioTaskBarIcon : public wxTaskBarIcon
class OrcaSlicerTaskBarIcon : public wxTaskBarIcon
{
public:
BambuStudioTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE) : wxTaskBarIcon(iconType) {}
OrcaSlicerTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE) : wxTaskBarIcon(iconType) {}
wxMenu *CreatePopupMenu() override {
wxMenu *menu = new wxMenu;
//if (wxGetApp().app_config->get("single_instance") == "false") {
@ -146,7 +147,7 @@ static wxIcon main_frame_icon(GUI_App::EAppMode app_mode)
}
return wxIcon(path, wxBITMAP_TYPE_ICO);
#else // _WIN32
return wxIcon(Slic3r::var("BambuStudio_128px.png"), wxBITMAP_TYPE_PNG);
return wxIcon(Slic3r::var("OrcaSlicer_128px.png"), wxBITMAP_TYPE_PNG);
#endif // _WIN32
}
@ -243,8 +244,8 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
switch (wxGetApp().get_app_mode()) {
default:
case GUI_App::EAppMode::Editor:
m_taskbar_icon = std::make_unique<BambuStudioTaskBarIcon>(wxTBI_DOCK);
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("BambuStudio-mac_256px.ico"), wxBITMAP_TYPE_ICO), "BambuStudio");
m_taskbar_icon = std::make_unique<OrcaSlicerTaskBarIcon>(wxTBI_DOCK);
m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("OrcaSlicer-mac_256px.ico"), wxBITMAP_TYPE_ICO), "OrcaSlicer");
break;
case GUI_App::EAppMode::GCodeViewer:
break;
@ -380,7 +381,6 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
update_layout();
sizer->SetSizeHints(this);
// BBS: fix taskbar overlay on windows
#ifdef WIN32
auto setMaxSize = [this]() {
wxDisplay display(this);
@ -470,56 +470,6 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
//}
#endif
try {
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent) {
json j;
std::string value;
agent->track_get_property("auto_orient", value);
j["auto_orient"] = value;
value = "";
agent->track_get_property("auto_arrange", value);
j["auto_arrange"] = value;
value = "";
agent->track_get_property("split_to_object", value);
j["split_to_object"] = value;
value = "";
agent->track_get_property("split_to_part", value);
j["split_to_part"] = value;
value = "";
agent->track_get_property("custom_height", value);
j["custom_height"] = value;
value = "";
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Move), value);
j["move"] = value;
value = "";
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Rotate), value);
j["rotate"] = value;
value = "";
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Scale), value);
j["scale"] = value;
value = "";
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Flatten), value);
j["flatten"] = value;
value = "";
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::FdmSupports), value);
j["custom_support"] = value;
value = "";
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Seam), value);
j["custom_seam"] = value;
value = "";
agent->track_get_property(get_name_from_gizmo_etype(GLGizmosManager::EType::Text), value);
j["text_shape"] = value;
value = "";
agent->track_get_property("custom_painting", value);
j["custom_painting"] = value;
agent->track_event("key_func", j.dump());
}
}
catch (...) {}
MarkdownTip::ExitTip();
m_plater->reset();
@ -606,7 +556,11 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
m_print_enable = get_enable_print_status();
m_print_btn->Enable(m_print_enable);
if (m_print_enable) {
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_PRINT_PLATE));
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
if (preset_bundle.printers.get_edited_preset().has_lidar(&preset_bundle))
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_PRINT_PLATE));
else
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SEND_GCODE));
}
evt.Skip();
return;
@ -891,7 +845,8 @@ void MainFrame::shutdown()
//wxGetApp().other_instance_message_handler()->shutdown(this);
// Save the slic3r.ini.Usually the ini file is saved from "on idle" callback,
// but in rare cases it may not have been called yet.
wxGetApp().app_config->save();
if(wxGetApp().app_config->dirty())
wxGetApp().app_config->save();
// if (m_plater)
// m_plater->print = undef;
// Slic3r::GUI::deregister_on_request_update_callback();
@ -977,13 +932,13 @@ void MainFrame::show_option(bool show)
}
}
void MainFrame::init_tabpanel()
{
// wxNB_NOPAGETHEME: Disable Windows Vista theme for the Notebook background. The theme performance is terrible on Windows 10
// with multiple high resolution displays connected.
// BBS
wxBoxSizer* side_tools = create_side_tools();
m_tabpanel = new Notebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, side_tools, wxNB_TOP | wxTAB_TRAVERSAL | wxNB_NOPAGETHEME);
void MainFrame::init_tabpanel() {
// wxNB_NOPAGETHEME: Disable Windows Vista theme for the Notebook background. The theme performance is terrible on
// Windows 10 with multiple high resolution displays connected.
// BBS
wxBoxSizer *side_tools = create_side_tools();
m_tabpanel = new Notebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, side_tools,
wxNB_TOP | wxTAB_TRAVERSAL | wxNB_NOPAGETHEME);
m_tabpanel->SetBackgroundColour(*wxWHITE);
#ifndef __WXOSX__ // Don't call SetFont under OSX to avoid name cutting in ObjectList
@ -992,40 +947,32 @@ void MainFrame::init_tabpanel()
m_tabpanel->Hide();
m_settings_dialog.set_tabpanel(m_tabpanel);
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGING, [this](wxBookCtrlEvent& e) {
int old_sel = e.GetOldSelection();
int new_sel = e.GetSelection();
if (wxGetApp().preset_bundle &&
wxGetApp().preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(wxGetApp().preset_bundle) &&
new_sel == tpMonitor) {
if (!wxGetApp().getAgent()) {
e.Veto();
BOOST_LOG_TRIVIAL(info) << boost::format("skipped tab switch from %1% to %2%, lack of network plugins") %
old_sel % new_sel;
if (m_plater) {
wxCommandEvent* evt = new wxCommandEvent(EVT_INSTALL_PLUGIN_HINT);
wxQueueEvent(m_plater, evt);
}
}
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGING, [this](wxBookCtrlEvent &e) {
int old_sel = e.GetOldSelection();
int new_sel = e.GetSelection();
if (wxGetApp().preset_bundle &&
wxGetApp().preset_bundle->printers.get_edited_preset().has_lidar(wxGetApp().preset_bundle) &&
new_sel == tpMonitor) {
if (!wxGetApp().getAgent()) {
e.Veto();
BOOST_LOG_TRIVIAL(info) << boost::format("skipped tab switch from %1% to %2%, lack of network plugins") %
old_sel % new_sel;
if (m_plater) {
wxCommandEvent *evt = new wxCommandEvent(EVT_INSTALL_PLUGIN_HINT);
wxQueueEvent(m_plater, evt);
}
}
else {
if (new_sel == tpMonitor && wxGetApp().preset_bundle != nullptr) {
auto cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config;
wxString url;
if (cfg.has("print_host_webui") && !cfg.opt_string("print_host_webui").empty()) {
url = cfg.opt_string("print_host_webui");
} else if (cfg.has("print_host") && !cfg.opt_string("print_host").empty()) {
url = cfg.opt_string("print_host");
}
else {
;
}
if (url.empty()) {
wxString url = wxString::Format("file://%s/web/device/missing_connection.html", from_u8(resources_dir()));
m_printer_view->load_url(url);
}
}
} else {
if (new_sel == tpMonitor && wxGetApp().preset_bundle != nullptr) {
auto cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config;
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host")
: cfg.opt_string("print_host_webui");
if (url.empty()) {
wxString url = wxString::Format("file://%s/web/orca/missing_connection.html", from_u8(resources_dir()));
m_printer_view->load_url(url);
}
}
}
});
#ifdef __WXMSW__
@ -1138,35 +1085,31 @@ void MainFrame::init_tabpanel()
}
}
// OrcaSlicer
// SoftFever
void MainFrame::show_device(bool bBBLPrinter) {
if (m_tabpanel->GetPage(tpMonitor) != m_monitor &&
m_tabpanel->GetPage(tpMonitor) != m_printer_view) {
if (m_tabpanel->GetPage(3) != m_monitor &&
m_tabpanel->GetPage(3) != m_printer_view) {
BOOST_LOG_TRIVIAL(error) << "Failed to find device tab";
return;
}
if (bBBLPrinter) {
if (m_tabpanel->GetPage(tpMonitor) != m_monitor) {
m_printer_view->Hide();
m_monitor->Show(true);
m_tabpanel->RemovePage(tpMonitor);
m_tabpanel->InsertPage(tpMonitor, m_monitor, _L("Device"),
if (m_tabpanel->GetPage(3) != m_monitor) {
m_tabpanel->RemovePage(3);
m_tabpanel->InsertPage(3, m_monitor, _L("Device"),
std::string("tab_monitor_active"),
std::string("tab_monitor_active"));
m_tabpanel->SetSelection(tp3DEditor);
}
} else {
if (m_tabpanel->GetPage(tpMonitor) != m_printer_view) {
m_printer_view->Show();
m_monitor->Show(false);
m_tabpanel->RemovePage(tpMonitor);
m_tabpanel->InsertPage(tpMonitor, m_printer_view, _L("Device"),
if (m_tabpanel->GetPage(3) != m_printer_view) {
m_tabpanel->RemovePage(3);
m_tabpanel->InsertPage(3, m_printer_view, _L("Device"),
std::string("tab_monitor_active"),
std::string("tab_monitor_active"));
m_tabpanel->SetSelection(tp3DEditor);
m_printer_view->Show();
}
}
}
@ -1549,8 +1492,6 @@ wxBoxSizer* MainFrame::create_side_tools()
// record
json j;
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent)
agent->track_event("enter_model_mall", j.dump());
});
});
@ -1634,7 +1575,7 @@ wxBoxSizer* MainFrame::create_side_tools()
SidePopup* p = new SidePopup(this);
if (wxGetApp().preset_bundle
&& !wxGetApp().preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(wxGetApp().preset_bundle)) {
&& !wxGetApp().preset_bundle->printers.get_edited_preset().has_lidar(wxGetApp().preset_bundle)) {
// ThirdParty Buttons
SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), "");
export_gcode_btn->SetCornerRadius(0);
@ -1659,24 +1600,11 @@ wxBoxSizer* MainFrame::create_side_tools()
p->Dismiss();
});
// upload only
/*SideButton* upload_gcode_btn = new SideButton(p, _L("Send"), "");
upload_gcode_btn->SetCornerRadius(0);
upload_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
m_print_btn->SetLabel(_L("Send"));
m_print_select = eUploadGcode;
m_print_enable = get_enable_print_status();
m_print_btn->Enable(m_print_enable);
this->Layout();
p->Dismiss();
});*/
p->append_button(send_gcode_btn);
//p->append_button(upload_gcode_btn);
p->append_button(export_gcode_btn);
}
else {
//Bambu Studio Buttons
//Orca Slicer Buttons
SideButton* print_plate_btn = new SideButton(p, _L("Print plate"), "");
print_plate_btn->SetCornerRadius(0);
@ -1747,12 +1675,23 @@ wxBoxSizer* MainFrame::create_side_tools()
p->Dismiss();
});
SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), "");
export_gcode_btn->SetCornerRadius(0);
export_gcode_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
m_print_btn->SetLabel(_L("Export G-code file"));
m_print_select = eExportGcode;
m_print_enable = get_enable_print_status();
m_print_btn->Enable(m_print_enable);
this->Layout();
p->Dismiss();
});
p->append_button(print_plate_btn);
p->append_button(print_all_btn);
p->append_button(send_to_printer_btn);
p->append_button(send_to_printer_all_btn);
p->append_button(export_sliced_file_btn);
p->append_button(export_all_sliced_file_btn);
p->append_button(export_gcode_btn);
}
p->Popup(m_print_btn);
@ -1912,9 +1851,9 @@ void MainFrame::update_side_button_style()
m_slice_btn->SetExtraSize(wxSize(FromDIP(38), FromDIP(10)));
m_slice_btn->SetBottomColour(wxColour(0x3B4446));*/
StateColor m_btn_bg_enable = StateColor(
std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(48, 221, 112), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal)
std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal)
);
m_publish_btn->SetMinSize(wxSize(FromDIP(125), FromDIP(24)));
@ -2117,20 +2056,15 @@ static wxMenu* generate_help_menu()
wxGetApp().plater()->get_current_canvas3D()->set_as_dirty();
});
append_menu_item(helpMenu, wxID_ANY, _L("Report issue"), _L("Report issue"), [](wxCommandEvent &) {
std::string url = "https://github.com/bambulab/BambuStudio/issues/new/choose";
wxLaunchDefaultBrowser(url);
});
// Report a bug
//append_menu_item(helpMenu, wxID_ANY, _L("Report Bug(TODO)"), _L("Report a bug of BambuStudio"),
//append_menu_item(helpMenu, wxID_ANY, _L("Report Bug(TODO)"), _L("Report a bug of OrcaSlicer"),
// [](wxCommandEvent&) {
// //TODO
// });
// Check New Version
append_menu_item(helpMenu, wxID_ANY, _L("Check for Update"), _L("Check for Update"),
[](wxCommandEvent&) {
wxGetApp().check_new_version(true, 1);
wxGetApp().check_new_version_sf(true, 1);
}, "", nullptr, []() {
return true;
});
@ -2163,8 +2097,6 @@ static void add_common_publish_menu_items(wxMenu* publish_menu, MainFrame* mainF
json j;
NetworkAgent* agent = GUI::wxGetApp().getAgent();
if (agent)
agent->track_event("enter_model_mall", j.dump());
//if (GUI::wxGetApp().plater()->model().objects.empty()) return;
wxGetApp().open_publish_page_dialog();
@ -2609,7 +2541,7 @@ void MainFrame::init_menubar_as_editor()
#ifdef __APPLE__
wxWindowID bambu_studio_id_base = wxWindow::NewControlId(int(2));
wxMenu* parent_menu = m_menubar->OSXGetAppleMenu();
//auto preference_item = new wxMenuItem(parent_menu, BambuStudioMenuPreferences + bambu_studio_id_base, _L("Preferences") + "\tCtrl+,", "");
//auto preference_item = new wxMenuItem(parent_menu, OrcaSlicerMenuPreferences + bambu_studio_id_base, _L("Preferences") + "\tCtrl+,", "");
#else
wxMenu* parent_menu = m_topbar->GetTopMenu();
auto preference_item = new wxMenuItem(parent_menu, ConfigMenuPreferences + config_id_base, _L("Preferences") + "\t" + ctrl + "P", "");
@ -2684,13 +2616,13 @@ void MainFrame::init_menubar_as_editor()
#ifdef __APPLE__
wxString about_title = wxString::Format(_L("&About %s"), SLIC3R_APP_FULL_NAME);
//auto about_item = new wxMenuItem(parent_menu, BambuStudioMenuAbout + bambu_studio_id_base, about_title, "");
//auto about_item = new wxMenuItem(parent_menu, OrcaSlicerMenuAbout + bambu_studio_id_base, about_title, "");
//parent_menu->Bind(wxEVT_MENU, [this, bambu_studio_id_base](wxEvent& event) {
// switch (event.GetId() - bambu_studio_id_base) {
// case BambuStudioMenuAbout:
// case OrcaSlicerMenuAbout:
// Slic3r::GUI::about();
// break;
// case BambuStudioMenuPreferences:
// case OrcaSlicerMenuPreferences:
// CallAfter([this] {
// PreferencesDialog dlg(this);
// dlg.ShowModal();
@ -2757,201 +2689,160 @@ void MainFrame::init_menubar_as_editor()
//m_topbar->AddDropDownMenuItem(config_item);
m_topbar->AddDropDownSubMenu(helpMenu, _L("Help"));
// OrcaSlicer calibrations
{
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Temperature"), _L("Temperature Calibration"),
[this](wxCommandEvent&) {
if (!m_temp_calib_dlg)
m_temp_calib_dlg = new Temp_Calibration_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_temp_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
auto flowrate_menu = new wxMenu();
append_menu_item(
flowrate_menu, wxID_ANY, _L("Pass 1"), _L("Flow rate test - Pass 1"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(1); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_menu_item(flowrate_menu, wxID_ANY, _L("Pass 2"), _L("Flow rate test - Pass 2"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(2); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
m_topbar->GetCalibMenu()->AppendSubMenu(flowrate_menu, _L("Flow rate"));
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Pressure advance"), _L("Pressure advance"),
[this](wxCommandEvent&) {
//if (!m_pa_calib_dlg)
// SoftFever calibrations
// Flowrate
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Temperature"), _L("Temperature Calibration"),
[this](wxCommandEvent&) {
if (!m_temp_calib_dlg)
m_temp_calib_dlg = new Temp_Calibration_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_temp_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
auto flowrate_menu = new wxMenu();
append_menu_item(
flowrate_menu, wxID_ANY, _L("Pass 1"), _L("Flow rate test - Pass 1"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(1); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_menu_item(flowrate_menu, wxID_ANY, _L("Pass 2"), _L("Flow rate test - Pass 2"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(2); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
m_topbar->GetCalibMenu()->AppendSubMenu(flowrate_menu, _L("Flow rate"));
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);
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Retraction test"), _L("Retraction test"),
[this](wxCommandEvent&) {
if (!m_retraction_calib_dlg)
m_retraction_calib_dlg = new Retraction_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_retraction_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
m_pa_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Retraction test"), _L("Retraction test"),
[this](wxCommandEvent&) {
if (!m_retraction_calib_dlg)
m_retraction_calib_dlg = new Retraction_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_retraction_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Orca Tolerance Test"), _L("Orca Tolerance Test"),
[this](wxCommandEvent&) {
m_plater->new_project();
m_plater->add_model(false, Slic3r::resources_dir() + "/calib/tolerance_test/OrcaToleranceTest.stl");
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Advance calibrations
auto advance_menu = new wxMenu();
// Advance calibrations
auto advance_menu = new wxMenu(); // sub menu
{
append_menu_item(
advance_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);
append_menu_item(
advance_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);
append_menu_item(
advance_menu, wxID_ANY, _L("VFA"), _L("VFA"),
[this](wxCommandEvent &) {
if (!m_vfa_test_dlg) m_vfa_test_dlg = new VFA_Test_Dlg((wxWindow *) this, wxID_ANY, m_plater);
m_vfa_test_dlg->ShowModal();
},
"", nullptr,
[this]() {
return m_plater->is_view3D_shown();
;
},
this);
m_topbar->GetCalibMenu()->AppendSubMenu(advance_menu, _L("More..."));
}
append_menu_item(
advance_menu, wxID_ANY, _L("VFA"), _L("VFA"),
[this](wxCommandEvent&) {
if (!m_vfa_test_dlg)
m_vfa_test_dlg = new VFA_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_vfa_test_dlg->ShowModal();
},
"", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
m_topbar->GetCalibMenu()->AppendSubMenu(advance_menu, _L("More..."));
// help
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Tutorial"), _L("Calibration help"),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://wiki.bambulab.com/e/en/staging/bambu-studio/Calibration", wxBROWSER_NEW_WINDOW); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// help
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Tutorial"), _L("Calibration help"),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/SoftFever/OrcaSlicer/wiki/Calibration", wxBROWSER_NEW_WINDOW); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
}
#else
m_menubar->Append(fileMenu, wxString::Format("&%s", _L("File")));
if (editMenu)
m_menubar->Append(editMenu, wxString::Format("&%s", _L("Edit")));
if (viewMenu)
m_menubar->Append(viewMenu, wxString::Format("&%s", _L("View")));
//if (publishMenu)
// m_menubar->Append(publishMenu, wxString::Format("&%s", _L("3D Models")));
/*if (publishMenu)
m_menubar->Append(publishMenu, wxString::Format("&%s", _L("3D Models")));*/
// SoftFever calibrations
m_calib_menu = new wxMenu();
// Temp
append_menu_item(
m_calib_menu, wxID_ANY, _L("Temperature"), _L("Temperature"),
[this](wxCommandEvent &) {
if (!m_temp_calib_dlg)
m_temp_calib_dlg = new Temp_Calibration_Dlg((wxWindow *) this, wxID_ANY, m_plater);
m_temp_calib_dlg->ShowModal();
},
"", nullptr,
[this]() {
return m_plater->is_view3D_shown();
;
},
this);
// Flowrate
auto flowrate_menu = new wxMenu();
append_menu_item(
flowrate_menu, wxID_ANY, _L("Pass 1"), _L("Flow rate test - Pass 1"),
[this](wxCommandEvent &) {
if (m_plater) m_plater->calib_flowrate(1);
},
"", nullptr,
[this]() {
return m_plater->is_view3D_shown();
;
},
this);
append_menu_item(
flowrate_menu, wxID_ANY, _L("Pass 2"), _L("Flow rate test - Pass 2"),
[this](wxCommandEvent &) {
if (m_plater) m_plater->calib_flowrate(2);
},
"", nullptr,
[this]() {
return m_plater->is_view3D_shown();
;
},
this);
append_submenu(m_calib_menu, flowrate_menu, wxID_ANY, _L("Flow rate"), _L("Flow rate"), "", [this]() {
return m_plater->is_view3D_shown();
;
});
// SoftFever calibrations
auto calib_menu = new wxMenu();
// PA
append_menu_item(
m_calib_menu, wxID_ANY, _L("Pressure advance"), _L("Pressure advance"),
[this](wxCommandEvent &) {
m_pa_calib_dlg = new PA_Calibration_Dlg((wxWindow *) this, wxID_ANY, m_plater);
append_menu_item(calib_menu, wxID_ANY, _L("Temperature"), _L("Temperature"),
[this](wxCommandEvent&) {
if (!m_temp_calib_dlg)
m_temp_calib_dlg = new Temp_Calibration_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_temp_calib_dlg->ShowModal();
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Flowrate
auto flowrate_menu = new wxMenu();
append_menu_item(flowrate_menu, wxID_ANY, _L("Pass 1"), _L("Flow rate test - Pass 1"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(1); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_menu_item(flowrate_menu, wxID_ANY, _L("Pass 2"), _L("Flow rate test - Pass 2"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_flowrate(2); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_submenu(calib_menu,flowrate_menu,wxID_ANY,_L("Flow rate"),_L("Flow rate"),"",
[this]() {return m_plater->is_view3D_shown();; });
// PA
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);
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Retraction
append_menu_item(
m_calib_menu, wxID_ANY, _L("Retraction test"), _L("Retraction test"),
[this](wxCommandEvent &) {
if (!m_retraction_calib_dlg) m_retraction_calib_dlg = new Retraction_Test_Dlg((wxWindow *) this, wxID_ANY, m_plater);
append_menu_item(calib_menu, wxID_ANY, _L("Retraction test"), _L("Retraction test"),
[this](wxCommandEvent&) {
if (!m_retraction_calib_dlg)
m_retraction_calib_dlg = new Retraction_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_retraction_calib_dlg->ShowModal();
},
"", nullptr,
[this]() {
return m_plater->is_view3D_shown();
;
},
this);
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Tolerance Test
append_menu_item(calib_menu, wxID_ANY, _L("Orca Tolerance Test"), _L("Orca Tolerance Test"),
[this](wxCommandEvent&) {
m_plater->new_project();
m_plater->add_model(false, Slic3r::resources_dir() + "/calib/tolerance_test/OrcaToleranceTest.stl");
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
// Advance calibrations
auto advance_menu = new wxMenu();
append_menu_item(
advance_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);
[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);
append_menu_item(
advance_menu, wxID_ANY, _L("VFA"), _L("VFA"),
[this](wxCommandEvent &) {
if (!m_vfa_test_dlg) m_vfa_test_dlg = new VFA_Test_Dlg((wxWindow *) this, wxID_ANY, m_plater);
[this](wxCommandEvent&) {
if (!m_vfa_test_dlg)
m_vfa_test_dlg = new VFA_Test_Dlg((wxWindow*)this, wxID_ANY, m_plater);
m_vfa_test_dlg->ShowModal();
},
"", nullptr,
[this]() {
return m_plater->is_view3D_shown();
;
},
this);
append_submenu(m_calib_menu, advance_menu, wxID_ANY, _L("More..."), _L("More calibrations"), "", [this]() {
return m_plater->is_view3D_shown();
;
});
}, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_submenu(calib_menu, advance_menu, wxID_ANY, _L("More..."), _L("More calibrations"), "",
[this]() {return m_plater->is_view3D_shown();; });
// help
append_menu_item(
m_calib_menu, wxID_ANY, _L("Tutorial"), _L("Calibration help"),
[this](wxCommandEvent &) { wxLaunchDefaultBrowser("https://wiki.bambulab.com/en/bambu-studio/Calibration", wxBROWSER_NEW_WINDOW); }, "", nullptr,
[this]() {
return m_plater->is_view3D_shown();
;
},
this);
append_menu_item(calib_menu, wxID_ANY, _L("Tutorial"), _L("Calibration help"),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/SoftFever/OrcaSlicer/wiki/Calibration", wxBROWSER_NEW_WINDOW); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
m_menubar->Append(calib_menu,wxString::Format("&%s", _L("Calibration")));
if (helpMenu)
m_menubar->Append(helpMenu, wxString::Format("&%s", _L("Help")));
SetMenuBar(m_menubar);
@ -3460,7 +3351,6 @@ void MainFrame::add_to_recent_projects(const wxString& filename)
recent_projects.push_back(into_u8(m_recent_projects.GetHistoryFile(i)));
}
wxGetApp().app_config->set_recent_projects(recent_projects);
wxGetApp().app_config->save();
m_webview->SendRecentList(0);
}
}
@ -3562,7 +3452,6 @@ void MainFrame::open_recent_project(size_t file_id, wxString const & filename)
recent_projects.push_back(into_u8(m_recent_projects.GetHistoryFile(i)));
}
wxGetApp().app_config->set_recent_projects(recent_projects);
wxGetApp().app_config->save();
m_webview->SendRecentList(-1);
}
}
@ -3586,7 +3475,6 @@ void MainFrame::remove_recent_project(size_t file_id, wxString const &filename)
recent_projects.push_back(into_u8(m_recent_projects.GetHistoryFile(i)));
}
wxGetApp().app_config->set_recent_projects(recent_projects);
wxGetApp().app_config->save();
m_webview->SendRecentList(-1);
}
@ -3609,7 +3497,7 @@ void MainFrame::load_printer_url(wxString url)
void MainFrame::load_printer_url()
{
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
if (preset_bundle.printers.get_edited_preset().is_bbl_vendor_preset(&preset_bundle))
if (preset_bundle.printers.get_edited_preset().has_lidar(&preset_bundle))
return;
auto cfg = preset_bundle.printers.get_edited_preset().config;
@ -3757,7 +3645,7 @@ SettingsDialog::SettingsDialog(MainFrame* mainframe)
SetIcon(wxIcon(szExeFileName, wxBITMAP_TYPE_ICO));
}
#else
SetIcon(wxIcon(var("BambuStudio_128px.png"), wxBITMAP_TYPE_PNG));
SetIcon(wxIcon(var("OrcaSlicer_128px.png"), wxBITMAP_TYPE_PNG));
#endif // _WIN32
//just hide the Frame on closing

View file

@ -31,9 +31,6 @@
#include "PrinterWebView.hpp"
#include "calib_dlg.hpp"
#include "PrinterWebView.hpp"
#include "calib_dlg.hpp"
#define ENABEL_PRINT_ALL 0
class Notebook;
@ -343,14 +340,6 @@ public:
bool is_printer_view() const;
void refresh_plugin_tips();
void RunScript(wxString js);
void show_device(bool bBBLPrinter);
// OrcaSlicer calibration
PA_Calibration_Dlg * m_pa_calib_dlg{nullptr};
Temp_Calibration_Dlg * m_temp_calib_dlg{nullptr};
MaxVolumetricSpeed_Test_Dlg *m_vol_test_dlg{nullptr};
VFA_Test_Dlg * m_vfa_test_dlg{nullptr};
Retraction_Test_Dlg * m_retraction_calib_dlg{nullptr};
//SoftFever
void show_device(bool bBBLPrinter);

View file

@ -294,12 +294,8 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj)
NetworkAgent* agent = wxGetApp().getAgent();
if (status == PrinterFileSystem::Failed && err != 0) {
j["result"] = "failed";
if (agent)
agent->track_event("download_video_conn", j.dump());
} else if (status == PrinterFileSystem::ListReady) {
j["result"] = "success";
if (agent)
agent->track_event("download_video_conn", j.dump());
}
m_last_errors.insert(fs->GetLastError());
}
@ -320,15 +316,9 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj)
if (result > 1) {
// download failed
j["result"] = "failed";
if (agent) {
agent->track_event("download_video", j.dump());
}
} else if (result == 0) {
// download success
j["result"] = "success";
if (agent) {
agent->track_event("download_video", j.dump());
}
}
}
return;

View file

@ -280,8 +280,6 @@ void MediaPlayCtrl::Stop(wxString const &msg)
j["tutk_state"] = m_tutk_state;
j["msg"] = into_u8(msg);
NetworkAgent *agent = wxGetApp().getAgent();
if (agent)
agent->track_event("start_liveview", j.dump());
m_last_failed_codes.insert(m_failed_code);
}
@ -440,8 +438,6 @@ void MediaPlayCtrl::onStateChanged(wxMediaEvent &event)
j["result"] = "success";
j["code"] = 0;
NetworkAgent* agent = wxGetApp().getAgent();
if (agent)
agent->track_event("start_liveview", j.dump());
m_failed_retry = 0;
m_failed_code = 0;

View file

@ -451,15 +451,9 @@ void MonitorPanel::show_status(int status)
j["dev_id"] = obj ? obj->dev_id : "obj_nullptr";
if (status & (int)MonitorStatus::MONITOR_DISCONNECTED != 0) {
j["result"] = "failed";
if (agent) {
agent->track_event("connect_dev", j.dump());
}
}
else if (status & (int)MonitorStatus::MONITOR_NORMAL != 0) {
j["result"] = "success";
if (agent) {
agent->track_event("connect_dev", j.dump());
}
}
}
last_status = status;

View file

@ -75,7 +75,7 @@ void OG_CustomCtrl::init_ctrl_lines()
for (const Line& line : og_lines)
{
if (line.is_separator()) {
ctrl_lines.emplace_back(CtrlLine(3, this, line));
ctrl_lines.emplace_back(CtrlLine(0, this, line));
continue;
}

View file

@ -248,6 +248,8 @@ ParamsPanel::ParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, c
});
}
//m_export_to_file = new Button( this, wxT("Export To File"), "");
//m_import_from_file = new Button( this, wxT("Import From File") );
@ -589,15 +591,6 @@ void ParamsPanel::set_active_tab(wxPanel* tab)
wxString title = cur_tab->type() == Preset::TYPE_FILAMENT ? _L("Filament settings") : _L("Printer settings");
dialog->SetTitle(title);
}
auto tab_print = dynamic_cast<Tab*>(m_tab_print);
if (cur_tab == m_tab_print) {
if (tab_print)
tab_print->toggle_line("print_flow_ratio", false);
}
else {
if (tab_print)
tab_print->toggle_line("print_flow_ratio", false);
}
}
bool ParamsPanel::is_active_and_shown_tab(wxPanel* tab)

View file

@ -36,12 +36,14 @@
#include "GUI_ObjectList.hpp"
#include "Tab.hpp"
#include "format.hpp"
#include "slic3r/GUI/GUI.hpp"
#include <imgui/imgui_internal.h>
#include <wx/dcgraph.h>
using boost::optional;
namespace fs = boost::filesystem;
static const float GROUND_Z = -0.03f;
static const float GROUND_Z_GRIDLINE = -0.26f;
static const float GRABBER_X_FACTOR = 0.20f;
static const float GRABBER_Y_FACTOR = 0.03f;
static const float GRABBER_Z_VALUE = 0.5f;
@ -49,16 +51,13 @@ static unsigned int GLOBAL_PLATE_INDEX = 0;
static const double LOGICAL_PART_PLATE_GAP = 1. / 5.;
static const int PARTPLATE_ICON_SIZE = 16;
static const int PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE = 12;
static const int PARTPLATE_PLATE_NAME_FIX_HEIGHT_SIZE = 20;
static const int PARTPLATE_ICON_GAP_TOP = 3;
static const int PARTPLATE_ICON_GAP_LEFT = 3;
static const int PARTPLATE_ICON_GAP_Y = 5;
static const int PARTPLATE_TEXT_OFFSET_X1 = 3;
static const int PARTPLATE_TEXT_OFFSET_X2 = 1;
static const int PARTPLATE_TEXT_OFFSET_Y = 1;
static const int PARTPLATE_PLATENAME_OFFSET_Y = 10;
std::array<unsigned char, 4> PlateTextureForeground = {0x0, 0xae, 0x42, 0xff};
namespace Slic3r {
namespace GUI {
@ -77,7 +76,44 @@ std::array<float, 4> PartPlate::LINE_BOTTOM_COLOR = { 0.8f, 0.8f, 0.8f, 0.4f };
std::array<float, 4> PartPlate::HEIGHT_LIMIT_TOP_COLOR = { 0.6f, 0.6f, 1.0f, 1.0f };
std::array<float, 4> PartPlate::HEIGHT_LIMIT_BOTTOM_COLOR = { 0.4f, 0.4f, 1.0f, 1.0f };
// get text extent with wxMemoryDC
void get_text_extent(const wxString &msg, wxCoord &w, wxCoord &h, wxFont *font)
{
wxMemoryDC memDC;
if (font)
memDC.SetFont(*font);
memDC.GetTextExtent(msg, &w, &h);
}
wxFont* find_font(const std::string& text_str, int max_size = 32)
{
auto is_font_suitable = [](std::string str, wxFont &font, int max_size) {
wxString msg(str);
wxCoord w, h;
get_text_extent(msg, w, h, &font);
if (w <= max_size)
return true;
else
return false;
};
wxFont *font = nullptr;
if (is_font_suitable(text_str, Label::Head_24, max_size))
font = &Label::Head_24;
else if (is_font_suitable(text_str, Label::Head_20, max_size))
font = &Label::Head_20;
else if (is_font_suitable(text_str, Label::Head_18, max_size))
font = &Label::Head_18;
else if (is_font_suitable(text_str, Label::Head_16, max_size))
font = &Label::Head_16;
else if (is_font_suitable(text_str, Label::Head_14, max_size))
font = &Label::Head_14;
else
font = &Label::Head_12;
return font;
}
void PartPlate::update_render_colors()
{
PartPlate::SELECT_COLOR = GLColor(RenderColor::colors[RenderCol_Plate_Selected]);
@ -134,6 +170,7 @@ void PartPlate::init()
m_print_index = -1;
m_print = nullptr;
m_plate_name_vbo_id = 0;
}
BedType PartPlate::get_bed_type(bool load_from_project) const
@ -342,10 +379,10 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox
Lines contour_lines = to_lines(poly);
std::copy(contour_lines.begin(), contour_lines.end(), std::back_inserter(gridlines));
if (!m_gridlines.set_from_lines(gridlines, GROUND_Z))
if (!m_gridlines.set_from_lines(gridlines, GROUND_Z_GRIDLINE))
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to create bed grid lines\n";
if (!m_gridlines_bolder.set_from_lines(gridlines_bolder, GROUND_Z))
if (!m_gridlines_bolder.set_from_lines(gridlines_bolder, GROUND_Z_GRIDLINE))
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to create bed grid lines\n";
}
@ -403,7 +440,8 @@ void PartPlate::calc_vertex_for_number(int index, bool one_number, GeometryBuffe
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP + PARTPLATE_ICON_SIZE - offset_x), scale_(p(1) - index * (PARTPLATE_ICON_SIZE + PARTPLATE_ICON_GAP)- PARTPLATE_ICON_GAP - PARTPLATE_TEXT_OFFSET_Y)});
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP + offset_x), scale_(p(1) - index * (PARTPLATE_ICON_SIZE + PARTPLATE_ICON_GAP)- PARTPLATE_ICON_GAP - PARTPLATE_TEXT_OFFSET_Y) });
#else //in the bottom
Vec2d& p = m_shape[1];
auto bed_ext = get_extents(m_shape);
Vec2d p = bed_ext[1];
float offset_x = one_number?PARTPLATE_TEXT_OFFSET_X1: PARTPLATE_TEXT_OFFSET_X2;
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x), scale_(p(1) + PARTPLATE_TEXT_OFFSET_Y) });
@ -416,66 +454,14 @@ void PartPlate::calc_vertex_for_number(int index, bool one_number, GeometryBuffe
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to generate geometry buffers for icons\n";
}
void PartPlate::calc_vertex_for_plate_name(GLTexture &texture, GeometryBuffer &buffer)
{
if (texture.get_width() > 0 && texture.get_height()) {
wxCoord w, h;
auto bed_ext = get_extents(m_shape);
auto factor = bed_ext.size()(1) / 200.0;
ExPolygon poly;
float offset_x = 1;
w = int(factor * (texture.get_width() * 16) / texture.get_height());
h = PARTPLATE_PLATE_NAME_FIX_HEIGHT_SIZE;
Vec2d p = bed_ext[3] + Vec2d(0, PARTPLATE_PLATENAME_OFFSET_Y + h * texture.m_original_height / texture.get_height());
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x), scale_(p(1) - h )});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + w - offset_x), scale_(p(1) - h )});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + w - offset_x), scale_(p(1) )});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x), scale_(p(1) )});
auto triangles = triangulate_expolygon_2f(poly, NORMALS_UP);
if (!buffer.set_from_triangles(triangles, GROUND_Z)) BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to generate geometry buffers for icons\n";
}
}
void PartPlate::calc_vertex_for_plate_name_edit_icon(GLTexture *texture, int index, GeometryBuffer &buffer) {
auto bed_ext = get_extents(m_shape);
auto factor = bed_ext.size()(1) / 200.0;
wxCoord w, h;
h = int(factor * 16);
ExPolygon poly;
Vec2d p = bed_ext[3];
float offset_x = 1;
h = PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE;
p += Vec2d(0, PARTPLATE_PLATENAME_OFFSET_Y + h);
if (texture && texture->get_width() > 0 && texture->get_height()) {
w = int(factor * (texture->get_original_width() * 16) / texture->get_height()) + 1;
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + w), scale_(p(1) - h )});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + w + PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE), scale_(p(1) - h)});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + w + PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE), scale_(p(1))});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + w), scale_(p(1) )});
auto triangles = triangulate_expolygon_2f(poly, NORMALS_UP);
if (!buffer.set_from_triangles(triangles, GROUND_Z))
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to generate geometry buffers for icons\n";
} else {
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x ), scale_(p(1) - h )});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x + PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE), scale_(p(1) - h)});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x + PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE), scale_(p(1))});
poly.contour.append({scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x), scale_(p(1) )});
auto triangles = triangulate_expolygon_2f(poly, NORMALS_UP);
if (!buffer.set_from_triangles(triangles, GROUND_Z))
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to generate geometry buffers for icons\n";
}
}
void PartPlate::calc_vertex_for_icons(int index, GeometryBuffer &buffer)
{
ExPolygon poly;
Vec2d& p = m_shape[2];
auto bed_ext = get_extents(m_shape);
Vec2d p = bed_ext[2];
if (m_plater->get_build_volume_type() == BuildVolume_Type::Circle)
p[1] -= std::max(
0.0, (bed_ext.size()(1) - 5 * PARTPLATE_ICON_SIZE - 4 * PARTPLATE_ICON_GAP_Y - PARTPLATE_ICON_GAP_TOP) / 2);
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT), scale_(p(1) - index * (PARTPLATE_ICON_SIZE + PARTPLATE_ICON_GAP_Y) - PARTPLATE_ICON_GAP_TOP - PARTPLATE_ICON_SIZE) });
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + PARTPLATE_ICON_SIZE), scale_(p(1) - index * (PARTPLATE_ICON_SIZE + PARTPLATE_ICON_GAP_Y)- PARTPLATE_ICON_GAP_TOP - PARTPLATE_ICON_SIZE) });
@ -490,7 +476,8 @@ void PartPlate::calc_vertex_for_icons(int index, GeometryBuffer &buffer)
void PartPlate::calc_vertex_for_icons_background(int icon_count, GeometryBuffer &buffer)
{
ExPolygon poly;
Vec2d& p = m_shape[2];
auto bed_ext = get_extents(m_shape);
Vec2d p = bed_ext[2];
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT), scale_(p(1) - icon_count * (PARTPLATE_ICON_SIZE + PARTPLATE_ICON_GAP_Y) - PARTPLATE_ICON_GAP_TOP) });
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + PARTPLATE_ICON_SIZE), scale_(p(1) - icon_count * (PARTPLATE_ICON_SIZE + PARTPLATE_ICON_GAP_Y)- PARTPLATE_ICON_GAP_TOP) });
@ -824,57 +811,33 @@ void PartPlate::render_icon_texture(int position_id, int tex_coords_id, const Ge
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
}
void PartPlate::render_plate_name_texture(int position_id, int tex_coords_id)
{
if (m_name_change) {
m_name_change = false;
if (m_plate_name_vbo_id > 0) {
glsafe(::glDeleteBuffers(1, &m_plate_name_vbo_id));
m_plate_name_vbo_id = 0;
}
if (m_plate_name_edit_vbo_id > 0) {
glsafe(::glDeleteBuffers(1, &m_plate_name_edit_vbo_id));
m_plate_name_edit_vbo_id = 0;
}
}
if (m_plate_name_vbo_id==0) {
if (generate_plate_name_texture()) {
calc_vertex_for_plate_name(m_name_texture, m_plate_name_icon);
if (m_plate_name_edit_vbo_id > 0) { //for redo
glsafe(::glDeleteBuffers(1, &m_plate_name_edit_vbo_id));
m_plate_name_edit_vbo_id = 0;
}
calc_vertex_for_plate_name_edit_icon(&m_name_texture, 0, m_plate_name_edit_icon);
}
else {
if (m_plate_name_edit_vbo_id==0) {
calc_vertex_for_plate_name_edit_icon(nullptr, 0, m_plate_name_edit_icon);
}
return;
}
if (m_name_texture.get_id() == 0)
generate_plate_name_texture();
if (m_plate_name_vbo_id == 0 && m_plate_name_icon.get_vertices_data_size() > 0) {
glsafe(::glGenBuffers(1, &m_plate_name_vbo_id));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, m_plate_name_vbo_id));
glsafe(::glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)m_plate_name_icon.get_vertices_data_size(), (const GLvoid*)m_plate_name_icon.get_vertices_data(), GL_STATIC_DRAW));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
}
if (m_plate_name_vbo_id == 0 && m_plate_name_icon.get_vertices_data_size() > 0) {
glsafe(::glGenBuffers(1, &m_plate_name_vbo_id));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, m_plate_name_vbo_id));
glsafe(::glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr) m_plate_name_icon.get_vertices_data_size(), (const GLvoid *) m_plate_name_icon.get_vertices_data(), GL_STATIC_DRAW));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
}
unsigned int stride = m_plate_name_icon.get_vertex_data_size();
GLuint tex_id = (GLuint)m_name_texture.get_id();
glsafe(::glBindTexture(GL_TEXTURE_2D, tex_id));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, m_plate_name_vbo_id));
if (position_id != -1)
glsafe(::glVertexAttribPointer(position_id, 3, GL_FLOAT, GL_FALSE, stride, (GLvoid*)(intptr_t)m_plate_name_icon.get_position_offset()));
if (tex_coords_id != -1)
glsafe(::glVertexAttribPointer(tex_coords_id, 2, GL_FLOAT, GL_FALSE, stride, (GLvoid*)(intptr_t)m_plate_name_icon.get_tex_coords_offset()));
glsafe(::glDrawArrays(GL_TRIANGLES, 0, (GLsizei)m_plate_name_icon.get_vertices_count()));
unsigned int stride = m_plate_name_icon.get_vertex_data_size();
GLuint tex_id = (GLuint) m_name_texture.get_id();
glsafe(::glBindTexture(GL_TEXTURE_2D, tex_id));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, m_plate_name_vbo_id));
if (position_id != -1) glsafe(::glVertexAttribPointer(position_id, 3, GL_FLOAT, GL_FALSE, stride, (GLvoid *) (intptr_t) m_plate_name_icon.get_position_offset()));
if (tex_coords_id != -1) glsafe(::glVertexAttribPointer(tex_coords_id, 2, GL_FLOAT, GL_FALSE, stride, (GLvoid *) (intptr_t) m_plate_name_icon.get_tex_coords_offset()));
glsafe(::glDrawArrays(GL_TRIANGLES, 0, (GLsizei) m_plate_name_icon.get_vertices_count()));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
}
void PartPlate::render_icons(bool bottom, bool only_body, int hover_id)
void PartPlate::render_icons(bool bottom, bool only_name, int hover_id)
{
GLShaderProgram* shader = wxGetApp().get_shader("printbed");
if (shader != nullptr) {
@ -895,59 +858,67 @@ void PartPlate::render_icons(bool bottom, bool only_body, int hover_id)
if (tex_coords_id != -1) {
glsafe(::glEnableVertexAttribArray(tex_coords_id));
}
render_plate_name_texture(position_id, tex_coords_id);
if (!only_body) {
if (!only_name) {
if (hover_id == 1)
render_icon_texture(position_id, tex_coords_id, m_del_icon, m_partplate_list->m_del_hovered_texture, m_del_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_del_icon, m_partplate_list->m_del_hovered_texture,
m_del_vbo_id);
else
render_icon_texture(position_id, tex_coords_id, m_del_icon, m_partplate_list->m_del_texture, m_del_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_del_icon, m_partplate_list->m_del_texture,
m_del_vbo_id);
if (hover_id == 2)
render_icon_texture(position_id, tex_coords_id, m_orient_icon, m_partplate_list->m_orient_hovered_texture, m_orient_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_orient_icon,
m_partplate_list->m_orient_hovered_texture, m_orient_vbo_id);
else
render_icon_texture(position_id, tex_coords_id, m_orient_icon, m_partplate_list->m_orient_texture, m_orient_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_orient_icon, m_partplate_list->m_orient_texture,
m_orient_vbo_id);
if (hover_id == 3)
render_icon_texture(position_id, tex_coords_id, m_arrange_icon, m_partplate_list->m_arrange_hovered_texture, m_arrange_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_arrange_icon,
m_partplate_list->m_arrange_hovered_texture, m_arrange_vbo_id);
else
render_icon_texture(position_id, tex_coords_id, m_arrange_icon, m_partplate_list->m_arrange_texture, m_arrange_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_arrange_icon, m_partplate_list->m_arrange_texture,
m_arrange_vbo_id);
if (hover_id == 4) {
if (this->is_locked())
render_icon_texture(position_id, tex_coords_id, m_lock_icon, m_partplate_list->m_locked_hovered_texture, m_lock_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_lock_icon,
m_partplate_list->m_locked_hovered_texture, m_lock_vbo_id);
else
render_icon_texture(position_id, tex_coords_id, m_lock_icon, m_partplate_list->m_lockopen_hovered_texture, m_lock_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_lock_icon,
m_partplate_list->m_lockopen_hovered_texture, m_lock_vbo_id);
} else {
if (this->is_locked())
render_icon_texture(position_id, tex_coords_id, m_lock_icon, m_partplate_list->m_locked_texture, m_lock_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_lock_icon, m_partplate_list->m_locked_texture,
m_lock_vbo_id);
else
render_icon_texture(position_id, tex_coords_id, m_lock_icon, m_partplate_list->m_lockopen_texture, m_lock_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_lock_icon, m_partplate_list->m_lockopen_texture,
m_lock_vbo_id);
}
if (hover_id == 6)
render_icon_texture(position_id, tex_coords_id, m_plate_name_edit_icon, m_partplate_list->m_plate_name_edit_hovered_texture, m_plate_name_edit_vbo_id);
else
render_icon_texture(position_id, tex_coords_id, m_plate_name_edit_icon, m_partplate_list->m_plate_name_edit_texture, m_plate_name_edit_vbo_id);
if (m_partplate_list->render_plate_settings) {
if (m_partplate_list->render_plate_settings) {
if (hover_id == 5) {
if (get_bed_type() == BedType::btDefault && get_print_seq() == PrintSequence::ByDefault && get_first_layer_print_sequence().empty())
render_icon_texture(position_id, tex_coords_id, m_plate_settings_icon, m_partplate_list->m_plate_settings_hovered_texture, m_plate_settings_vbo_id);
else
render_icon_texture(position_id, tex_coords_id, m_plate_settings_icon, m_partplate_list->m_plate_settings_changed_hovered_texture,
m_plate_settings_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_plate_settings_icon,
m_partplate_list->m_plate_settings_changed_hovered_texture,
m_plate_settings_vbo_id);
} else {
if (get_bed_type() == BedType::btDefault && get_print_seq() == PrintSequence::ByDefault && get_first_layer_print_sequence().empty())
render_icon_texture(position_id, tex_coords_id, m_plate_settings_icon, m_partplate_list->m_plate_settings_texture, m_plate_settings_vbo_id);
else
render_icon_texture(position_id, tex_coords_id, m_plate_settings_icon, m_partplate_list->m_plate_settings_changed_texture, m_plate_settings_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_plate_settings_icon,
m_partplate_list->m_plate_settings_changed_texture, m_plate_settings_vbo_id);
}
}
if (m_plate_index >= 0 && m_plate_index < MAX_PLATE_COUNT) {
render_icon_texture(position_id, tex_coords_id, m_plate_idx_icon, m_partplate_list->m_idx_textures[m_plate_index], m_plate_idx_vbo_id);
render_icon_texture(position_id, tex_coords_id, m_plate_idx_icon,
m_partplate_list->m_idx_textures[m_plate_index], m_plate_idx_vbo_id);
}
}
render_plate_name_texture(position_id, tex_coords_id);
if (tex_coords_id != -1)
glsafe(::glDisableVertexAttribArray(tex_coords_id));
@ -1280,14 +1251,6 @@ void PartPlate::on_render_for_picking() const {
m_grabber_color[3] = color[3];
if (m_partplate_list->render_plate_settings)
render_rectangle_for_picking(m_plate_settings_icon, m_grabber_color);
hover_id = 6;
color = picking_color_component(hover_id);
m_grabber_color[0] = color[0];
m_grabber_color[1] = color[1];
m_grabber_color[2] = color[2];
m_grabber_color[3] = color[3];
// render_left_arrow(m_grabber_color, false);
render_rectangle_for_picking(m_plate_name_edit_icon, m_grabber_color);
}
std::array<float, 4> PartPlate::picking_color_component(int idx) const
@ -1332,14 +1295,10 @@ void PartPlate::release_opengl_resource()
glsafe(::glDeleteBuffers(1, &m_plate_idx_vbo_id));
m_plate_idx_vbo_id = 0;
}
if (m_plate_name_vbo_id > 0) {
glsafe(::glDeleteBuffers(1, &m_plate_name_vbo_id));
m_plate_name_vbo_id = 0;
}
if (m_plate_name_edit_vbo_id > 0) {
glsafe(::glDeleteBuffers(1, &m_plate_name_edit_vbo_id));
m_plate_name_edit_vbo_id = 0;
}
if (m_plate_name_vbo_id > 0) {
glsafe(::glDeleteBuffers(1, &m_plate_name_vbo_id));
m_plate_name_vbo_id = 0;
}
}
std::vector<int> PartPlate::get_extruders(bool conside_custom_gcode) const
@ -1683,7 +1642,7 @@ void PartPlate::clear(bool clear_sliced_result)
m_ready_for_slice = true;
update_slice_result_valid_state(false);
}
m_name_texture.reset();
return;
}
@ -1771,47 +1730,50 @@ Vec3d PartPlate::get_center_origin()
return origin;
}
bool PartPlate::generate_plate_name_texture()
void PartPlate::generate_plate_name_texture()
{
auto bed_ext = get_extents(m_shape);
int bed_width = bed_ext.size()(1);
wxString cur_plate_name = from_u8(m_name);
wxGCDC dc;
wxString limitTextWidth = wxControl::Ellipsize(cur_plate_name, dc, wxELLIPSIZE_END, bed_width);
if (limitTextWidth.Length()==0) {
return false;
}
// generate m_name_texture texture from m_name with generate_from_text_string
m_name_texture.reset();
auto * font = &Label::Head_32;
wxColour NumberForeground(PlateTextureForeground[0], PlateTextureForeground[1], PlateTextureForeground[2], PlateTextureForeground[3]);
if (!m_name_texture.generate_from_text_string(limitTextWidth.ToUTF8().data(), *font, *wxBLACK, NumberForeground)) {
auto text = m_name.empty()? _L("Untitled") : from_u8(m_name);
wxCoord w, h;
auto* font = &Label::Head_32;
wxColour foreground(0xf2, 0x75, 0x4e, 0xff);
if (!m_name_texture.generate_from_text_string(text.ToUTF8().data(), *font, *wxBLACK, foreground))
BOOST_LOG_TRIVIAL(error) << "PartPlate::generate_plate_name_texture(): generate_from_text_string() failed";
return false;
auto bed_ext = get_extents(m_shape);
auto factor = bed_ext.size()(1) / 200.0;
ExPolygon poly;
float offset_x = 1;
w = int(factor * (m_name_texture.get_width() * 16) / m_name_texture.get_height());
h = int(factor * 16);
Vec2d p = bed_ext[3] + Vec2d(0, 1 + h * m_name_texture.m_original_height / m_name_texture.get_height());
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x), scale_(p(1) - h + PARTPLATE_TEXT_OFFSET_Y) });
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + w - offset_x), scale_(p(1) - h + PARTPLATE_TEXT_OFFSET_Y) });
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + w - offset_x), scale_(p(1) - PARTPLATE_TEXT_OFFSET_Y)});
poly.contour.append({ scale_(p(0) + PARTPLATE_ICON_GAP_LEFT + offset_x), scale_(p(1) - PARTPLATE_TEXT_OFFSET_Y) });
auto triangles = triangulate_expolygon_2f(poly, NORMALS_UP);
if (!m_plate_name_icon.set_from_triangles(triangles, GROUND_Z))
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to generate geometry buffers for icons\n";
if (m_plate_name_vbo_id > 0) {
glsafe(::glDeleteBuffers(1, &m_plate_name_vbo_id));
m_plate_name_vbo_id = 0;
}
return true;
}
void PartPlate::set_plate_name(const std::string& name)
{
// compare if name equal to m_name, case sensitive
if (boost::equals(m_name, name))
return;
void PartPlate::set_plate_name(const std::string &name)
{
// compare if name equal to m_name, case sensitive
if (boost::equals(m_name, name)) return;
if (m_plater)
m_plater->take_snapshot("set_plate_name");
m_name = name;
std::regex reg("[\\\\/:*?\"<>|\\0]");
m_name= regex_replace(m_name, reg, "");
m_name_change = true;
if (m_plater) {
ObjectList *obj_list = wxGetApp().obj_list();
if (obj_list) {
obj_list->GetModel()->SetCurSelectedPlateFullName(m_plate_index, m_name);
}
}
if (m_print != nullptr)
m_print->set_plate_name(m_name);
m_print->set_plate_name(name);
generate_plate_name_texture();
}
//get the print's object, result and index
@ -1934,9 +1896,11 @@ bool PartPlate::check_outside(int obj_id, int instance_id, BoundingBoxf3* boundi
ModelInstance* instance = object->instances[instance_id];
BoundingBoxf3 instance_box = bounding_box? *bounding_box: object->instance_convex_hull_bounding_box(instance_id);
Polygon hull = instance->convex_hull_2d();
Vec3d up_point(m_origin.x() + m_width + Slic3r::BuildVolume::SceneEpsilon, m_origin.y() + m_depth + Slic3r::BuildVolume::SceneEpsilon, m_origin.z() + m_height + Slic3r::BuildVolume::SceneEpsilon);
Vec3d low_point(m_origin.x() - Slic3r::BuildVolume::SceneEpsilon, m_origin.y() - Slic3r::BuildVolume::SceneEpsilon, m_origin.z() - Slic3r::BuildVolume::SceneEpsilon);
Vec3d up_point = m_bounding_box.max + Vec3d(Slic3r::BuildVolume::SceneEpsilon, Slic3r::BuildVolume::SceneEpsilon,
m_origin.z() + m_height + Slic3r::BuildVolume::SceneEpsilon);
Vec3d low_point = m_bounding_box.min + Vec3d(-Slic3r::BuildVolume::SceneEpsilon, -Slic3r::BuildVolume::SceneEpsilon,
m_origin.z() - Slic3r::BuildVolume::SceneEpsilon);
Polygon hull = instance->convex_hull_2d();
if (instance_box.max.z() > low_point.z()) low_point.z() += instance_box.min.z(); // not considering outsize if sinking
BoundingBoxf3 plate_box(low_point, up_point);
@ -1944,6 +1908,7 @@ bool PartPlate::check_outside(int obj_id, int instance_id, BoundingBoxf3* boundi
{
if (m_exclude_bounding_box.size() > 0)
{
Polygon hull = instance->convex_hull_2d();
int index;
for (index = 0; index < m_exclude_bounding_box.size(); index ++)
{
@ -1980,8 +1945,12 @@ bool PartPlate::intersect_instance(int obj_id, int instance_id, BoundingBoxf3* b
ModelObject* object = m_model->objects[obj_id];
ModelInstance* instance = object->instances[instance_id];
BoundingBoxf3 instance_box = bounding_box? *bounding_box: object->instance_convex_hull_bounding_box(instance_id);
Vec3d up_point(m_origin.x() + m_width, m_origin.y() + m_depth, m_origin.z() + m_height);
Vec3d low_point(m_origin.x(), m_origin.y(), m_origin.z() - 5.0f);
Vec3d up_point =
m_bounding_box.max + Vec3d(Slic3r::BuildVolume::SceneEpsilon, Slic3r::BuildVolume::SceneEpsilon,
m_origin.z() + m_height + Slic3r::BuildVolume::SceneEpsilon);
Vec3d low_point =
m_bounding_box.min + Vec3d(-Slic3r::BuildVolume::SceneEpsilon, -Slic3r::BuildVolume::SceneEpsilon,
m_origin.z() - Slic3r::BuildVolume::SceneEpsilon);
BoundingBoxf3 plate_box(low_point, up_point);
result = plate_box.intersects(instance_box);
@ -2505,9 +2474,10 @@ bool PartPlate::set_shape(const Pointfs& shape, const Pointfs& exclude_areas, Ve
calc_vertex_for_icons(4, m_plate_settings_icon);
//calc_vertex_for_number(0, (m_plate_index < 9), m_plate_idx_icon);
calc_vertex_for_number(0, false, m_plate_idx_icon);
calc_vertex_for_plate_name(m_name_texture, m_plate_name_icon);//if (generate_plate_name_texture())
calc_vertex_for_plate_name_edit_icon(&m_name_texture, 0, m_plate_name_edit_icon);
// calc vertex for plate name
generate_plate_name_texture();
}
calc_height_limit();
release_opengl_resource();
@ -2581,7 +2551,7 @@ void PartPlate::render(bool bottom, bool only_body, bool force_background_color,
render_height_limit(mode);
render_icons(bottom, only_body, hover_id);
render_icons(bottom, only_body, hover_id);
if (!force_background_color){
render_only_numbers(bottom);
}
@ -2651,7 +2621,7 @@ void PartPlate::update_slice_context(BackgroundSlicingProcess & process)
Slic3r::SlicingStatusEvent *event = new Slic3r::SlicingStatusEvent(EVT_SLICING_UPDATE, 0, status);
//BBS: GUI refactor: add plate info befor message
if (status.message_type == Slic3r::PrintStateBase::SlicingDefaultNotification) {
auto temp = Slic3r::format(_u8L(" plate %1%: "), std::to_string(m_plate_index + 1));
auto temp = Slic3r::format(_u8L(" plate %1%:"), std::to_string(m_plate_index + 1));
event->status.text = temp + event->status.text;
}
wxQueueEvent(m_plater, event);
@ -3103,47 +3073,9 @@ void PartPlateList::generate_icon_textures()
}
}
// if (m_plate_name_edit_texture.get_id() == 0)
{
file_name = path + (m_is_dark ? "plate_name_edit_dark.svg" : "plate_name_edit.svg");
if (!m_plate_name_edit_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
}
}
// if (m_plate_name_edit_hovered_texture.get_id() == 0)
{
file_name = path + (m_is_dark ? "plate_name_edit_hover_dark.svg" : "plate_name_edit_hover.svg");
if (!m_plate_name_edit_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
}
}
auto is_font_suitable = [](std::string text_str, wxFont& font, int max_size) {
wxMemoryDC memDC;
wxCoord w, h;
wxString msg(text_str);
memDC.SetFont(font);
memDC.GetMultiLineTextExtent(msg, &w, &h);
if (w <= max_size)
return true;
else
return false;;
};
wxFont* font = nullptr;
std::string text_str = "01";
int max_size = 32;
if (is_font_suitable(text_str, Label::Head_24, max_size))
font = &Label::Head_24;
else if (is_font_suitable(text_str, Label::Head_20, max_size))
font = &Label::Head_20;
else if (is_font_suitable(text_str, Label::Head_18, max_size))
font = &Label::Head_18;
else if (is_font_suitable(text_str, Label::Head_16, max_size))
font = &Label::Head_16;
else if (is_font_suitable(text_str, Label::Head_14, max_size))
font = &Label::Head_14;
else
font = &Label::Head_12;
wxFont* font = find_font(text_str,32);
for (int i = 0; i < MAX_PLATE_COUNT; i++) {
if (m_idx_textures[i].get_id() == 0) {
@ -3152,8 +3084,9 @@ void PartPlateList::generate_icon_textures()
file_name = std::string("0") + std::to_string(i+1);
else
file_name = std::to_string(i+1);
wxColour NumberForeground(PlateTextureForeground[0], PlateTextureForeground[1], PlateTextureForeground[2], PlateTextureForeground[3]);
if (!m_idx_textures[i].generate_from_text_string(file_name, *font, *wxBLACK, NumberForeground)) {
wxColour foreground(0xf2, 0x75, 0x4e, 0xff);
if (!m_idx_textures[i].generate_from_text_string(file_name, *font, *wxBLACK, foreground)) {
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
}
}
@ -3177,8 +3110,7 @@ void PartPlateList::release_icon_textures()
m_plate_settings_texture.reset();
m_plate_settings_texture.reset();
m_plate_settings_hovered_texture.reset();
m_plate_name_edit_texture.reset();
m_plate_name_edit_hovered_texture.reset();
for (int i = 0;i < MAX_PLATE_COUNT; i++) {
m_idx_textures[i].reset();
}
@ -3685,7 +3617,7 @@ double PartPlateList::plate_stride_y()
}
//get the plate counts, not including the invalid plate
int PartPlateList::get_plate_count()
int PartPlateList::get_plate_count() const
{
int ret = 0;
@ -4725,15 +4657,18 @@ int PartPlateList::rebuild_plates_after_deserialize(std::vector<bool>& previous_
int ret = 0;
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": plates count %1%") % m_plate_list.size();
// SoftFever: assign plater info first
for (auto partplate : m_plate_list) {
partplate->m_plater = this->m_plater;
partplate->m_partplate_list = this;
partplate->m_model = this->m_model;
partplate->printer_technology = this->printer_technology;
}
update_plate_cols();
set_shapes(m_shape, m_exclude_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
{
bool need_reset_print = false;
m_plate_list[i]->m_plater = this->m_plater;
m_plate_list[i]->m_partplate_list = this;
m_plate_list[i]->m_model = this->m_model;
m_plate_list[i]->printer_technology = this->printer_technology;
//check the previous sliced result
if (m_plate_list[i]->m_slice_result_valid) {
if ((i >= previous_sliced_result.size()) || !previous_sliced_result[i])
@ -4880,7 +4815,7 @@ int PartPlateList::store_to_3mf_structure(PlateDataPtrs& plate_data_list, bool w
PlateData* plate_data_item = new PlateData();
plate_data_item->locked = m_plate_list[i]->m_locked;
plate_data_item->plate_index = m_plate_list[i]->m_plate_index;
plate_data_item->plate_name = m_plate_list[i]->get_plate_name();
plate_data_item->plate_name = m_plate_list[i]->get_plate_name();
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": plate %1% before load, width %2%, height %3%, size %4%!")
%(i+1) %m_plate_list[i]->thumbnail_data.width %m_plate_list[i]->thumbnail_data.height %m_plate_list[i]->thumbnail_data.pixels.size();
plate_data_item->plate_thumbnail.load_from(m_plate_list[i]->thumbnail_data);
@ -4960,7 +4895,7 @@ int PartPlateList::load_from_3mf_structure(PlateDataPtrs& plate_data_list)
int index = create_plate(false);
m_plate_list[index]->m_locked = plate_data_list[i]->locked;
m_plate_list[index]->config()->apply(plate_data_list[i]->config);
m_plate_list[index]->set_plate_name(plate_data_list[i]->plate_name);
m_plate_list[index]->set_plate_name(plate_data_list[i]->plate_name);
if (plate_data_list[i]->plate_index != index)
{
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":plate index %1% seems invalid, skip it")% plate_data_list[i]->plate_index;

View file

@ -125,7 +125,6 @@ private:
GeometryBuffer m_height_limit_bottom;
GeometryBuffer m_height_limit_top;
GeometryBuffer m_del_icon;
GeometryBuffer m_plate_name_edit_icon;
//GeometryBuffer m_del_and_background_icon;
mutable unsigned int m_del_vbo_id{ 0 };
GeometryBuffer m_arrange_icon;
@ -138,7 +137,6 @@ private:
mutable unsigned int m_plate_settings_vbo_id{ 0 };
GeometryBuffer m_plate_idx_icon;
mutable unsigned int m_plate_idx_vbo_id{ 0 };
mutable unsigned int m_plate_name_edit_vbo_id{0};
GLTexture m_texture;
mutable float m_grabber_color[4];
@ -150,12 +148,14 @@ private:
// BBS
DynamicPrintConfig m_config;
// SoftFever
// part plate name
std::string m_name; // utf8 string
bool m_name_change = false;
GeometryBuffer m_plate_name_icon;
mutable unsigned int m_plate_name_vbo_id{0};
GLTexture m_name_texture;
std::string m_name;
GeometryBuffer m_plate_name_icon;
mutable unsigned int m_plate_name_vbo_id{ 0 };
GLTexture m_name_texture;
wxCoord m_name_texture_width;
wxCoord m_name_texture_height;
void init();
bool valid_instance(int obj_id, int instance_id);
@ -168,8 +168,6 @@ private:
void calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox);
void calc_height_limit();
void calc_vertex_for_number(int index, bool one_number, GeometryBuffer &buffer);
void calc_vertex_for_plate_name(GLTexture& texture, GeometryBuffer &buffer);
void calc_vertex_for_plate_name_edit_icon(GLTexture *texture, int index, GeometryBuffer &buffer);
void calc_vertex_for_icons(int index, GeometryBuffer &buffer);
void calc_vertex_for_icons_background(int icon_count, GeometryBuffer &buffer);
void render_background(bool force_default_color = false) const;
@ -186,9 +184,9 @@ private:
void render_left_arrow(const float* render_color, bool use_lighting) const;
void render_right_arrow(const float* render_color, bool use_lighting) const;
void render_icon_texture(int position_id, int tex_coords_id, const GeometryBuffer &buffer, GLTexture &texture, unsigned int &vbo_id) const;
void render_plate_name_texture(int position_id, int tex_coords_id);
void render_icons(bool bottom, bool only_body = false, int hover_id = -1);
void render_icons(bool bottom, bool only_name = false, int hover_id = -1);
void render_only_numbers(bool bottom) const;
void render_plate_name_texture(int position_id, int tex_coords_id);
void render_rectangle_for_picking(const GeometryBuffer &buffer, const float* render_color) const;
void on_render_for_picking() const;
std::array<float, 4> picking_color_component(int idx) const;
@ -254,16 +252,16 @@ public:
//set the plate's index
void set_index(int index);
// get the plate's index
//get the plate's index
int get_index() { return m_plate_index; }
// get the plate's name
// SoftFever
//get the plate's name
std::string get_plate_name() const { return m_name; }
bool generate_plate_name_texture();
// set the plate's name
void set_plate_name(const std::string &name);
void generate_plate_name_texture();
//set the plate's name
void set_plate_name(const std::string& name);
//get the print's object, result and index
void get_print(PrintBase **print, GCodeResult **result, int *index);
@ -356,8 +354,8 @@ public:
const BoundingBox get_bounding_box_crd();
BoundingBoxf3 get_build_volume()
{
Vec3d up_point(m_origin.x() + m_width, m_origin.y() + m_depth, m_origin.z() + m_height);
Vec3d low_point(m_origin.x(), m_origin.y(), m_origin.z());
Vec3d up_point = m_bounding_box.max + Vec3d(0, 0, m_origin.z() + m_height);
Vec3d low_point = m_bounding_box.min + Vec3d(0, 0, m_origin.z());
BoundingBoxf3 plate_box(low_point, up_point);
return plate_box;
}
@ -458,7 +456,7 @@ public:
std::vector<std::pair<int, int>> objects_and_instances;
std::vector<std::pair<int, int>> instances_outside;
ar(m_plate_index, m_print_index, m_origin, m_width, m_depth, m_height, m_locked, m_selected, m_ready_for_slice, m_slice_result_valid, m_apply_invalid, m_printable, m_tmp_gcode_path, objects_and_instances, instances_outside, m_config, m_name);
ar(m_plate_index, m_name, m_print_index, m_origin, m_width, m_depth, m_height, m_locked, m_selected, m_ready_for_slice, m_slice_result_valid, m_apply_invalid, m_printable, m_tmp_gcode_path, objects_and_instances, instances_outside, m_config);
for (std::vector<std::pair<int, int>>::iterator it = objects_and_instances.begin(); it != objects_and_instances.end(); ++it)
obj_to_instance_set.insert(std::pair(it->first, it->second));
@ -476,7 +474,7 @@ public:
for (std::set<std::pair<int, int>>::iterator it = obj_to_instance_set.begin(); it != obj_to_instance_set.end(); ++it)
objects_and_instances.emplace_back(it->first, it->second);
ar(m_plate_index, m_print_index, m_origin, m_width, m_depth, m_height, m_locked, m_selected, m_ready_for_slice, m_slice_result_valid, m_apply_invalid, m_printable,m_tmp_gcode_path, objects_and_instances, instances_outside, m_config, m_name);
ar(m_plate_index, m_name, m_print_index, m_origin, m_width, m_depth, m_height, m_locked, m_selected, m_ready_for_slice, m_slice_result_valid, m_apply_invalid, m_printable, m_tmp_gcode_path, objects_and_instances, instances_outside, m_config);
}
/*template<class Archive> void serialize(Archive& ar)
{
@ -656,9 +654,14 @@ public:
m_height_limit_mode = mode;
}
// SoftFever
const std::string& get_logo_texture_filename() const {
return m_logo_texture_filename;
}
int get_curr_plate_index() const { return m_current_plate; }
PartPlate* get_curr_plate() { return m_plate_list[m_current_plate]; }
const PartPlate *get_curr_plate() const { return m_plate_list[m_current_plate]; }
const PartPlate* get_curr_plate() const { return m_plate_list[m_current_plate]; }
std::vector<PartPlate*>& get_plate_list() { return m_plate_list; };
@ -676,7 +679,7 @@ public:
int select_plate(int index);
//get the plate counts, not including the invalid plate
int get_plate_count();
int get_plate_count() const;
//update the plate cols due to plate count change
void update_plate_cols();

View file

@ -8,7 +8,7 @@ wxDEFINE_EVENT(EVT_SET_BED_TYPE_CONFIRM, wxCommandEvent);
PlateSettingsDialog::PlateSettingsDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
:DPIDialog(parent, id, title, pos, size, style)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -23,10 +23,19 @@ PlateSettingsDialog::PlateSettingsDialog(wxWindow* parent, wxWindowID id, const
top_sizer->SetFlexibleDirection(wxBOTH);
top_sizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
m_bed_type_choice = new ComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(240),-1), 0, NULL, wxCB_READONLY );
auto plate_name_txt = new wxStaticText(this, wxID_ANY, _L("Plate name"));
plate_name_txt->SetFont(Label::Body_14);
m_ti_plate_name = new TextInput(this, wxString::FromDouble(0.0), "", "", wxDefaultPosition, wxSize(FromDIP(240),-1), wxTE_PROCESS_ENTER);
top_sizer->Add(plate_name_txt, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT |wxALL, FromDIP(5));
top_sizer->Add(m_ti_plate_name, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT |wxALL, FromDIP(5));
// bool is_bbl = wxGetApp().preset_bundle->printers.get_edited_preset().has_lidar(wxGetApp().preset_bundle);
m_bed_type_choice = new ComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(240), -1), 0,
NULL, wxCB_READONLY);
for (BedType i = btDefault; i < btCount; i = BedType(int(i) + 1)) {
m_bed_type_choice->Append(to_bed_type_name(i));
m_bed_type_choice->Append(to_bed_type_name(i));
}
m_bed_type_choice->Disable();
wxStaticText* m_bed_type_txt = new wxStaticText(this, wxID_ANY, _L("Bed type"));
m_bed_type_txt->SetFont(Label::Body_14);
top_sizer->Add(m_bed_type_txt, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, FromDIP(5));
@ -77,8 +86,8 @@ PlateSettingsDialog::PlateSettingsDialog(wxWindow* parent, wxWindowID id, const
m_sizer_main->Add(top_sizer, 0, wxEXPAND | wxALL, FromDIP(30));
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
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));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
@ -196,6 +205,12 @@ void PlateSettingsDialog::on_dpi_changed(const wxRect& suggested_rect)
m_button_cancel->Rescale();
}
wxString PlateSettingsDialog::get_plate_name() const {
return m_ti_plate_name->GetTextCtrl()->GetValue();
}
void PlateSettingsDialog::set_plate_name(const wxString &name) { m_ti_plate_name->GetTextCtrl()->SetValue(name); }
std::vector<int> PlateSettingsDialog::get_first_layer_print_seq()
{
return m_drag_canvas->get_shape_list_order();
@ -206,7 +221,7 @@ std::vector<int> PlateSettingsDialog::get_first_layer_print_seq()
PlateNameEditDialog::PlateNameEditDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style)
: DPIDialog(parent, id, title, pos, size, style)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -231,8 +246,8 @@ PlateNameEditDialog::PlateNameEditDialog(wxWindow *parent, wxWindowID id, const
m_sizer_main->Add(top_sizer, 0, wxEXPAND | wxALL, FromDIP(30));
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
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));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));

View file

@ -51,6 +51,9 @@ public:
return choice;
};
wxString get_plate_name() const;
void set_plate_name(const wxString& name);
int get_first_layer_print_seq_choice() {
int choice = 0;
if (m_first_layer_print_seq_choice != nullptr)
@ -67,6 +70,7 @@ protected:
ComboBox* m_bed_type_choice { nullptr };
Button* m_button_ok;
Button* m_button_cancel;
TextInput *m_ti_plate_name;
};
class PlateNameEditDialog : public DPIDialog

File diff suppressed because it is too large Load diff

View file

@ -23,7 +23,8 @@
#include "Jobs/SendJob.hpp"
#include "libslic3r/Model.hpp"
#include "libslic3r/PrintBase.hpp"
#include "libslic3r/Calib.hpp"
#include "libslic3r/calib.hpp"
#define FILAMENT_SYSTEM_COLORS_NUM 16
@ -37,6 +38,7 @@ class Button;
namespace Slic3r {
class BuildVolume;
enum class BuildVolume_Type : unsigned char;
class Model;
class ModelObject;
enum class ModelObjectCutAttribute : int;
@ -209,7 +211,7 @@ public:
const SLAPrint& sla_print() const;
SLAPrint& sla_print();
int new_project(bool skip_confirm = false, bool silent = false, const wxString &project_name = wxString());
int new_project(bool skip_confirm = false, bool silent = false, const wxString& project_name = wxString());
// BBS: save & backup
void load_project(wxString const & filename = "", wxString const & originfile = "-");
int save_project(bool saveAs = false);
@ -232,13 +234,15 @@ public:
void reload_gcode_from_disk();
void refresh_print();
// OrcaSlicer calibration
void calib_pa(const Calib_Params &params);
// SoftFever
void calib_pa(const Calib_Params& params);
void calib_flowrate(int pass);
void calib_temp(const Calib_Params &params);
void calib_max_vol_speed(const Calib_Params &params);
void calib_retraction(const Calib_Params &params);
void calib_VFA(const Calib_Params &params);
void calib_temp(const Calib_Params& params);
void calib_max_vol_speed(const Calib_Params& params);
void calib_retraction(const Calib_Params& params);
void calib_VFA(const Calib_Params& params);
BuildVolume_Type get_build_volume_type() const;
//BBS: add only gcode mode
bool only_gcode_mode() { return m_only_gcode; }
@ -736,8 +740,8 @@ private:
// BBS: add project slice related functions
int start_next_slice();
void _calib_pa_pattern(const Calib_Params &params);
void _calib_pa_tower(const Calib_Params &params);
void _calib_pa_pattern(const Calib_Params& params);
void _calib_pa_tower(const Calib_Params& params);
void _calib_pa_select_added_objects();
friend class SuppressBackgroundProcessingUpdate;

View file

@ -149,7 +149,7 @@ wxBoxSizer *PreferencesDialog::create_item_language_combobox(
language_name = wxString::FromUTF8("Ukrainian");
}
if (language == vlist[i]->CanonicalName) {
if (app_config->get(param) == vlist[i]->CanonicalName) {
m_current_language_selected = i;
}
combobox->Append(language_name);
@ -193,7 +193,7 @@ wxBoxSizer *PreferencesDialog::create_item_language_combobox(
// or sometimes the application crashes into wxDialogBase() destructor
// so we put it into an inner scope
MessageDialog msg_wingow(nullptr, _L("Switching the language requires application restart.\n") + "\n" + _L("Do you want to continue?"),
_L("Language selection"), wxICON_QUESTION | wxOK | wxCANCEL);
L("Language selection"), wxICON_QUESTION | wxOK | wxCANCEL);
if (msg_wingow.ShowModal() == wxID_CANCEL) {
combobox->SetSelection(m_current_language_selected);
return;

View file

@ -371,7 +371,7 @@ void PresetComboBox::update_from_bundle()
void PresetComboBox::add_ams_filaments(std::string selected, bool alias_name)
{
bool is_bbl_vendor_preset = m_preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(m_preset_bundle);
bool is_bbl_vendor_preset = m_preset_bundle->printers.get_edited_preset().has_lidar(m_preset_bundle);
if (is_bbl_vendor_preset && !m_preset_bundle->filament_ams_list.empty()) {
set_label_marker(Append(separator(L("AMS filaments")), wxNullBitmap));
m_first_ams_filament = GetCount();
@ -1017,9 +1017,8 @@ void PlaterPresetComboBox::update()
//if (i + 1 == m_collection->num_default_presets())
// set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
}
if (m_type == Preset::TYPE_FILAMENT)
add_ams_filaments(into_u8(selected_user_preset.empty() ? selected_system_preset : selected_user_preset), true);
if (m_type == Preset::TYPE_FILAMENT && m_preset_bundle->printers.get_edited_preset().has_lidar(m_preset_bundle))
add_ams_filaments(into_u8(selected_user_preset), true);
//BBS: add project embedded preset logic
if (!project_embedded_presets.empty())
@ -1246,7 +1245,7 @@ void TabPresetComboBox::update()
// set_label_marker(Append(separator(L("System presets")), wxNullBitmap));
}
if (m_type == Preset::TYPE_FILAMENT)
if (m_type == Preset::TYPE_FILAMENT && m_preset_bundle->printers.get_edited_preset().has_lidar(m_preset_bundle))
add_ams_filaments(into_u8(selected));
//BBS: add project embedded preset logic

View file

@ -587,7 +587,7 @@ void gstbambusrc_register()
return;
did_register = 1;
gst_plugin_register_static(GST_VERSION_MAJOR, GST_VERSION_MINOR, "bambusrc", "Bambu Lab source", gstbambusrc_init, "0.0.1", "GPL", "OrcaSlicer", "OrcaSlicer", "https://github.com/bambulab/OrcaSlicer");
gst_plugin_register_static(GST_VERSION_MAJOR, GST_VERSION_MINOR, "bambusrc", "Bambu Lab source", gstbambusrc_init, "0.0.1", "GPL", "BambuStudio", "BambuStudio", "https://github.com/bambulab/BambuStudio");
}
#else
@ -596,6 +596,6 @@ void gstbambusrc_register()
#define PACKAGE "bambusrc"
#endif
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, bambusrc, "Bambu Lab source", gstbambusrc_init, "0.0.1", "GPL", "OrcaSlicer", "https://github.com/bambulab/OrcaSlicer")
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, bambusrc, "Bambu Lab source", gstbambusrc_init, "0.0.1", "GPL", "BambuStudio", "https://github.com/bambulab/BambuStudio")
#endif

View file

@ -66,7 +66,7 @@ PrivacyUpdateDialog::PrivacyUpdateDialog(wxWindow* parent, wxWindowID id, const
m_sizer_right->Add(m_vebview_release_note, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(15));
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(220, 220, 220), StateColor::Hovered),

View file

@ -37,7 +37,7 @@
#define AUFILE_GREY500 wxColour(158, 158, 158)
#define AUFILE_GREY300 wxColour(238, 238, 238)
#define AUFILE_GREY200 wxColour(248, 248, 248)
#define AUFILE_BRAND wxColour(0, 174, 66)
#define AUFILE_BRAND wxColour(0, 150, 136)
#define AUFILE_BRAND_TRANSPARENT wxColour(215, 232, 222)
//#define AUFILE_PICTURES_SIZE wxSize(FromDIP(300), FromDIP(300))
//#define AUFILE_PICTURES_PANEL_SIZE wxSize(FromDIP(300), FromDIP(340))

View file

@ -36,7 +36,7 @@ wxDEFINE_EVENT(EVT_SECONDARY_CHECK_RETRY, wxCommandEvent);
ReleaseNoteDialog::ReleaseNoteDialog(Plater *plater /*= nullptr*/)
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Release Note"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -50,7 +50,7 @@ ReleaseNoteDialog::ReleaseNoteDialog(Plater *plater /*= nullptr*/)
m_sizer_body->Add(0, 0, 0, wxLEFT, FromDIP(38));
auto sm = create_scaled_bitmap("BambuStudio", nullptr, 70);
auto sm = create_scaled_bitmap("OrcaSlicer", nullptr, 70);
auto brand = new wxStaticBitmap(this, wxID_ANY, sm, wxDefaultPosition, wxSize(FromDIP(70), FromDIP(70)));
m_sizer_body->Add(brand, 0, wxALL, 0);
@ -106,7 +106,7 @@ void ReleaseNoteDialog::update_release_note(wxString release_note, std::string v
UpdatePluginDialog::UpdatePluginDialog(wxWindow* parent /*= nullptr*/)
: DPIDialog(static_cast<wxWindow*>(wxGetApp().mainframe), wxID_ANY, _L("Network plug-in update"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -120,7 +120,7 @@ UpdatePluginDialog::UpdatePluginDialog(wxWindow* parent /*= nullptr*/)
auto sm = create_scaled_bitmap("BambuStudio", nullptr, 55);
auto sm = create_scaled_bitmap("OrcaSlicer", nullptr, 55);
auto brand = new wxStaticBitmap(this, wxID_ANY, sm, wxDefaultPosition, wxSize(FromDIP(55), FromDIP(55)));
wxBoxSizer* m_sizer_right = new wxBoxSizer(wxVERTICAL);
@ -142,7 +142,7 @@ UpdatePluginDialog::UpdatePluginDialog(wxWindow* parent /*= nullptr*/)
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
@ -248,7 +248,7 @@ void UpdatePluginDialog::update_info(std::string json_path)
UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
: DPIDialog(parent, wxID_ANY, _L("New version of Bambu Studio"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX | wxRESIZE_BORDER)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -262,7 +262,7 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
auto sm = create_scaled_bitmap("BambuStudio", nullptr, 70);
auto sm = create_scaled_bitmap("OrcaSlicer", nullptr, 70);
m_brand = new wxStaticBitmap(this, wxID_ANY, sm, wxDefaultPosition, wxSize(FromDIP(70), FromDIP(70)));
@ -311,7 +311,7 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
@ -508,7 +508,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
:DPIFrame(parent, id, title, pos, size, style)
{
m_button_style = btn_style;
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -531,7 +531,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
auto bottom_sizer = new wxBoxSizer(wxVERTICAL);
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
@ -790,7 +790,7 @@ void SecondaryCheckDialog::rescale()
ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum ButtonStyle btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check)
:DPIDialog(parent, id, title, pos, size, style)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -813,7 +813,7 @@ ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id
auto bottom_sizer = new wxBoxSizer(wxVERTICAL);
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
@ -983,7 +983,7 @@ void ConfirmBeforeSendDialog::rescale()
InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
:DPIDialog(static_cast<wxWindow*>(wxGetApp().mainframe), wxID_ANY, _L("LAN Connection Failed (Sending print file)"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -1057,7 +1057,7 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
auto sizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
@ -1219,7 +1219,7 @@ void InputIpAddressDialog::set_machine_obj(MachineObject* obj)
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
if (isIp(str_ip.ToStdString()) && str_access_code.Length() == 8) {
m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);
@ -1356,7 +1356,7 @@ void InputIpAddressDialog::on_check_ip_address_failed(wxCommandEvent& evt)
{
update_error_msg(_L("Error: IP or Access Code are not correct"));
m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);
@ -1369,7 +1369,7 @@ void InputIpAddressDialog::on_text(wxCommandEvent& evt)
if (isIp(str_ip.ToStdString()) && str_access_code.Length() == 8) {
m_button_ok->Enable(true);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok->SetTextColor(StateColor::darkModeColorFor("#FFFFFE"));
m_button_ok->SetBackgroundColor(btn_bg_green);

View file

@ -934,7 +934,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
SetFont(wxGetApp().normal_font());
// icon
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
Freeze();
@ -1110,7 +1110,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_sizer_backup = new wxBoxSizer(wxHORIZONTAL);
m_ams_backup_tip = new Label(this, _L("Auto Refill"));
m_ams_backup_tip->SetFont(::Label::Head_12);
m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42));
m_ams_backup_tip->SetForegroundColour(wxColour(0x009688));
m_ams_backup_tip->SetBackgroundColour(*wxWHITE);
img_ams_backup = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
img_ams_backup->SetBackgroundColour(*wxWHITE);
@ -1154,8 +1154,8 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_comboBox_printer->Bind(wxEVT_COMBOBOX, &SelectMachineDialog::on_selection_changed, this);
m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5));
m_btn_bg_enable = StateColor(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
m_btn_bg_enable = StateColor(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));
m_button_refresh = new Button(this, _L("Refresh"));
m_button_refresh->SetBackgroundColor(m_btn_bg_enable);
@ -1247,7 +1247,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_statictext_finish = new wxStaticText(m_panel_finish, wxID_ANY, L("send completed"), wxDefaultPosition, wxDefaultSize, 0);
m_statictext_finish->Wrap(-1);
m_statictext_finish->SetForegroundColour(wxColour(0, 174, 66));
m_statictext_finish->SetForegroundColour(wxColour(0, 150, 136));
m_sizer_finish_h->Add(m_statictext_finish, 0, wxALIGN_CENTER | wxALL, FromDIP(5));
m_sizer_finish_v->Add(m_sizer_finish_h, 1, wxALIGN_CENTER, 0);
@ -1328,7 +1328,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_link_network_state = new Label(m_sw_print_failed_info, _L("Check the status of current system services"));
m_link_network_state->SetForegroundColour(0x00AE42);
m_link_network_state->SetForegroundColour(0x009688);
m_link_network_state->SetFont(::Label::Body_12);
m_link_network_state->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_network_check();});
m_link_network_state->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_HAND);});
@ -2379,7 +2379,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
void SelectMachineDialog::Enable_Auto_Refill(bool enable)
{
if (enable) {
m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42));
m_ams_backup_tip->SetForegroundColour(wxColour(0x009688));
}
else {
m_ams_backup_tip->SetForegroundColour(wxColour(0x90, 0x90, 0x90));
@ -3988,7 +3988,7 @@ void SelectMachineDialog::update_lan_machine_list()
EditDevNameDialog::EditDevNameDialog(Plater *plater /*= nullptr*/)
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Modifying the device name"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
{
std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str();
std::string icon_path = (boost::format("%1%/images/OrcaSlicerTitle.ico") % resources_dir()).str();
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
@ -4010,9 +4010,9 @@ EditDevNameDialog::EditDevNameDialog(Plater *plater /*= nullptr*/)
m_button_confirm = new Button(this, _L("Confirm"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed), std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
m_button_confirm->SetBackgroundColor(btn_bg_green);
m_button_confirm->SetBorderColor(wxColour(0, 174, 66));
m_button_confirm->SetBorderColor(wxColour(0, 150, 136));
m_button_confirm->SetTextColor(wxColour(255, 255, 255));
m_button_confirm->SetSize(wxSize(FromDIP(72), FromDIP(24)));
m_button_confirm->SetMinSize(wxSize(FromDIP(72), FromDIP(24)));

View file

@ -437,7 +437,7 @@ static std::string generate_system_info_json()
);
#endif // __WXGTK__
data_node.put("SystemLanguage", sys_language);
data_node.put("TranslationLanguage: ", wxGetApp().current_language_code_safe());
data_node.put("TranslationLanguage: ", wxGetApp().app_config->get("language"));
pt::ptree hw_node;

View file

@ -381,7 +381,7 @@ SendToPrinterDialog::SendToPrinterDialog(Plater *plater)
m_link_network_state = new Label(m_sw_print_failed_info, _L("Check the status of current system services"));
m_link_network_state->SetForegroundColour(0x00AE42);
m_link_network_state->SetForegroundColour(0x009688);
m_link_network_state->SetFont(::Label::Body_12);
m_link_network_state->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_network_check(); });
m_link_network_state->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_HAND); });
@ -1171,7 +1171,7 @@ void SendToPrinterDialog::show_status(PrintDialogStatus status, std::vector<wxSt
Enable_Refresh_Button(true);
}
else if (status == PrintDialogStatus::PrintStatusNotOnTheSameLAN) {
wxString msg_text = _L("The printer is required to be in the same LAN as Orca Slicer.");
wxString msg_text = _L("The printer is required to be in the same LAN as Bambu Studio.");
update_print_status_msg(msg_text, true, true);
Enable_Send_Button(false);
Enable_Refresh_Button(true);
@ -1233,7 +1233,7 @@ void SendToPrinterDialog::set_default()
if (filename.empty()) filename = _L("Untitled");
}
fs::path filename_path(filename.ToStdWstring());
fs::path filename_path(filename.c_str());
m_current_project_name = wxString::FromUTF8(filename_path.filename().string());
//unsupported character filter
@ -1352,4 +1352,4 @@ SendToPrinterDialog::~SendToPrinterDialog()
}
}
}
}

View file

@ -26,7 +26,7 @@ SingleChoiceDialog::SingleChoiceDialog(const wxString &message, const wxString &
wxBoxSizer *bSizer_button = new wxBoxSizer(wxHORIZONTAL);
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
m_button_ok = new Button(this, _L("OK"));

View file

@ -39,13 +39,13 @@ static const wxColour STATIC_BOX_LINE_COL = wxColour(238, 238, 238);
static const wxColour BUTTON_NORMAL1_COL = wxColour(238, 238, 238);
static const wxColour BUTTON_NORMAL2_COL = wxColour(206, 206, 206);
static const wxColour BUTTON_PRESS_COL = wxColour(172, 172, 172);
static const wxColour BUTTON_HOVER_COL = wxColour(0, 174, 66);
static const wxColour BUTTON_HOVER_COL = wxColour(0, 150, 136);
static const wxColour DISCONNECT_TEXT_COL = wxColour(171, 172, 172);
static const wxColour NORMAL_TEXT_COL = wxColour(48,58,60);
static const wxColour NORMAL_FAN_TEXT_COL = wxColour(107, 107, 107);
static const wxColour WARNING_INFO_BG_COL = wxColour(255, 111, 0);
static const wxColour STAGE_TEXT_COL = wxColour(0, 174, 66);
static const wxColour STAGE_TEXT_COL = wxColour(0, 150, 136);
static const wxColour GROUP_STATIC_LINE_COL = wxColour(206, 206, 206);
@ -294,12 +294,12 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
m_staticText_progress_percent = new wxStaticText(penel_text, wxID_ANY, L("0"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText_progress_percent->SetFont(::Label::Head_18);
m_staticText_progress_percent->SetMaxSize(wxSize(-1, FromDIP(20)));
m_staticText_progress_percent->SetForegroundColour(wxColour(0, 174, 66));
m_staticText_progress_percent->SetForegroundColour(wxColour(0, 150, 136));
m_staticText_progress_percent_icon = new wxStaticText(penel_text, wxID_ANY, L("%"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText_progress_percent_icon->SetFont(::Label::Body_11);
m_staticText_progress_percent_icon->SetMaxSize(wxSize(-1, FromDIP(13)));
m_staticText_progress_percent_icon->SetForegroundColour(wxColour(0, 174, 66));
m_staticText_progress_percent_icon->SetForegroundColour(wxColour(0, 150, 136));
sizer_percent->Add(m_staticText_progress_percent, 0, 0, 0);
@ -347,8 +347,8 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
penel_bottons->SetSizer(bSizer_buttons);
penel_bottons->Layout();
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
m_button_market_scoring = new Button(parent, _L("Immediately score"));
@ -829,8 +829,8 @@ wxBoxSizer *StatusBasePanel::create_machine_control_page(wxWindow *parent)
m_staticText_control->SetFont(PAGE_TITLE_FONT);
m_staticText_control->SetForegroundColour(PAGE_TITLE_FONT_COL);
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Disabled), std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
m_options_btn = new Button(m_panel_control_title, _L("Print Options"));
@ -1036,7 +1036,7 @@ wxBoxSizer *StatusBasePanel::create_misc_control(wxWindow *parent)
m_switch_nozzle_fan->SetTextColor(StateColor(std::make_pair(DISCONNECT_TEXT_COL, (int) StateColor::Disabled), std::make_pair(NORMAL_FAN_TEXT_COL, (int) StateColor::Normal)));
m_switch_nozzle_fan->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
m_fan_panel->SetBackgroundColor(wxColour(0, 174, 66));
m_fan_panel->SetBackgroundColor(wxColour(0, 150, 136));
});
m_switch_nozzle_fan->Bind(wxEVT_LEAVE_WINDOW, [this, parent](auto& e) {
@ -1056,7 +1056,7 @@ wxBoxSizer *StatusBasePanel::create_misc_control(wxWindow *parent)
StateColor(std::make_pair(DISCONNECT_TEXT_COL, (int) StateColor::Disabled), std::make_pair(NORMAL_FAN_TEXT_COL, (int) StateColor::Normal)));
m_switch_printing_fan->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
m_fan_panel->SetBackgroundColor(wxColour(0, 174, 66));
m_fan_panel->SetBackgroundColor(wxColour(0, 150, 136));
});
m_switch_printing_fan->Bind(wxEVT_LEAVE_WINDOW, [this, parent](auto& e) {
@ -1076,7 +1076,7 @@ wxBoxSizer *StatusBasePanel::create_misc_control(wxWindow *parent)
StateColor(std::make_pair(DISCONNECT_TEXT_COL, (int)StateColor::Disabled), std::make_pair(NORMAL_FAN_TEXT_COL, (int)StateColor::Normal)));
m_switch_cham_fan->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
m_fan_panel->SetBackgroundColor(wxColour(0, 174, 66));
m_fan_panel->SetBackgroundColor(wxColour(0, 150, 136));
});
m_switch_cham_fan->Bind(wxEVT_LEAVE_WINDOW, [this, parent](auto& e) {

View file

@ -203,7 +203,6 @@ protected:
wxStaticText * m_staticText_progress_percent;
wxStaticText * m_staticText_progress_percent_icon;
wxStaticText * m_staticText_progress_left;
wxStaticText * m_staticText_progress_end;
wxStaticText * m_staticText_layers;
Button * m_button_report;
ScalableButton *m_button_pause_resume;

View file

@ -43,6 +43,8 @@
#include "MarkdownTip.hpp"
#include "Search.hpp"
#include "BedShapeDialog.hpp"
// #include "BonjourDialog.hpp"
#ifdef WIN32
#include <commctrl.h>
#endif // WIN32
@ -860,7 +862,7 @@ void TabPrinter::init_options_list()
for (const std::string& opt_key : m_config->keys())
{
if (opt_key == "printable_area" || opt_key == "bed_exclude_area") {
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" | opt_key == "thumbnails") {
m_options_list.emplace(opt_key, m_opt_status_value);
continue;
}
@ -1422,7 +1424,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
new_conf.set_key_value("support_style", new ConfigOptionEnum<SupportMaterialStyle>(smsDefault));
m_config_manipulation.apply(m_config, &new_conf);
}
#if 0
// BBS popup a message to ask the user to set optimum parameters for tree support
if (opt_key == "support_type" || opt_key == "support_style") {
if (is_tree_slim(m_config->opt_enum<SupportType>("support_type"), m_config->opt_enum<SupportMaterialStyle>("support_style")) &&
@ -1459,7 +1461,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
wxGetApp().plater()->update();
}
}
#endif
// BBS popup a message to ask the user to set optimum parameters for support interface if support materials are used
if (opt_key == "support_interface_filament") {
int interface_filament_id = m_config->opt_int("support_interface_filament") - 1; // the displayed id is based from 1, while internal id is based from 0
@ -1642,7 +1644,7 @@ void Tab::on_presets_changed()
// Instead of PostEvent (EVT_TAB_PRESETS_CHANGED) just call update_presets
wxGetApp().plater()->sidebar().update_presets(m_type);
bool is_bbl_vendor_preset = wxGetApp().preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(wxGetApp().preset_bundle);
bool is_bbl_vendor_preset = wxGetApp().preset_bundle->printers.get_edited_preset().has_lidar(wxGetApp().preset_bundle);
if (is_bbl_vendor_preset) {
wxGetApp().plater()->get_partplate_list().set_render_option(true, true);
if (wxGetApp().preset_bundle->printers.get_edited_preset().has_cali_lines(wxGetApp().preset_bundle)) {
@ -1651,7 +1653,7 @@ void Tab::on_presets_changed()
wxGetApp().plater()->get_partplate_list().set_render_cali(false);
}
} else {
wxGetApp().plater()->get_partplate_list().set_render_option(false, false);
wxGetApp().plater()->get_partplate_list().set_render_option(false, true);
wxGetApp().plater()->get_partplate_list().set_render_cali(false);
}
@ -1848,8 +1850,12 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Seam"), L"param_seam");
optgroup->append_single_option_line("seam_position", "Seam");
optgroup->append_single_option_line("seam_gap", "Seam");
optgroup->append_single_option_line("staggered_inner_seams", "Seam");
optgroup->append_single_option_line("seam_gap","Seam");
optgroup->append_single_option_line("role_based_wipe_speed","Seam");
optgroup->append_single_option_line("wipe_speed", "Seam");
optgroup->append_single_option_line("wipe_on_loops","Seam");
optgroup = page->new_optgroup(L("Precision"), L"param_precision");
optgroup->append_single_option_line("slice_closing_radius");
@ -1858,6 +1864,7 @@ void TabPrint::build()
optgroup->append_single_option_line("xy_hole_compensation");
optgroup->append_single_option_line("xy_contour_compensation");
optgroup->append_single_option_line("elefant_foot_compensation");
optgroup->append_single_option_line("precise_outer_wall");
optgroup = page->new_optgroup(L("Ironing"), L"param_ironing");
optgroup->append_single_option_line("ironing_type");
@ -1877,13 +1884,19 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
optgroup->append_single_option_line("wall_infill_order");
optgroup->append_single_option_line("print_flow_ratio");
optgroup->append_single_option_line("bridge_flow");
optgroup->append_single_option_line("bridge_density");
optgroup->append_single_option_line("thick_bridges");
optgroup->append_single_option_line("top_solid_infill_flow_ratio");
optgroup->append_single_option_line("initial_layer_flow_ratio");
optgroup->append_single_option_line("top_one_wall_type");
optgroup->append_single_option_line("bottom_solid_infill_flow_ratio");
optgroup->append_single_option_line("only_one_wall_top");
optgroup->append_single_option_line("min_width_top_surface");
optgroup->append_single_option_line("only_one_wall_first_layer");
optgroup->append_single_option_line("detect_overhang_wall");
optgroup->append_single_option_line("make_overhang_printable");
optgroup->append_single_option_line("make_overhang_printable_angle");
optgroup->append_single_option_line("make_overhang_printable_hole_size");
optgroup->append_single_option_line("reduce_crossing_wall");
optgroup->append_single_option_line("max_travel_detour_distance");
@ -1901,11 +1914,12 @@ void TabPrint::build()
optgroup->append_single_option_line("bottom_shell_thickness");
optgroup->append_single_option_line("internal_solid_infill_pattern");
optgroup = page->new_optgroup(L("Sparse infill"), L"param_infill");
optgroup = page->new_optgroup(L("Infill"), L"param_infill");
optgroup->append_single_option_line("sparse_infill_density");
optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse");
optgroup->append_single_option_line("sparse_infill_anchor");
optgroup->append_single_option_line("sparse_infill_anchor_max");
optgroup->append_single_option_line("infill_anchor");
optgroup->append_single_option_line("infill_anchor_max");
optgroup->append_single_option_line("filter_out_gap_fill");
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
@ -1922,13 +1936,22 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Initial layer speed"), L"param_speed_first", 15);
optgroup->append_single_option_line("initial_layer_speed");
optgroup->append_single_option_line("initial_layer_infill_speed");
optgroup->append_single_option_line("initial_layer_travel_speed");
optgroup->append_single_option_line("slow_down_layers");
optgroup = page->new_optgroup(L("Other layers speed"), L"param_speed", 15);
optgroup->append_single_option_line("outer_wall_speed");
optgroup->append_single_option_line("inner_wall_speed");
optgroup->append_single_option_line("small_perimeter_speed");
optgroup->append_single_option_line("small_perimeter_threshold");
optgroup->append_single_option_line("sparse_infill_speed");
optgroup->append_single_option_line("internal_solid_infill_speed");
optgroup->append_single_option_line("top_surface_speed");
optgroup->append_single_option_line("gap_infill_speed");
optgroup->append_single_option_line("support_speed");
optgroup->append_single_option_line("support_interface_speed");
optgroup = page->new_optgroup(L("Overhang speed"), L"param_speed", 15);
optgroup->append_single_option_line("enable_overhang_speed", "slow-down-for-overhang");
optgroup->append_single_option_line("overhang_speed_classic", "slow-down-for-overhang");
Line line = { L("Overhang speed"), L("This is the speed for various overhang degrees. Overhang degrees are expressed as a percentage of line width. 0 speed means no slowing down for the overhang degree range and wall speed is used") };
line.label_path = "slow-down-for-overhang";
line.append_option(optgroup->get_option("overhang_1_4_speed"));
@ -1936,25 +1959,29 @@ void TabPrint::build()
line.append_option(optgroup->get_option("overhang_3_4_speed"));
line.append_option(optgroup->get_option("overhang_4_4_speed"));
optgroup->append_line(line);
optgroup->append_single_option_line("bridge_speed");
optgroup->append_single_option_line("gap_infill_speed");
optgroup->append_single_option_line("support_speed");
optgroup->append_single_option_line("support_interface_speed");
optgroup->append_separator();
line = { L("Bridge"), L("Set speed for external and internal bridges") };
line.append_option(optgroup->get_option("bridge_speed"));
line.append_option(optgroup->get_option("internal_bridge_speed"));
optgroup->append_line(line);
optgroup = page->new_optgroup(L("Travel speed"), L"param_travel_speed", 15);
optgroup->append_single_option_line("travel_speed");
optgroup = page->new_optgroup(L("Acceleration"), L"param_acceleration", 15);
optgroup->append_single_option_line("default_acceleration");
optgroup->append_single_option_line("initial_layer_acceleration");
optgroup->append_single_option_line("outer_wall_acceleration");
optgroup->append_single_option_line("inner_wall_acceleration");
optgroup->append_single_option_line("top_surface_acceleration");
optgroup->append_single_option_line("bridge_acceleration");
optgroup->append_single_option_line("sparse_infill_acceleration");
optgroup->append_single_option_line("internal_solid_infill_acceleration");
optgroup->append_single_option_line("initial_layer_acceleration");
optgroup->append_single_option_line("top_surface_acceleration");
optgroup->append_single_option_line("travel_acceleration");
optgroup->append_single_option_line("accel_to_decel_enable");
optgroup->append_single_option_line("accel_to_decel_factor");
optgroup = page->new_optgroup(L("Jerk(XY)"), L"param_acceleration", 15);
optgroup = page->new_optgroup(L("Jerk(XY)"), L"param_speed", 15);
optgroup->append_single_option_line("default_jerk");
optgroup->append_single_option_line("outer_wall_jerk");
optgroup->append_single_option_line("inner_wall_jerk");
@ -1997,6 +2024,8 @@ void TabPrint::build()
optgroup->append_single_option_line("tree_support_branch_diameter", "support#tree-support-only-options");
optgroup->append_single_option_line("tree_support_branch_angle", "support#tree-support-only-options");
optgroup->append_single_option_line("tree_support_wall_count");
optgroup->append_single_option_line("tree_support_adaptive_layer_height");
optgroup->append_single_option_line("tree_support_auto_brim");
optgroup->append_single_option_line("tree_support_brim_width");
optgroup->append_single_option_line("support_top_z_distance", "support#top-z-distance");
optgroup->append_single_option_line("support_bottom_z_distance", "support#bottom-z-distance");
@ -2019,12 +2048,15 @@ void TabPrint::build()
page = add_options_page(L("Others"), "advanced");
optgroup = page->new_optgroup(L("Bed adhension"), L"param_adhension");
optgroup->append_single_option_line("skirt_loops");
optgroup->append_single_option_line("skirt_height");
optgroup->append_single_option_line("skirt_distance");
optgroup->append_single_option_line("skirt_height");
optgroup->append_single_option_line("skirt_speed");
//optgroup->append_single_option_line("draft_shield");
optgroup->append_single_option_line("brim_type", "auto-brim");
optgroup->append_single_option_line("brim_width", "auto-brim#manual");
optgroup->append_single_option_line("brim_object_gap", "auto-brim#brim-object-gap");
optgroup->append_single_option_line("brim_ears_max_angle");
optgroup->append_single_option_line("brim_ears_detection_length");
optgroup = page->new_optgroup(L("Prime tower"), L"param_tower");
optgroup->append_single_option_line("enable_prime_tower");
@ -2051,12 +2083,17 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("G-code output"), L"param_gcode");
optgroup->append_single_option_line("reduce_infill_retraction");
optgroup->append_single_option_line("gcode_add_line_number");
optgroup->append_single_option_line("gcode_comments");
optgroup->append_single_option_line("gcode_label_objects");
optgroup->append_single_option_line("exclude_object");
Option option = optgroup->get_option("filename_format");
option.opt.full_width = true;
// option.opt.full_width = true;
option.opt.is_code = true;
option.opt.multiline = true;
// option.opt.height = 5;
optgroup->append_single_option_line(option);
optgroup = page->new_optgroup(L("Post-processing scripts"), L"param_gcode", 0);
optgroup = page->new_optgroup(L("Post-processing Scripts"), L"param_gcode", 0);
option = optgroup->get_option("post_process");
option.opt.full_width = true;
option.opt.is_code = true;
@ -2109,7 +2146,7 @@ void TabPrint::toggle_options()
if (!m_active_page) return;
// BBS: whether the preset is Bambu Lab printer
if (m_preset_bundle) {
bool is_BBL_printer = m_preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(m_preset_bundle);
bool is_BBL_printer = m_preset_bundle->printers.get_edited_preset().has_lidar(m_preset_bundle);
m_config_manipulation.set_is_BBL_Printer(is_BBL_printer);
}
@ -2546,16 +2583,21 @@ void TabFilament::add_filament_overrides_page()
for (const std::string opt_key : { "filament_retraction_length",
"filament_z_hop",
"filament_z_hop_types",
"filament_z_hop_types",
"filament_retract_lift_above",
"filament_retract_lift_below",
"filament_retract_lift_enforce",
"filament_retraction_speed",
"filament_deretraction_speed",
//"filament_retract_restart_extra",
"filament_retract_restart_extra",
"filament_retraction_minimum_travel",
"filament_retract_when_changing_layer",
"filament_wipe",
//BBS
"filament_wipe_distance",
"filament_retract_before_wipe"
"filament_retract_before_wipe",
//SoftFever
// "filament_seam_gap"
})
append_single_option_line(opt_key, extruder_idx);
}
@ -2578,16 +2620,21 @@ void TabFilament::update_filament_overrides_page()
std::vector<std::string> opt_keys = { "filament_retraction_length",
"filament_z_hop",
"filament_z_hop_types",
"filament_z_hop_types",
"filament_retract_lift_above",
"filament_retract_lift_below",
"filament_retract_lift_enforce",
"filament_retraction_speed",
"filament_deretraction_speed",
//"filament_retract_restart_extra",
"filament_retract_restart_extra",
"filament_retraction_minimum_travel",
"filament_retract_when_changing_layer",
"filament_wipe",
//BBS
"filament_wipe_distance",
"filament_retract_before_wipe"
"filament_retract_before_wipe",
//SoftFever
// "filament_seam_gap"
};
const int extruder_idx = 0; // #ys_FIXME
@ -2630,9 +2677,12 @@ void TabFilament::build()
optgroup->append_single_option_line("default_filament_colour");
optgroup->append_single_option_line("filament_diameter");
optgroup->append_single_option_line("filament_flow_ratio");
optgroup->append_single_option_line("enable_pressure_advance");
optgroup->append_single_option_line("pressure_advance");
optgroup->append_single_option_line("filament_density");
optgroup->append_single_option_line("filament_shrink");
optgroup->append_single_option_line("filament_cost");
//BBS
optgroup->append_single_option_line("temperature_vitrification");
@ -2645,19 +2695,21 @@ void TabFilament::build()
optgroup->append_single_option_line("bed_temperature_difference");
optgroup = page->new_optgroup(L("Print temperature"), L"param_temperature");
optgroup->append_single_option_line("chamber_temperatures");
optgroup->append_single_option_line("chamber_temperature");
optgroup->append_separator();
line = { L("Nozzle"), L("Nozzle temperature when printing") };
line.append_option(optgroup->get_option("nozzle_temperature_initial_layer"));
line.append_option(optgroup->get_option("nozzle_temperature"));
optgroup->append_line(line);
line = { L("Cool Plate / PLA Plate"), L("Bed temperature when cool plate is installed. Value 0 means the filament does not support to print on the Cool Plate") };
line = { L("Cool plate"), L("Bed temperature when cool plate is installed. Value 0 means the filament does not support to print on the Cool Plate") };
line.append_option(optgroup->get_option("cool_plate_temp_initial_layer"));
line.append_option(optgroup->get_option("cool_plate_temp"));
optgroup->append_line(line);
line = { L("Engineering Plate"), L("Bed temperature when engineering plate is installed. Value 0 means the filament does not support to print on the Engineering Plate") };
line = { L("Engineering plate"), L("Bed temperature when engineering plate is installed. Value 0 means the filament does not support to print on the Engineering Plate") };
line.append_option(optgroup->get_option("eng_plate_temp_initial_layer"));
line.append_option(optgroup->get_option("eng_plate_temp"));
optgroup->append_line(line);
@ -2719,8 +2771,8 @@ void TabFilament::build()
//};
//optgroup->append_line(line);
optgroup = page->new_optgroup(L("Cooling for specific layer"), L"param_cooling");
optgroup->append_single_option_line("close_fan_the_first_x_layers", "auto-cooling");
//optgroup->append_single_option_line("full_fan_speed_layer");
optgroup->append_single_option_line("close_fan_the_first_x_layers", "auto-cooling");
optgroup->append_single_option_line("full_fan_speed_layer");
optgroup = page->new_optgroup(L("Part cooling fan"), L"param_cooling_fan");
line = { L("Min fan speed threshold"), L("Part cooling fan speed will start to run at min speed when the estimated layer time is no longer than the layer time in setting. When layer time is shorter than threshold, fan speed is interpolated between the minimum and maximum fan speed according to layer printing time") };
@ -2740,6 +2792,7 @@ void TabFilament::build()
optgroup->append_single_option_line("enable_overhang_bridge_fan", "auto-cooling");
optgroup->append_single_option_line("overhang_fan_threshold", "auto-cooling");
optgroup->append_single_option_line("overhang_fan_speed", "auto-cooling");
optgroup->append_single_option_line("support_material_interface_fan_speed");
optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_fan");
optgroup->append_single_option_line("additional_cooling_fan_speed");
@ -2835,39 +2888,35 @@ void TabFilament::toggle_options()
{
if (!m_active_page)
return;
bool is_BBL_printer = false;
if (m_preset_bundle) {
is_BBL_printer =
m_preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(
m_preset_bundle);
is_BBL_printer =
m_preset_bundle->printers.get_edited_preset().has_lidar(
m_preset_bundle);
}
if (m_active_page->title() == "Cooling")
{
bool cooling = m_config->opt_bool("slow_down_for_layer_cooling", 0);
toggle_option("slow_down_min_speed", cooling);
if (m_active_page->title() == "Cooling") {
bool cooling = m_config->opt_bool("slow_down_for_layer_cooling", 0);
toggle_option("slow_down_min_speed", cooling);
bool has_enable_overhang_bridge_fan = m_config->opt_bool("enable_overhang_bridge_fan", 0);
for (auto el : { "overhang_fan_speed", "overhang_fan_threshold" })
bool has_enable_overhang_bridge_fan = m_config->opt_bool("enable_overhang_bridge_fan", 0);
for (auto el : {"overhang_fan_speed", "overhang_fan_threshold"})
toggle_option(el, has_enable_overhang_bridge_fan);
toggle_option(
"additional_cooling_fan_speed",
m_preset_bundle->printers.get_edited_preset().config.option<ConfigOptionBool>("auxiliary_fan")->value);
}
if (m_active_page->title() == "Filament")
{
//BBS: hide these useless option for bambu printer
toggle_line("enable_pressure_advance", !is_BBL_printer);
if (is_BBL_printer)
toggle_line("pressure_advance", false);
else {
toggle_line("pressure_advance", true);
toggle_option("pressure_advance", m_config->opt_bool("enable_pressure_advance", 0));
}
toggle_line("chamber_temperatures", !is_BBL_printer);
for (auto el :
{"cool_plate_temp", "cool_plate_temp_initial_layer", "eng_plate_temp", "eng_plate_temp_initial_layer", "textured_plate_temp", "textured_plate_temp_initial_layer"})
toggle_line(el, is_BBL_printer);
}
bool pa = m_config->opt_bool("enable_pressure_advance", 0);
toggle_option("pressure_advance", pa);
toggle_line("cool_plate_temp_initial_layer", is_BBL_printer);
toggle_line("eng_plate_temp_initial_layer", is_BBL_printer);
toggle_line("textured_plate_temp_initial_layer", is_BBL_printer);
toggle_option("chamber_temperature", !is_BBL_printer);
}
if (m_active_page->title() == "Setting Overrides")
update_filament_overrides_page();
}
@ -2961,12 +3010,13 @@ void TabPrinter::build_fff()
auto page = add_options_page(L("Basic information"), "printer");
auto optgroup = page->new_optgroup(L("Printable space")/*, L"param_printable_space"*/);
//create_line_with_widget(optgroup.get(), "printable_area", "custom-svg-and-png-bed-textures_124612", [this](wxWindow* parent) {
// return create_bed_shape_widget(parent);
//});
create_line_with_widget(optgroup.get(), "printable_area", "custom-svg-and-png-bed-textures_124612", [this](wxWindow* parent) {
return create_bed_shape_widget(parent);
});
Option option = optgroup->get_option("bed_exclude_area");
option.opt.full_width = true;
optgroup->append_single_option_line(option);
// optgroup->append_single_option_line("printable_area");
optgroup->append_single_option_line("printable_height");
optgroup->append_single_option_line("nozzle_volume");
// BBS
@ -3067,12 +3117,23 @@ void TabPrinter::build_fff()
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
optgroup->append_single_option_line("gcode_flavor");
optgroup->append_single_option_line("scan_first_layer");
option = optgroup->get_option("thumbnails");
option.opt.full_width = true;
optgroup->append_single_option_line(option);
optgroup->append_single_option_line("use_relative_e_distances");
optgroup->append_single_option_line("use_firmware_retraction");
optgroup->append_single_option_line("scan_first_layer");
// optgroup->append_single_option_line("spaghetti_detector");
optgroup->append_single_option_line("machine_load_filament_time");
optgroup->append_single_option_line("machine_unload_filament_time");
optgroup = page->new_optgroup(L("Cooling Fan"));
Line line = Line{ L("Fan speed-up time"), optgroup->get_option("fan_speedup_time").opt.tooltip };
line.append_option(optgroup->get_option("fan_speedup_time"));
line.append_option(optgroup->get_option("fan_speedup_overhangs"));
optgroup->append_line(line);
optgroup->append_single_option_line("fan_kickstart");
optgroup = page->new_optgroup(L("Extruder Clearance"));
optgroup->append_single_option_line("extruder_clearance_radius");
optgroup->append_single_option_line("extruder_clearance_height_to_rod");
@ -3080,6 +3141,7 @@ void TabPrinter::build_fff()
optgroup = page->new_optgroup(L("Accessory") /*, L"param_accessory"*/);
optgroup->append_single_option_line("nozzle_type");
optgroup->append_single_option_line("nozzle_hrc");
optgroup->append_single_option_line("auxiliary_fan");
const int gcode_field_height = 15; // 150
@ -3103,8 +3165,8 @@ void TabPrinter::build_fff()
option.opt.is_code = true;
option.opt.height = gcode_field_height;//150;
optgroup->append_single_option_line(option);
#if 0
optgroup = page->new_optgroup(L("Before layer change G-code"), 0);
optgroup = page->new_optgroup(L("Before layer change G-code"),"param_gcode", 0);
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
validate_custom_gcode_cb(this, optgroup, opt_key, value);
};
@ -3113,7 +3175,6 @@ void TabPrinter::build_fff()
option.opt.is_code = true;
option.opt.height = gcode_field_height;//150;
optgroup->append_single_option_line(option);
#endif
optgroup = page->new_optgroup(L("Layer change G-code"), L"param_gcode", 0);
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
@ -3159,7 +3220,6 @@ void TabPrinter::build_fff()
// build_preset_description_line(optgroup.get());
#endif
build_unregular_pages(true);
}
@ -3414,8 +3474,7 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
auto page = add_options_page(page_name, "empty", true);
m_pages.insert(m_pages.begin() + n_before_extruders + extruder_idx, page);
auto optgroup = page->new_optgroup(L("Type"), L"param_type", -1, true);
optgroup->append_single_option_line("extruder_type", "", extruder_idx);
auto optgroup = page->new_optgroup(L("Size"), L"param_diameter", -1, true);
optgroup->append_single_option_line("nozzle_diameter", "", extruder_idx);
optgroup->m_on_change = [this, extruder_idx](const t_config_option_key& opt_key, boost::any value)
@ -3464,17 +3523,22 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
//BBS: don't show retract related config menu in machine page
optgroup = page->new_optgroup(L("Retraction"), L"param_retraction");
optgroup->append_single_option_line("retraction_length", "", extruder_idx);
optgroup->append_single_option_line("retract_restart_extra", "", extruder_idx);
optgroup->append_single_option_line("z_hop", "", extruder_idx);
optgroup->append_single_option_line("z_hop_types", "", extruder_idx);
optgroup->append_single_option_line("retraction_speed", "", extruder_idx);
optgroup->append_single_option_line("deretraction_speed", "", extruder_idx);
//optgroup->append_single_option_line("retract_restart_extra", "", extruder_idx);
optgroup->append_single_option_line("retraction_minimum_travel", "", extruder_idx);
optgroup->append_single_option_line("retract_when_changing_layer", "", extruder_idx);
optgroup->append_single_option_line("wipe", "", extruder_idx);
optgroup->append_single_option_line("wipe_distance", "", extruder_idx);
optgroup->append_single_option_line("retract_before_wipe", "", extruder_idx);
optgroup = page->new_optgroup(L("Lift Z Enforcement"), L"param_retraction", -1, true);
optgroup->append_single_option_line("retract_lift_above", "", extruder_idx);
optgroup->append_single_option_line("retract_lift_below", "", extruder_idx);
optgroup->append_single_option_line("retract_lift_enforce", "", extruder_idx);
optgroup = page->new_optgroup(L("Retraction when switching material"), L"param_retraction", -1, true);
optgroup->append_single_option_line("retract_length_toolchange", "", extruder_idx);
optgroup->append_single_option_line("retract_restart_extra_toolchange", "", extruder_idx);
@ -3622,26 +3686,33 @@ void TabPrinter::toggle_options()
//BBS: whether the preset is Bambu Lab printer
bool is_BBL_printer = false;
if (m_preset_bundle) {
is_BBL_printer = m_preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(m_preset_bundle);
is_BBL_printer = m_preset_bundle->printers.get_edited_preset().has_lidar(m_preset_bundle);
}
bool have_multiple_extruders = m_extruders_count > 1;
bool have_multiple_extruders = true;
//m_extruders_count > 1;
//if (m_active_page->title() == "Custom G-code") {
// toggle_option("change_filament_gcode", have_multiple_extruders);
//}
if (m_active_page->title() == "Basic information") {
toggle_option("single_extruder_multi_material", have_multiple_extruders);
//BBS: gcode_flavore of BBL printer can't be edited and changed
toggle_option("gcode_flavor", !is_BBL_printer);
toggle_option("use_relative_e_distances", !is_BBL_printer);
auto flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
bool is_marlin_flavor = flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware;
// Disable silent mode for non-marlin firmwares.
toggle_option("silent_mode", is_marlin_flavor);
//BBS: extruder clearance of BBL printer can't be edited.
for (auto el : { "extruder_clearance_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" })
toggle_option(el, !is_BBL_printer);
//for (auto el : { "extruder_clearance_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" })
// toggle_option(el, !is_BBL_printer);
// SoftFever: hide BBL specific settings
for (auto el :
{"scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "bbl_calib_mark_logo"})
toggle_line(el, is_BBL_printer);
// SoftFever: hide non-BBL settings
for (auto el : {"use_firmware_retraction", "use_relative_e_distances"})
toggle_line(el, !is_BBL_printer);
}
wxString extruder_number;
@ -3653,30 +3724,57 @@ void TabPrinter::toggle_options()
size_t i = size_t(val - 1);
bool have_retract_length = m_config->opt_float("retraction_length", i) > 0;
//BBS
for (auto el : {"extruder_type" , "nozzle_diameter", "extruder_offset"})
toggle_option(el, !is_BBL_printer, i);
// when using firmware retraction, firmware decides retraction length
bool use_firmware_retraction = m_config->opt_bool("use_firmware_retraction");
toggle_option("retract_length", !use_firmware_retraction, i);
// user can customize travel length if we have retraction length or we"re using
// firmware retraction
toggle_option("retraction_minimum_travel", have_retract_length, i);
toggle_option("retraction_minimum_travel", have_retract_length || use_firmware_retraction, i);
// user can customize other retraction options if retraction is enabled
//BBS
bool retraction = have_retract_length;
bool retraction = have_retract_length || use_firmware_retraction;
std::vector<std::string> vec = { "z_hop", "retract_when_changing_layer" };
for (auto el : vec)
toggle_option(el, retraction, i);
// retract lift above / below + enforce only applies if using retract lift
vec.resize(0);
vec = {"retract_lift_above", "retract_lift_below", "retract_lift_enforce"};
for (auto el : vec)
toggle_option(el, retraction && (m_config->opt_float("z_hop", i) > 0), i);
// some options only apply when not using firmware retraction
vec.resize(0);
vec = { "retraction_speed", "deretraction_speed", "retract_before_wipe", "retract_restart_extra", "wipe", "wipe_distance" };
vec = {"retraction_speed", "deretraction_speed", "retract_before_wipe",
"retract_length", "retract_restart_extra", "wipe",
"wipe_distance"};
for (auto el : vec)
//BBS
toggle_option(el, retraction, i);
toggle_option(el, retraction && !use_firmware_retraction, i);
bool wipe = retraction && m_config->opt_bool("wipe", i);
toggle_option("retract_before_wipe", wipe, i);
if (use_firmware_retraction && wipe) {
//wxMessageDialog dialog(parent(),
MessageDialog dialog(parent(),
_(L("The Wipe option is not available when using the Firmware Retraction mode.\n"
"\nShall I disable it in order to enable Firmware Retraction?")),
_(L("Firmware Retraction")), wxICON_WARNING | wxYES | wxNO);
DynamicPrintConfig new_conf = *m_config;
if (dialog.ShowModal() == wxID_YES) {
auto wipe = static_cast<ConfigOptionBools*>(m_config->option("wipe")->clone());
for (size_t w = 0; w < wipe->values.size(); w++)
wipe->values[w] = false;
new_conf.set_key_value("wipe", wipe);
}
else {
new_conf.set_key_value("use_firmware_retraction", new ConfigOptionBool(false));
}
load_config(new_conf);
}
// BBS
toggle_option("wipe_distance", wipe, i);
@ -3686,20 +3784,16 @@ void TabPrinter::toggle_options()
toggle_option("retract_restart_extra_toolchange", have_multiple_extruders && toolchange_retraction, i);
}
if (m_active_page->title() == "Motion ability") {
assert(m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfMarlinLegacy
|| m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfMarlinFirmware
|| m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfKlipper);
bool silent_mode = m_config->opt_bool("silent_mode");
int max_field = silent_mode ? 2 : 1;
//BBS: limits of BBL printer can't be edited, except jerk.
for (const std::string& opt : { "machine_max_acceleration_extruding", "machine_max_acceleration_retracting", "machine_max_acceleration_travel",
"machine_max_acceleration_x", "machine_max_acceleration_y", "machine_max_acceleration_z", "machine_max_acceleration_e",
"machine_max_speed_x", "machine_max_speed_y", "machine_max_speed_z", "machine_max_speed_e",
"machine_min_extruding_rate", "machine_min_travel_rate" })
for (int i = 0; i < max_field; ++ i)
toggle_option(opt, !is_BBL_printer, i);
}
//auto gcf = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
//if (m_active_page->title() == "Motion ability") {
// assert(gcf == gcfMarlinLegacy || gcf == gcfMarlinFirmware || gcf == gcfKlipper);
// bool silent_mode = m_config->opt_bool("silent_mode");
// int max_field = silent_mode ? 2 : 1;
// //BBS: limits of BBL printer can't be edited.
// for (const std::string &opt : Preset::machine_limits_options())
// for (int i = 0; i < max_field; ++ i)
// toggle_option(opt, !is_BBL_printer, i);
//}
}
void TabPrinter::update()
@ -3724,7 +3818,8 @@ void TabPrinter::update_fff()
m_use_silent_mode = m_config->opt_bool("silent_mode");
}
auto gcf_ = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
auto gcf_ =
m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
bool supports_travel_acceleration = (gcf_ == gcfMarlinFirmware || gcf_ == gcfMarlinLegacy || gcf_ == gcfKlipper);
if (m_supports_travel_acceleration != supports_travel_acceleration) {
m_rebuild_kinematics_page = true;
@ -4165,6 +4260,11 @@ bool Tab::select_preset(std::string preset_name, bool delete_current /*=false*/,
// check if there is something in the cache to move to the new selected preset
apply_config_from_cache();
// Orca: update presets for the selected printer
if (m_type == Preset::TYPE_PRINTER) {
m_preset_bundle->update_selections(*wxGetApp().app_config);
wxGetApp().plater()->sidebar().on_filaments_change(m_preset_bundle->filament_presets.size());
}
load_current_preset();
}
@ -4847,7 +4947,7 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
}
// Return a callback to create a TabPrinter widget to edit bed shape
/*wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
{
ScalableButton* btn = new ScalableButton(parent, wxID_ANY, "printer", " " + _(L("Set")) + " " + dots,
wxDefaultSize, wxDefaultPosition, wxBU_LEFT | wxBU_EXACTFIT, true);
@ -4860,24 +4960,34 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e)
{
BedShapeDialog dlg(this);
dlg.build_dialog(*m_config->option<ConfigOptionPoints>("printable_area"), {}, {});
dlg.build_dialog(*m_config->option<ConfigOptionPoints>("printable_area"),
*m_config->option<ConfigOptionString>("bed_custom_texture"),
*m_config->option<ConfigOptionString>("bed_custom_model"));
if (dlg.ShowModal() == wxID_OK) {
const std::vector<Vec2d>& shape = dlg.get_shape();
const std::string& custom_texture = dlg.get_custom_texture();
const std::string& custom_model = dlg.get_custom_model();
if (!shape.empty())
{
load_key_value("printable_area", shape);
load_key_value("bed_custom_texture", custom_texture);
load_key_value("bed_custom_model", custom_model);
update_changed_ui();
}
on_presets_changed();
}
}));
{
Search::OptionsSearcher& searcher = wxGetApp().sidebar().get_searcher();
const Search::GroupAndCategory& gc = searcher.get_group_and_category("printable_area");
searcher.add_key("bed_custom_texture", m_type, gc.group, gc.category);
searcher.add_key("bed_custom_model", m_type, gc.group, gc.category);
}
return sizer;
}*/
}
void TabPrinter::cache_extruder_cnt()
{

View file

@ -1007,7 +1007,6 @@ int GuideFrame::LoadProfile()
} else {
//cout << "is a file" << endl;
//cout << iter->path().string() << endl;
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
strVendor = strVendor.AfterLast( '\\');
strVendor = strVendor.AfterLast('\/');

View file

@ -1891,7 +1891,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
//backup tips
m_ams_backup_tip = new Label(m_amswin, _L("Auto Refill"));
m_ams_backup_tip->SetFont(::Label::Head_12);
m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42));
m_ams_backup_tip->SetForegroundColour(wxColour(0x009688));
m_ams_backup_tip->SetBackgroundColour(*wxWHITE);
m_img_ams_backup = new wxStaticBitmap(m_amswin, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
m_img_ams_backup->SetBackgroundColour(*wxWHITE);
@ -1973,7 +1973,6 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),

View file

@ -92,12 +92,6 @@ void ComboBox::SelectAndNotify(int n) {
sendComboBoxEvent();
}
void ComboBox::SelectAndNotify(int n) {
SetSelection(n);
sendComboBoxEvent();
}
void ComboBox::Rescale()
{
TextInput::Rescale();

View file

@ -1,6 +1,7 @@
#include "libslic3r/Utils.hpp"
#include "Label.hpp"
#include "StaticBox.hpp"
#include <wx/intl.h> // For wxLocale
wxFont Label::sysFont(int size, bool bold)
{
@ -11,13 +12,22 @@ wxFont Label::sysFont(int size, bool bold)
size = size * 4 / 5;
#endif
auto face = wxString::FromUTF8("HarmonyOS Sans SC");
wxString face = "HarmonyOS Sans SC";
// Check if the current locale is Korean
if (wxLocale::GetSystemLanguage() == wxLANGUAGE_KOREAN) {
face = "Noto Sans KR";
}
wxFont font{size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, false, face};
font.SetFaceName(face);
if (!font.IsOk()) {
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
if (bold) font.MakeBold();
font.SetPointSize(size);
BOOST_LOG_TRIVIAL(warning) << boost::format("Can't find %1% font") % face;
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
BOOST_LOG_TRIVIAL(warning) << boost::format("Use system font instead: %1%") % font.GetFaceName();
if (bold)
font.MakeBold();
font.SetPointSize(size);
}
return font;
}
@ -45,16 +55,25 @@ wxFont Label::Body_9;
void Label::initSysFont()
{
#ifdef __linux__
const std::string& resource_path = Slic3r::resources_dir();
wxString font_path = wxString::FromUTF8(resource_path+"/fonts/HarmonyOS_Sans_SC_Bold.ttf");
#if defined(__linux__) || defined(_WIN32)
const std::string &resource_path = Slic3r::resources_dir();
wxString font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Bold.ttf");
bool result = wxFont::AddPrivateFont(font_path);
//BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
printf("add font of HarmonyOS_Sans_SC_Bold returns %d\n", result);
font_path = wxString::FromUTF8(resource_path+"/fonts/HarmonyOS_Sans_SC_Regular.ttf");
font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Regular.ttf");
result = wxFont::AddPrivateFont(font_path);
//BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
printf("add font of HarmonyOS_Sans_SC_Regular returns %d\n", result);
// Adding Noto Sans KR Regular and Bold
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Regular.otf");
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Regular returns %1%")%result;
printf("add font of NotoSansKR-Regular returns %d\n", result);
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Bold.otf");
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Bold returns %1%")%result;
printf("add font of NotoSansKR-Bold returns %d\n", result);
#endif
Head_48 = Label::sysFont(48, true);
Head_32 = Label::sysFont(32, true);
@ -283,7 +302,7 @@ void Label::SetWindowStyleFlag(long style)
wxStaticText::SetWindowStyleFlag(style);
if (style & LB_HYPERLINK) {
this->m_color = GetForegroundColour();
static wxColor clr_url("#00AE42");
static wxColor clr_url("#009688");
SetFont(this->m_font.Underlined());
SetForegroundColour(clr_url);
SetCursor(wxCURSOR_HAND);

View file

@ -28,9 +28,9 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly
border_color.append(0x6B6B6B, StateColor::Disabled);
border_color.append(wxColour(23, 129, 63), StateColor::Pressed);
border_color.append(wxColour(48,221,112), StateColor::Hovered);
border_color.append(0x00AE42, StateColor::Normal);
border_color.append(wxColour(0, 137, 123), StateColor::Pressed);
border_color.append(wxColour(38, 166, 154), StateColor::Hovered);
border_color.append(0x009688, StateColor::Normal);
border_color.setTakeFocusedAsHovered(false);
text_color.append(0xACACAC, StateColor::Disabled);
@ -39,9 +39,9 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly
text_color.append(0xFEFEFE, StateColor::Normal);
background_color.append(0x6B6B6B, StateColor::Disabled);
background_color.append(wxColour(23, 129, 63), StateColor::Pressed);
background_color.append(wxColour(48, 221, 112), StateColor::Hovered);
background_color.append(0x00AE42, StateColor::Normal);
background_color.append(wxColour(0, 137, 123), StateColor::Pressed);
background_color.append(wxColour(38, 166, 154), StateColor::Hovered);
background_color.append(0x009688, StateColor::Normal);
background_color.setTakeFocusedAsHovered(false);
SetBottomColour(wxColour("#3B4446"));

View file

@ -315,7 +315,7 @@ SideTools::SideTools(wxWindow *parent, wxWindowID id, const wxPoint &pos, const
m_link_network_state = new Label(m_side_error_panel, _L("Check cloud service status"), wxALIGN_CENTER_HORIZONTAL | wxST_ELLIPSIZE_END);
m_link_network_state->SetMinSize(wxSize(FromDIP(220), -1));
m_link_network_state->SetMaxSize(wxSize(FromDIP(220), -1));
m_link_network_state->SetForegroundColour(0x00AE42);
m_link_network_state->SetForegroundColour(0x009688);
m_link_network_state->SetFont(::Label::Body_12);
m_link_network_state->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_network_check(); });
m_link_network_state->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_HAND); });
@ -507,8 +507,8 @@ void SideTools::show_status(int status)
else if ((status & (int)MonitorStatus::MONITOR_CONNECTING) != 0) {
m_hyperlink->Hide();
m_connection_info->SetLabel(_L("Connecting..."));
m_connection_info->SetBackgroundColor(0x00AE42);
m_connection_info->SetBorderColor(0x00AE42);
m_connection_info->SetBackgroundColor(0x009688);
m_connection_info->SetBorderColor(0x009688);
m_connection_info->Show();
m_more_button->Hide();
m_side_error_panel->Hide();

View file

@ -55,8 +55,8 @@ wxBoxSizer* WipingDialog::create_btn_sizer(long flags)
btn_sizer->AddStretchSpacer();
StateColor ok_btn_bg(
std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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)
);
@ -84,8 +84,8 @@ wxBoxSizer* WipingDialog::create_btn_sizer(long flags)
StateColor calc_btn_bg(
std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
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)
);

View file

@ -5,9 +5,6 @@
#include <wx/dcgraph.h>
#include "MainFrame.hpp"
#include <string>
#include "libslic3r/Config.hpp"
#include "libslic3r/PrintConfig.hpp"
namespace Slic3r { namespace GUI {
wxBoxSizer* create_item_checkbox(wxString title, wxWindow* parent, bool* value, CheckBox*& checkbox)
@ -43,14 +40,12 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
SetSizer(v_sizer);
wxBoxSizer* choice_sizer = new wxBoxSizer(wxHORIZONTAL);
// BBS: get from printer preset
//wxString m_rbExtruderTypeChoices[] = { _L("DDE"), _L("Bowden") };
//int m_rbExtruderTypeNChoices = sizeof(m_rbExtruderTypeChoices) / sizeof(wxString);
//m_rbExtruderType = new wxRadioBox(this, wxID_ANY, _L("Extruder type"), wxDefaultPosition, wxDefaultSize, m_rbExtruderTypeNChoices, m_rbExtruderTypeChoices, 2, wxRA_SPECIFY_COLS);
//m_rbExtruderType->SetSelection(0);
//choice_sizer->Add(m_rbExtruderType, 0, wxALL, 5);
//choice_sizer->Add(FromDIP(5), 0, 0, wxEXPAND, 5);
wxString m_rbExtruderTypeChoices[] = { _L("DDE"), _L("Bowden") };
int m_rbExtruderTypeNChoices = sizeof(m_rbExtruderTypeChoices) / sizeof(wxString);
m_rbExtruderType = new wxRadioBox(this, wxID_ANY, _L("Extruder type"), wxDefaultPosition, wxDefaultSize, m_rbExtruderTypeNChoices, m_rbExtruderTypeChoices, 2, wxRA_SPECIFY_COLS);
m_rbExtruderType->SetSelection(0);
choice_sizer->Add(m_rbExtruderType, 0, wxALL, 5);
choice_sizer->Add(FromDIP(5), 0, 0, wxEXPAND, 5);
wxString m_rbMethodChoices[] = { _L("PA Tower"), _L("PA Line"), _L("PA Pattern") };
int m_rbMethodNChoices = sizeof(m_rbMethodChoices) / sizeof(wxString);
m_rbMethod = new wxRadioBox(this, wxID_ANY, _L("Method"), wxDefaultPosition, wxDefaultSize, m_rbMethodNChoices, m_rbMethodChoices, 2, wxRA_SPECIFY_COLS);
@ -106,10 +101,9 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
v_sizer->Add(settings_sizer);
v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5);
m_btnStart = new Button(this, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(23, 129, 63), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(48, 221, 112), StateColor::Hovered),
std::pair<wxColour, int>(0x00AE42, StateColor::Normal));
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));
m_btnStart->SetBackgroundColor(btn_bg_green);
m_btnStart->SetBorderColor(wxColour(0, 150, 136));
@ -123,38 +117,24 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
PA_Calibration_Dlg::reset_params();
// Connect Events
//m_rbExtruderType->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(PA_Calibration_Dlg::on_extruder_type_changed), NULL, this);
m_rbExtruderType->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(PA_Calibration_Dlg::on_extruder_type_changed), NULL, this);
m_rbMethod->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(PA_Calibration_Dlg::on_method_changed), NULL, this);
this->Connect(wxEVT_SHOW, wxShowEventHandler(PA_Calibration_Dlg::on_show));
//wxGetApp().UpdateDlgDarkUI(this);
Preset &printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset();
int extruder_type = printer_preset.config.opt_enum("extruder_type", 0);
if (extruder_type == ExtruderType::etBowden) {
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(1.0));
m_tiStartPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.0));
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(0.02));
} else {
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.1));
m_tiStartPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.0));
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(0.002));
}
Layout();
Fit();
}
PA_Calibration_Dlg::~PA_Calibration_Dlg() {
// Disconnect Events
//m_rbExtruderType->Disconnect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(PA_Calibration_Dlg::on_extruder_type_changed), NULL, this);
m_rbExtruderType->Disconnect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(PA_Calibration_Dlg::on_extruder_type_changed), NULL, this);
m_rbMethod->Disconnect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(PA_Calibration_Dlg::on_method_changed), NULL, this);
m_btnStart->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PA_Calibration_Dlg::on_start), NULL, this);
}
void PA_Calibration_Dlg::reset_params() {
Preset &printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset();
int extruder_type = printer_preset.config.opt_enum("extruder_type", 0);
bool isDDE =extruder_type == 0 ? true : false;
bool isDDE = m_rbExtruderType->GetSelection() == 0 ? true : false;
int method = m_rbMethod->GetSelection();
m_tiStartPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.0));
@ -240,7 +220,7 @@ void PA_Calibration_Dlg::on_show(wxShowEvent& event) {
PA_Calibration_Dlg::reset_params();
}
// Temp Calib dlg
// Temp calib dlg
//
enum FILAMENT_TYPE : int
{
@ -274,7 +254,7 @@ Temp_Calibration_Dlg::Temp_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plat
// Settings
//
wxString start_temp_str = _L("Start temp: ");
wxString end_temp_str = _L("End temp: ");
wxString end_temp_str = _L("End end: ");
wxString temp_step_str = _L("Temp step: ");
auto text_size = wxWindow::GetTextExtent(start_temp_str);
text_size.IncTo(wxWindow::GetTextExtent(end_temp_str));
@ -316,9 +296,9 @@ Temp_Calibration_Dlg::Temp_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plat
v_sizer->Add(settings_sizer);
v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5);
m_btnStart = new Button(this, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(23, 129, 63), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(48, 221, 112), StateColor::Hovered),
std::pair<wxColour, int>(0x00AE42, StateColor::Normal));
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));
m_btnStart->SetBackgroundColor(btn_bg_green);
m_btnStart->SetBorderColor(wxColour(0, 150, 136));
@ -488,9 +468,9 @@ MaxVolumetricSpeed_Test_Dlg::MaxVolumetricSpeed_Test_Dlg(wxWindow* parent, wxWin
v_sizer->Add(settings_sizer);
v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5);
m_btnStart = new Button(this, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(23, 129, 63), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(48, 221, 112), StateColor::Hovered),
std::pair<wxColour, int>(0x00AE42, StateColor::Normal));
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));
m_btnStart->SetBackgroundColor(btn_bg_green);
m_btnStart->SetBorderColor(wxColour(0, 150, 136));
@ -593,9 +573,9 @@ VFA_Test_Dlg::VFA_Test_Dlg(wxWindow* parent, wxWindowID id, Plater* plater)
v_sizer->Add(settings_sizer);
v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5);
m_btnStart = new Button(this, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(23, 129, 63), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(48, 221, 112), StateColor::Hovered),
std::pair<wxColour, int>(0x00AE42, StateColor::Normal));
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));
m_btnStart->SetBackgroundColor(btn_bg_green);
m_btnStart->SetBorderColor(wxColour(0, 150, 136));
@ -699,9 +679,9 @@ Retraction_Test_Dlg::Retraction_Test_Dlg(wxWindow* parent, wxWindowID id, Plater
v_sizer->Add(settings_sizer);
v_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 5);
m_btnStart = new Button(this, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(23, 129, 63), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(48, 221, 112), StateColor::Hovered),
std::pair<wxColour, int>(0x00AE42, StateColor::Normal));
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));
m_btnStart->SetBackgroundColor(btn_bg_green);
m_btnStart->SetBorderColor(wxColour(0, 150, 136));

View file

@ -13,7 +13,7 @@
#include "GUI_App.hpp"
#include "wx/hyperlink.h"
#include <wx/radiobox.h>
#include "libslic3r/Calib.hpp"
#include "libslic3r/calib.hpp"
namespace Slic3r { namespace GUI {

View file

@ -89,8 +89,8 @@ void wxMediaCtrl2::Load(wxURI url)
BambuPlayer * player = (BambuPlayer *) m_player;
if (player) {
[player close];
m_error = 0;
[player open: url.BuildURI().ToUTF8()];
m_error = 0;
}
wxMediaEvent event(wxEVT_MEDIA_STATECHANGED);
event.SetId(GetId());