mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-12 02:11:39 +00:00
Merge branch 'main' into belt-printer
This commit is contained in:
@@ -298,11 +298,7 @@
|
||||
#include "DeviceCore/DevConfigUtil.h"
|
||||
#include "DeviceCore/DevDefs.h"
|
||||
|
||||
using boost::optional;
|
||||
namespace fs = boost::filesystem;
|
||||
using Slic3r::_3DScene;
|
||||
using Slic3r::Preset;
|
||||
using Slic3r::GUI::format_wxstr;
|
||||
using namespace nlohmann;
|
||||
|
||||
static const std::pair<unsigned int, unsigned int> THUMBNAIL_SIZE_3MF = { 512, 512 };
|
||||
@@ -363,7 +359,7 @@ wxDEFINE_EVENT(EVT_NOTICE_FULL_SCREEN_CHANGED, IntEvent);
|
||||
#define PRINTER_PANEL_RADIUS (6) // ORCA
|
||||
#define BTN_SYNC_SIZE (wxSize(FromDIP(96), FromDIP(98)))
|
||||
|
||||
static string get_diameter_string(float diameter)
|
||||
static std::string get_diameter_string(float diameter)
|
||||
{
|
||||
std::ostringstream stream; // ORCA ensure 0.25 returned as 0.25. previous code returned as 0.2 because of std::setprecision(1)
|
||||
stream << std::fixed << std::setprecision(2) << diameter; // Use 2 decimals to capture 0.25 / 0.15 reliably
|
||||
@@ -6329,7 +6325,7 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn)
|
||||
}
|
||||
|
||||
// BBS:Record consumables information before synchronization
|
||||
std::vector<string> color_before_sync;
|
||||
std::vector<std::string> color_before_sync;
|
||||
std::vector<bool> is_support_before;
|
||||
DynamicPrintConfig& project_config = wxGetApp().preset_bundle->project_config;
|
||||
ConfigOptionStrings* color_opt = project_config.option<ConfigOptionStrings>("filament_colour");
|
||||
@@ -8118,13 +8114,13 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_TAB, [this](SimpleEvent&) { select_next_view_3D(); });
|
||||
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_COLLAPSE_SIDEBAR, [this](SimpleEvent&) { this->q->collapse_sidebar(!this->q->is_sidebar_collapsed()); });
|
||||
preview->get_wxglcanvas()->Bind(EVT_CUSTOMEVT_TICKSCHANGED, [this](wxCommandEvent& event) {
|
||||
Type tick_event_type = (Type)event.GetInt();
|
||||
CustomGCode::Type tick_event_type = (CustomGCode::Type)event.GetInt();
|
||||
Model& model = wxGetApp().plater()->model();
|
||||
//BBS: replace model custom gcode with current plate custom gcode
|
||||
model.plates_custom_gcodes[model.curr_plate_index] = preview->get_canvas3d()->get_gcode_viewer().get_layers_slider()->GetTicksValues();
|
||||
|
||||
// BBS set to invalid state only
|
||||
if (tick_event_type == Type::ToolChange || tick_event_type == Type::Custom || tick_event_type == Type::Template || tick_event_type == Type::PausePrint) {
|
||||
if (tick_event_type == CustomGCode::Type::ToolChange || tick_event_type == CustomGCode::Type::Custom || tick_event_type == CustomGCode::Type::Template || tick_event_type == CustomGCode::Type::PausePrint) {
|
||||
PartPlate *plate = this->q->get_partplate_list().get_curr_plate();
|
||||
if (plate) {
|
||||
plate->update_slice_result_valid_state(false);
|
||||
@@ -12787,7 +12783,7 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
|
||||
Vec3d old_plate_pos = old_plate->get_center_origin();
|
||||
|
||||
// BBS: Save the model in the current platelist
|
||||
std::vector<vector<int> > plate_object;
|
||||
std::vector<std::vector<int> > plate_object;
|
||||
for (size_t i = 0; i < old_plate_list.get_plate_count(); ++i) {
|
||||
PartPlate* plate = old_plate_list.get_plate(i);
|
||||
std::vector<int> obj_idxs;
|
||||
@@ -18387,7 +18383,7 @@ bool Plater::load_files(const wxArrayString& filenames)
|
||||
|
||||
// Orca: Iters through given paths and imports files from zip then remove zip from paths
|
||||
// returns true if zip files were found
|
||||
auto handle_zips = [this](vector<fs::path>& paths) { // NOLINT(*-no-recursion) - Recursion is intended and should be managed properly
|
||||
auto handle_zips = [this](std::vector<fs::path>& paths) { // NOLINT(*-no-recursion) - Recursion is intended and should be managed properly
|
||||
bool res = false;
|
||||
for (auto it = paths.begin(); it != paths.end();) {
|
||||
if (boost::algorithm::iends_with(it->string(), ".zip")) {
|
||||
@@ -20952,7 +20948,7 @@ void Plater::on_filaments_delete(size_t num_filaments, size_t filament_id, int r
|
||||
|
||||
// update customize gcode
|
||||
for (auto item = p->model.plates_custom_gcodes.begin(); item != p->model.plates_custom_gcodes.end(); ++item) {
|
||||
auto iter = std::remove_if(item->second.gcodes.begin(), item->second.gcodes.end(), [filament_id](const Item& gcode_item) {
|
||||
auto iter = std::remove_if(item->second.gcodes.begin(), item->second.gcodes.end(), [filament_id](const CustomGCode::Item& gcode_item) {
|
||||
return (gcode_item.type == CustomGCode::Type::ToolChange && gcode_item.extruder == filament_id + 1);
|
||||
});
|
||||
if (replace_filament_id == -1)
|
||||
|
||||
Reference in New Issue
Block a user