Fix Compile Warnings (#5963)

* Fix calls to depreciated wxPen constructor

* Fix use of wxTimerEvent

* Fix unrecognized character escape sequence

* Fix signed/unsigned mismatch

At least as much as possible without significantly altering parts of the application

* Clean unreferenced variables

* fix mistyped namespace selector

* Update deprecated calls

* Fix preprocessor statement

* Remove empty switch statements

* Change int vector used as bool to bool vector

* Remove empty control statements and related unused code

* Change multi character constant to string constant

* Fix discarded return value

json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured.

* Rename ICON_SIZE def used by MultiMachine

By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future.

* Remove unused includes

* Fix linux/macOS compilation

* Hide unused-function errors on non-Windows systems

* Disable signed/unsigned comparison mismatch error

* Remove/Disable more unused variables

Still TODO: check double for loop in Print.cpp

* Remove unused variable that was missed

* Remove unused variables in libraries in the src folder

* Apply temporary fix for subobject linkage error

* Remove/Disable last set of unused variables reported by GCC

* remove redundant for loop

* fix misspelled ifdef check

* Update message on dialog

* Fix hard-coded platform specific modifier keys

* Remove duplicate for loop

* Disable -Wmisleading-indentation warning

* disable -Wswitch warning

* Remove unused local typedefs

* Fix -Wunused-value

* Fix pragma error on Windows from subobject linkage fix

* Fix -Waddress

* Fix null conversions (-Wconversion-null)

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Ocraftyone 2024-07-29 09:00:26 -04:00 committed by GitHub
parent b40853af94
commit b83e16dbdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
187 changed files with 494 additions and 1101 deletions

View file

@ -241,7 +241,7 @@ float GLVolume::last_explosion_ratio = 1.0;
void GLVolume::set_render_color()
{
bool outside = is_outside || is_below_printbed();
// bool outside = is_outside || is_below_printbed();
if (force_native_color || force_neutral_color) {
#ifdef ENABBLE_OUTSIDE_COLOR
@ -859,7 +859,6 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
return;
GLShaderProgram* sink_shader = GUI::wxGetApp().get_shader("flat");
GLShaderProgram* edges_shader = GUI::wxGetApp().get_shader("flat");
if (type == ERenderType::Transparent) {
glsafe(::glEnable(GL_BLEND));
@ -1023,7 +1022,6 @@ bool GLVolumeCollection::check_outside_state(const BuildVolume &build_volume, Mo
GUI::PartPlate* curr_plate = GUI::wxGetApp().plater()->get_partplate_list().get_selected_plate();
const Pointfs& pp_bed_shape = curr_plate->get_shape();
BuildVolume plate_build_volume(pp_bed_shape, build_volume.printable_height());
const std::vector<BoundingBoxf3>& exclude_areas = curr_plate->get_exclude_areas();
for (GLVolume* volume : this->volumes)
{

View file

@ -331,7 +331,6 @@ void AMSMaterialsSetting::create_panel_kn(wxWindow* parent)
kn_val_sizer->Add(m_input_k_val, 0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, FromDIP(0));
// n params input
wxBoxSizer* n_sizer = new wxBoxSizer(wxHORIZONTAL);
m_n_param = new wxStaticText(parent, wxID_ANY, _L("Factor N"), wxDefaultPosition, wxDefaultSize, 0);
m_n_param->SetFont(::Label::Body_13);
m_n_param->SetForegroundColour(wxColour(50, 58, 61));
@ -357,7 +356,7 @@ void AMSMaterialsSetting::paintEvent(wxPaintEvent &evt)
{
auto size = GetSize();
wxPaintDC dc(this);
dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour("#000000")), 1, wxSOLID));
dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour("#000000")), 1, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
dc.DrawRectangle(0, 0, size.x, size.y);
}

View file

@ -366,7 +366,6 @@ void MaterialItem::doRender(wxDC &dc)
wxString out_txt = m_msg;
wxString count_txt = "";
int new_line_pos = 0;
for (int i = 0; i < m_msg.length(); i++) {
auto text_size = m_warning_text->GetTextExtent(count_txt);
@ -402,7 +401,6 @@ void AmsMapingPopup::on_left_down(wxMouseEvent &evt)
auto pos = ClientToScreen(evt.GetPosition());
for (MappingItem *item : m_mapping_item_list) {
auto p_rect = item->ClientToScreen(wxPoint(0, 0));
auto left = item->GetSize();
if (pos.x > p_rect.x && pos.y > p_rect.y && pos.x < (p_rect.x + item->GetSize().x) && pos.y < (p_rect.y + item->GetSize().y)) {
if (item->m_tray_data.type == TrayType::NORMAL && !is_match_material(item->m_tray_data.filament_type)) return;
@ -1524,9 +1522,6 @@ void AmsRMGroup::on_mouse_move(wxMouseEvent& evt)
std::string tray_name = iter->first;
wxColour tray_color = iter->second;
int x = size.x / 2;
int y = size.y / 2;
int radius = size.x / 2;
endAngle += ev_angle;
if (click_angle >= startAngle && click_angle < endAngle) {

View file

@ -989,7 +989,7 @@ void AuxiliaryPanel::create_folder(wxString name)
fs::path bfs_path((m_root_dir + "/" + folder_name).ToStdWstring());
if (fs::exists(bfs_path)) {
try {
bool is_done = fs::remove_all(bfs_path);
fs::remove_all(bfs_path);
} catch (...) {
BOOST_LOG_TRIVIAL(error) << "Failed removing the auxiliary directory " << m_root_dir.c_str();
}

View file

@ -337,7 +337,7 @@ wxDataViewItemArray AuxiliaryModel::ImportFile(AuxiliaryModelNode* sel, wxArrayS
dir_path += "\\" + src_bfs_path.filename().generic_wstring();
boost::system::error_code ec;
if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_option::overwrite_if_exists, ec))
if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_options::overwrite_existing, ec))
continue;
// Update model data

View file

@ -3,8 +3,6 @@
#include <wx/timer.h>
#include <wx/gauge.h>
#include <wx/button.h>
#include <wx/statusbr.h>
#include <wx/frame.h>
#include "GUI_App.hpp"

View file

@ -230,7 +230,7 @@ void BBLTopbar::Init(wxFrame* parent)
this->AddSpacer(FromDIP(10));
wxBitmap save_bitmap = create_scaled_bitmap("topbar_save", nullptr, TOPBAR_ICON_SIZE);
wxAuiToolBarItem* save_btn = this->AddTool(wxID_SAVE, "", save_bitmap);
this->AddTool(wxID_SAVE, "", save_bitmap);
this->AddSpacer(FromDIP(10));
@ -278,7 +278,7 @@ void BBLTopbar::Init(wxFrame* parent)
this->AddSpacer(FromDIP(4));
wxBitmap iconize_bitmap = create_scaled_bitmap("topbar_min", nullptr, TOPBAR_ICON_SIZE);
wxAuiToolBarItem* iconize_btn = this->AddTool(wxID_ICONIZE_FRAME, "", iconize_bitmap);
this->AddTool(wxID_ICONIZE_FRAME, "", iconize_bitmap);
this->AddSpacer(FromDIP(4));
@ -294,7 +294,7 @@ void BBLTopbar::Init(wxFrame* parent)
this->AddSpacer(FromDIP(4));
wxBitmap close_bitmap = create_scaled_bitmap("topbar_close", nullptr, TOPBAR_ICON_SIZE);
wxAuiToolBarItem* close_btn = this->AddTool(wxID_CLOSE_FRAME, "", close_bitmap);
this->AddTool(wxID_CLOSE_FRAME, "", close_bitmap);
Realize();
// m_toolbar_h = this->GetSize().GetHeight();
@ -466,7 +466,6 @@ void BBLTopbar::UpdateToolbarWidth(int width)
}
void BBLTopbar::Rescale() {
int em = em_unit(this);
wxAuiToolBarItem* item;
/*item = this->FindTool(ID_LOGO);
@ -496,7 +495,7 @@ void BBLTopbar::Rescale() {
item->SetBitmap(create_scaled_bitmap("calib_sf", nullptr, TOPBAR_ICON_SIZE));
item->SetDisabledBitmap(create_scaled_bitmap("calib_sf_inactive", nullptr, TOPBAR_ICON_SIZE));
item = this->FindTool(ID_TITLE);
// item = this->FindTool(ID_TITLE);
/*item = this->FindTool(ID_PUBLISH);
item->SetBitmap(create_scaled_bitmap("topbar_publish", this, TOPBAR_ICON_SIZE));
@ -548,14 +547,14 @@ void BBLTopbar::OnCloseFrame(wxAuiToolBarEvent& event)
void BBLTopbar::OnMouseLeftDClock(wxMouseEvent& mouse)
{
wxPoint mouse_pos = ::wxGetMousePosition();
// check whether mouse is not on any tool item
if (this->FindToolByCurrentPosition() != NULL &&
this->FindToolByCurrentPosition() != m_title_item) {
mouse.Skip();
return;
}
#ifdef __W1XMSW__
#ifdef __WXMSW__
wxPoint mouse_pos = ::wxGetMousePosition();
::PostMessage((HWND) m_frame->GetHandle(), WM_NCLBUTTONDBLCLK, HTCAPTION, MAKELPARAM(mouse_pos.x, mouse_pos.y));
return;
#endif // __WXMSW__
@ -637,7 +636,6 @@ void BBLTopbar::OnMouseLeftDown(wxMouseEvent& event)
void BBLTopbar::OnMouseLeftUp(wxMouseEvent& event)
{
wxPoint mouse_pos = ::wxGetMousePosition();
if (HasCapture())
{
ReleaseMouse();

View file

@ -5,13 +5,9 @@
#include "format.hpp"
#include <wx/app.h>
#include <wx/panel.h>
#include <wx/stdpaths.h>
// For zipped archive creation
#include <wx/stdstream.h>
#include <wx/wfstream.h>
#include <wx/zipstrm.h>
#include <miniz.h>
@ -20,23 +16,18 @@
#include "libslic3r/SLAPrint.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/GCode/PostProcessor.hpp"
#include "libslic3r/Format/SL1.hpp"
#include "libslic3r/Thread.hpp"
#include "libslic3r/libslic3r.h"
#include <cassert>
#include <stdexcept>
#include <cctype>
#include <boost/format/format_fwd.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/cstdio.hpp>
#include "I18N.hpp"
//#include "RemovableDriveManager.hpp"
#include "slic3r/GUI/Plater.hpp"
namespace Slic3r {
bool SlicingProcessCompletedEvent::critical_error() const

View file

@ -67,7 +67,6 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/)
SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO));
SetBackgroundColour(*wxWHITE);
wxBoxSizer* m_sizer_main = new wxBoxSizer(wxVERTICAL);
auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
m_line_top->SetBackgroundColour(wxColour(166, 169, 170));

View file

@ -226,7 +226,7 @@ SelectMObjectPopup::SelectMObjectPopup(wxWindow* parent)
m_refresh_timer = new wxTimer();
m_refresh_timer->SetOwner(this);
Bind(EVT_UPDATE_USER_MLIST, &SelectMObjectPopup::update_machine_list, this);
Bind(wxEVT_TIMER, &SelectMObjectPopup::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
Bind(EVT_DISSMISS_MACHINE_LIST, &SelectMObjectPopup::on_dissmiss_win, this);
}
@ -265,7 +265,7 @@ void SelectMObjectPopup::Popup(wxWindow* WXUNUSED(focus))
}
}
wxPostEvent(this, wxTimerEvent());
on_timer();
PopupWindow::Popup();
}
@ -304,7 +304,7 @@ bool SelectMObjectPopup::Show(bool show) {
return PopupWindow::Show(show);
}
void SelectMObjectPopup::on_timer(wxTimerEvent& event)
void SelectMObjectPopup::on_timer()
{
BOOST_LOG_TRIVIAL(trace) << "SelectMObjectPopup on_timer";
wxGetApp().reset_to_active();
@ -459,7 +459,7 @@ CalibrationPanel::CalibrationPanel(wxWindow* parent, wxWindowID id, const wxPoin
Layout();
init_timer();
Bind(wxEVT_TIMER, &CalibrationPanel::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
}
void CalibrationPanel::init_tabpanel() {
@ -502,10 +502,10 @@ void CalibrationPanel::init_timer()
m_refresh_timer = new wxTimer();
m_refresh_timer->SetOwner(this);
m_refresh_timer->Start(REFRESH_INTERVAL);
wxPostEvent(this, wxTimerEvent());
on_timer();
}
void CalibrationPanel::on_timer(wxTimerEvent& event) {
void CalibrationPanel::on_timer() {
update_all();
}
@ -644,7 +644,7 @@ bool CalibrationPanel::Show(bool show) {
m_refresh_timer->Stop();
m_refresh_timer->SetOwner(this);
m_refresh_timer->Start(REFRESH_INTERVAL);
wxPostEvent(this, wxTimerEvent());
on_timer();
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (dev) {
@ -670,9 +670,6 @@ bool CalibrationPanel::Show(bool show) {
void CalibrationPanel::on_printer_clicked(wxMouseEvent& event)
{
auto mouse_pos = ClientToScreen(event.GetPosition());
wxPoint rect = m_side_tools->ClientToScreen(wxPoint(0, 0));
if (!m_side_tools->is_in_interval()) {
wxPoint pos = m_side_tools->ClientToScreen(wxPoint(0, 0));
pos.y += m_side_tools->GetRect().height;

View file

@ -94,7 +94,7 @@ private:
private:
void OnLeftUp(wxMouseEvent& event);
void on_timer(wxTimerEvent& event);
void on_timer();
void update_user_devices();
void on_dissmiss_win(wxCommandEvent& event);
};
@ -117,7 +117,7 @@ public:
protected:
void init_tabpanel();
void init_timer();
void on_timer(wxTimerEvent& event);
void on_timer();
int last_status;

View file

@ -1126,7 +1126,6 @@ void FlowRateWizard::on_cali_save()
}
std::string old_preset_name;
CalibrationPresetPage* preset_page = (static_cast<CalibrationPresetPage*>(preset_step->page));
std::map<int, Preset*> selected_filaments = get_cached_selected_filament(curr_obj);
if (!selected_filaments.empty()) {
old_preset_name = selected_filaments.begin()->second->name;
@ -1173,7 +1172,6 @@ void FlowRateWizard::on_cali_save()
return;
std::string old_preset_name;
CalibrationPresetPage* preset_page = (static_cast<CalibrationPresetPage*>(preset_step->page));
std::map<int, Preset*> selected_filaments = get_cached_selected_filament(curr_obj);
if (!selected_filaments.empty()) {
old_preset_name = selected_filaments.begin()->second->name;
@ -1443,7 +1441,6 @@ void MaxVolumetricSpeedWizard::on_cali_save()
std::string old_preset_name;
std::string new_preset_name;
CalibrationPresetPage *preset_page = (static_cast<CalibrationPresetPage *>(preset_step->page));
std::map<int, Preset *> selected_filaments = get_cached_selected_filament(curr_obj);
if (!selected_filaments.empty()) {
old_preset_name = selected_filaments.begin()->second->name;

View file

@ -790,7 +790,6 @@ wxString CalibrationPresetPage::format_text(wxString& m_msg)
wxString out_txt = m_msg;
wxString count_txt = "";
int new_line_pos = 0;
for (int i = 0; i < m_msg.length(); i++) {
auto text_size = m_statictext_printer_msg->GetTextExtent(count_txt);

View file

@ -282,7 +282,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
}
double sparse_infill_density = config->option<ConfigOptionPercent>("sparse_infill_density")->value;
auto timelapse_type = config->opt_enum<TimelapseType>("timelapse_type");
if (!is_plate_config &&
config->opt_bool("spiral_mode") &&
@ -298,7 +297,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
{
DynamicPrintConfig new_conf = *config;
auto answer = show_spiral_mode_settings_dialog(is_object_config);
bool support = true;
if (answer == wxID_YES) {
new_conf.set_key_value("wall_loops", new ConfigOptionInt(1));
new_conf.set_key_value("top_shell_layers", new ConfigOptionInt(0));
@ -310,8 +308,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
new_conf.set_key_value("wall_direction", new ConfigOptionEnum<WallDirection>(WallDirection::Auto));
new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
sparse_infill_density = 0;
timelapse_type = TimelapseType::tlTraditional;
support = false;
}
else {
new_conf.set_key_value("spiral_mode", new ConfigOptionBool(false));

View file

@ -2438,7 +2438,7 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
header = _L_PLURAL("A new vendor was installed and one of its printers will be activated", "New vendors were installed and one of theirs printers will be activated", install_bundles.size());
// Decide whether to create snapshot based on run_reason and the reset profile checkbox
bool snapshot = true;
/*bool snapshot = true;
Snapshot::Reason snapshot_reason = Snapshot::SNAPSHOT_UPGRADE;
switch (run_reason) {
case ConfigWizard::RR_DATA_EMPTY:
@ -2456,7 +2456,7 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
snapshot = false;
snapshot_reason = Snapshot::SNAPSHOT_USER;
break;
}
}*/
//BBS: remove snapshot logic
/*if (snapshot && ! take_config_snapshot_cancel_on_error(*app_config, snapshot_reason, "", _u8L("Do you want to continue changing the configuration?")))
@ -2701,8 +2701,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
//BBS: add BBL as default
const auto bbl_it = p->bundles.find("BBL");
wxCHECK_RET(bbl_it != p->bundles.cend(), "Vendor BambooLab not found");
const VendorProfile * vendor_bbl = bbl_it->second.vendor_profile;
p->only_sla_mode = false;
p->any_sla_selected = p->check_sla_selected();
if (p->only_sla_mode)

View file

@ -315,7 +315,7 @@ static wxBoxSizer *create_preset_tree(wxWindow *parent, std::pair<std::string, s
int row = 1;
for (std::shared_ptr<Preset> preset : printer_and_preset.second) {
wxString preset_name = wxString::FromUTF8(preset->name);
wxTreeItemId childId1 = treeCtrl->AppendItem(rootId, preset_name);
treeCtrl->AppendItem(rootId, preset_name);
row++;
}
@ -671,8 +671,6 @@ bool CreateFilamentPresetDialog::is_check_box_selected()
wxBoxSizer *CreateFilamentPresetDialog::create_item(FilamentOptionType option_type)
{
wxSizer *item = nullptr;
switch (option_type) {
case VENDOR: return create_vendor_item();
case TYPE: return create_type_item();
@ -3092,10 +3090,6 @@ bool CreatePrinterPresetDialog::check_printable_area() {
if (x == 0 || y == 0) {
return false;
}
double x0 = 0.0;
double y0 = 0.0;
double x1 = x;
double y1 = y;
if (dx >= x || dy >= y) {
return false;
}
@ -4633,7 +4627,6 @@ wxBoxSizer *EditFilamentPresetDialog::create_button_sizer()
WarningDialog dlg(this, _L("All the filament presets belong to this filament would be deleted. \nIf you are using this filament on your printer, please reset the filament information for that slot."), _L("Delete filament"), wxYES | wxCANCEL | wxCANCEL_DEFAULT | wxCENTRE);
int res = dlg.ShowModal();
if (wxID_YES == res) {
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
std::set<std::shared_ptr<Preset>> inherit_preset_names;
std::set<std::shared_ptr<Preset>> root_preset_names;
for (std::pair<std::string, std::vector<std::shared_ptr<Preset>>> printer_and_preset : m_printer_compatible_presets) {

View file

@ -89,7 +89,6 @@ void DailyTipsDataRenderer::open_wiki() const
void DailyTipsDataRenderer::render(const ImVec2& pos, const ImVec2& size) const
{
ImGuiWrapper& imgui = *wxGetApp().imgui();
ImGuiWindow* parent_window = ImGui::GetCurrentWindow();
int window_flags = parent_window->Flags;
window_flags &= ~ImGuiWindowFlags_NoScrollbar;
@ -190,7 +189,6 @@ void DailyTipsDataRenderer::render_text(const ImVec2& start_pos, const ImVec2& s
std::string tips_line = _u8L("For more information, please check out Wiki");
std::string wiki_part_text = _u8L("Wiki");
std::string first_part_text = tips_line.substr(0, tips_line.find(wiki_part_text));
ImVec2 wiki_part_size = ImGui::CalcTextSize(wiki_part_text.c_str());
ImVec2 first_part_size = ImGui::CalcTextSize(first_part_text.c_str());
//text
@ -200,7 +198,6 @@ void DailyTipsDataRenderer::render_text(const ImVec2& start_pos, const ImVec2& s
ImColor HyperColor = ImColor(31, 142, 234, (int)(255 * m_fade_opacity)).Value;
ImVec2 wiki_part_rect_min = ImVec2(link_start_pos.x + first_part_size.x, link_start_pos.y);
ImVec2 wiki_part_rect_max = wiki_part_rect_min + wiki_part_size;
ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value);
ImGui::SetCursorScreenPos(wiki_part_rect_min);
imgui.text(wiki_part_text.c_str());
@ -264,9 +261,6 @@ ImVec2 DailyTipsPanel::get_size()
void DailyTipsPanel::render()
{
ImGuiWrapper& imgui = *wxGetApp().imgui();
float scale = imgui.get_font_size() / 15.0f;
if (!m_first_enter) {
retrieve_data_from_hint_database(HintDataNavigation::Curr);
m_first_enter = true;

View file

@ -1007,17 +1007,17 @@ int MachineObject::ams_filament_mapping(std::vector<FilamentInfo> filaments, std
reset_mapping_result(result);
try {
// try to use ordering ams mapping
bool order_mapping_result = true;
// bool order_mapping_result = true;
for (int i = 0; i < filaments.size(); i++) {
if (i >= tray_info_list.size()) {
order_mapping_result = false;
// order_mapping_result = false;
break;
}
if (tray_info_list[i].tray_id == -1) {
result[i].tray_id = tray_info_list[i].tray_id;
} else {
if (!tray_info_list[i].type.empty() && tray_info_list[i].type != filaments[i].type) {
order_mapping_result = false;
// order_mapping_result = false;
break;
} else {
result[i].tray_id = tray_info_list[i].tray_id;
@ -1319,7 +1319,6 @@ wxString MachineObject::get_curr_stage()
int MachineObject::get_curr_stage_idx()
{
int result = -1;
for (int i = 0; i < stage_list_info.size(); i++) {
if (stage_list_info[i] == stage_curr) {
return i;
@ -2349,8 +2348,6 @@ int MachineObject::command_xcam_control(std::string module_name, bool on_off, st
int MachineObject::command_xcam_control_ai_monitoring(bool on_off, std::string lvl)
{
bool print_halt = (lvl == "never_halt") ? false:true;
xcam_ai_monitoring = on_off;
xcam_ai_monitoring_hold_count = HOLD_COUNT_MAX;
xcam_ai_monitoring_sensitivity = lvl;
@ -5662,9 +5659,7 @@ void DeviceManager::parse_user_print_info(std::string body)
}
}
}
catch (std::exception& e) {
;
}
catch (std::exception&) {}
}
void DeviceManager::update_user_machine_list_info()

View file

@ -128,7 +128,6 @@ wxString DownloadProgressDialog::format_text(wxStaticText* st, wxString str, int
wxString out_txt = str;
wxString count_txt = "";
int new_line_pos = 0;
for (int i = 0; i < str.length(); i++) {
auto text_size = st->GetTextExtent(count_txt);

View file

@ -626,7 +626,6 @@ void ExtrusionCalibration::update_combobox_filaments()
{
m_comboBox_filament->SetValue(wxEmptyString);
user_filaments.clear();
int selection_idx = -1;
int filament_index = -1;
int curr_selection = -1;
wxArrayString filament_items;

View file

@ -2,7 +2,6 @@
#include "I18N.hpp"
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "MainFrame.hpp"
#include "ExtraRenderers.hpp"
#include "format.hpp"

View file

@ -1447,9 +1447,6 @@ void GCodeViewer::_render_calibration_thumbnail_internal(ThumbnailData& thumbnai
//shader->set_uniform("emission_factor", 0.0f);
}
else {
switch (buffer.render_primitive_type) {
default: break;
}
int uniform_color = shader->get_uniform_location("uniform_color");
auto it_path = buffer.render_paths.begin();
for (unsigned int ibuffer_id = 0; ibuffer_id < static_cast<unsigned int>(buffer.indices.size()); ++ibuffer_id) {
@ -1747,10 +1744,10 @@ void GCodeViewer::update_layers_slider_mode()
// true -> single-extruder printer profile OR
// multi-extruder printer profile , but whole model is printed by only one extruder
// false -> multi-extruder printer profile , and model is printed by several extruders
bool one_extruder_printed_model = true;
// bool one_extruder_printed_model = true;
// extruder used for whole model for multi-extruder printer profile
int only_extruder = -1;
// int only_extruder = -1;
// BBS
if (wxGetApp().filaments_cnt() > 1) {
@ -1773,10 +1770,10 @@ void GCodeViewer::update_layers_slider_mode()
return true;
};
if (is_one_extruder_printed_model())
only_extruder = extruder;
else
one_extruder_printed_model = false;
// if (is_one_extruder_printed_model())
// only_extruder = extruder;
// else
// one_extruder_printed_model = false;
}
}
@ -3247,12 +3244,6 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
return in_layers_range(path.sub_paths.front().first.s_id) && in_layers_range(path.sub_paths.back().last.s_id);
};
//BBS
auto is_extruder_in_layer_range = [this](const Path& path, size_t extruder_id) {
return path.extruder_id == extruder_id;
};
auto is_travel_in_layers_range = [this](size_t path_id, size_t min_id, size_t max_id) {
const TBuffer& buffer = m_buffers[buffer_id(EMoveType::Travel)];
if (path_id >= buffer.paths.size())
@ -4097,7 +4088,6 @@ void GCodeViewer::render_all_plates_stats(const std::vector<const GCodeProcessor
std::vector<double> support_used_filaments_g_all_plates;
float total_time_all_plates = 0.0f;
float total_cost_all_plates = 0.0f;
bool show_detailed_statistics_page = false;
struct ColumnData {
enum {
Model = 1,
@ -4399,7 +4389,6 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
const float icon_size = ImGui::GetTextLineHeight() * 0.7;
//BBS GUI refactor
//const float percent_bar_size = 2.0f * ImGui::GetTextLineHeight();
const float percent_bar_size = 0;
bool imperial_units = wxGetApp().app_config->get("use_inches") == "1";
ImDrawList* draw_list = ImGui::GetWindowDrawList();
@ -4511,7 +4500,6 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
append_range_item(0, range.min, decimals);
}
else {
const float step_size = range.step_size();
for (int i = static_cast<int>(Range_Colors.size()) - 1; i >= 0; --i) {
append_range_item(i, range.get_value_at_step(i), decimals);
}
@ -4560,7 +4548,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
return ret;
};
auto color_print_ranges = [this](unsigned char extruder_id, const std::vector<CustomGCode::Item>& custom_gcode_per_print_z) {
/*auto color_print_ranges = [this](unsigned char extruder_id, const std::vector<CustomGCode::Item>& custom_gcode_per_print_z) {
std::vector<std::pair<ColorRGBA, std::pair<double, double>>> ret;
ret.reserve(custom_gcode_per_print_z.size());
@ -4589,27 +4577,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
}
return ret;
};
auto upto_label = [](double z) {
char buf[64];
::sprintf(buf, "%.2f", z);
return _u8L("up to") + " " + std::string(buf) + " " + _u8L("mm");
};
auto above_label = [](double z) {
char buf[64];
::sprintf(buf, "%.2f", z);
return _u8L("above") + " " + std::string(buf) + " " + _u8L("mm");
};
auto fromto_label = [](double z1, double z2) {
char buf1[64];
::sprintf(buf1, "%.2f", z1);
char buf2[64];
::sprintf(buf2, "%.2f", z2);
return _u8L("from") + " " + std::string(buf1) + " " + _u8L("to") + " " + std::string(buf2) + " " + _u8L("mm");
};
};*/
auto role_time_and_percent = [time_mode](ExtrusionRole role) {
auto it = std::find_if(time_mode.roles_times.begin(), time_mode.roles_times.end(), [role](const std::pair<ExtrusionRole, float>& item) { return role == item.first; });
@ -5106,7 +5074,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
ImGuiWindow* window = ImGui::GetCurrentWindow();
const ImRect separator(ImVec2(window->Pos.x + window_padding * 3, window->DC.CursorPos.y), ImVec2(window->Pos.x + window->Size.x - window_padding * 3, window->DC.CursorPos.y + 1.0f));
ImGui::ItemSize(ImVec2(0.0f, 0.0f));
const bool item_visible = ImGui::ItemAdd(separator, 0);
ImGui::ItemAdd(separator, 0);
window->DrawList->AddLine(separator.Min, ImVec2(separator.Max.x, separator.Min.y), ImGui::GetColorU32(ImGuiCol_Separator));
std::vector<std::pair<std::string, float>> columns_offsets;
@ -5228,7 +5196,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
return items;
};
auto append_color_change = [&imgui](const ColorRGBA& color1, const ColorRGBA& color2, const std::array<float, 4>& offsets, const Times& times) {
/*auto append_color_change = [&imgui](const ColorRGBA& color1, const ColorRGBA& color2, const std::array<float, 4>& offsets, const Times& times) {
imgui.text(_u8L("Color change"));
ImGui::SameLine();
@ -5245,9 +5213,9 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
ImGui::SameLine(offsets[0]);
imgui.text(short_time(get_time_dhms(times.second - times.first)));
};
};*/
auto append_print = [&imgui, imperial_units](const ColorRGBA& color, const std::array<float, 4>& offsets, const Times& times, std::pair<double, double> used_filament) {
/*auto append_print = [&imgui, imperial_units](const ColorRGBA& color, const std::array<float, 4>& offsets, const Times& times, std::pair<double, double> used_filament) {
imgui.text(_u8L("Print"));
ImGui::SameLine();
@ -5273,7 +5241,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
::sprintf(buffer, "%.2f g", used_filament.second);
imgui.text(buffer);
}
};
};*/
PartialTimes partial_times = generate_partial_times(time_mode.custom_gcode_times, m_print_statistics.volumes_per_color_change);
if (!partial_times.empty()) {
@ -5380,7 +5348,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
// }
//}
auto any_option_available = [this]() {
/* auto any_option_available = [this]() {
auto available = [this](EMoveType type) {
const TBuffer& buffer = m_buffers[buffer_id(type)];
return buffer.visible && buffer.has_data();
@ -5393,7 +5361,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
available(EMoveType::Tool_change) ||
available(EMoveType::Unretract) ||
available(EMoveType::Seam);
};
};*/
//auto add_option = [this, append_item](EMoveType move_type, EOptionsColors color, const std::string& text) {
// const TBuffer& buffer = m_buffers[buffer_id(move_type)];

View file

@ -2773,7 +2773,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
ModelInstanceEPrintVolumeState state;
const bool contained_min_one = m_volumes.check_outside_state(m_bed.build_volume(), &state);
const bool partlyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Partly_Outside);
const bool fullyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Fully_Outside);
// const bool fullyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Fully_Outside);
_set_warning_notification(EWarning::ObjectClashed, partlyOut);
//BBS: turn off the warning when fully outside
@ -4080,12 +4080,12 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
// Set focus in order to remove it from sidebar fields
if (m_canvas != nullptr) {
// Only set focus, if the top level window of this canvas is active.
auto p = dynamic_cast<wxWindow*>(evt.GetEventObject());
while (p->GetParent())
p = p->GetParent();
auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p);
if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status())
;// m_canvas->SetFocus();
// auto p = dynamic_cast<wxWindow*>(evt.GetEventObject());
// while (p->GetParent())
// p = p->GetParent();
// auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p);
// if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status())
// m_canvas->SetFocus();
m_mouse.position = pos.cast<double>();
m_tooltip_enabled = false;
// 1) forces a frame render to ensure that m_hover_volume_idxs is updated even when the user right clicks while
@ -5085,7 +5085,6 @@ std::vector<Vec2f> GLCanvas3D::get_empty_cells(const Vec2f start_point, const Ve
}
for (size_t i = 0; i < m_model->objects.size(); ++i) {
ModelObject* model_object = m_model->objects[i];
auto id = model_object->id().id;
ModelInstance* model_instance0 = model_object->instances.front();
Polygon hull_2d = model_object->convex_hull_2d(Geometry::assemble_transform({ 0.0, 0.0, model_instance0->get_offset().z() }, model_instance0->get_rotation(),
model_instance0->get_scaling_factor(), model_instance0->get_mirror()));
@ -5356,7 +5355,6 @@ void GLCanvas3D::update_sequential_clearance()
for (int i = k+1; i < bounding_box_count; i++)
{
Polygon& next_convex = convex_and_bounding_boxes[i].hull_polygon;
BoundingBox& next_bbox = convex_and_bounding_boxes[i].bounding_box;
auto py1 = next_bbox.min.y();
auto py2 = next_bbox.max.y();
@ -5417,7 +5415,6 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa
ImGuiWrapper* imgui = wxGetApp().imgui();
auto canvas_w = float(get_canvas_size().get_width());
auto canvas_h = float(get_canvas_size().get_height());
//BBS: GUI refactor: move main toolbar to the right
//original use center as {0.0}, and top is (canvas_h/2), bottom is (-canvas_h/2), also plus inv_camera
//now change to left_up as {0,0}, and top is 0, bottom is canvas_h
@ -5426,6 +5423,7 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa
ImGuiWrapper::push_toolbar_style(get_scale());
imgui->set_next_window_pos(x, m_main_toolbar.get_height(), ImGuiCond_Always, 0.5f, 0.0f);
#else
auto canvas_h = float(get_canvas_size().get_height());
const float x = canvas_w - m_main_toolbar.get_width();
const float y = 0.5f * canvas_h - top * float(wxGetApp().plater()->get_camera().get_zoom());
imgui->set_next_window_pos(x, y, ImGuiCond_Always, 1.0f, 0.0f);
@ -5440,13 +5438,13 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa
PrinterTechnology ptech = current_printer_technology();
bool settings_changed = false;
float angle_min = 45.f;
// float angle_min = 45.f;
std::string angle_key = "overhang_angle", rot_key = "enable_rotation";
std::string key_min_area = "min_area";
std::string postfix = "_fff";
if (ptech == ptSLA) {
angle_min = 45.f;
// angle_min = 45.f;
postfix = "_sla";
}
@ -5502,7 +5500,6 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
ImGuiWrapper *imgui = wxGetApp().imgui();
auto canvas_w = float(get_canvas_size().get_width());
auto canvas_h = float(get_canvas_size().get_height());
//BBS: GUI refactor: move main toolbar to the right
//original use center as {0.0}, and top is (canvas_h/2), bottom is (-canvas_h/2), also plus inv_camera
//now change to left_up as {0,0}, and top is 0, bottom is canvas_h
@ -5510,8 +5507,8 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo
float left_pos = m_main_toolbar.get_item("arrange")->render_left_pos;
const float x = (1 + left_pos) * canvas_w / 2;
imgui->set_next_window_pos(x, m_main_toolbar.get_height(), ImGuiCond_Always, 0.0f, 0.0f);
#else
auto canvas_h = float(get_canvas_size().get_height());
const float x = canvas_w - m_main_toolbar.get_width();
const float y = 0.5f * canvas_h - top * float(wxGetApp().plater()->get_camera().get_zoom());
imgui->set_next_window_pos(x, y, ImGuiCond_Always, 1.0f, 0.0f);
@ -8091,16 +8088,13 @@ void GLCanvas3D::_render_return_toolbar() const
ImVec2 button_icon_size = ImVec2(font_size * 1.3, font_size * 1.3);
ImGuiWrapper& imgui = *wxGetApp().imgui();
Size cnv_size = get_canvas_size();
auto canvas_w = float(cnv_size.get_width());
auto canvas_h = float(cnv_size.get_height());
float window_width = real_size.x + button_icon_size.x + imgui.scaled(2.0f);
float window_height = button_icon_size.y + imgui.scaled(2.0f);
float window_pos_x = 30.0f + (is_collapse_toolbar_on_left() ? (get_collapse_toolbar_width() + 5.f) : 0);
float window_pos_y = 14.0f;
imgui.set_next_window_pos(window_pos_x, window_pos_y, ImGuiCond_Always, 0, 0);
#ifdef __WINDOWS__
float window_width = real_size.x + button_icon_size.x + imgui.scaled(2.0f);
float window_height = button_icon_size.y + imgui.scaled(2.0f);
imgui.set_next_window_size(window_width, window_height, ImGuiCond_Always);
#endif
@ -8114,9 +8108,6 @@ void GLCanvas3D::_render_return_toolbar() const
imgui.begin(_L("Assembly Return"), ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBackground
| ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse);
float button_width = 20;
float button_height = 20;
ImVec2 size = ImVec2(button_width, button_height); // Size of the image we want to make visible
ImVec2 uv0 = ImVec2(0.0f, 0.0f);
ImVec2 uv1 = ImVec2(1.0f, 1.0f);
@ -8392,11 +8383,11 @@ void GLCanvas3D::_render_assemble_control() const
ImGui::SameLine(window_padding.x + 2 * text_size_x + slider_width + item_spacing * 7 + value_size);
ImGui::PushItemWidth(slider_width);
bool explosion_slider_changed = imgui->bbl_slider_float_style("##ratio_slider", &m_explosion_ratio, 1.0f, 3.0f, "%1.2f");
imgui->bbl_slider_float_style("##ratio_slider", &m_explosion_ratio, 1.0f, 3.0f, "%1.2f");
ImGui::SameLine(window_padding.x + 2 * text_size_x + 2 * slider_width + item_spacing * 8 + value_size);
ImGui::PushItemWidth(value_size);
bool explosion_input_changed = ImGui::BBLDragFloat("##ratio_input", &m_explosion_ratio, 0.1f, 1.0f, 3.0f, "%1.2f");
ImGui::BBLDragFloat("##ratio_input", &m_explosion_ratio, 0.1f, 1.0f, 3.0f, "%1.2f");
}
imgui->end();
@ -8426,7 +8417,6 @@ void GLCanvas3D::_render_assemble_info() const
auto canvas_h = float(get_canvas_size().get_height());
float space_size = imgui->get_style_scaling() * 8.0f;
float caption_max = imgui->calc_text_size(_L("Total Volume:")).x + 3 * space_size;
char buf[3][64];
ImGuiIO& io = ImGui::GetIO();
ImFont* font = io.Fonts->Fonts[0];

View file

@ -470,7 +470,6 @@ void GLTexture::reset()
bool GLTexture::generate_from_text_string(const std::string& text_str, wxFont &font, wxColor background, wxColor foreground)
{
int w,h,hl;
return generate_from_text(text_str, font, background, foreground);
}

View file

@ -1466,7 +1466,6 @@ void GLToolbar::render_vertical(const GLCanvas3D& parent)
int tex_width, tex_height;
if (item->is_action_with_text_image()) {
float scaled_text_size = m_layout.text_size * m_layout.scale * inv_cnv_w;
float scaled_text_width = item->get_extra_size_ratio() * icons_size_x;
float scaled_text_border = 2.5 * m_layout.scale * inv_cnv_h;
float scaled_text_height = icons_size_y / 2.0f;
item->render_text(left, left + scaled_text_size, top - scaled_text_border - scaled_text_height, top - scaled_text_border);

View file

@ -301,7 +301,6 @@ public:
memDC.SetTextForeground(StateColor::darkModeColorFor(wxColour(144, 144, 144)));
int width = bitmap.GetWidth();
int text_height = memDC.GetTextExtent(text).GetHeight();
int text_width = memDC.GetTextExtent(text).GetWidth();
wxRect text_rect(wxPoint(0, m_action_line_y_position), wxPoint(width, m_action_line_y_position + text_height));
memDC.DrawLabel(text, text_rect, wxALIGN_CENTER);
@ -963,7 +962,7 @@ void GUI_App::post_init()
// Neither wxShowEvent nor wxWindowCreateEvent work reliably.
if (this->preset_updater) { // G-Code Viewer does not initialize preset_updater.
CallAfter([this] {
bool cw_showed = this->config_wizard_startup();
this->config_wizard_startup();
std::string http_url = get_http_url(app_config->get_country_code());
std::string language = GUI::into_u8(current_language_code());
@ -1026,8 +1025,7 @@ void GUI_App::post_init()
try {
std::time_t lw_t = boost::filesystem::last_write_time(temp_path) ;
files_vec.push_back({ lw_t, temp_path.filename().string() });
} catch (const std::exception &ex) {
}
} catch (std::exception&) {}
}
std::sort(files_vec.begin(), files_vec.end(), [](
std::pair<time_t, std::string> &a, std::pair<time_t, std::string> &b) {
@ -1317,7 +1315,6 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install
.on_complete([&pro_fn, tmp_path, target_file_path](std::string body, unsigned status) {
BOOST_LOG_TRIVIAL(info) << "[download_plugin 2] completed";
bool cancel = false;
int percent = 0;
fs::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc);
file.write(body.c_str(), body.size());
file.close();
@ -1927,8 +1924,13 @@ void GUI_App::init_app_config()
boost::filesystem::create_directory(data_dir_path);
}
// Change current dirtory of application
chdir(encode_path((Slic3r::data_dir() + "/log").c_str()).c_str());
// Change current directory of application
auto path = encode_path((Slic3r::data_dir() + "/log").c_str());
#ifdef _WIN32
_chdir(path.c_str());
#else
chdir(path.c_str());
#endif
} else {
m_datadir_redefined = true;
}
@ -3365,7 +3367,7 @@ if (res) {
mainframe->refresh_plugin_tips();
// BBS: remove SLA related message
}
} catch (std::exception &e) {
} catch (std::exception&) {
// wxMessageBox(e.what(), "", MB_OK);
}
}
@ -3379,9 +3381,7 @@ void GUI_App::ShowDownNetPluginDlg() {
return;
DownloadProgressDialog dlg(_L("Downloading Bambu Network Plug-in"));
dlg.ShowModal();
} catch (std::exception &e) {
;
}
} catch (std::exception&) {}
}
void GUI_App::ShowUserLogin(bool show)
@ -3396,9 +3396,7 @@ void GUI_App::ShowUserLogin(bool show)
login_dlg = new ZUserLogin();
}
login_dlg->ShowModal();
} catch (std::exception &e) {
;
}
} catch (std::exception&) {}
} else {
if (login_dlg)
login_dlg->EndModal(wxID_OK);
@ -3418,7 +3416,7 @@ void GUI_App::ShowOnlyFilament() {
// BBS: remove SLA related message
}
} catch (std::exception &e) {
} catch (std::exception&) {
// wxMessageBox(e.what(), "", MB_OK);
}
}
@ -3830,10 +3828,10 @@ std::string GUI_App::handle_web_request(std::string cmd)
auto keyCode = key_event_node.get<int>("key");
auto ctrlKey = key_event_node.get<bool>("ctrl");
auto shiftKey = key_event_node.get<bool>("shift");
auto cmdKey = key_event_node.get<bool>("cmd");
wxKeyEvent e(wxEVT_CHAR_HOOK);
#ifdef __APPLE__
auto cmdKey = key_event_node.get<bool>("cmd");
e.SetControlDown(cmdKey);
e.SetRawControlDown(ctrlKey);
#else
@ -4786,8 +4784,6 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg)
});
}
unsigned int http_code = 200;
/* get list witch need to be deleted*/
std::vector<string> delete_cache_presets = get_delete_cache_presets_lock();
for (auto it = delete_cache_presets.begin(); it != delete_cache_presets.end();) {
@ -5467,7 +5463,7 @@ void GUI_App::show_ip_address_enter_dialog_handler(wxCommandEvent& evt)
void GUI_App::open_preferences(size_t open_on_tab, const std::string& highlight_option)
{
bool app_layout_changed = false;
// bool app_layout_changed = false;
{
// the dialog needs to be destroyed before the call to recreate_GUI()
// or sometimes the application crashes into wxDialogBase() destructor
@ -6500,8 +6496,6 @@ static bool del_win_registry(HKEY hkeyHive, const wchar_t *pszVar, const wchar_t
return false;
if (!bDidntExist) {
DWORD dwDisposition;
HKEY hkey;
iRC = ::RegDeleteKeyExW(hkeyHive, pszVar, KEY_ALL_ACCESS, 0);
if (iRC == ERROR_SUCCESS) {
return true;

View file

@ -3,8 +3,6 @@
#include "I18N.hpp"
#include "wxExtensions.hpp"
#include <boost/filesystem.hpp>
#include "GUI_App.hpp"
#include "Plater.hpp"
#include "libslic3r/Model.hpp"

View file

@ -711,9 +711,9 @@ wxMenuItem* MenuFactory::append_menu_item_settings(wxMenu* menu_)
// Create new items for settings popupmenu
if (printer_technology() == ptFFF ||
(menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator()))
;// menu->SetFirstSeparator();
// if (printer_technology() == ptFFF ||
// (menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator()))
// menu->SetFirstSeparator();
// detect itemm for adding of the setting
ObjectList* object_list = obj_list();
@ -1339,7 +1339,7 @@ void MenuFactory::create_extra_object_menu()
m_object_menu.AppendSeparator();
// Set filament insert menu item here
// Set Printable
wxMenuItem* menu_item_printable = append_menu_item_printable(&m_object_menu);
append_menu_item_printable(&m_object_menu);
append_menu_item_per_object_process(&m_object_menu);
// Enter per object parameters
append_menu_item_per_object_settings(&m_object_menu);
@ -1493,8 +1493,6 @@ void MenuFactory::create_plate_menu()
// arrange objects on current plate
append_menu_item(menu, wxID_ANY, _L("Arrange"), _L("arrange current plate"),
[](wxCommandEvent&) {
PartPlate* plate = plater()->get_partplate_list().get_selected_plate();
assert(plate);
plater()->set_prepare_state(Job::PREPARE_STATE_MENU);
plater()->arrange();
}, "", nullptr,
@ -1507,8 +1505,6 @@ void MenuFactory::create_plate_menu()
append_menu_item(
menu, wxID_ANY, _L("Reload All"), _L("reload all from disk"),
[](wxCommandEvent&) {
PartPlate* plate = plater()->get_partplate_list().get_selected_plate();
assert(plate);
plater()->set_prepare_state(Job::PREPARE_STATE_MENU);
plater()->reload_all_from_disk();
},
@ -1517,8 +1513,6 @@ void MenuFactory::create_plate_menu()
// orient objects on current plate
append_menu_item(menu, wxID_ANY, _L("Auto Rotate"), _L("auto rotate current plate"),
[](wxCommandEvent&) {
PartPlate* plate = plater()->get_partplate_list().get_selected_plate();
assert(plate);
//BBS TODO call auto rotate for current plate
plater()->set_prepare_state(Job::PREPARE_STATE_MENU);
plater()->orient();
@ -1801,7 +1795,7 @@ void MenuFactory::append_menu_item_clone(wxMenu* menu)
void MenuFactory::append_menu_item_simplify(wxMenu* menu)
{
wxMenuItem* menu_item = append_menu_item(menu, wxID_ANY, _L("Simplify Model"), "",
append_menu_item(menu, wxID_ANY, _L("Simplify Model"), "",
[](wxCommandEvent&) { obj_list()->simplify(); }, "", menu,
[]() {return plater()->can_simplify(); }, m_parent);
}
@ -1899,16 +1893,16 @@ void MenuFactory::append_menu_item_change_filament(wxMenu* menu)
wxMenu* extruder_selection_menu = new wxMenu();
const wxString& name = sels.Count() == 1 ? names[0] : names[1];
int initial_extruder = -1; // negative value for multiple object/part selection
if (sels.Count() == 1) {
const ModelConfig& config = obj_list()->get_item_config(sels[0]);
// BBS
const auto sel_vol = obj_list()->get_selected_model_volume();
if (sel_vol && sel_vol->type() == ModelVolumeType::PARAMETER_MODIFIER)
initial_extruder = config.has("extruder") ? config.extruder() : 0;
else
initial_extruder = config.has("extruder") ? config.extruder() : 1;
}
// int initial_extruder = -1; // negative value for multiple object/part selection
// if (sels.Count() == 1) {
// const ModelConfig& config = obj_list()->get_item_config(sels[0]);
// // BBS
// const auto sel_vol = obj_list()->get_selected_model_volume();
// if (sel_vol && sel_vol->type() == ModelVolumeType::PARAMETER_MODIFIER)
// initial_extruder = config.has("extruder") ? config.extruder() : 0;
// else
// initial_extruder = config.has("extruder") ? config.extruder() : 1;
// }
// BBS
bool has_modifier = false;
@ -1949,7 +1943,6 @@ void MenuFactory::append_menu_item_change_filament(wxMenu* menu)
void MenuFactory::append_menu_item_set_printable(wxMenu* menu)
{
const Selection& selection = plater()->canvas3D()->get_selection();
bool all_printable = true;
ObjectList* list = obj_list();
wxDataViewItemArray sels;
@ -1957,7 +1950,6 @@ void MenuFactory::append_menu_item_set_printable(wxMenu* menu)
for (wxDataViewItem item : sels) {
ItemType type = list->GetModel()->GetItemType(item);
bool check;
if (type != itInstance && type != itObject)
continue;
else {
@ -2000,8 +1992,8 @@ void MenuFactory::append_menu_item_locked(wxMenu* menu)
}, "", nullptr, []() { return true; }, m_parent);
m_parent->Bind(wxEVT_UPDATE_UI, [](wxUpdateUIEvent& evt) {
PartPlate* plate = plater()->get_partplate_list().get_selected_plate();
assert(plate);
// PartPlate* plate = plater()->get_partplate_list().get_selected_plate();
// assert(plate);
//bool check = plate->is_locked();
//evt.Check(check);
plater()->set_current_canvas_as_dirty();
@ -2037,8 +2029,6 @@ void MenuFactory::append_menu_item_plate_name(wxMenu *menu)
m_parent->Bind(
wxEVT_UPDATE_UI,
[](wxUpdateUIEvent &evt) {
PartPlate *plate = plater()->get_partplate_list().get_selected_plate();
assert(plate);
plater()->set_current_canvas_as_dirty();
},
item->GetId());

View file

@ -713,7 +713,6 @@ void ObjectList::update_plate_values_for_items()
Unselect(item);
bool is_old_parent_expanded = IsExpanded(old_parent);
bool is_expanded = IsExpanded(item);
m_objects_model->OnPlateChange(plate_idx, item);
if (is_old_parent_expanded)
Expand(old_parent);
@ -739,7 +738,6 @@ void ObjectList::object_config_options_changed(const ObjectVolumeID& ov_id)
if (ov_id.object == nullptr)
return;
ModelObjectPtrs& objects = wxGetApp().model().objects;
ModelObject* mo = ov_id.object;
ModelVolume* mv = ov_id.volume;
@ -846,8 +844,6 @@ void ObjectList::update_filament_colors()
void ObjectList::update_name_column_width() const
{
wxSize client_size = this->GetClientSize();
bool p_vbar = this->GetParent()->HasScrollbar(wxVERTICAL);
bool p_hbar = this->GetParent()->HasScrollbar(wxHORIZONTAL);
auto em = em_unit(const_cast<ObjectList*>(this));
// BBS: walkaround for wxDataViewCtrl::HasScrollbar() does not return correct status
@ -936,7 +932,6 @@ void ObjectList::update_name_in_model(const wxDataViewItem& item) const
if (m_objects_model->GetItemType(item) & itPlate) {
std::string name = m_objects_model->GetName(item).ToUTF8().data();
int plate_idx = -1;
const ItemType type0 = m_objects_model->GetItemType(item, plate_idx);
if (plate_idx >= 0) {
auto plate = wxGetApp().plater()->get_partplate_list().get_plate(plate_idx);
if (plate->get_plate_name() != name) {
@ -1351,8 +1346,7 @@ void ObjectList::show_context_menu(const bool evt_context_menu)
plater->SetPlateIndexByRightMenuInLeftUI(-1);
if (type & itPlate) {
int plate_idx = -1;
const ItemType type0 = m_objects_model->GetItemType(item, plate_idx);
if (plate_idx >= 0) {
if (plate_idx >= 0) {
plater->SetPlateIndexByRightMenuInLeftUI(plate_idx);
}
}
@ -2006,7 +2000,7 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
try {
model = Model::read_from_file(input_file, nullptr, nullptr, LoadStrategy::LoadModel);
}
catch (std::exception& e) {
catch (std::exception&) {
// auto msg = _L("Error!") + " " + input_file + " : " + e.what() + ".";
auto msg = _L("Error!") + " " + _L("Failed to get the model data in the current file.");
show_error(parent, msg);
@ -2905,7 +2899,7 @@ void ObjectList::boolean()
new_object->config.assign_config(object->config);
if (new_object->instances.empty())
new_object->add_instance();
ModelVolume* new_volume = new_object->add_volume(mesh);
new_object->add_volume(mesh);
// BBS: ensure on bed but no need to ensure locate in the center around origin
new_object->ensure_on_bed();
@ -2952,9 +2946,9 @@ DynamicPrintConfig ObjectList::get_default_layer_config(const int obj_idx)
wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("layer_height");
config.set_key_value("layer_height",new ConfigOptionFloat(layer_height));
// BBS
int extruder = object(obj_idx)->config.has("extruder") ?
object(obj_idx)->config.opt_int("extruder") :
wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("extruder");
// int extruder = object(obj_idx)->config.has("extruder") ?
// object(obj_idx)->config.opt_int("extruder") :
// wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("extruder");
config.set_key_value("extruder", new ConfigOptionInt(0));
return config;
@ -3176,8 +3170,8 @@ void ObjectList::part_selection_changed()
bool update_and_show_settings = false;
bool update_and_show_layers = false;
bool enable_manipulation{true};
bool disable_ss_manipulation{false};
// bool enable_manipulation{true}; Orca: Removed because not used
// bool disable_ss_manipulation{false}; Orca: Removed because not used
bool disable_ununiform_scale{false};
const auto item = GetSelection();
@ -3185,7 +3179,7 @@ void ObjectList::part_selection_changed()
og_name = _L("Cut Connectors information");
update_and_show_manipulations = true;
enable_manipulation = false;
// enable_manipulation = false;
disable_ununiform_scale = true;
}
else if (item && (m_objects_model->GetItemType(item) & itPlate)) {
@ -3202,7 +3196,7 @@ void ObjectList::part_selection_changed()
obj_idx = selection.get_object_idx();
ModelObject *object = (*m_objects)[obj_idx];
m_config = &object->config;
disable_ss_manipulation = object->is_cut();
// disable_ss_manipulation = object->is_cut();
}
else {
og_name = _L("Group manipulation");
@ -3211,17 +3205,17 @@ void ObjectList::part_selection_changed()
update_and_show_manipulations = !selection.is_single_full_instance();
if (int obj_idx = selection.get_object_idx(); obj_idx >= 0) {
if (selection.is_any_volume() || selection.is_any_modifier())
enable_manipulation = !(*m_objects)[obj_idx]->is_cut();
else // if (item && m_objects_model->GetItemType(item) == itInstanceRoot)
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
// if (selection.is_any_volume() || selection.is_any_modifier())
// enable_manipulation = !(*m_objects)[obj_idx]->is_cut();
// else // if (item && m_objects_model->GetItemType(item) == itInstanceRoot)
// disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
}
else {
wxDataViewItemArray sels;
GetSelections(sels);
if (selection.is_single_full_object() || selection.is_multiple_full_instance()) {
int obj_idx = m_objects_model->GetObjectIdByItem(sels.front());
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
// int obj_idx = m_objects_model->GetObjectIdByItem(sels.front());
// disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
} else if (selection.is_mixed() || selection.is_multiple_full_object()) {
std::map<CutObjectBase, std::set<int>> cut_objects;
@ -3240,7 +3234,7 @@ void ObjectList::part_selection_changed()
// check if selected cut objects are "full selected"
for (auto cut_object : cut_objects)
if (cut_object.first.check_sum() != cut_object.second.size()) {
disable_ss_manipulation = true;
// disable_ss_manipulation = true;
break;
}
disable_ununiform_scale = !cut_objects.empty();
@ -3288,7 +3282,7 @@ void ObjectList::part_selection_changed()
// BBS: select object to edit config
m_config = &(*m_objects)[obj_idx]->config;
update_and_show_settings = true;
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
// disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
}
}
else {
@ -3316,8 +3310,8 @@ void ObjectList::part_selection_changed()
m_config = &(*m_objects)[obj_idx]->volumes[volume_id]->config;
update_and_show_settings = true;
const ModelVolume *volume = (*m_objects)[obj_idx]->volumes[volume_id];
enable_manipulation = !((*m_objects)[obj_idx]->is_cut() && (volume->is_cut_connector() || volume->is_model_part()));
// const ModelVolume *volume = (*m_objects)[obj_idx]->volumes[volume_id];
// enable_manipulation = !((*m_objects)[obj_idx]->is_cut() && (volume->is_cut_connector() || volume->is_model_part()));
}
else if (type & itInstance) {
og_name = _L("Instance manipulation");
@ -3325,7 +3319,7 @@ void ObjectList::part_selection_changed()
// fill m_config by object's values
m_config = &(*m_objects)[obj_idx]->config;
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
// disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
}
else if (type & (itLayerRoot | itLayer)) {
og_name = type & itLayerRoot ? _L("Height ranges") : _L("Settings for height range");
@ -3368,7 +3362,7 @@ void ObjectList::part_selection_changed()
if (printer_technology() == ptSLA)
update_and_show_layers = false;
else if (update_and_show_layers) {
;//wxGetApp().obj_layers()->get_og()->set_name(" " + og_name + " ");
//wxGetApp().obj_layers()->get_og()->set_name(" " + og_name + " ");
}
update_min_height();
@ -3400,7 +3394,6 @@ wxDataViewItem ObjectList::add_settings_item(wxDataViewItem parent_item, const D
return ret;
const bool is_object_settings = m_objects_model->GetItemType(parent_item) == itObject;
const bool is_volume_settings = m_objects_model->GetItemType(parent_item) == itVolume;
const bool is_layer_settings = m_objects_model->GetItemType(parent_item) == itLayer;
if (!is_object_settings) {
ModelVolumeType volume_type = m_objects_model->GetVolumeType(parent_item);
@ -4689,8 +4682,6 @@ void ObjectList::select_item(const ObjectVolumeID& ov_id)
void ObjectList::select_items(const std::vector<ObjectVolumeID>& ov_ids)
{
ModelObjectPtrs& objects = wxGetApp().model().objects;
wxDataViewItemArray sel_items;
for (auto ov_id : ov_ids) {
if (ov_id.object == nullptr)
@ -5695,7 +5686,7 @@ void ObjectList::set_extruder_for_selected_items(const int extruder)
void ObjectList::on_plate_added(PartPlate* part_plate)
{
wxDataViewItem plate_item = m_objects_model->AddPlate(part_plate);
m_objects_model->AddPlate(part_plate);
}
void ObjectList::on_plate_deleted(int plate_idx)

View file

@ -205,7 +205,7 @@ bool ObjectSettings::update_settings_list()
bool is_object_settings = false;
bool is_volume_settings = false;
bool is_layer_range_settings = false;
bool is_layer_root = false;
// bool is_layer_root = false;
ModelObject * parent_object = nullptr;
for (auto item : items) {
auto type = objects_model->GetItemType(item);
@ -255,9 +255,9 @@ bool ObjectSettings::update_settings_list()
t_layer_height_range height_range = objects_model->GetLayerRangeByItem(item);
object_configs.emplace( (ObjectBase*)(&object->layer_config_ranges.at(height_range)), &object->layer_config_ranges.at(height_range) );
}
else if (type == itLayerRoot) {
is_layer_root = true;
}
// else if (type == itLayerRoot) {
// is_layer_root = true;
// }
}
auto tab_plate = dynamic_cast<TabPrintPlate*>(wxGetApp().get_plate_tab());

View file

@ -280,7 +280,6 @@ wxGridActivationResult GridCellFilamentsEditor::TryActivate(int row, int col, wx
{
ObjectGridTable *table = dynamic_cast<ObjectGridTable *>(grid->GetTable());
ObjectGridTable::ObjectGridCol* grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow* grid_row = table->get_grid_row(row - 1);
if ( actSource.GetOrigin() == wxGridActivationSource::Key ) {
const wxKeyEvent& key_event = actSource.GetKeyEvent();
@ -316,7 +315,6 @@ void GridCellFilamentsEditor::DoActivate(int row, int col, wxGrid* grid)
if (m_cached_value != -1) {
ObjectGridTable *table = dynamic_cast<ObjectGridTable *>(grid->GetTable());
ObjectGridTable::ObjectGridCol* grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow* grid_row = table->get_grid_row(row - 1);
if (m_cached_value <= grid_col->choice_count) {
wxString choice = grid_col->choices[m_cached_value-1];
table->SetValue(row, col, choice);
@ -332,7 +330,6 @@ void GridCellFilamentsRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &d
wxRect text_rect = rect;
if (table) {
ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
ConfigOptionInt & cur_option = dynamic_cast<ConfigOptionInt &>((*grid_row)[(ObjectGridTable::GridColType) col]);
@ -472,7 +469,6 @@ wxGridActivationResult GridCellChoiceEditor::TryActivate(int row, int col, wxGri
{
ObjectGridTable * table = dynamic_cast<ObjectGridTable *>(grid->GetTable());
ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
if (actSource.GetOrigin() == wxGridActivationSource::Key) {
const wxKeyEvent &key_event = actSource.GetKeyEvent();
@ -505,7 +501,6 @@ void GridCellChoiceEditor::DoActivate(int row, int col, wxGrid *grid)
if (m_cached_value != -1) {
ObjectGridTable * table = dynamic_cast<ObjectGridTable *>(grid->GetTable());
ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
if (m_cached_value <= grid_col->choice_count) {
wxString choice = grid_col->choices[m_cached_value - 1];
table->SetValue(row, col, choice);
@ -521,7 +516,6 @@ void GridCellComboBoxRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc
wxRect text_rect = rect;
if (table) {
ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
ConfigOptionInt & cur_option = dynamic_cast<ConfigOptionInt &>((*grid_row)[(ObjectGridTable::GridColType) col]);
@ -561,7 +555,6 @@ wxString GridCellSupportEditor::ms_stringValues[2] = { wxT(""), wxT("") };
void GridCellSupportEditor::DoActivate(int row, int col, wxGrid* grid)
{
ObjectGrid* local_table = dynamic_cast<ObjectGrid*>(grid);
wxGridBlocks cell_array = grid->GetSelectedBlocks();
auto left_col = cell_array.begin()->GetLeftCol();
@ -691,7 +684,6 @@ void GridCellSupportRenderer::Draw(wxGrid& grid,
//wxGridCellBoolRenderer::Draw(grid, attr, dc, rect, row, col, isSelected);
ObjectGridTable * table = dynamic_cast<ObjectGridTable *>(grid.GetTable());
ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
ConfigOptionBool & cur_option = dynamic_cast<ConfigOptionBool &>((*grid_row)[(ObjectGridTable::GridColType) col]);
@ -891,7 +883,6 @@ void ObjectGrid::OnKeyDown( wxKeyEvent& event )
// see include/wx/defs.h enum wxKeyCode
int keyCode = event.GetKeyCode();
int ctrlMask = wxMOD_CONTROL;
int shiftMask = wxMOD_SHIFT;
// Coordinates of the selected block to copy to clipboard.
wxGridBlockCoords selection;
wxTextDataObject text_data;
@ -1544,7 +1535,6 @@ void ObjectGridTable::SetValue( int row, int col, const wxString& value )
return;
ObjectGridRow* grid_row = m_grid_data[row - 1];
ObjectGridCol* grid_col = m_col_data[col];
ObjectList* obj_list = wxGetApp().obj_list();
if (grid_col->type == coEnum) {
int enum_value = 0;
for (int i = 0; i < grid_col->choice_count; i++)
@ -1812,9 +1802,6 @@ wxString ObjectGridTable::convert_filament_string(int index, wxString& filament_
void ObjectGridTable::init_cols(ObjectGrid *object_grid)
{
const float font_size = 1.5f * wxGetApp().em_unit();
// printable for object
ObjectGridCol *col = new ObjectGridCol(coBool, "printable", ObjectGridTable::category_all, true, false, true, false, wxALIGN_CENTRE);
col->size = object_grid->GetTextExtent(L("Printable")).x;
@ -1910,7 +1897,6 @@ void ObjectGridTable::init_cols(ObjectGrid *object_grid)
col = new ObjectGridCol(coFloat, "inner_wall_speed_reset", L("Speed"), false, true, false, false, wxALIGN_LEFT);
m_col_data.push_back(col);
return;
}
void ObjectGridTable::construct_object_configs(ObjectGrid *object_grid)
@ -1929,8 +1915,8 @@ void ObjectGridTable::construct_object_configs(ObjectGrid *object_grid)
int object_count = m_panel->m_model->objects.size();
PartPlateList& partplate_list = m_panel->m_plater->get_partplate_list();
DynamicPrintConfig& global_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
const DynamicPrintConfig* plater_config = m_panel->m_plater->config();
const DynamicPrintConfig& filament_config = *plater_config;
// const DynamicPrintConfig* plater_config = m_panel->m_plater->config();
// const DynamicPrintConfig& filament_config = *plater_config;
for (int i = 0; i < object_count; i++)
{
@ -2826,7 +2812,7 @@ int ObjectTablePanel::init_filaments_and_colors()
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(", invalid color count:%1%, extruder count: %2%") %color_count %m_filaments_count;
}
unsigned int i = 0;
int i = 0;
ColorRGB rgb;
while (i < m_filaments_count) {
const std::string& txt_color = global_config->opt_string("filament_colour", i);
@ -3032,7 +3018,6 @@ void ObjectTablePanel::load_data()
{
ObjectGridTable::ObjectGridCol *grid_col = m_object_grid_table->get_grid_col(i);
if (grid_col->size > 0) {
int fit_size1 = m_object_grid->GetColSize(i);
m_object_grid->SetColSize(i, grid_col->size);
}
}
@ -3173,7 +3158,7 @@ void ObjectTablePanel::OnRowSize( wxGridSizeEvent& ev)
g_dialog_max_height =(panel_size.GetHeight() > g_max_size_from_parent.GetHeight())?g_max_size_from_parent.GetHeight():panel_size.GetHeight();
this->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height));
wxSize current_size = GetParent()->GetSize();
// wxSize current_size = GetParent()->GetSize();
//if (current_size.GetHeight() < g_dialog_max_height)
GetParent()->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height));
GetParent()->SetSize(wxSize(g_dialog_max_width, g_dialog_max_height));
@ -3187,7 +3172,7 @@ void ObjectTablePanel::OnColSize( wxGridSizeEvent& ev)
g_dialog_max_height =(panel_size.GetHeight() > g_max_size_from_parent.GetHeight())?g_max_size_from_parent.GetHeight():panel_size.GetHeight();
this->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height));
wxSize current_size = GetParent()->GetSize();
// wxSize current_size = GetParent()->GetSize();
//if (current_size.GetWidth() < g_dialog_max_width)
GetParent()->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height));
GetParent()->SetSize(wxSize(g_dialog_max_width, g_dialog_max_height));
@ -3471,8 +3456,6 @@ void GridCellTextEditor::SetSize(const wxRect &rect) { wxGridCellTextEditor::Set
void GridCellTextEditor::BeginEdit(int row, int col, wxGrid *grid)
{
ObjectGridTable * table = dynamic_cast<ObjectGridTable *>(grid->GetTable());
ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
auto val = table->GetValue(row, col);
@ -3506,10 +3489,6 @@ void GridCellTextEditor::BeginEdit(int row, int col, wxGrid *grid)
bool GridCellTextEditor::EndEdit(int row, int col, const wxGrid *grid, const wxString &WXUNUSED(oldval), wxString *newval)
{
ObjectGridTable * table = dynamic_cast<ObjectGridTable *>(grid->GetTable());
ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col);
ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1);
wxCHECK_MSG(m_control, false, "wxGridCellTextEditor must be created first!");
const wxString value = Text()->GetTextCtrl()->GetValue();

View file

@ -108,7 +108,6 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
//SettingsFactory::Bundle cat_options = SettingsFactory::get_bundle(&config->get(), is_object);
std::map<std::string, std::vector<SimpleSettingData>> cat_options;
std::vector<SimpleSettingData> category_settings = SettingsFactory::get_visible_options(category, !is_object);
bool display_multiple = false;
auto is_option_modified = [this](std::string key) {
ConfigOption* config_option1 = m_origin_config.option(key);
ConfigOption* config_option2 = m_current_config.option(key);
@ -147,7 +146,6 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_
else
it1 = cat_options.erase(it1);
}
display_multiple = true;
}
else {
cat_options.emplace(category, category_settings);

View file

@ -6,7 +6,6 @@
#include "GUI_App.hpp"
#include "GUI.hpp"
#include "I18N.hpp"
#include "3DScene.hpp"
#include "BackgroundSlicingProcess.hpp"
#include "OpenGLManager.hpp"
#include "GLCanvas3D.hpp"
@ -15,19 +14,11 @@
#include "MainFrame.hpp"
#include "format.hpp"
#include <wx/listbook.h>
#include <wx/notebook.h>
#include <wx/glcanvas.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/combo.h>
#include <wx/combobox.h>
#include <wx/checkbox.h>
// this include must follow the wxWidgets ones or it won't compile on Windows -> see http://trac.wxwidgets.org/ticket/2421
#include "libslic3r/Print.hpp"
#include "libslic3r/SLAPrint.hpp"
#include "NotificationManager.hpp"
#ifdef _WIN32
@ -536,7 +527,6 @@ void Preview::update_layers_slider_from_canvas(wxKeyEvent &event)
const auto key = event.GetKeyCode();
IMSlider *m_layers_slider = m_canvas->get_gcode_viewer().get_layers_slider();
IMSlider *m_moves_slider = m_canvas->get_gcode_viewer().get_moves_slider();
if (key == 'L') {
if(!m_layers_slider->switch_one_layer_mode())
event.Skip();

View file

@ -3057,7 +3057,7 @@ bool GLGizmoEmboss::choose_font_by_wxdialog()
}
#endif // ALLOW_ADD_FONT_BY_OS_SELECTOR
#if defined ALLOW_ADD_FONT_BY_FILE or defined ALLOW_DEBUG_MODE
#if defined(ALLOW_ADD_FONT_BY_FILE) || defined(ALLOW_DEBUG_MODE)
namespace priv {
static std::string get_file_name(const std::string &file_path)
{
@ -3693,7 +3693,6 @@ GuiCfg create_gui_configuration()
cfg.height_of_volume_type_selector = separator_height + line_height_with_spacing + input_height;
int max_style_image_width = static_cast<int>(std::round(cfg.max_style_name_width/2 - 2 * style.FramePadding.x));
int max_style_image_height = static_cast<int>(std::round(input_height));
cfg.max_style_image_size = Vec2i32(max_style_image_width, line_height);
cfg.face_name_size = Vec2i32(cfg.input_width, line_height_with_spacing);
cfg.face_name_texture_offset_x = cfg.face_name_size.x() + space;

View file

@ -245,17 +245,10 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
const float gap_fill_slider_left = m_imgui->calc_text_size(m_desc.at("gap_fill")).x + m_imgui->scaled(1.5f);
const float highlight_slider_left = m_imgui->calc_text_size(m_desc.at("highlight_by_angle")).x + m_imgui->scaled(1.5f);
const float reset_button_slider_left = m_imgui->calc_text_size(m_desc.at("reset_direction")).x + m_imgui->scaled(1.5f) + ImGui::GetStyle().FramePadding.x * 2;
const float on_overhangs_only_width = m_imgui->calc_text_size(m_desc["on_overhangs_only"]).x + m_imgui->scaled(1.5f);
const float remove_btn_width = m_imgui->calc_text_size(m_desc.at("remove_all")).x + m_imgui->scaled(1.5f);
const float filter_btn_width = m_imgui->calc_text_size(m_desc.at("perform")).x + m_imgui->scaled(1.5f);
const float gap_area_txt_width = m_imgui->calc_text_size(m_desc.at("gap_area")).x + m_imgui->scaled(1.5f);
const float smart_fill_angle_txt_width = m_imgui->calc_text_size(m_desc.at("smart_fill_angle")).x + m_imgui->scaled(1.5f);
const float buttons_width = remove_btn_width + filter_btn_width + m_imgui->scaled(1.5f);
const float empty_button_width = m_imgui->calc_button_size("").x;
const float tips_width = m_imgui->calc_text_size(_L("Auto support threshold angle: ") + " 90 ").x + m_imgui->scaled(1.5f);
const float minimal_slider_width = m_imgui->scaled(4.f);
float caption_max = 0.f;
float total_text_max = 0.f;
for (const auto &t : std::array<std::string, 5>{"enforce", "block", "remove", "cursor_size", "clipping_of_view"}) {
@ -272,8 +265,6 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
const float sliders_width = m_imgui->scaled(7.0f);
const float drag_left_width = ImGui::GetStyle().WindowPadding.x + sliders_left_width + sliders_width - space_size;
float drag_pos_times = 0.7;
ImGui::AlignTextToFramePadding();
m_imgui->text(m_desc.at("tool_type"));
std::array<wchar_t, 4> tool_ids = { ImGui::CircleButtonIcon, ImGui::SphereButtonIcon, ImGui::FillButtonIcon, ImGui::GapFillIcon };
@ -697,7 +688,6 @@ wxString GLGizmoFdmSupports::handle_snapshot_action_name(bool shift_down, GLGizm
void GLGizmoFdmSupports::init_print_instance()
{
const PrintObject* print_object = NULL;
PrintInstance print_instance = { 0 };
const Print *print = m_parent.fff_print();
if (!m_c->selection_info() || (m_print_instance.print_object))

View file

@ -138,8 +138,6 @@ void GLGizmoMeshBoolean::on_render()
BoundingBoxf3 src_bb;
BoundingBoxf3 tool_bb;
const ModelObject* mo = m_c->selection_info()->model_object();
const ModelInstance* mi = mo->instances[m_parent.get_selection().get_instance_idx()];
const Selection& selection = m_parent.get_selection();
const Selection::IndicesList& idxs = selection.get_volume_idxs();
for (unsigned int i : idxs) {
@ -163,16 +161,12 @@ void GLGizmoMeshBoolean::on_set_state()
if (m_state == EState::On) {
m_src.reset();
m_tool.reset();
bool m_diff_delete_input = false;
bool m_inter_delete_input = false;
m_operation_mode = MeshBooleanOperation::Union;
m_selecting_state = MeshBooleanSelectingState::SelectSource;
}
else if (m_state == EState::Off) {
m_src.reset();
m_tool.reset();
bool m_diff_delete_input = false;
bool m_inter_delete_input = false;
m_operation_mode = MeshBooleanOperation::Undef;
m_selecting_state = MeshBooleanSelectingState::Undef;
wxGetApp().notification_manager()->close_plater_warning_notification(warning_text);

View file

@ -403,7 +403,6 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
const float filter_btn_width = m_imgui->calc_text_size(m_desc.at("perform")).x + m_imgui->scaled(1.f);
const float buttons_width = remove_btn_width + filter_btn_width + m_imgui->scaled(1.f);
const float minimal_slider_width = m_imgui->scaled(4.f);
const float color_button_width = m_imgui->calc_text_size(std::string_view{""}).x + m_imgui->scaled(1.75f);
float caption_max = 0.f;
float total_text_max = 0.f;
@ -444,7 +443,6 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
float start_pos_x = ImGui::GetCursorPos().x;
const ImVec2 max_label_size = ImGui::CalcTextSize("99", NULL, true);
const float item_spacing = m_imgui->scaled(0.8f);
size_t n_extruder_colors = std::min((size_t)EnforcerBlockerType::ExtruderMax, m_extruders_colors.size());
for (int extruder_idx = 0; extruder_idx < n_extruder_colors; extruder_idx++) {
const ColorRGBA &extruder_color = m_extruders_colors[extruder_idx];

View file

@ -527,21 +527,10 @@ std::vector<GLGizmoPainterBase::ProjectedHeightRange> GLGizmoPainterBase::get_pr
if (m_rr.mesh_id == -1)
return hit_triangles_by_mesh;
ProjectedMousePosition mesh_hit_point = { m_rr.hit, m_rr.mesh_id, m_rr.facet };
float z_bot_world= (trafo_matrices[m_rr.mesh_id] * Vec3d(m_rr.hit(0), m_rr.hit(1), m_rr.hit(2))).z();
float z_top_world = z_bot_world+ m_cursor_height;
hit_triangles_by_mesh.push_back({ z_bot_world, m_rr.mesh_id, size_t(m_rr.facet) });
const Selection& selection = m_parent.get_selection();
const ModelObject* mo = m_c->selection_info()->model_object();
const ModelInstance* mi = mo->instances[selection.get_instance_idx()];
const Transform3d instance_trafo = m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView ?
mi->get_assemble_transformation().get_matrix() :
mi->get_transformation().get_matrix();
const Transform3d instance_trafo_not_translate = m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView ?
mi->get_assemble_transformation().get_matrix_no_offset() :
mi->get_transformation().get_matrix_no_offset();
for (int mesh_idx = 0; mesh_idx < part_volumes.size(); mesh_idx++) {
if (mesh_idx == m_rr.mesh_id)
continue;
@ -712,7 +701,6 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
// The mouse button click detection is enabled when there is a valid hit.
// Missing the object entirely
// shall not capture the mouse.
const bool dragging_while_painting = (action == SLAGizmoEventType::Dragging && m_button_down != Button::None);
if (mesh_idx != -1 && m_button_down == Button::None)
m_button_down = ((action == SLAGizmoEventType::LeftDown) ? Button::Left : Button::Right);
@ -1063,7 +1051,7 @@ void GLGizmoPainterBase::on_set_state()
if (m_state == On && m_old_state != On) { // the gizmo was just turned on
on_opening();
const Selection& selection = m_parent.get_selection();
// const Selection& selection = m_parent.get_selection();
//Camera& camera = wxGetApp().plater()->get_camera();
//Vec3d rotate_target = selection.get_bounding_box().center();
//rotate_target(2) = 0.f;

View file

@ -186,7 +186,7 @@ bool GLGizmosManager::init()
// Order of gizmos in the vector must match order in EType!
//BBS: GUI refactor: add obj manipulation
m_gizmos.clear();
unsigned int sprite_id = 0;
// unsigned int sprite_id = 0;
m_gizmos.emplace_back(new GLGizmoMove3D(m_parent, m_is_dark ? "toolbar_move_dark.svg" : "toolbar_move.svg", EType::Move, &m_object_manipulation));
m_gizmos.emplace_back(new GLGizmoRotate3D(m_parent, m_is_dark ? "toolbar_rotate_dark.svg" : "toolbar_rotate.svg", EType::Rotate, &m_object_manipulation));
m_gizmos.emplace_back(new GLGizmoScale3D(m_parent, m_is_dark ? "toolbar_scale_dark.svg" : "toolbar_scale.svg", EType::Scale, &m_object_manipulation));
@ -1042,11 +1042,7 @@ void GLGizmosManager::render_arrow(const GLCanvas3D& parent, EType highlighted_t
for (size_t idx : selectable_idxs)
{
if (idx == highlighted_type) {
int tex_width = m_icons_texture.get_width();
int tex_height = m_icons_texture.get_height();
unsigned int tex_id = m_arrow_texture.get_id();
float inv_tex_width = (tex_width != 0.0f) ? 1.0f / tex_width : 0.0f;
float inv_tex_height = (tex_height != 0.0f) ? 1.0f / tex_height : 0.0f;
const float left_uv = 0.0f;
const float right_uv = 1.0f;

View file

@ -591,7 +591,6 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
float World_size = imgui_wrapper->calc_text_size(position_title).x + space_size;
float caption_max = std::max(position_size, World_size) + 2 * space_size;
float end_text_size = imgui_wrapper->calc_text_size(this->m_new_unit_string).x;
// position
Vec3d original_position;
@ -601,8 +600,6 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper,
original_position = this->m_new_position;
Vec3d display_position = m_buffered_position;
// Rotation
Vec3d rotation = this->m_buffered_rotation;
float unit_size = imgui_wrapper->calc_text_size(MAX_SIZE).x + space_size;
int index = 1;
int index_unit = 1;
@ -708,13 +705,6 @@ void GizmoObjectManipulation::do_render_rotate_window(ImGuiWrapper *imgui_wrappe
float caption_max = std::max(position_size, World_size) + 2 * space_size;
float end_text_size = imgui_wrapper->calc_text_size(this->m_new_unit_string).x;
// position
Vec3d original_position;
if (this->m_imperial_units)
original_position = this->m_new_position * this->mm_to_in;
else
original_position = this->m_new_position;
Vec3d display_position = m_buffered_position;
// Rotation
Vec3d rotation = this->m_buffered_rotation;
@ -835,10 +825,7 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
Vec3d scale = m_buffered_scale;
Vec3d display_size = m_buffered_size;
Vec3d display_position = m_buffered_position;
float unit_size = imgui_wrapper->calc_text_size(MAX_SIZE).x + space_size;
bool imperial_units = this->m_imperial_units;
int index = 2;
int index_unit = 1;

View file

@ -499,8 +499,7 @@ HintData* HintDatabase::get_hint(HintDataNavigation nav)
m_hint_id = get_next_hint_id();
if(nav == HintDataNavigation::Prev)
m_hint_id = get_prev_hint_id();
if (nav == HintDataNavigation::Curr)
;
// if (nav == HintDataNavigation::Curr)
if (nav == HintDataNavigation::Random)
init_random_hint_id();
}

View file

@ -231,7 +231,7 @@ void IMSlider::SetTicksValues(const Info &custom_gcode_per_print_z)
static bool last_spiral_vase_status = false;
const bool was_empty = m_ticks.empty();
// const bool was_empty = m_ticks.empty();
m_ticks.ticks.clear();
const std::vector<CustomGCode::Item> &heights = custom_gcode_per_print_z.gcodes;
@ -240,9 +240,9 @@ void IMSlider::SetTicksValues(const Info &custom_gcode_per_print_z)
if (tick >= 0) m_ticks.ticks.emplace(TickCode{tick, h.type, h.extruder, h.color, h.extra});
}
if (!was_empty && m_ticks.empty())
// if (!was_empty && m_ticks.empty())
// Switch to the "Feature type"/"Tool" from the very beginning of a new object slicing after deleting of the old one
;// post_ticks_changed_event();
// post_ticks_changed_event();
if (m_ticks.has_tick_with_code(ToolChange) && !m_can_change_color) {
if (!wxGetApp().plater()->only_gcode_mode() && !wxGetApp().plater()->using_exported_file())
@ -1034,8 +1034,6 @@ bool IMSlider::vertical_slider(const char* str_id, int* higher_value, int* lower
context.IO.MouseClicked[0])
m_show_menu = false;
ImVec2 bar_center = higher_handle.GetCenter();
// draw ticks
draw_ticks(one_slideable_region);
// draw colored band

View file

@ -182,8 +182,6 @@ int ImGuiWrapper::TOOLBAR_WINDOW_FLAGS = ImGuiWindowFlags_AlwaysAutoResize
bool get_data_from_svg(const std::string &filename, unsigned int max_size_px, ThumbnailData &thumbnail_data)
{
bool compression_enabled = false;
NSVGimage *image = nsvgParseFromFile(filename.c_str(), "px", 96.0f);
if (image == nullptr) { return false; }
@ -236,7 +234,6 @@ bool get_data_from_svg(const std::string &filename, unsigned int max_size_px, Th
bool slider_behavior(ImGuiID id, const ImRect& region, const ImS32 v_min, const ImS32 v_max, ImS32* out_value, ImRect* out_handle, ImGuiSliderFlags flags/* = 0*/, const int fixed_value/* = -1*/, const ImVec4& fixed_rect/* = ImRect()*/)
{
ImGuiContext& context = *GImGui;
ImGuiIO& io = ImGui::GetIO();
const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X;
@ -1793,7 +1790,7 @@ void ImGuiWrapper::search_list(const ImVec2& size_, bool (*items_getter)(int, co
ImGui::ListBoxFooter();
auto check_box = [&edited, this](const wxString& label, bool& check) {
/*auto check_box = [&edited, this](const wxString& label, bool& check) {
ImGui::SameLine();
bool ch = check;
checkbox(label, ch);
@ -1801,7 +1798,7 @@ void ImGuiWrapper::search_list(const ImVec2& size_, bool (*items_getter)(int, co
check = !check;
edited = true;
}
};
};*/
ImGui::AlignTextToFramePadding();
@ -3149,7 +3146,6 @@ bool IMTexture::load_from_svg_file(const std::string& filename, unsigned width,
std::vector<unsigned char> data(n_pixels * 4, 0);
nsvgRasterize(rast, image, 0, 0, scale, data.data(), width, height, width * 4);
bool compress = false;
GLint last_texture;
unsigned m_image_texture{ 0 };
unsigned char* pixels = (unsigned char*)(&data[0]);

View file

@ -136,7 +136,6 @@ void ArrangeJob::prepare_selected() {
inst_sel[size_t(inst_id)] = true;
for (size_t i = 0; i < inst_sel.size(); ++i) {
ModelInstance* mi = mo->instances[i];
ArrangePolygon&& ap = prepare_arrange_polygon(mo->instances[i]);
//BBS: partplate_list preprocess
//remove the locked plate's instances, neither in selected, nor in un-selected
@ -208,7 +207,6 @@ void ArrangeJob::prepare_all() {
ModelObject *mo = model.objects[oidx];
for (size_t i = 0; i < mo->instances.size(); ++i) {
ModelInstance * mi = mo->instances[i];
ArrangePolygon&& ap = prepare_arrange_polygon(mo->instances[i]);
//BBS: partplate_list preprocess
//remove the locked plate's instances, neither in selected, nor in un-selected
@ -324,7 +322,6 @@ void ArrangeJob::prepare_wipe_tower()
wipe_tower_ap.name = "WipeTower";
wipe_tower_ap.is_virt_object = true;
wipe_tower_ap.is_wipe_tower = true;
const GLCanvas3D* canvas3D = static_cast<const GLCanvas3D*>(m_plater->canvas3D());
std::set<int> extruder_ids;
PartPlateList& ppl = wxGetApp().plater()->get_partplate_list();
@ -530,7 +527,6 @@ void ArrangeJob::process(Ctl &ctl)
auto & partplate_list = m_plater->get_partplate_list();
const Slic3r::DynamicPrintConfig& global_config = wxGetApp().preset_bundle->full_config();
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
const bool is_bbl = wxGetApp().preset_bundle->is_bbl_vendor();
if (is_bbl && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES);

View file

@ -127,8 +127,8 @@ void FillBedJob::prepare()
m_bedpts = get_bed_shape(*m_plater->config());
auto &objects = m_plater->model().objects;
/*BoundingBox bedbb = get_extents(m_bedpts);
/*auto &objects = m_plater->model().objects;
BoundingBox bedbb = get_extents(m_bedpts);
for (size_t idx = 0; idx < objects.size(); ++idx)
if (int(idx) != m_object_idx)
@ -209,9 +209,7 @@ void FillBedJob::process(Ctl &ctl)
m_bedpts = get_shrink_bedpts(m_plater->config(), params);
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();
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
const bool is_bbl = wxGetApp().preset_bundle->is_bbl_vendor();
if (is_bbl && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES);
@ -275,8 +273,6 @@ void FillBedJob::finalize(bool canceled, std::exception_ptr &eptr)
int plate_cols = plate_list.get_plate_cols();
int cur_plate = plate_list.get_curr_plate_index();
size_t inst_cnt = model_object->instances.size();
int added_cnt = std::accumulate(m_selected.begin(), m_selected.end(), 0, [](int s, auto &ap) {
return s + int(ap.priority == 0 && ap.bed_idx == 0);
});

View file

@ -46,7 +46,6 @@ void OrientJob::prepare_selection(std::vector<bool> obj_sel, bool only_one_plate
ModelInstance* mi = mo->instances[inst_idx];
OrientMesh&& om = get_orient_mesh(mi);
bool locked = false;
if (!only_one_plate) {
int plate_index = plate_list.find_instance(oidx, inst_idx);
if ((plate_index >= 0)&&(plate_index < plate_list.get_plate_count())) {

View file

@ -103,9 +103,6 @@ wxString PrintJob::get_http_error_msg(unsigned int status, std::string body)
if (!j["message"].is_null())
message = j["message"].get<std::string>();
}
switch (status) {
;
}
}
catch (...) {
;
@ -137,7 +134,6 @@ void PrintJob::process(Ctl &ctl)
wxString error_str;
int curr_percent = 10;
NetworkAgent* m_agent = wxGetApp().getAgent();
AppConfig* config = wxGetApp().app_config;
if (this->connection_type == "lan") {
msg = _u8L("Sending print job over LAN");
@ -150,12 +146,9 @@ void PrintJob::process(Ctl &ctl)
ctl.call_on_main_thread([this] { prepare(); }).wait();
int result = -1;
unsigned int http_code;
std::string http_body;
int total_plate_num = plate_data.plate_count;
if (!plate_data.is_valid) {
total_plate_num = m_plater->get_partplate_list().get_plate_count();
PartPlate *plate = m_plater->get_partplate_list().get_plate(job_data.plate_idx);
if (plate == nullptr) {
plate = m_plater->get_partplate_list().get_curr_plate();
@ -312,7 +305,7 @@ void PrintJob::process(Ctl &ctl)
try {
stl_design_id = std::stoi(wxGetApp().model().stl_design_id);
}
catch (const std::exception& e) {
catch (std::exception&) {
stl_design_id = 0;
}
params.stl_design_id = stl_design_id;
@ -447,7 +440,7 @@ void PrintJob::process(Ctl &ctl)
std::string curr_job_id;
json job_info_j;
try {
job_info_j.parse(job_info);
job_info_j = json::parse(job_info);
if (job_info_j.contains("job_id")) {
curr_job_id = job_info_j["job_id"].get<std::string>();
}

View file

@ -57,8 +57,7 @@ void RotoptimizeJob::process(Ctl &ctl)
.print_config(&m_default_print_cfg)
.statucb([this, &prev_status, &ctl/*, &statustxt*/](int s)
{
if (s > 0 && s < 100)
;
// if (s > 0 && s < 100)
// ctl.update_status(prev_status + s / m_selected_object_ids.size(),
// statustxt);

View file

@ -67,9 +67,6 @@ wxString SendJob::get_http_error_msg(unsigned int status, std::string body)
if (!j["message"].is_null())
message = j["message"].get<std::string>();
}
switch (status) {
;
}
}
catch (...) {
;
@ -109,9 +106,7 @@ void SendJob::process(Ctl &ctl)
std::string msg;
int curr_percent = 10;
NetworkAgent* m_agent = wxGetApp().getAgent();
AppConfig* config = wxGetApp().app_config;
int result = -1;
unsigned int http_code;
std::string http_body;
if (this->connection_type == "lan") {

View file

@ -183,11 +183,7 @@ void KBShortcutsDialog::fill_shortcuts()
// Slice plate
{ ctrl + "R", L("Slice plate")},
// Send to Print
#ifdef __APPLE__
{ L("⌘+Shift+G"), L("Print plate")},
#else
{ L("Ctrl+Shift+G"), L("Print plate")},
#endif // __APPLE
{ ctrl + L("Shift+G"), L("Print plate")},
// Edit
{ ctrl + "X", L("Cut") },
@ -226,16 +222,9 @@ void KBShortcutsDialog::fill_shortcuts()
{L("Shift+R"), L("Auto orientates selected objects or all objects.If there are selected objects, it just orientates the selected ones.Otherwise, it will orientates all objects in the current disk.")},
{L("Shift+Tab"), L("Collapse/Expand the sidebar")},
#ifdef __APPLE__
{L("⌘+Any arrow"), L("Movement in camera space")},
{L("⌥+Left mouse button"), L("Select a part")},
{L("⌘+Left mouse button"), L("Select multiple objects")},
#else
{L("Ctrl+Any arrow"), L("Movement in camera space")},
{L("Alt+Left mouse button"), L("Select a part")},
{L("Ctrl+Left mouse button"), L("Select multiple objects")},
#endif
{ ctrl + L("Any arrow"), L("Movement in camera space")},
{ alt + L("Left mouse button"), L("Select a part")},
{ ctrl + L("Left mouse button"), L("Select multiple objects")},
{L("Shift+Left mouse button"), L("Select objects by rectangle")},
{L("Arrow Up"), L("Move selection 10 mm in positive Y direction")},
{L("Arrow Down"), L("Move selection 10 mm in negative Y direction")},
@ -274,13 +263,8 @@ void KBShortcutsDialog::fill_shortcuts()
Shortcuts gizmos_shortcuts = {
{L("Esc"), L("Deselect all")},
{L("Shift+"), L("Move: press to snap by 1mm")},
#ifdef __APPLE__
{L("⌘+Mouse wheel"), L("Support/Color Painting: adjust pen radius")},
{L("⌥+Mouse wheel"), L("Support/Color Painting: adjust section position")},
#else
{L("Ctrl+Mouse wheel"), L("Support/Color Painting: adjust pen radius")},
{L("Alt+Mouse wheel"), L("Support/Color Painting: adjust section position")},
#endif
{ ctrl + L("Mouse wheel"), L("Support/Color Painting: adjust pen radius")},
{ alt + L("Mouse wheel"), L("Support/Color Painting: adjust section position")},
};
m_full_shortcuts.push_back({{_L("Gizmo"), ""}, gizmos_shortcuts});
@ -311,13 +295,8 @@ void KBShortcutsDialog::fill_shortcuts()
{ "Tab", L("Switch between Prepare/Preview") },
{L("Shift+Any arrow"), L("Move slider 5x faster")},
{L("Shift+Mouse wheel"), L("Move slider 5x faster")},
#ifdef __APPLE__
{L("⌘+Any arrow"), L("Move slider 5x faster")},
{L("⌘+Mouse wheel"), L("Move slider 5x faster")},
#else
{L("Ctrl+Any arrow"), L("Move slider 5x faster")},
{L("Ctrl+Mouse wheel"), L("Move slider 5x faster")},
#endif
{ ctrl + L("Any arrow"), L("Move slider 5x faster")},
{ ctrl + L("Mouse wheel"), L("Move slider 5x faster")},
{ L("Home"), L("Horizontal slider - Move to start position")},
{ L("End"), L("Horizontal slider - Move to last position")},
};

View file

@ -743,7 +743,6 @@ void MainFrame::update_layout()
if (m_layout != ESettingsLayout::Unknown)
restore_to_creation();
ESettingsLayout old_layout = m_layout;
m_layout = layout;
// From the very beginning the Print settings should be selected
@ -1488,7 +1487,6 @@ bool MainFrame::can_reslice() const
wxBoxSizer* MainFrame::create_side_tools()
{
enable_multi_machine = wxGetApp().is_enable_multi_machine();
int em = em_unit();
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
m_slice_select = eSlicePlate;
@ -1779,7 +1777,7 @@ wxBoxSizer* MainFrame::create_side_tools()
aux_btn->Bind(wxEVT_BUTTON, [](auto e) {
wxGetApp().sidebar().show_auxiliary_dialog();
});
sizer->Add(aux_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 1 * em / 10);
sizer->Add(aux_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 1 * em_unit() / 10);
*/
sizer->Add(FromDIP(19), 0, 0, 0, 0);
@ -1924,9 +1922,6 @@ bool MainFrame::get_enable_print_status()
void MainFrame::update_side_button_style()
{
// BBS
int em = em_unit();
/*m_slice_btn->SetLayoutStyle(1);
m_slice_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Center, FromDIP(15));
m_slice_btn->SetMinSize(wxSize(-1, FromDIP(24)));
@ -2188,9 +2183,6 @@ static void add_common_publish_menu_items(wxMenu* publish_menu, MainFrame* mainF
return;
}
json j;
NetworkAgent* agent = GUI::wxGetApp().getAgent();
//if (GUI::wxGetApp().plater()->model().objects.empty()) return;
wxGetApp().open_publish_page_dialog();
});
@ -2588,13 +2580,13 @@ void MainFrame::init_menubar_as_editor()
//BBS perspective view
wxWindowID camera_id_base = wxWindow::NewControlId(int(wxID_CAMERA_COUNT));
auto perspective_item = append_menu_radio_item(viewMenu, wxID_CAMERA_PERSPECTIVE + camera_id_base, _L("Use Perspective View"), _L("Use Perspective View"),
append_menu_radio_item(viewMenu, wxID_CAMERA_PERSPECTIVE + camera_id_base, _L("Use Perspective View"), _L("Use Perspective View"),
[this](wxCommandEvent&) {
wxGetApp().app_config->set_bool("use_perspective_camera", true);
wxGetApp().update_ui_from_settings();
}, nullptr);
//BBS orthogonal view
auto orthogonal_item = append_menu_radio_item(viewMenu, wxID_CAMERA_ORTHOGONAL + camera_id_base, _L("Use Orthogonal View"), _L("Use Orthogonal View"),
append_menu_radio_item(viewMenu, wxID_CAMERA_ORTHOGONAL + camera_id_base, _L("Use Orthogonal View"), _L("Use Orthogonal View"),
[this](wxCommandEvent&) {
wxGetApp().app_config->set_bool("use_perspective_camera", false);
wxGetApp().update_ui_from_settings();
@ -2669,7 +2661,8 @@ void MainFrame::init_menubar_as_editor()
//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", "");
// auto preference_item =
new wxMenuItem(parent_menu, ConfigMenuPreferences + config_id_base, _L("Preferences") + "\t" + ctrl + "P", "");
#endif
//auto printer_item = new wxMenuItem(parent_menu, ConfigMenuPrinter + config_id_base, _L("Printer"), "");
@ -3100,10 +3093,6 @@ void MainFrame::init_menubar_as_gcodeviewer()
void MainFrame::update_menubar()
{
if (wxGetApp().is_gcode_viewer())
return;
const bool is_fff = plater()->printer_technology() == ptFFF;
}
void MainFrame::reslice_now()
@ -3179,7 +3168,6 @@ void MainFrame::load_config_file()
cfiles.push_back(into_u8(file));
m_last_config = file;
}
bool update = false;
wxGetApp().preset_bundle->import_presets(cfiles, [this](std::string const & name) {
ConfigsOverwriteConfirmDialog dlg(this, from_u8(name), false);
int res = dlg.ShowModal();
@ -3749,7 +3737,6 @@ void MainFrame::on_select_default_preset(SimpleEvent& evt)
wxICON_INFORMATION);
/* get setting list */
NetworkAgent* agent = wxGetApp().getAgent();
switch ( dialog.ShowModal() )
{
case wxID_YES: {

View file

@ -328,7 +328,6 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj)
MessageDialog(this, m, _L("Download failed"), wxOK | wxICON_ERROR).ShowModal();
});
NetworkAgent* agent = wxGetApp().getAgent();
if (result > 1 || result == 0) {
json j;
j["code"] = result;
@ -576,7 +575,7 @@ void MediaFilePanel::doAction(size_t index, int action)
}
else {
MessageDialog dlg(this, _L("The .gcode.3mf file contains no G-code data.Please slice it with Orca Slicer and export a new .gcode.3mf file."), wxEmptyString, wxICON_WARNING | wxOK);
auto res = dlg.ShowModal();
dlg.ShowModal();
}
});

View file

@ -67,7 +67,7 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const w
auto ip = str.find(' ', ik);
if (ip == wxString::npos) ip = str.Length();
auto v = str.Mid(ik, ip - ik);
if (k == "T:" && v.Length() == 8) {
if (strcmp(k, "T:") == 0 && v.Length() == 8) {
long h = 0,m = 0,s = 0;
v.Left(2).ToLong(&h);
v.Mid(3, 2).ToLong(&m);
@ -389,7 +389,7 @@ void MediaPlayCtrl::Stop(wxString const &msg)
}
auto tunnel = m_url.empty() ? "" : into_u8(wxURI(m_url).GetPath()).substr(1);
if (auto n = tunnel.find_first_of('/_'); n != std::string::npos)
if (auto n = tunnel.find_first_of("/_"); n != std::string::npos)
tunnel = tunnel.substr(0, n);
if (last_state != wxMEDIASTATE_PLAYING && m_failed_code != 0
&& m_last_failed_codes.find(m_failed_code) == m_last_failed_codes.end()
@ -734,7 +734,7 @@ bool MediaPlayCtrl::start_stream_service(bool *need_install)
auto file_dll = tools_dir + dll;
auto file_dll2 = plugins_dir + dll;
if (!boost::filesystem::exists(file_dll) || boost::filesystem::last_write_time(file_dll) != boost::filesystem::last_write_time(file_dll2))
boost::filesystem::copy_file(file_dll2, file_dll, boost::filesystem::copy_option::overwrite_if_exists);
boost::filesystem::copy_file(file_dll2, file_dll, boost::filesystem::copy_options::overwrite_existing);
}
boost::process::child process_source(file_source, file_url2.ToStdWstring(), boost::process::start_dir(tools_dir),
boost::process::windows::create_no_window,

View file

@ -133,7 +133,7 @@ namespace GUI {
}
}
catch (std::exception& e) {
catch (std::exception&) {
// wxMessageBox(e.what(), "json Exception", MB_OK);
}
}

View file

@ -114,7 +114,7 @@ AddMachinePanel::~AddMachinePanel() {
m_side_tools->get_panel()->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MonitorPanel::on_printer_clicked), NULL, this);
Bind(wxEVT_TIMER, &MonitorPanel::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
Bind(wxEVT_SIZE, &MonitorPanel::on_size, this);
Bind(wxEVT_COMMAND_CHOICE_SELECTED, &MonitorPanel::on_select_printer, this);
@ -160,7 +160,7 @@ MonitorPanel::~MonitorPanel()
m_refresh_timer = new wxTimer();
m_refresh_timer->SetOwner(this);
m_refresh_timer->Start(REFRESH_INTERVAL);
wxPostEvent(this, wxTimerEvent());
on_timer();
Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev) return;
@ -272,7 +272,7 @@ void MonitorPanel::on_update_all(wxMouseEvent &event)
}
}
void MonitorPanel::on_timer(wxTimerEvent& event)
void MonitorPanel::on_timer()
{
if (update_flag) {
update_all();
@ -306,9 +306,6 @@ void MonitorPanel::on_update_all(wxMouseEvent &event)
void MonitorPanel::on_printer_clicked(wxMouseEvent &event)
{
auto mouse_pos = ClientToScreen(event.GetPosition());
wxPoint rect = m_side_tools->ClientToScreen(wxPoint(0, 0));
if (!m_side_tools->is_in_interval()) {
wxPoint pos = m_side_tools->ClientToScreen(wxPoint(0, 0));
pos.y += m_side_tools->GetRect().height;
@ -434,7 +431,6 @@ bool MonitorPanel::Show(bool show)
wxGetApp().mainframe->SetMinSize(wxGetApp().plater()->GetMinSize());
#endif
NetworkAgent* m_agent = wxGetApp().getAgent();
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (show) {
start_update();
@ -442,7 +438,7 @@ bool MonitorPanel::Show(bool show)
m_refresh_timer->Stop();
m_refresh_timer->SetOwner(this);
m_refresh_timer->Start(REFRESH_INTERVAL);
wxPostEvent(this, wxTimerEvent());
on_timer();
if (dev) {
//set a default machine when obj is null
@ -485,7 +481,6 @@ void MonitorPanel::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) {

View file

@ -133,7 +133,7 @@ public:
StatusPanel* get_status_panel() {return m_status_info_panel;};
void select_machine(std::string machine_sn);
void on_update_all(wxMouseEvent &event);
void on_timer(wxTimerEvent& event);
void on_timer();
void on_select_printer(wxCommandEvent& event);
void on_printer_clicked(wxMouseEvent &event);
void on_size(wxSizeEvent &event);

View file

@ -6,7 +6,6 @@
///////////////////////////////////////////////////////////////////////////
#include "MonitorBasePanel.h"
#include "Printer/PrinterFileSystem.h"
#include "Widgets/Label.hpp"
///////////////////////////////////////////////////////////////////////////
@ -21,7 +20,7 @@ MonitorBasePanel::MonitorBasePanel(wxWindow* parent, wxWindowID id, const wxPoin
m_splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D | wxSP_BORDER);
m_splitter->SetSashGravity(0);
m_splitter->SetSashSize(0);
m_splitter->SetSashInvisible();
m_splitter->Connect(wxEVT_IDLE, wxIdleEventHandler(MonitorBasePanel::m_splitterOnIdle), NULL, this);
m_splitter->SetMinimumPaneSize(182);
@ -281,7 +280,7 @@ VideoMonitoringBasePanel::~VideoMonitoringBasePanel()
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "MonitorBasePanel.h"
//#include "MonitorBasePanel.h"
///////////////////////////////////////////////////////////////////////////
using namespace Slic3r::GUI;

View file

@ -9,16 +9,16 @@ namespace Slic3r {
namespace GUI {
#define DEVICE_ITEM_MAX_WIDTH 900
#define SEND_ITEM_MAX_HEIGHT 30
#define DEVICE_ITEM_MAX_HEIGHT 50
#define DEVICE_ITEM_MAX_WIDTH 900
#define SEND_ITEM_MAX_HEIGHT 30
#define DEVICE_ITEM_MAX_HEIGHT 50
#define TABLE_HEAR_NORMAL_COLOUR wxColour(238, 238, 238)
#define TABLE_HEAD_PRESSED_COLOUR wxColour(150, 150, 150)
#define CTRL_BUTTON_NORMAL_COLOUR wxColour(255, 255, 255)
#define CTRL_BUTTON_PRESSEN_COLOUR wxColour(150, 150, 150)
#define TABLE_HEAD_FONT Label::Body_13
#define ICON_SIZE FromDIP(16)
#define MM_ICON_SIZE FromDIP(16)
class DeviceItem : public wxWindow
{

View file

@ -320,7 +320,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
m_table_head_panel->SetBackgroundColour(TABLE_HEAR_NORMAL_COLOUR);
m_table_head_sizer = new wxBoxSizer(wxHORIZONTAL);
m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE);
m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE);
m_printer_name->SetBackgroundColor(head_bg);
m_printer_name->SetFont(TABLE_HEAD_FONT);
m_printer_name->SetCornerRadius(0);
@ -343,7 +343,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
});
m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, ICON_SIZE);
m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, MM_ICON_SIZE);
m_task_name->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR);
m_task_name->SetFont(TABLE_HEAD_FONT);
m_task_name->SetCornerRadius(0);
@ -353,7 +353,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
m_status = new Button(m_table_head_panel, _L("Device Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE);
m_status = new Button(m_table_head_panel, _L("Device Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE);
m_status->SetBackgroundColor(head_bg);
m_status->SetFont(TABLE_HEAD_FONT);
m_status->SetCornerRadius(0);
@ -376,7 +376,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
});
m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, ICON_SIZE, false);
m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, MM_ICON_SIZE, false);
m_action->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR);
m_action->SetFont(TABLE_HEAD_FONT);
m_action->SetCornerRadius(0);
@ -523,7 +523,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent)
Layout();
Fit();
Bind(wxEVT_TIMER, &MultiMachineManagerPage::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
}
void MultiMachineManagerPage::update_page()
@ -676,7 +676,7 @@ void MultiMachineManagerPage::start_timer()
m_flipping_timer->SetOwner(this);
m_flipping_timer->Start(1000);
wxPostEvent(this, wxTimerEvent());
on_timer();
}
void MultiMachineManagerPage::update_page_number()
@ -688,7 +688,7 @@ void MultiMachineManagerPage::update_page_number()
st_page_number->SetLabel(number);
}
void MultiMachineManagerPage::on_timer(wxTimerEvent& event)
void MultiMachineManagerPage::on_timer()
{
m_flipping_timer->Stop();
if (btn_last_page)

View file

@ -55,7 +55,7 @@ public:
void start_timer();
void update_page_number();
void on_timer(wxTimerEvent& event);
void on_timer();
void clear_page();
void page_num_enter_evt();

View file

@ -19,7 +19,7 @@ MultiMachinePage::MultiMachinePage(wxWindow* parent, wxWindowID id, const wxPoin
wxGetApp().UpdateDarkUIWin(this);
init_timer();
Bind(wxEVT_TIMER, &MultiMachinePage::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
}
MultiMachinePage::~MultiMachinePage()
@ -59,7 +59,7 @@ bool MultiMachinePage::Show(bool show)
m_refresh_timer->Stop();
m_refresh_timer->SetOwner(this);
m_refresh_timer->Start(2000);
wxPostEvent(this, wxTimerEvent());
on_timer();
}
else {
m_refresh_timer->Stop();
@ -97,7 +97,7 @@ void MultiMachinePage::init_timer()
//wxPostEvent(this, wxTimerEvent());
}
void MultiMachinePage::on_timer(wxTimerEvent& event)
void MultiMachinePage::on_timer()
{
m_local_task_manager->update_page();
m_cloud_task_manager->update_page();

View file

@ -41,7 +41,7 @@ public:
void init_tabpanel();
void init_timer();
void on_timer(wxTimerEvent& event);
void on_timer();
void clear_page();
};

View file

@ -4,7 +4,6 @@
#include "GUI_App.hpp"
#include "MainFrame.hpp"
#include "Widgets/RadioBox.hpp"
#include <wx/listimpl.cpp>
#include <boost/date_time/posix_time/posix_time.hpp>
namespace Slic3r {
@ -574,7 +573,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent)
});
m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, ICON_SIZE);
m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, MM_ICON_SIZE);
m_task_name->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR);
m_task_name->SetFont(TABLE_HEAD_FONT);
m_task_name->SetCornerRadius(0);
@ -583,7 +582,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent)
m_task_name->SetCenter(false);
m_table_head_sizer->Add(m_task_name, 0, wxALIGN_CENTER_VERTICAL, 0);
m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE);
m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE);
m_printer_name->SetBackgroundColor(head_bg);
m_printer_name->SetFont(TABLE_HEAD_FONT);
m_printer_name->SetCornerRadius(0);
@ -603,7 +602,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent)
});
m_table_head_sizer->Add(m_printer_name, 0, wxALIGN_CENTER_VERTICAL, 0);
m_status = new Button(m_table_head_panel, _L("Task Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE);
m_status = new Button(m_table_head_panel, _L("Task Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE);
m_status->SetBackgroundColor(head_bg);
m_status->SetFont(TABLE_HEAD_FONT);
m_status->SetCornerRadius(0);
@ -623,7 +622,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent)
});
m_table_head_sizer->Add(m_status, 0, wxALIGN_CENTER_VERTICAL, 0);
m_info = new Button(m_table_head_panel, _L("Info"), "", wxNO_BORDER, ICON_SIZE);
m_info = new Button(m_table_head_panel, _L("Info"), "", wxNO_BORDER, MM_ICON_SIZE);
m_info->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR);
m_info->SetFont(TABLE_HEAD_FONT);
m_info->SetCornerRadius(0);
@ -632,7 +631,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent)
m_info->SetCenter(false);
m_table_head_sizer->Add(m_info, 0, wxALIGN_CENTER_VERTICAL, 0);
m_send_time = new Button(m_table_head_panel, _L("Sent Time"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE, false);
m_send_time = new Button(m_table_head_panel, _L("Sent Time"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE, false);
m_send_time->SetBackgroundColor(head_bg);
m_send_time->SetFont(TABLE_HEAD_FONT);
m_send_time->SetCornerRadius(0);
@ -652,7 +651,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent)
});
m_table_head_sizer->Add(m_send_time, 0, wxALIGN_CENTER_VERTICAL, 0);
m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, ICON_SIZE, false);
m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, MM_ICON_SIZE, false);
m_action->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR);
m_action->SetFont(TABLE_HEAD_FONT);
m_action->SetCornerRadius(0);
@ -946,7 +945,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent)
m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, ICON_SIZE);
m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, MM_ICON_SIZE);
m_task_name->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR);
m_task_name->SetFont(TABLE_HEAD_FONT);
m_task_name->SetCornerRadius(0);
@ -955,7 +954,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent)
m_task_name->SetCenter(false);
m_table_head_sizer->Add(m_task_name, 0, wxALIGN_CENTER_VERTICAL, 0);
m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE);
m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE);
m_printer_name->SetBackgroundColor(head_bg);
m_printer_name->SetFont(TABLE_HEAD_FONT);
m_printer_name->SetCornerRadius(0);
@ -975,7 +974,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent)
});
m_table_head_sizer->Add(m_printer_name, 0, wxALIGN_CENTER_VERTICAL, 0);
m_status = new Button(m_table_head_panel, _L("Task Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE);
m_status = new Button(m_table_head_panel, _L("Task Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE);
m_status->SetBackgroundColor(head_bg);
m_status->SetFont(TABLE_HEAD_FONT);
m_status->SetCornerRadius(0);
@ -995,7 +994,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent)
});
m_table_head_sizer->Add(m_status, 0, wxALIGN_CENTER_VERTICAL, 0);
m_info = new Button(m_table_head_panel, _L("Info"), "", wxNO_BORDER, ICON_SIZE);
m_info = new Button(m_table_head_panel, _L("Info"), "", wxNO_BORDER, MM_ICON_SIZE);
m_info->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR);
m_info->SetFont(TABLE_HEAD_FONT);
m_info->SetCornerRadius(0);
@ -1004,7 +1003,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent)
m_info->SetCenter(false);
m_table_head_sizer->Add(m_info, 0, wxALIGN_CENTER_VERTICAL, 0);
m_send_time = new Button(m_table_head_panel, _L("Sent Time"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE, false);
m_send_time = new Button(m_table_head_panel, _L("Sent Time"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE, false);
m_send_time->SetBackgroundColor(head_bg);
m_send_time->SetFont(TABLE_HEAD_FONT);
m_send_time->SetCornerRadius(0);
@ -1024,7 +1023,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent)
});
m_table_head_sizer->Add(m_send_time, 0, wxALIGN_CENTER_VERTICAL, 0);
m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, ICON_SIZE, false);
m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, MM_ICON_SIZE, false);
m_action->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR);
m_action->SetFont(TABLE_HEAD_FONT);
m_action->SetCornerRadius(0);
@ -1183,7 +1182,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent)
page_sizer = new wxBoxSizer(wxVERTICAL);
page_sizer->Add(m_main_panel, 1, wxALL | wxEXPAND, FromDIP(25));
Bind(wxEVT_TIMER, &CloudTaskManagerPage::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
wxGetApp().UpdateDarkUIWin(this);
@ -1400,10 +1399,10 @@ void CloudTaskManagerPage::start_timer()
m_flipping_timer->SetOwner(this);
m_flipping_timer->Start(1000);
wxPostEvent(this, wxTimerEvent());
on_timer();
}
void CloudTaskManagerPage::on_timer(wxTimerEvent& event)
void CloudTaskManagerPage::on_timer()
{
m_flipping_timer->Stop();
enable_buttons(true);

View file

@ -135,7 +135,7 @@ public:
bool Show(bool show);
void update_page_number();
void start_timer();
void on_timer(wxTimerEvent& event);
void on_timer();
void pause_all(wxCommandEvent& evt);
void resume_all(wxCommandEvent& evt);

View file

@ -194,8 +194,6 @@ public:
// check that only the selected page is visible and others are hidden:
for (size_t page = 0; page < m_pages.size(); page++) {
wxWindow* win_a = GetPage(page);
wxWindow* win_b = GetPage(n);
if (page != n && GetPage(page) != GetPage(n)) {
m_pages[page]->Hide();
}

View file

@ -857,7 +857,7 @@ void NotificationManager::PopNotification::bbl_render_block_notif_buttons(ImGuiW
void NotificationManager::PopNotification::bbl_render_block_notif_left_sign(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
{
auto window = ImGui::GetCurrentWindow();
// auto window = ImGui::GetCurrentWindow();
//window->DrawList->AddImage(user_texture_id, bb.Min + padding + margin, bb.Max - padding - margin, uv0, uv1, ImGui::GetColorU32(tint_col));
std::wstring text;

View file

@ -405,7 +405,6 @@ void OG_CustomCtrl::OnMotion(wxMouseEvent& event)
// Set tooltips with information for each icon
// BBS: markdown tip
if (!markdowntip.empty()) {
wxWindow* window = GetGrandParent();
assert(focusedLine);
wxPoint pos2 = { 250, focusedLine->rect_label.y };
pos2 = ClientToScreen(pos2);

View file

@ -1,9 +1,6 @@
#include <algorithm>
#include <sstream>
//#include "libslic3r/FlushVolCalc.hpp"
#include "ObjColorDialog.hpp"
#include "BitmapCache.hpp"
#include "GUI.hpp"
#include "I18N.hpp"
#include "GUI_App.hpp"
#include "MsgDialog.hpp"
@ -244,7 +241,6 @@ ObjColorPanel::ObjColorPanel(wxWindow * parent,
}
//end first cluster
//draw ui
auto sizer_width = FromDIP(300);
// Create two switched panels with their own sizers
m_sizer_simple = new wxBoxSizer(wxVERTICAL);
m_page_simple = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
@ -674,7 +670,6 @@ void ObjColorPanel::draw_table()
m_scrolledWindow->SetSizer(m_gridsizer);
int totalHeight = row_height *(row+1) * 2;
m_scrolledWindow->SetVirtualSize(MIN_OBJCOLOR_DIALOG_WIDTH, totalHeight);
auto look = FIX_SCROLL_HEIGTH;
if (totalHeight > FIX_SCROLL_HEIGTH) {
m_scrolledWindow->SetMinSize(wxSize(MIN_OBJCOLOR_DIALOG_WIDTH, FIX_SCROLL_HEIGTH));
m_scrolledWindow->SetMaxSize(wxSize(MIN_OBJCOLOR_DIALOG_WIDTH, FIX_SCROLL_HEIGTH));

View file

@ -9,12 +9,8 @@
#include "Widgets/StaticLine.hpp"
#include <utility>
#include <wx/bookctrl.h>
#include <wx/numformatter.h>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include "libslic3r/Exception.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/AppConfig.hpp"
#include "I18N.hpp"
#include <locale>

View file

@ -1536,9 +1536,6 @@ std::vector<int> PartPlate::get_extruders_without_support(bool conside_custom_gc
return plate_extruders;
}
// if 3mf file
const DynamicPrintConfig& glb_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
for (int obj_idx = 0; obj_idx < m_model->objects.size(); obj_idx++) {
if (!contain_instance_totally(obj_idx, 0))
continue;
@ -1597,14 +1594,14 @@ Vec3d PartPlate::estimate_wipe_tower_size(const DynamicPrintConfig & config, con
{
Vec3d wipe_tower_size;
double layer_height = 0.08f; // hard code layer height
// double layer_height = 0.08f; // hard code layer height
double max_height = 0.f;
wipe_tower_size.setZero();
wipe_tower_size(0) = w;
const ConfigOption* layer_height_opt = config.option("layer_height");
if (layer_height_opt)
layer_height = layer_height_opt->getFloat();
// const ConfigOption* layer_height_opt = config.option("layer_height");
// if (layer_height_opt)
// layer_height = layer_height_opt->getFloat();
// empty plate
if (plate_extruder_size == 0)
@ -1652,7 +1649,6 @@ Vec3d PartPlate::estimate_wipe_tower_size(const DynamicPrintConfig & config, con
// If wipe tower height is between the current and next member, set the min_depth as linear interpolation between them
auto next_height_to_depth = *iter;
if (next_height_to_depth.first > max_height) {
float height_base = curr_height_to_depth.first;
float height_diff = next_height_to_depth.first - curr_height_to_depth.first;
float min_depth_base = curr_height_to_depth.second;
float depth_diff = next_height_to_depth.second - curr_height_to_depth.second;
@ -2041,7 +2037,6 @@ bool PartPlate::intersect_instance(int obj_id, int instance_id, BoundingBoxf3* b
if (m_printable)
{
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);
result = get_plate_box().intersects(instance_box);
}
@ -2065,7 +2060,6 @@ bool PartPlate::is_left_top_of(int obj_id, int instance_id)
}
ModelObject* object = m_model->objects[obj_id];
ModelInstance* instance = object->instances[instance_id];
std::pair<int, int> pair(obj_id, instance_id);
BoundingBoxf3 instance_box = object->instance_convex_hull_bounding_box(instance_id);
@ -2461,7 +2455,7 @@ void PartPlate::generate_print_polygon(ExPolygon &print_polygon)
{
auto compute_points = [&print_polygon](Vec2d& center, double radius, double start_angle, double stop_angle, int count)
{
double angle, angle_steps;
double angle_steps;
angle_steps = (stop_angle - start_angle) / (count - 1);
for(int j = 0; j < count; j++ )
{
@ -2480,7 +2474,7 @@ void PartPlate::generate_print_polygon(ExPolygon &print_polygon)
{
const Vec2d& p = m_shape[i];
Vec2d center;
double start_angle, stop_angle, angle_steps, radius_x, radius_y, radius;
double start_angle, stop_angle, radius_x, radius_y, radius;
switch (i) {
case 0:
radius = 5.f;
@ -2531,7 +2525,7 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon)
{
auto compute_exclude_points = [&exclude_polygon](Vec2d& center, double radius, double start_angle, double stop_angle, int count)
{
double angle, angle_steps;
double angle_steps;
angle_steps = (stop_angle - start_angle) / (count - 1);
for(int j = 0; j < count; j++ )
{
@ -2550,7 +2544,7 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon)
{
const Vec2d& p = m_exclude_area[i];
Vec2d center;
double start_angle, stop_angle, angle_steps, radius_x, radius_y, radius;
double start_angle, stop_angle, radius;
switch (i) {
case 0:
radius = 5.f;
@ -3065,7 +3059,7 @@ void PartPlate::update_first_layer_print_sequence(size_t filament_nums)
void PartPlate::print() const
{
unsigned int count=0;
// unsigned int count=0;
BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << boost::format(": plate index %1%, pointer %2%, print_index %3% print pointer %4%") % m_plate_index % this % m_print_index % m_print;
BOOST_LOG_TRIVIAL(trace) << boost::format("\t origin {%1%,%2%,%3%}, width %4%, depth %5%, height %6%") % m_origin.x() % m_origin.y() % m_origin.z() % m_width % m_depth % m_height;
@ -4092,8 +4086,7 @@ int PartPlateList::find_instance_belongs(int obj_id, int instance_id)
//newly added or modified
int PartPlateList::notify_instance_update(int obj_id, int instance_id, bool is_new)
{
int ret = 0, index;
PartPlate* plate = NULL;
int index;
ModelObject* object = NULL;
if ((obj_id >= 0) && (obj_id < m_model->objects.size()))
@ -4122,7 +4115,7 @@ int PartPlateList::notify_instance_update(int obj_id, int instance_id, bool is_n
{
//found it added before
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found it in previous plate %1%") % index;
plate = m_plate_list[index];
PartPlate* plate = m_plate_list[index];
if (!plate->intersect_instance(obj_id, instance_id, &boundingbox))
{
//not include anymore, remove it from original plate
@ -4227,7 +4220,7 @@ int PartPlateList::notify_instance_update(int obj_id, int instance_id, bool is_n
//notify instance is removed
int PartPlateList::notify_instance_removed(int obj_id, int instance_id)
{
int ret = 0, index, instance_to_delete = instance_id;
int index, instance_to_delete = instance_id;
PartPlate* plate = NULL;
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1%, instance_id %2%") % obj_id % instance_id;
@ -4325,7 +4318,6 @@ int PartPlateList::reload_all_objects(bool except_locked, int plate_index)
ModelObject* object = m_model->objects[i];
for (j = 0; j < (unsigned int)object->instances.size(); ++j)
{
ModelInstance* instance = object->instances[j];
BoundingBoxf3 boundingbox = object->instance_convex_hull_bounding_box(j);
for (k = 0; k < (unsigned int)m_plate_list.size(); ++k)
{
@ -4376,9 +4368,7 @@ int PartPlateList::construct_objects_list_for_new_plate(int plate_index)
ModelObject* object = m_model->objects[i];
for (j = 0; j < (unsigned int)object->instances.size(); ++j)
{
ModelInstance* instance = object->instances[j];
already_included = false;
for (k = 0; k < (unsigned int)plate_index; ++k)
{
PartPlate* plate = m_plate_list[k];
@ -4552,7 +4542,6 @@ bool PartPlateList::preprocess_nonprefered_areas(arrangement::ArrangePolygons& r
nonprefered_regions.emplace_back(Vec2d{ 18,0 }, Vec2d{ 240,15 }); // new extrusion & hand-eye calibration region
//has exclude areas
PartPlate* plate = m_plate_list[0];
for (int index = 0; index < nonprefered_regions.size(); index++)
{
Polygon ap = scaled(nonprefered_regions[index]).polygon();
@ -4779,11 +4768,8 @@ void PartPlateList::set_render_option(bool bedtype_texture, bool plate_settings)
int PartPlateList::select_plate_by_obj(int obj_index, int instance_index)
{
int ret = 0, index;
PartPlate* plate = NULL;
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1%, instance_id %2%") % obj_index % instance_index;
index = find_instance(obj_index, instance_index);
int index = find_instance(obj_index, instance_index);
if (index != -1)
{
//found it in plate
@ -4821,8 +4807,6 @@ bool PartPlateList::set_shapes(const Pointfs& shape, const Pointfs& exclude_area
m_height_to_lid = height_to_lid;
m_height_to_rod = height_to_rod;
double stride_x = plate_stride_x();
double stride_y = plate_stride_y();
for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
{
PartPlate* plate = m_plate_list[i];
@ -5384,14 +5368,12 @@ void PartPlateList::BedTextureInfo::TexturePart::update_buffer()
rectangle.push_back(Vec2d(x, y+h));
ExPolygon poly;
for (int i = 0; i < 4; i++) {
const Vec2d & p = rectangle[i];
for (auto& p : rectangle) {
Vec2d pp = Vec2d(p.x() + offset.x(), p.y() + offset.y());
poly.contour.append({ scale_(pp(0)), scale_(pp(1)) });
}
for (const auto& p : rectangle) {
Vec2d pp = Vec2d(p.x() + offset.x(), p.y() + offset.y());
poly.contour.append({ scale_(pp(0)), scale_(pp(1)) });
}
if (!buffer)
buffer = new GLModel();

View file

@ -396,10 +396,9 @@ Sidebar::priv::~priv()
void Sidebar::priv::show_preset_comboboxes()
{
const bool showSLA = wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA;
//BBS
#if 0
const bool showSLA = wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA;
for (size_t i = 0; i < 4; ++i)
sizer_presets->Show(i, !showSLA);
@ -1102,7 +1101,7 @@ void Sidebar::init_filament_combo(PlaterPresetComboBox **combo, const int filame
auto combo_and_btn_sizer = new wxBoxSizer(wxHORIZONTAL);
// BBS: filament double columns
int em = wxGetApp().em_unit();
// int em = wxGetApp().em_unit();
combo_and_btn_sizer->Add(FromDIP(8), 0, 0, 0, 0 );
(*combo)->clr_picker->SetLabel(wxString::Format("%d", filament_idx + 1));
combo_and_btn_sizer->Add((*combo)->clr_picker, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(3));
@ -1268,7 +1267,6 @@ void Sidebar::update_all_preset_comboboxes()
void Sidebar::update_presets(Preset::Type preset_type)
{
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
const auto print_tech = preset_bundle.printers.get_edited_preset().printer_technology();
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": enter, preset_type %1%")%preset_type;
switch (preset_type) {
@ -1276,6 +1274,7 @@ void Sidebar::update_presets(Preset::Type preset_type)
{
// BBS
#if 0
const auto print_tech = preset_bundle.printers.get_edited_preset().printer_technology();
const size_t extruder_cnt = print_tech != ptFFF ? 1 :
dynamic_cast<ConfigOptionFloats*>(preset_bundle.printers.get_edited_preset().config.option("nozzle_diameter"))->values.size();
const size_t filament_cnt = p->combos_filament.size() > extruder_cnt ? extruder_cnt : p->combos_filament.size();
@ -1731,7 +1730,7 @@ void Sidebar::sync_ams_list()
// BBS:Record consumables information before synchronization
std::vector<string> color_before_sync;
std::vector<int> is_support_before;
std::vector<bool> is_support_before;
DynamicPrintConfig& project_config = wxGetApp().preset_bundle->project_config;
ConfigOptionStrings* color_opt = project_config.option<ConfigOptionStrings>("filament_colour");
for (int i = 0; i < p->combos_filament.size(); ++i) {
@ -1953,18 +1952,13 @@ void Sidebar::auto_calc_flushing_volumes(const int modify_id)
{
auto& preset_bundle = wxGetApp().preset_bundle;
auto& project_config = preset_bundle->project_config;
auto& printer_config = preset_bundle->printers.get_edited_preset().config;
const auto& full_config = wxGetApp().preset_bundle->full_config();
auto& ams_multi_color_filament = preset_bundle->ams_multi_color_filment;
auto& ams_filament_list = preset_bundle->filament_ams_list;
const std::vector<double>& init_matrix = (project_config.option<ConfigOptionFloats>("flush_volumes_matrix"))->values;
const std::vector<double>& init_extruders = (project_config.option<ConfigOptionFloats>("flush_volumes_vector"))->values;
const std::vector<int>& min_flush_volumes= get_min_flush_volumes(full_config);
ConfigOptionFloat* flush_multi_opt = project_config.option<ConfigOptionFloat>("flush_multiplier");
float flush_multiplier = flush_multi_opt ? flush_multi_opt->getFloat() : 1.f;
std::vector<double> matrix = init_matrix;
int m_max_flush_volume = Slic3r::g_max_flush_volume;
unsigned int m_number_of_extruders = (int)(sqrt(init_matrix.size()) + 0.001);
@ -2861,7 +2855,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
wxGLCanvas* view3D_canvas = view3D->get_wxglcanvas();
//BBS: GUI refactor
wxGLCanvas* preview_canvas = preview->get_wxglcanvas();
// wxGLCanvas* preview_canvas = preview->get_wxglcanvas();
if (wxGetApp().is_editor()) {
// 3DScene events:
@ -3579,11 +3573,8 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
std::string designer_model_id;
std::string designer_country_code;
int answer_convert_from_meters = wxOK_DEFAULT;
int answer_convert_from_imperial_units = wxOK_DEFAULT;
int tolal_model_count = 0;
int progress_percent = 0;
int total_files = input_files.size();
const int stage_percent[IMPORT_STAGE_MAX+1] = {
5, // IMPORT_STAGE_RESTORE
@ -3750,7 +3741,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
wxString text = wxString::Format(_L("The 3mf's version %s is newer than %s's version %s, Found following keys unrecognized:"),
file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string());
text += "\n";
bool first = true;
// bool first = true;
// std::string context = into_u8(text);
wxString context = text;
// if (wxGetApp().app_config->get("user_mode") == "develop") {
@ -3856,7 +3847,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
}
// Based on the printer technology field found in the loaded config, select the base for the config,
PrinterTechnology printer_technology = Preset::printer_technology(config_loaded);
// PrinterTechnology printer_technology = Preset::printer_technology(config_loaded);
config.apply(static_cast<const ConfigBase &>(FullPrintConfig::defaults()));
// and place the loaded config over the base.
@ -3911,7 +3902,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
MessageDialog dlg(q, _L("The 3mf has following modified G-codes in filament or printer presets:") + warning_message+ _L("Please confirm that these modified G-codes are safe to prevent any damage to the machine!"), _L("Modified G-codes"));
dlg.show_dsa_button();
auto res = dlg.ShowModal();
dlg.ShowModal();
if (dlg.get_checkbox_state())
wxGetApp().app_config->set("no_warn_when_modified_gcodes", "true");
}
@ -3924,7 +3915,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
//show_info(q, _L("The 3mf has following customized filament or printer presets:") + warning_message + _L("Please confirm that the G-codes within these presets are safe to prevent any damage to the machine!"), _L("Customized Preset"));
MessageDialog dlg(q, _L("The 3mf has following customized filament or printer presets:") + from_u8(warning_message)+ _L("Please confirm that the G-codes within these presets are safe to prevent any damage to the machine!"), _L("Customized Preset"));
dlg.show_dsa_button();
auto res = dlg.ShowModal();
dlg.ShowModal();
if (dlg.get_checkbox_state())
wxGetApp().app_config->set("no_warn_when_modified_gcodes", "true");
}
@ -4427,7 +4418,7 @@ std::vector<size_t> Plater::priv::load_model_objects(const ModelObjectPtrs& mode
#ifndef AUTOPLACEMENT_ON_LOAD
// bool need_arrange = false;
#endif /* AUTOPLACEMENT_ON_LOAD */
bool scaled_down = false;
// bool scaled_down = false;
std::vector<size_t> obj_idxs;
unsigned int obj_count = model.objects.size();
@ -4464,15 +4455,15 @@ std::vector<size_t> Plater::priv::load_model_objects(const ModelObjectPtrs& mode
const Vec3d ratio = size.cwiseQuotient(bed_size);
const double max_ratio = std::max(ratio(0), ratio(1));
if (max_ratio > 10000) {
MessageDialog dlg(q, _L("Your object appears to be too large, Do you want to scale it down to fit the heat bed automatically?"), _L("Object too large"),
wxICON_QUESTION | wxYES);
int answer = dlg.ShowModal();
MessageDialog dlg(q, _L("Your object appears to be too large. It will be scaled down to fit the heat bed automatically."), _L("Object too large"),
wxICON_QUESTION | wxOK);
dlg.ShowModal();
// the size of the object is too big -> this could lead to overflow when moving to clipper coordinates,
// so scale down the mesh
object->scale_mesh_after_creation(1. / max_ratio);
object->origin_translation = Vec3d::Zero();
object->center_around_origin();
scaled_down = true;
// scaled_down = true;
break;
}
else if (max_ratio > 10) {
@ -4481,7 +4472,7 @@ std::vector<size_t> Plater::priv::load_model_objects(const ModelObjectPtrs& mode
int answer = dlg.ShowModal();
if (answer == wxID_YES) {
instance->set_scaling_factor(instance->get_scaling_factor() / max_ratio);
scaled_down = true;
// scaled_down = true;
}
}
}
@ -5230,7 +5221,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool
process_validation_warning(warning);
return_state |= UPDATE_BACKGROUND_PROCESS_INVALID;
if (printer_technology == ptFFF) {
const Print* print = background_process.fff_print();
// const Print* print = background_process.fff_print();
//Polygons polygons;
//if (print->config().print_sequence == PrintSequence::ByObject)
// Print::sequential_print_clearance_valid(*print, &polygons);
@ -6374,7 +6365,6 @@ void Plater::priv::on_select_bed_type(wxCommandEvent &evt)
int selection = combo->GetSelection();
std::string bed_type_name = print_config_def.get("curr_bed_type")->enum_values[selection];
PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
DynamicPrintConfig& proj_config = wxGetApp().preset_bundle->project_config;
const t_config_enum_values* keys_map = print_config_def.get("curr_bed_type")->enum_keys_map;
@ -8213,7 +8203,7 @@ void Plater::priv::on_create_filament(SimpleEvent &)
update_ui_from_settings();
sidebar->update_all_preset_comboboxes();
CreatePresetSuccessfulDialog success_dlg(wxGetApp().mainframe, SuccessType::FILAMENT);
int res = success_dlg.ShowModal();
success_dlg.ShowModal();
}
}
@ -8325,7 +8315,7 @@ void Plater::priv::take_snapshot(const std::string& snapshot_name, const UndoRed
// This is a workaround until we refactor the Wipe Tower position / orientation to live solely inside the Model, not in the Print config.
// BBS: add partplate logic
if (this->printer_technology == ptFFF) {
const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
// const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
const DynamicPrintConfig& proj_cfg = wxGetApp().preset_bundle->project_config;
const ConfigOptionFloats* tower_x_opt = proj_cfg.option<ConfigOptionFloats>("wipe_tower_x");
const ConfigOptionFloats* tower_y_opt = proj_cfg.option<ConfigOptionFloats>("wipe_tower_y");
@ -8435,7 +8425,7 @@ void Plater::priv::undo_redo_to(std::vector<UndoRedo::Snapshot>::const_iterator
// This is a workaround until we refactor the Wipe Tower position / orientation to live solely inside the Model, not in the Print config.
// BBS: add partplate logic
if (this->printer_technology == ptFFF) {
const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
// const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
const DynamicPrintConfig& proj_cfg = wxGetApp().preset_bundle->project_config;
const ConfigOptionFloats* tower_x_opt = proj_cfg.option<ConfigOptionFloats>("wipe_tower_x");
const ConfigOptionFloats* tower_y_opt = proj_cfg.option<ConfigOptionFloats>("wipe_tower_y");
@ -8502,7 +8492,7 @@ void Plater::priv::undo_redo_to(std::vector<UndoRedo::Snapshot>::const_iterator
// This is a workaround until we refactor the Wipe Tower position / orientation to live solely inside the Model, not in the Print config.
// BBS: add partplate logic
if (this->printer_technology == ptFFF) {
const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
// const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
const DynamicPrintConfig& proj_cfg = wxGetApp().preset_bundle->project_config;
ConfigOptionFloats* tower_x_opt = const_cast<ConfigOptionFloats*>(proj_cfg.option<ConfigOptionFloats>("wipe_tower_x"));
ConfigOptionFloats* tower_y_opt = const_cast<ConfigOptionFloats*>(proj_cfg.option<ConfigOptionFloats>("wipe_tower_y"));
@ -8683,7 +8673,6 @@ void Plater::priv::record_start_print_preset(std::string action) {
}
j["record_event"] = action;
NetworkAgent* agent = wxGetApp().getAgent();
}
catch (...) {
return;
@ -8886,7 +8875,7 @@ void Plater::load_project(wxString const& filename2,
// if res is empty no data has been loaded
if (!res.empty() && (load_restore || !(strategy & LoadStrategy::Silence))) {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " call set_project_filename: " << load_restore ? originfile : filename;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " call set_project_filename: " << (load_restore ? originfile : filename);
p->set_project_filename(load_restore ? originfile : filename);
if (load_restore && originfile.IsEmpty()) {
p->set_project_name(_L("Untitled"));
@ -8968,8 +8957,6 @@ int Plater::save_project(bool saveAs)
boost::uintmax_t size = boost::filesystem::file_size(into_path(filename));
j["file_size"] = size;
j["file_name"] = std::string(filename.mb_str());
NetworkAgent* agent = wxGetApp().getAgent();
}
catch (...) {}
@ -9002,7 +8989,7 @@ void Plater::import_model_id(wxString download_info)
}
}
catch (const std::exception& error)
catch (std::exception&)
{
//wxString sError = error.what();
}
@ -9043,8 +9030,6 @@ void Plater::import_model_id(wxString download_info)
// NetworkAgent* m_agent = Slic3r::GUI::wxGetApp().getAgent();
// if (!m_agent) return;
int res = 0;
unsigned int http_code;
std::string http_body;
msg = _L("prepare 3mf file...");
@ -9083,7 +9068,7 @@ void Plater::import_model_id(wxString download_info)
if (sFile == filename) is_already_exist = true;
}
}
catch (const std::exception& error)
catch (std::exception&)
{
//wxString sError = error.what();
}
@ -9796,7 +9781,6 @@ void Plater::calib_retraction(const Calib_Params& params)
add_model(false, Slic3r::resources_dir() + "/calib/retraction/retraction_tower.stl");
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
auto obj = model().objects[0];
@ -10127,7 +10111,7 @@ bool Plater::preview_zip_archive(const boost::filesystem::path& archive_path)
std::replace(name.begin(), name.end(), '\\', '/');
// rename if file exists
std::string filename = path.filename().string();
std::string extension = boost::filesystem::extension(path);
std::string extension = path.extension().string();
std::string just_filename = filename.substr(0, filename.size() - extension.size());
std::string final_filename = just_filename;
@ -10433,7 +10417,6 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
auto limit_width = m_fname_f->GetSize().GetWidth() - 2;
auto current_width = 0;
auto cut_index = 0;
auto fstring = wxString("");
auto bstring = wxString("");
@ -10441,7 +10424,6 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
auto file_name = wxString(filename);
for (int x = 0; x < file_name.length(); x++) {
current_width += m_fname_s->GetTextExtent(file_name[x]).GetWidth();
cut_index = x;
if (current_width > limit_width) {
bstring += file_name[x];
@ -11344,7 +11326,6 @@ void Plater::export_gcode(bool prefer_removable)
if (preset_bundle) {
j["gcode_printer_model"] = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
}
NetworkAgent *agent = wxGetApp().getAgent();
} catch (...) {}
}
@ -11454,7 +11435,7 @@ TriangleMesh Plater::combine_mesh_fff(const ModelObject& mo, int instance_id, st
std::vector<csg::CSGPart> csgmesh;
csgmesh.reserve(2 * mo.volumes.size());
bool has_splitable_volume = csg::model_to_csgmesh(mo, Transform3d::Identity(), std::back_inserter(csgmesh),
csg::model_to_csgmesh(mo, Transform3d::Identity(), std::back_inserter(csgmesh),
csg::mpartsPositive | csg::mpartsNegative);
std::string fail_msg = _u8L("Unable to perform boolean operation on model meshes. "
@ -11534,9 +11515,9 @@ void Plater::export_stl(bool extended, bool selection_only, bool multi_stls)
wxBusyCursor wait;
const auto& selection = p->get_selection();
const auto obj_idx = selection.get_object_idx();
#if EXPORT_WITH_BOOLEAN
const auto obj_idx = selection.get_object_idx();
if (selection_only && (obj_idx == -1 || selection.is_wipe_tower()))
return;
#else
@ -12299,7 +12280,6 @@ void Plater::record_slice_preset(std::string action)
}
j["record_event"] = action;
NetworkAgent* agent = wxGetApp().getAgent();
}
catch (...)
{
@ -12482,7 +12462,7 @@ int Plater::send_gcode(int plate_idx, Export3mfProgressFn proFn)
p->m_print_job_data._3mf_path = fs::path(plate->get_tmp_gcode_path());
p->m_print_job_data._3mf_path.replace_extension("3mf");
}
catch (std::exception& e) {
catch (std::exception&) {
BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed";
return -1;
}
@ -12515,7 +12495,7 @@ int Plater::export_config_3mf(int plate_idx, Export3mfProgressFn proFn)
try {
p->m_print_job_data._3mf_config_path = fs::path(plate->get_temp_config_3mf_path());
}
catch (std::exception& e) {
catch (std::exception&) {
BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed";
return -1;
}

View file

@ -228,13 +228,13 @@ wxBoxSizer *PreferencesDialog::create_item_language_combobox(
}
}
auto check = [this](bool yes_or_no) {
/*auto check = [this](bool yes_or_no) {
// if (yes_or_no)
// return true;
int act_btns = ActionButtons::SAVE;
return wxGetApp().check_and_keep_current_preset_changes(_L("Switching application language"),
_L("Switching application language while some presets are modified."), act_btns);
};
};*/
m_current_language_selected = combobox->GetSelection();
if (m_current_language_selected >= 0 && m_current_language_selected < vlist.size()) {

View file

@ -401,7 +401,7 @@ void PresetComboBox::add_ams_filaments(std::string selected, bool alias_name)
auto color = tray.opt_string("filament_colour", 0u);
auto name = tray.opt_string("tray_name", 0u);
wxBitmap bmp(*get_extruder_color_icon(color, name, 24, 16));
int item_id = Append(get_preset_name(*iter), bmp.ConvertToImage(), &m_first_ams_filament + entry.first);
Append(get_preset_name(*iter), bmp.ConvertToImage(), &m_first_ams_filament + entry.first);
//validate_selection(id->value == selected); // can not select
}
m_last_ams_filament = GetCount();
@ -668,7 +668,6 @@ PlaterPresetComboBox::PlaterPresetComboBox(wxWindow *parent, Preset::Type preset
// BBS
if (m_type == Preset::TYPE_FILAMENT) {
int em = wxGetApp().em_unit();
clr_picker = new wxBitmapButton(parent, wxID_ANY, {}, wxDefaultPosition, wxSize(FromDIP(20), FromDIP(20)), wxBU_EXACTFIT | wxBU_AUTODRAW | wxBORDER_NONE);
clr_picker->SetToolTip(_L("Click to pick filament color"));
clr_picker->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
@ -803,7 +802,6 @@ bool PlaterPresetComboBox::switch_to_tab()
wxGetApp().params_dialog()->Popup();
tab->restore_last_select_item();
const Preset* selected_filament_preset = nullptr;
if (m_type == Preset::TYPE_FILAMENT)
{
const std::string& selected_preset = GetString(GetSelection()).ToUTF8().data();
@ -983,7 +981,6 @@ void PlaterPresetComboBox::update()
if (!preset.is_visible || (!preset.is_compatible && !is_selected))
continue;
bool single_bar = false;
if (m_type == Preset::TYPE_FILAMENT)
{
#if 0
@ -991,7 +988,7 @@ void PlaterPresetComboBox::update()
filament_rgb = is_selected ? selected_filament_preset->config.opt_string("filament_colour", 0) :
preset.config.opt_string("filament_colour", 0);
extruder_rgb = (is_selected && !filament_color.empty()) ? filament_color : filament_rgb;
single_bar = filament_rgb == extruder_rgb;
bool single_bar = filament_rgb == extruder_rgb;
bitmap_key += single_bar ? filament_rgb : filament_rgb + extruder_rgb;
#endif
@ -1479,8 +1476,6 @@ void GUI::CalibrateFilamentComboBox::update()
this->Clear();
invalidate_selection();
const Preset* selected_filament_preset = nullptr;
m_nonsys_presets.clear();
m_system_presets.clear();

View file

@ -548,7 +548,6 @@ void PrinterFileSystem::BuildGroups()
void PrinterFileSystem::UpdateGroupSelect()
{
m_group_flags.clear();
int beg = 0;
if (m_group_mode != G_NONE) {
auto group = m_group_mode == G_YEAR ? m_group_year : m_group_month;
if (m_group_mode == G_YEAR)

View file

@ -1,11 +1,9 @@
#include "PrinterWebView.hpp"
#include "I18N.hpp"
#include "slic3r/GUI/PrinterWebView.hpp"
#include "slic3r/GUI/wxExtensions.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/MainFrame.hpp"
#include "libslic3r_version.h"
#include <wx/sizer.h>
#include <wx/string.h>

View file

@ -266,7 +266,7 @@ void ProjectPanel::OnScriptMessage(wxWebViewEvent& evt)
}
}
catch (std::exception& e) {
catch (std::exception&) {
// wxMessageBox(e.what(), "json Exception", MB_OK);
}
}

View file

@ -86,8 +86,6 @@ void RecenterDialog::OnPaint(wxPaintEvent& event){
}
void RecenterDialog::render(wxDC& dc) {
wxSize size = GetSize();
dc.SetFont(Label::Body_14);
dc.SetTextForeground(text_color);
wxPoint pos_start = wxPoint(BORDER, BORDER);

View file

@ -1375,7 +1375,6 @@ wxString ConfirmBeforeSendDialog::format_text(wxString str, int warp)
Label st (this, str);
wxString out_txt = str;
wxString count_txt = "";
int new_line_pos = 0;
for (int i = 0; i < str.length(); i++) {
auto text_size = st.GetTextExtent(count_txt);

View file

@ -6,13 +6,9 @@
#include <boost/log/trivial.hpp>
#if _WIN32
#include <windows.h>
#include <tchar.h>
#include <winioctl.h>
#include <shlwapi.h>
#include <Dbt.h>
#else
// unix, linux & OSX includes
#include <errno.h>

View file

@ -435,8 +435,6 @@ void SearchItem::OnPaint(wxPaintEvent &event)
auto bold_pair = std::vector<std::pair<int, int>>();
auto index = 0;
auto b_first_list = std::vector<int>();
auto b_second_list = std::vector<int>();
@ -815,9 +813,9 @@ void SearchDialog::OnCheck(wxCommandEvent &event)
void SearchDialog::OnMotion(wxMouseEvent &event)
{
wxDataViewItem item;
wxDataViewColumn *col;
wxWindow * win = this;
// wxDataViewItem item;
// wxDataViewColumn *col;
// wxWindow * win = this;
// search_list->HitTest(wxGetMousePosition() - win->GetScreenPosition(), item, col);
// search_list->Select(item);

View file

@ -421,7 +421,7 @@ SelectMachinePopup::SelectMachinePopup(wxWindow *parent)
m_refresh_timer = new wxTimer();
m_refresh_timer->SetOwner(this);
Bind(EVT_UPDATE_USER_MACHINE_LIST, &SelectMachinePopup::update_machine_list, this);
Bind(wxEVT_TIMER, &SelectMachinePopup::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
Bind(EVT_DISSMISS_MACHINE_LIST, &SelectMachinePopup::on_dissmiss_win, this);
}
@ -459,7 +459,7 @@ void SelectMachinePopup::Popup(wxWindow *WXUNUSED(focus))
}
}
wxPostEvent(this, wxTimerEvent());
on_timer();
PopupWindow::Popup();
}
@ -529,7 +529,7 @@ wxWindow *SelectMachinePopup::create_title_panel(wxString text)
return m_panel_title_own;
}
void SelectMachinePopup::on_timer(wxTimerEvent &event)
void SelectMachinePopup::on_timer()
{
BOOST_LOG_TRIVIAL(trace) << "SelectMachinePopup on_timer";
wxGetApp().reset_to_active();
@ -933,7 +933,6 @@ wxString SelectMachineDialog::format_text(wxString &m_msg)
wxString out_txt = m_msg;
wxString count_txt = "";
int new_line_pos = 0;
for (int i = 0; i < m_msg.length(); i++) {
auto text_size = m_statictext_ams_msg->GetTextExtent(count_txt);
@ -2461,9 +2460,6 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
//check blacklist
for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
auto tid = m_ams_mapping_result[i].tray_id;
std::string filament_type = boost::to_upper_copy(m_ams_mapping_result[i].type);
std::string filament_brand;
@ -3319,7 +3315,7 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event)
if (m_list[i]->is_lan_mode_printer() && !m_list[i]->has_access_right()) {
ConnectPrinterDialog dlg(wxGetApp().mainframe, wxID_ANY, _L("Input access code"));
dlg.set_machine_object(m_list[i]);
auto res = dlg.ShowModal();
dlg.ShowModal();
m_printer_last_select = "";
m_comboBox_printer->SetSelection(-1);
m_comboBox_printer->Refresh();
@ -3369,7 +3365,6 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event)
void SelectMachineDialog::update_flow_cali_check(MachineObject* obj)
{
auto bed_type = m_plater->get_partplate_list().get_curr_plate()->get_bed_type(true);
auto show_cali_tips = true;
if (obj && obj->get_printer_arch() == PrinterArch::ARCH_I3) { show_cali_tips = false; }
@ -3706,7 +3701,6 @@ void SelectMachineDialog::reset_ams_material()
{
MaterialHash::iterator iter = m_materialList.begin();
while (iter != m_materialList.end()) {
int id = iter->first;
Material* item = iter->second;
MaterialItem* m = item->item;
wxString ams_id = "-";
@ -3988,7 +3982,6 @@ void SelectMachineDialog::reset_and_sync_ams_list()
BitmapCache bmcache;
MaterialHash::iterator iter = m_materialList.begin();
while (iter != m_materialList.end()) {
int id = iter->first;
Material *item = iter->second;
item->item->Destroy();
delete item;
@ -4015,7 +4008,6 @@ void SelectMachineDialog::reset_and_sync_ams_list()
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
MaterialHash::iterator iter = m_materialList.begin();
while (iter != m_materialList.end()) {
int id = iter->first;
Material * item = iter->second;
MaterialItem *m = item->item;
m->on_normal();
@ -4025,9 +4017,6 @@ void SelectMachineDialog::reset_and_sync_ams_list()
m_current_filament_id = extruder;
item->on_selected();
auto mouse_pos = ClientToScreen(e.GetPosition());
wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
// update ams data
DeviceManager *dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev_manager) return;
@ -4247,7 +4236,6 @@ void SelectMachineDialog::unify_deal_thumbnail_data(ThumbnailData &input_data, T
MaterialHash::iterator iter = m_materialList.begin();
bool is_connect_printer = true;
while (iter != m_materialList.end()) {
int id = iter->first;
Material * item = iter->second;
MaterialItem *m = item->item;
if (m->m_ams_name == "-") {
@ -4359,10 +4347,10 @@ void SelectMachineDialog::set_default_normal(const ThumbnailData &data)
MachineObject* obj_ = dev_manager->get_selected_machine();
update_flow_cali_check(obj_);
#ifdef __WINDOWS__
wxSize screenSize = wxGetDisplaySize();
auto dialogSize = this->GetSize();
#ifdef __WINDOWS__
if (screenSize.GetHeight() < dialogSize.GetHeight()) {
m_need_adaptation_screen = true;
m_scrollable_view->SetScrollRate(0, 5);
@ -4423,7 +4411,6 @@ void SelectMachineDialog::set_default_from_sdcard()
//init MaterialItem
MaterialHash::iterator iter = m_materialList.begin();
while (iter != m_materialList.end()) {
int id = iter->first;
Material* item = iter->second;
item->item->Destroy();
delete item;
@ -4446,7 +4433,6 @@ void SelectMachineDialog::set_default_from_sdcard()
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, fo](wxMouseEvent& e) {
MaterialHash::iterator iter = m_materialList.begin();
while (iter != m_materialList.end()) {
int id = iter->first;
Material* item = iter->second;
MaterialItem* m = item->item;
m->on_normal();
@ -4459,9 +4445,6 @@ void SelectMachineDialog::set_default_from_sdcard()
catch (...) {}
item->on_selected();
auto mouse_pos = ClientToScreen(e.GetPosition());
wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
// update ams data
DeviceManager* dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev_manager) return;
@ -4485,7 +4468,7 @@ void SelectMachineDialog::set_default_from_sdcard()
m_mapping_popup.Popup();
}
}
});
});
Material* material_item = new Material();
material_item->id = fo.id;
@ -4512,10 +4495,9 @@ void SelectMachineDialog::set_default_from_sdcard()
set_flow_calibration_state(true);
#ifdef __WINDOWS__
wxSize screenSize = wxGetDisplaySize();
auto dialogSize = this->GetSize();
#ifdef __WINDOWS__
if (screenSize.GetHeight() < dialogSize.GetHeight()) {
m_need_adaptation_screen = true;
m_scrollable_view->SetScrollRate(0, 5);

View file

@ -278,7 +278,7 @@ private:
private:
void OnLeftUp(wxMouseEvent &event);
void on_timer(wxTimerEvent &event);
void on_timer();
void update_other_devices();
void update_user_devices();

View file

@ -1104,7 +1104,6 @@ void Selection::move_to_center(const Vec3d& displacement, bool local)
if (!m_valid)
return;
EMode translation_type = m_mode;
//BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": %1%, displacement {%2%, %3%, %4%}") % __LINE__ % displacement(X) % displacement(Y) % displacement(Z);
set_caches();
@ -1125,7 +1124,6 @@ void Selection::move_to_center(const Vec3d& displacement, bool local)
else {
const Vec3d local_displacement = (m_cache.volumes_data[i].get_instance_rotation_matrix() * m_cache.volumes_data[i].get_instance_scale_matrix() * m_cache.volumes_data[i].get_instance_mirror_matrix()).inverse() * displacement;
v.set_volume_offset(m_cache.volumes_data[i].get_volume_position() + local_displacement);
translation_type = Volume;
}
}
}
@ -2179,7 +2177,8 @@ void Selection::update_type()
obj_it->second.insert(inst_idx);
}
bool requires_disable = false;
// BBL removed functionality below
// bool requires_disable = false;
if (!m_valid)
m_type = Invalid;
@ -2195,7 +2194,7 @@ void Selection::update_type()
else if (first->is_modifier)
{
m_type = SingleModifier;
requires_disable = true;
// requires_disable = true;
}
else
{
@ -2217,7 +2216,7 @@ void Selection::update_type()
else
{
m_type = SingleVolume;
requires_disable = true;
// requires_disable = true;
}
}
}
@ -2265,7 +2264,7 @@ void Selection::update_type()
else if (modifiers_count == (unsigned int)m_list.size())
m_type = MultipleModifier;
requires_disable = true;
// requires_disable = true;
}
}
else if ((selected_instances_count > 1) && (selected_instances_count * model_volumes_count + sla_volumes_count == (unsigned int)m_list.size()))

View file

@ -300,7 +300,7 @@ SendMultiMachinePage::SendMultiMachinePage(Plater* plater)
m_main_scroll->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this); e.Skip(); });
init_timer();
Bind(wxEVT_TIMER, &SendMultiMachinePage::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
wxGetApp().UpdateDlgDarkUI(this);
}
@ -451,8 +451,6 @@ BBL::PrintParams SendMultiMachinePage::request_params(MachineObject* obj)
auto use_ams = false;
AmsRadioSelectorList::Node* node = m_radio_group.GetFirst();
auto groupid = 0;
while (node) {
AmsRadioSelector* rs = node->GetData();
@ -472,13 +470,11 @@ BBL::PrintParams SendMultiMachinePage::request_params(MachineObject* obj)
PrintPrepareData job_data;
m_plater->get_print_job_data(&job_data);
if (&job_data) {
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
auto check_access_code_path = temp_file.c_str();
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
job_data._temp_path = fs::path(check_access_code_path);
}
std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
auto check_access_code_path = temp_file.c_str();
BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
job_data._temp_path = fs::path(check_access_code_path);
int curr_plate_idx;
if (job_data.plate_idx >= 0)
@ -639,7 +635,7 @@ void SendMultiMachinePage::on_send(wxCommandEvent& event)
int result = m_plater->send_gcode(m_print_plate_idx, [this](int export_stage, int current, int total, bool& cancel) {
if (m_is_canceled) return;
bool cancelled = false;
// bool cancelled = false;
wxString msg = _L("Preparing print job");
//m_status_bar->update_status(msg, cancelled, 10, true);
//m_export_3mf_cancel = cancel = cancelled;
@ -738,7 +734,7 @@ bool SendMultiMachinePage::Show(bool show)
m_refresh_timer->Stop();
m_refresh_timer->SetOwner(this);
m_refresh_timer->Start(4000);
wxPostEvent(this, wxTimerEvent());
on_timer();
}
else {
m_refresh_timer->Stop();
@ -935,7 +931,6 @@ void SendMultiMachinePage::on_set_finish_mapping(wxCommandEvent& evt)
if (selection_data_arr.size() == 6) {
auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3]));
int old_filament_id = (int)wxAtoi(selection_data_arr[5]);
int ctype = 0;
std::vector<wxColour> material_cols;
@ -1147,7 +1142,7 @@ wxPanel* SendMultiMachinePage::create_page()
e.Skip();
});
m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE);
m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE);
m_printer_name->SetBackgroundColor(head_bg);
m_printer_name->SetCornerRadius(0);
m_printer_name->SetFont(TABLE_HEAD_FONT);
@ -1169,7 +1164,7 @@ wxPanel* SendMultiMachinePage::create_page()
m_table_head_sizer->Add( 0, 0, 0, wxLEFT, FromDIP(10) );
m_table_head_sizer->Add(m_printer_name, 0, wxALIGN_CENTER_VERTICAL, 0);
m_device_status = new Button(m_table_head_panel, _L("Device Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE);
m_device_status = new Button(m_table_head_panel, _L("Device Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE);
m_device_status->SetBackgroundColor(head_bg);
m_device_status->SetFont(TABLE_HEAD_FONT);
m_device_status->SetCornerRadius(0);
@ -1212,7 +1207,7 @@ wxPanel* SendMultiMachinePage::create_page()
//m_table_head_sizer->Add(m_task_status, 0, wxALIGN_CENTER_VERTICAL, 0);
m_ams = new Button(m_table_head_panel, _L("Ams Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE, false);
m_ams = new Button(m_table_head_panel, _L("Ams Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE, false);
m_ams->SetBackgroundColor(head_bg);
m_ams->SetCornerRadius(0);
m_ams->SetFont(TABLE_HEAD_FONT);
@ -1233,7 +1228,7 @@ wxPanel* SendMultiMachinePage::create_page()
});
m_table_head_sizer->Add(m_ams, 0, wxALIGN_CENTER_VERTICAL, 0);
m_refresh_button = new Button(m_table_head_panel, "", "mall_control_refresh", wxNO_BORDER, ICON_SIZE, false);
m_refresh_button = new Button(m_table_head_panel, "", "mall_control_refresh", wxNO_BORDER, MM_ICON_SIZE, false);
m_refresh_button->SetBackgroundColor(head_bg);
m_refresh_button->SetCornerRadius(0);
m_refresh_button->SetFont(TABLE_HEAD_FONT);
@ -1385,7 +1380,6 @@ void SendMultiMachinePage::sync_ams_list()
BitmapCache bmcache;
MaterialHash::iterator iter = m_material_list.begin();
while (iter != m_material_list.end()) {
int id = iter->first;
Material* item = iter->second;
item->item->Destroy();
delete item;
@ -1414,7 +1408,6 @@ void SendMultiMachinePage::sync_ams_list()
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent& e) {
MaterialHash::iterator iter = m_material_list.begin();
while (iter != m_material_list.end()) {
int id = iter->first;
Material* item = iter->second;
MaterialItem* m = item->item;
m->on_normal();
@ -1424,9 +1417,6 @@ void SendMultiMachinePage::sync_ams_list()
m_current_filament_id = extruder;
item->on_selected();
auto mouse_pos = ClientToScreen(e.GetPosition());
wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
// update ams data
if (get_value_radio("use_ams")) {
if (m_mapping_popup->IsShown()) return;
@ -1656,7 +1646,7 @@ void SendMultiMachinePage::init_timer()
m_refresh_timer = new wxTimer();
}
void SendMultiMachinePage::on_timer(wxTimerEvent& event)
void SendMultiMachinePage::on_timer()
{
for (auto it = m_device_items.begin(); it != m_device_items.end(); it++) {
it->second->sync_state();

View file

@ -194,7 +194,7 @@ protected:
void on_set_finish_mapping(wxCommandEvent& evt);
void on_rename_click(wxCommandEvent& event);
void on_timer(wxTimerEvent& event);
void on_timer();
void init_timer();
private:

View file

@ -443,7 +443,7 @@ static std::string generate_system_info_json()
pt::ptree hw_node;
{
hw_node.put("ArchName", wxPlatformInfo::Get().GetArchName());
hw_node.put("ArchName", wxPlatformInfo::Get().GetBitnessName());
size_t num = std::round(Slic3r::total_physical_memory()/107374100.);
hw_node.put("RAM_GiB", std::to_string(num / 10) + "." + std::to_string(num % 10));
}

View file

@ -59,7 +59,6 @@ wxString SendToPrinterDialog::format_text(wxString &m_msg)
wxString out_txt = m_msg;
wxString count_txt = "";
int new_line_pos = 0;
for (int i = 0; i < m_msg.length(); i++) {
auto text_size = m_statictext_printer_msg->GetTextExtent(count_txt);
@ -1338,11 +1337,6 @@ void SendToPrinterDialog::set_default()
Layout();
Fit();
wxSize screenSize = wxGetDisplaySize();
auto dialogSize = this->GetSize();
// basic info
auto aprint_stats = m_plater->get_partplate_list().get_current_fff_print().print_statistics();
wxString time;

View file

@ -224,8 +224,8 @@ void NotificationManager::SlicingProgressNotification::render(GLCanvas3D& canvas
const float progress_panel_width = (m_window_width - 2 * progress_child_window_padding.x);
const float progress_panel_height = (58.0f * scale);
const float dailytips_panel_width = (m_window_width - 2 * dailytips_child_window_padding.x);
const float gcodeviewer_height = wxGetApp().plater()->get_preview_canvas3D()->get_gcode_viewer().get_legend_height();
//const float dailytips_panel_height = std::min(380.0f * scale, std::max(90.0f, (cnv_size.get_height() - gcodeviewer_height - progress_panel_height - dailytips_child_window_padding.y - initial_y - m_line_height * 4)));
// const float gcodeviewer_height = wxGetApp().plater()->get_preview_canvas3D()->get_gcode_viewer().get_legend_height();
// const float dailytips_panel_height = std::min(380.0f * scale, std::max(90.0f, (cnv_size.get_height() - gcodeviewer_height - progress_panel_height - dailytips_child_window_padding.y - initial_y - m_line_height * 4)));
const float dailytips_panel_height = 125.0f * scale;
float right_gap = right_margin + (move_from_overlay ? overlay_width + m_line_height * 5 : 0);

View file

@ -291,7 +291,6 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
});
m_button_pause_resume->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
auto buf = m_button_pause_resume->GetClientData();
if (m_button_pause_resume->GetToolTipText() == _L("Pause")) {
m_button_pause_resume->SetBitmap_("print_control_pause");
}
@ -2528,7 +2527,7 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
}
bool light_on = obj->chamber_light != MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_OFF;
BOOST_LOG_TRIVIAL(trace) << "light: " << light_on ? "on" : "off";
BOOST_LOG_TRIVIAL(trace) << "light: " << (light_on ? "on" : "off");
if (m_switch_lamp_timeout > 0)
m_switch_lamp_timeout--;
else {
@ -2592,7 +2591,6 @@ void StatusPanel::update_ams(MachineObject *obj)
}
bool is_support_virtual_tray = obj->ams_support_virtual_tray;
bool is_support_filament_backup = obj->is_support_filament_backup;
AMSModel ams_mode = AMSModel::GENERIC_AMS;
if (obj) {
@ -2663,9 +2661,6 @@ void StatusPanel::update_ams(MachineObject *obj)
std::string curr_ams_id = m_ams_control->GetCurentAms();
std::string curr_can_id = m_ams_control->GetCurrentCan(curr_ams_id);
bool is_vt_tray = false;
if (obj->m_tray_tar == std::to_string(VIRTUAL_TRAY_ID))
is_vt_tray = true;
// set segment 1, 2
if (obj->m_tray_now == std::to_string(VIRTUAL_TRAY_ID) ) {
@ -4907,7 +4902,6 @@ wxBoxSizer *ScoreDialog::get_button_sizer()
if (m_upload_status_code == StatusCode::UPLOAD_PROGRESS) {
int need_upload_nums = need_upload_images.size();
int upload_nums = 0;
int upload_failed_nums = 0;
ProgressDialog *progress_dialog = new ProgressDialog(_L("Upload Pictrues"), _L("Number of images successfully uploaded") + ": " + std::to_string(upload_nums) + "/" + std::to_string(need_upload_nums), need_upload_nums, this);
for (std::set<std::pair<wxStaticBitmap *, wxString>>::iterator it = need_upload_images.begin(); it != need_upload_images.end();) {
std::pair<wxStaticBitmap *, wxString> need_upload = *it;

View file

@ -1221,7 +1221,7 @@ void Tab::msw_rescale()
// recreate and set new ImageList for tree_ctrl
m_icons->RemoveAll();
m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false);
for (ScalableBitmap& bmp : m_scaled_icons_list)
// for (ScalableBitmap& bmp : m_scaled_icons_list)
//m_icons->Add(bmp.bmp());
m_tabctrl->AssignImageList(m_icons);
@ -1255,7 +1255,7 @@ void Tab::sys_color_changed()
// recreate and set new ImageList for tree_ctrl
m_icons->RemoveAll();
m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false);
for (ScalableBitmap& bmp : m_scaled_icons_list)
// for (ScalableBitmap& bmp : m_scaled_icons_list)
//m_icons->Add(bmp.bmp());
m_tabctrl->AssignImageList(m_icons);
@ -1609,19 +1609,6 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
}
// -1 means caculate all
auto update_flush_volume = [](int idx = -1) {
if (idx < 0) {
size_t filament_size = wxGetApp().plater()->get_extruder_colors_from_plater_config().size();
for (size_t i = 0; i < filament_size; ++i)
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(i);
}
else
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx);
};
string opt_key_without_idx = opt_key.substr(0, opt_key.find('#'));
if (opt_key_without_idx == "long_retractions_when_cut") {
@ -2588,8 +2575,6 @@ void TabPrintModel::update_model_config()
// Reset m_config manually because there's no corresponding config in m_parent_tab->m_config
for (auto plate_item : m_object_configs) {
const DynamicPrintConfig& plate_config = plate_item.second->get();
BedType plate_bed_type = (BedType)0;
PrintSequence plate_print_seq = (PrintSequence)0;
if (!plate_config.has("curr_bed_type")) {
// same as global
DynamicConfig& global_cfg = wxGetApp().preset_bundle->project_config;
@ -2900,7 +2885,6 @@ void TabPrintPlate::on_value_change(const std::string& opt_key, const boost::any
void TabPrintPlate::notify_changed(ObjectBase* object)
{
auto plate = dynamic_cast<PartPlate*>(object);
auto objects_list = wxGetApp().obj_list();
wxDataViewItemArray items;
objects_list->GetSelections(items);
@ -4680,14 +4664,14 @@ void Tab::rebuild_page_tree()
if (sel_item == m_last_select_item)
m_last_select_item = item;
else
m_last_select_item = NULL;
m_last_select_item = 0;
// allow activate page before selection of a page_tree item
m_disable_tree_sel_changed_event = false;
//BBS: GUI refactor
if (item >= 0)
{
bool ret = update_current_page_in_background(item);
update_current_page_in_background(item);
//if m_active_page is changed in update_current_page_in_background
//will just update the selected item of the treectrl
if (m_parent->is_active_and_shown_tab(this)) // FIX: modify state not update
@ -5507,7 +5491,6 @@ void Tab::delete_preset()
if (m_presets->get_preset_base(current_preset) == &current_preset) { //root preset
is_base_preset = true;
if (current_preset.type == Preset::Type::TYPE_PRINTER && !current_preset.is_system) { //Customize third-party printers
Preset &current_preset = m_presets->get_selected_preset();
int filament_preset_num = 0;
int process_preset_num = 0;
for (const Preset &preset : m_preset_bundle->filaments.get_presets()) {
@ -5771,7 +5754,6 @@ wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL);
btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) {
bool is_configed_by_BBL = PresetUtils::system_printer_bed_model(m_preset_bundle->printers.get_edited_preset()).size() > 0;
BedShapeDialog dlg(this);
dlg.build_dialog(*m_config->option<ConfigOptionPoints>("printable_area"),
*m_config->option<ConfigOptionString>("bed_custom_texture"),

View file

@ -198,8 +198,6 @@ public:
// check that only the selected page is visible and others are hidden:
for (size_t page = 0; page < m_pages.size(); page++) {
wxWindow* win_a = GetPage(page);
wxWindow* win_b = GetPage(n);
if (page != n && GetPage(page) != GetPage(n)) {
m_pages[page]->Hide();
}

View file

@ -1654,7 +1654,7 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres
const DynamicPrintConfig& new_config = presets->get_edited_preset().config;
type = presets->type();
const std::map<wxString, std::string>& category_icon_map = wxGetApp().get_tab(type)->get_category_icon_map();
// const std::map<wxString, std::string>& category_icon_map = wxGetApp().get_tab(type)->get_category_icon_map();
//m_tree->model->AddPreset(type, from_u8(presets->get_edited_preset().name), old_pt);

View file

@ -24,12 +24,11 @@
namespace Slic3r {
namespace GUI {
static const char* URL_CHANGELOG = "%1%";
static const char* URL_DOWNLOAD = "%1%";
static const char* URL_DEV = "%1%";
static const std::string CONFIG_UPDATE_WIKI_URL("");
// Orca: Replace static char* with macro defs
// currently disabled until needed
// #define URL_CHANGELOG "%1%"
// #define URL_DOWNLOAD "%1%"
// #define URL_DEV "%1%"
// MsgUpdateSlic3r

View file

@ -670,8 +670,6 @@ void MachineInfoPanel::update_ams_ext(MachineObject *obj)
show_ams(true);
std::map<int, MachineObject::ModuleVersionInfo> ver_list = obj->get_ams_version();
AmsPanelHash::iterator iter = m_amspanel_list.begin();
for (auto i = 0; i < m_amspanel_list.GetCount(); i++) {
AmsPanel* amspanel = m_amspanel_list[i];
amspanel->Hide();

View file

@ -25,7 +25,6 @@ void UserManager::set_agent(NetworkAgent* agent)
int UserManager::parse_json(std::string payload)
{
bool restored_json = false;
json j;
json j_pre = json::parse(payload);
if (j_pre.empty()) {
@ -41,7 +40,7 @@ int UserManager::parse_json(std::string payload)
//bind
if (j_pre["bind"]["command"].get<std::string>() == "bind") {
std::string dev_id;
std:; string result;
std::string result;
if (j_pre["bind"].contains("dev_id")) {
dev_id = j_pre["bind"]["dev_id"].get<std::string>();

View file

@ -1,27 +1,17 @@
#include "WebDownPluginDlg.hpp"
#include "ConfigWizard.hpp"
#include <string.h>
#include "I18N.hpp"
#include "libslic3r/AppConfig.hpp"
#include "slic3r/GUI/wxExtensions.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "libslic3r_version.h"
#include <wx/sizer.h>
#include <wx/toolbar.h>
#include <wx/textdlg.h>
#include <wx/wx.h>
#include <wx/fileconf.h>
#include <wx/file.h>
#include <wx/wfstream.h>
#include <boost/cast.hpp>
#include <boost/lexical_cast.hpp>
#include "MainFrame.hpp"
#include <boost/dll.hpp>
#include <slic3r/GUI/Widgets/WebView.hpp>
#include <slic3r/Utils/Http.hpp>
#include <libslic3r/miniz_extension.hpp>
@ -227,7 +217,7 @@ void DownPluginFrame::OnScriptMessage(wxWebViewEvent &evt)
auto plugin_folder = (boost::filesystem::path(wxStandardPaths::Get().GetUserDataDir().ToUTF8().data()) / "plugins").make_preferred().string();
desktop_open_any_folder(plugin_folder);
}
} catch (std::exception &e) {
} catch (std::exception&) {
// wxMessageBox(e.what(), "json Exception", MB_OK);
}
}

View file

@ -882,13 +882,13 @@ bool GuideFrame::apply_config(AppConfig *app_config, PresetBundle *preset_bundle
}
std::string first_added_filament;
auto get_first_added_material_preset = [this, app_config](const std::string& section_name, std::string& first_added_preset) {
/*auto get_first_added_material_preset = [this, app_config](const std::string& section_name, std::string& first_added_preset) {
if (m_appconfig_new.has_section(section_name)) {
// get first of new added preset names
const std::map<std::string, std::string>& old_presets = app_config->has_section(section_name) ? app_config->get_section(section_name) : std::map<std::string, std::string>();
first_added_preset = get_first_added_preset(old_presets, m_appconfig_new.get_section(section_name));
}
};
};*/
// Not switch filament
//get_first_added_material_preset(AppConfig::SECTION_FILAMENTS, first_added_filament);
@ -949,7 +949,6 @@ bool GuideFrame::run()
BOOST_LOG_TRIVIAL(info) << "GuideFrame cancelled";
if (app.preset_bundle->printers.only_default_printers()) {
//we install the default here
bool apply_keeped_changes = false;
//clear filament section and use default materials
app.app_config->set_variant(PresetBundle::BBL_BUNDLE,
PresetBundle::BBL_DEFAULT_PRINTER_MODEL, PresetBundle::BBL_DEFAULT_PRINTER_VARIANT, "true");
@ -1129,7 +1128,7 @@ int GuideFrame::LoadProfile()
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
strVendor = strVendor.AfterLast( '\\');
strVendor = strVendor.AfterLast('\/');
strVendor = strVendor.AfterLast('/');
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
if (w2s(strVendor) == PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json") == 0)
@ -1148,7 +1147,7 @@ int GuideFrame::LoadProfile()
//cout << iter->path().string() << endl;
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
strVendor = strVendor.AfterLast( '\\');
strVendor = strVendor.AfterLast('\/');
strVendor = strVendor.AfterLast('/');
wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower();
if (w2s(strVendor) != PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json")==0)
@ -1530,9 +1529,6 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Vendor: " << strVendor <<", tFilaList Add: " << s1;
}
int nFalse = 0;
int nModel = 0;
int nFinish = 0;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% filaments") % nsize;
for (int n = 0; n < nsize; n++) {
json OneFF = pFilament.at(n);
@ -1642,7 +1638,7 @@ std::string GuideFrame::w2s(wxString sSrc)
void GuideFrame::GetStardardFilePath(std::string &FilePath) {
StrReplace(FilePath, "\\", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
StrReplace(FilePath, "\/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
StrReplace(FilePath, "/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator)));
}
bool GuideFrame::LoadFile(std::string jPath, std::string &sContent)

View file

@ -3,7 +3,6 @@
#include <string.h>
#include "I18N.hpp"
#include "libslic3r/AppConfig.hpp"
#include "slic3r/GUI/wxExtensions.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "libslic3r_version.h"
@ -13,11 +12,9 @@
#include <wx/wx.h>
#include <wx/fileconf.h>
#include <wx/file.h>
#include <wx/wfstream.h>
#include <boost/cast.hpp>
#include <boost/lexical_cast.hpp>
#include <nlohmann/json.hpp>
#include "MainFrame.hpp"

View file

@ -5,7 +5,6 @@
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/MainFrame.hpp"
#include "libslic3r_version.h"
#include "../Utils/Http.hpp"
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>

View file

@ -137,7 +137,7 @@ void AMSrefresh::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, con
wxWindow::Create(parent, id, pos, size, wxBORDER_NONE);
SetBackgroundColour(AMS_CONTROL_DEF_BLOCK_BK_COLOUR);
Bind(wxEVT_TIMER, &AMSrefresh::on_timer, this);
Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); });
Bind(wxEVT_PAINT, &AMSrefresh::paintEvent, this);
Bind(wxEVT_ENTER_WINDOW, &AMSrefresh::OnEnterWindow, this);
Bind(wxEVT_LEAVE_WINDOW, &AMSrefresh::OnLeaveWindow, this);
@ -166,14 +166,14 @@ void AMSrefresh::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, con
m_playing_timer = new wxTimer();
m_playing_timer->SetOwner(this);
wxPostEvent(this, wxTimerEvent());
on_timer();
SetSize(AMS_REFRESH_SIZE);
SetMinSize(AMS_REFRESH_SIZE);
SetMaxSize(AMS_REFRESH_SIZE);
}
void AMSrefresh::on_timer(wxTimerEvent &event)
void AMSrefresh::on_timer()
{
//if (m_rotation_angle >= m_rfid_bitmap_list.size()) {
// m_rotation_angle = 0;
@ -472,7 +472,7 @@ void AMSextruder::doRender(wxDC& dc)
{
//m_current_colur =
wxSize size = GetSize();
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
if (!m_none_ams_mode) {
@ -484,24 +484,24 @@ void AMSextruder::doRender(wxDC& dc)
if (m_vams_loading) {
if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxSOLID)); }
else { dc.SetPen(wxPen(m_current_colur, 6, wxSOLID)); }
if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxPENSTYLE_SOLID)); }
else { dc.SetPen(wxPen(m_current_colur, 6, wxPENSTYLE_SOLID)); }
dc.DrawRoundedRectangle(-size.x / 2, size.y * 0.1, size.x, size.y, 4);
if ((m_current_colur == *wxWHITE || m_current_colur.Alpha() == 0) && !wxGetApp().dark_mode()) {
dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxPENSTYLE_SOLID));
dc.DrawRoundedRectangle(-size.x / 2 - FromDIP(3), size.y * 0.1 + FromDIP(3), size.x, size.y, 3);
dc.DrawRoundedRectangle(-size.x / 2 + FromDIP(3), size.y * 0.1 - FromDIP(3), size.x, size.y, 5);
}
}
if (m_ams_loading && !m_none_ams_mode) {
if (m_current_colur.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, 6, wxSOLID));}
else {dc.SetPen(wxPen(m_current_colur, 6, wxSOLID));}
if (m_current_colur.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, 6, wxPENSTYLE_SOLID));}
else {dc.SetPen(wxPen(m_current_colur, 6, wxPENSTYLE_SOLID));}
dc.DrawLine(size.x / 2, -1, size.x / 2, size.y * 0.6 - 1);
if ((m_current_colur == *wxWHITE || m_current_colur.Alpha() == 0) && !wxGetApp().dark_mode()) {
dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxPENSTYLE_SOLID));
dc.DrawLine(size.x / 2 - FromDIP(4), -1, size.x / 2 - FromDIP(3), size.y * 0.6 - 1);
dc.DrawLine(size.x / 2 + FromDIP(3), -1, size.x / 2 + FromDIP(3), size.y * 0.6 - 1);
}
@ -509,12 +509,12 @@ void AMSextruder::doRender(wxDC& dc)
}
else {
if (m_ams_loading) {
if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxSOLID)); }
else { dc.SetPen(wxPen(m_current_colur, 6, wxSOLID)); }
if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxPENSTYLE_SOLID)); }
else { dc.SetPen(wxPen(m_current_colur, 6, wxPENSTYLE_SOLID)); }
dc.DrawLine(size.x / 2, -1, size.x / 2, size.y * 0.6 - 1);
if ((m_current_colur == *wxWHITE || m_current_colur.Alpha() == 0) && !wxGetApp().dark_mode()) {
dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxPENSTYLE_SOLID));
dc.DrawLine(size.x / 2 - FromDIP(4), -1, size.x / 2 - FromDIP(3), size.y * 0.6 - 1);
dc.DrawLine(size.x / 2 + FromDIP(3), -1, size.x / 2 + FromDIP(3), size.y * 0.6 - 1);
}
@ -587,18 +587,18 @@ void AMSVirtualRoad::doRender(wxDC& dc)
wxSize size = GetSize();
if (m_vams_loading) {
if (m_current_color.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxSOLID)); }
else { dc.SetPen(wxPen(m_current_color, 6, wxSOLID)); }
if (m_current_color.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxPENSTYLE_SOLID)); }
else { dc.SetPen(wxPen(m_current_color, 6, wxPENSTYLE_SOLID)); }
}
else {
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID));
}
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
dc.DrawRoundedRectangle(size.x / 2, -size.y / 1.1 + FromDIP(1), size.x, size.y, 4);
if ((m_current_color == *wxWHITE || m_current_color.Alpha() == 0) && !wxGetApp().dark_mode()) {
dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxPENSTYLE_SOLID));
dc.DrawRoundedRectangle(size.x / 2 - FromDIP(3), -size.y / 1.1 + FromDIP(4), size.x, size.y, 5);
dc.DrawRoundedRectangle(size.x / 2 + FromDIP(3), -size.y / 1.1 - FromDIP(2), size.x, size.y, 3);
}
@ -988,11 +988,11 @@ void AMSLib::render_extra_lib(wxDC& dc)
//draw road
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
if (m_pass_road) {
dc.SetPen(wxPen(m_info.material_colour, 6, wxSOLID));
dc.SetPen(wxPen(m_info.material_colour, 6, wxPENSTYLE_SOLID));
}
if (m_can_index == 0 || m_can_index == 3) {
@ -1114,9 +1114,9 @@ void AMSLib::render_generic_lib(wxDC &dc)
// selected
if (m_selected) {
dc.SetPen(wxPen(tmp_lib_colour, 2, wxSOLID));
dc.SetPen(wxPen(tmp_lib_colour, 2, wxPENSTYLE_SOLID));
if (tmp_lib_colour.Alpha() == 0) {
dc.SetPen(wxPen(wxColour(tmp_lib_colour.Red(), tmp_lib_colour.Green(),tmp_lib_colour.Blue(),128), 2, wxSOLID));
dc.SetPen(wxPen(wxColour(tmp_lib_colour.Red(), tmp_lib_colour.Green(),tmp_lib_colour.Blue(),128), 2, wxPENSTYLE_SOLID));
}
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
if (m_radius == 0) {
@ -1131,7 +1131,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
}
if (!m_selected && m_hover) {
dc.SetPen(wxPen(AMS_CONTROL_BRAND_COLOUR, 2, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_BRAND_COLOUR, 2, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
if (m_radius == 0) {
dc.DrawRectangle(0, 0, size.x, size.y);
@ -1144,7 +1144,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
dc.SetBrush(wxBrush(tmp_lib_colour));
}
else {
dc.SetPen(wxPen(tmp_lib_colour, 1, wxSOLID));
dc.SetPen(wxPen(tmp_lib_colour, 1, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(tmp_lib_colour));
}
@ -1230,7 +1230,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
dc.SetBrush(wxBrush(tmp_lib_colour));
}
else {
dc.SetPen(wxPen(tmp_lib_colour, 1, wxSOLID));
dc.SetPen(wxPen(tmp_lib_colour, 1, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(tmp_lib_colour));
}
}
@ -1260,7 +1260,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
#endif
}
if (tmp_lib_colour.Red() > 238 && tmp_lib_colour.Green() > 238 && tmp_lib_colour.Blue() > 238) {
dc.SetPen(wxPen(wxColour(130, 129, 128), 1, wxSOLID));
dc.SetPen(wxPen(wxColour(130, 129, 128), 1, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
dc.DrawLine(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(4), FromDIP(4) + top);
}
@ -1268,10 +1268,10 @@ void AMSLib::render_generic_lib(wxDC &dc)
else {
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
if (tmp_lib_colour.Red() > 238 && tmp_lib_colour.Green() > 238 && tmp_lib_colour.Blue() > 238) {
dc.SetPen(wxPen(wxColour(130, 129, 128), 2, wxSOLID));
dc.SetPen(wxPen(wxColour(130, 129, 128), 2, wxPENSTYLE_SOLID));
}
else {
dc.SetPen(wxPen(tmp_lib_colour, 2, wxSOLID));
dc.SetPen(wxPen(tmp_lib_colour, 2, wxPENSTYLE_SOLID));
}
#ifdef __APPLE__
@ -1285,7 +1285,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
}
//border
dc.SetPen(wxPen(wxColour(130, 130, 128), 1, wxSOLID));
dc.SetPen(wxPen(wxColour(130, 130, 128), 1, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
#ifdef __APPLE__
dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4), size.x - FromDIP(7), size.y - FromDIP(7), m_radius);
@ -1371,7 +1371,6 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in
m_info = info;
m_canindex = canindex;
// road type
auto mode = AMSRoadMode::AMS_ROAD_MODE_END;
if (m_canindex == 0 && maxcan == 1) {
m_rode_mode = AMSRoadMode::AMS_ROAD_MODE_NONE;
} else if (m_canindex == 0 && maxcan > 1) {
@ -1492,7 +1491,7 @@ void AMSRoad::doRender(wxDC &dc)
{
wxSize size = GetSize();
dc.SetPen(wxPen(m_road_def_color, 2, wxSOLID));
dc.SetPen(wxPen(m_road_def_color, 2, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
// left mode
if (m_rode_mode == AMSRoadMode::AMS_ROAD_MODE_LEFT) { dc.DrawRoundedRectangle(-10, -10, size.x / 2 + 10, size.y * 0.6 + 10, 4); }
@ -1535,8 +1534,8 @@ void AMSRoad::doRender(wxDC &dc)
// mode none
// if (m_pass_rode_mode.size() == 1 && m_pass_rode_mode[0] == AMSPassRoadMode::AMS_ROAD_MODE_NONE) return;
if (m_road_color.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, m_passroad_width, wxSOLID));}
else {dc.SetPen(wxPen(m_road_color, m_passroad_width, wxSOLID));}
if (m_road_color.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, m_passroad_width, wxPENSTYLE_SOLID));}
else {dc.SetPen(wxPen(m_road_color, m_passroad_width, wxPENSTYLE_SOLID));}
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
@ -1563,7 +1562,7 @@ void AMSRoad::doRender(wxDC &dc)
// end mode
if (m_rode_mode == AMSRoadMode::AMS_ROAD_MODE_END || m_rode_mode == AMSRoadMode::AMS_ROAD_MODE_END_ONLY) {
dc.SetPen(wxPen(m_road_def_color, 2, wxSOLID));
dc.SetPen(wxPen(m_road_def_color, 2, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(m_road_def_color));
dc.DrawRoundedRectangle(size.x * 0.37 / 2, size.y * 0.6 - size.y / 6, size.x * 0.63, size.y / 3, m_radius);
}
@ -2244,7 +2243,7 @@ void AmsCans::doRender(wxDC& dc)
// A1
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
try
@ -2285,32 +2284,32 @@ void AmsCans::doRender(wxDC& dc)
if (!m_road_canid.empty()) {
if (m_road_canid == "0") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID));
dc.DrawLine(a1_left, FromDIP(30), a1_left, a1_top);
dc.DrawLine(a1_left, a1_top, end_top, a1_top);
}
if (m_road_canid == "1") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID));
dc.DrawLine(a2_left, FromDIP(160), a2_left, a2_top);
dc.DrawLine(a2_left, a2_top, end_top, a2_top);
}
if (m_road_canid == "2") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID));
dc.DrawLine(a3_left, FromDIP(160), a3_left, a3_top);
dc.DrawLine(a3_left, a3_top, end_top, a3_top);
}
if (m_road_canid == "3") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID));
dc.DrawLine(a4_left, FromDIP(30), a4_left, a4_top);
dc.DrawLine(a4_left, a4_top, end_top, a4_top);
}
}
//to Extruder
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
dc.DrawLine(end_top, a1_top, end_top, size.y);
@ -2318,19 +2317,19 @@ void AmsCans::doRender(wxDC& dc)
if (!m_road_canid.empty()) {
if (!m_road_canid.empty()) {
if (m_road_canid == "0") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID));
dc.DrawLine(end_top, a1_top, end_top, size.y);
}
else if (m_road_canid == "1") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID));
dc.DrawLine(end_top, a2_top, end_top, size.y);
}
else if (m_road_canid == "2") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID));
dc.DrawLine(end_top, a3_top, end_top, size.y);
}
else if (m_road_canid == "3") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID));
dc.DrawLine(end_top, a4_top, end_top, size.y);
}
}
@ -3100,7 +3099,6 @@ void AMSControl::SetClibrationLink(wxString link)
void AMSControl::PlayRridLoading(wxString amsid, wxString canid)
{
AmsCansHash::iterator iter = m_ams_cans_list.begin();
auto count_item_index = 0;
for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) {
AmsCansWindow *cans = m_ams_cans_list[i];
@ -3112,7 +3110,6 @@ void AMSControl::PlayRridLoading(wxString amsid, wxString canid)
void AMSControl::StopRridLoading(wxString amsid, wxString canid)
{
AmsCansHash::iterator iter = m_ams_cans_list.begin();
auto count_item_index = 0;
for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) {
AmsCansWindow *cans = m_ams_cans_list[i];

Some files were not shown because too many files have changed in this diff Show more