mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-26 10:21:00 +00:00
Merge branch 'main' into feature/filament_id
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "libslic3r/Utils.hpp"
|
||||
#include "libslic3r/Color.hpp"
|
||||
#include "BuildCommit.hpp"
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "MainFrame.hpp"
|
||||
@@ -245,7 +246,7 @@ AboutDialog::AboutDialog()
|
||||
vesizer->Add(0, 0, 1, wxEXPAND, FromDIP(5));
|
||||
auto version_string = std::string(SoftFever_VERSION); // _L("Orca Slicer ") + " " + std::string(SoftFever_VERSION);
|
||||
wxStaticText* version = new wxStaticText(this, wxID_ANY, version_string.c_str(), wxDefaultPosition, wxDefaultSize);
|
||||
wxStaticText* credits_string = new wxStaticText(this, wxID_ANY, wxString::Format("Build %s", std::string(GIT_COMMIT_HASH)), wxDefaultPosition, wxDefaultSize);
|
||||
wxStaticText* credits_string = new wxStaticText(this, wxID_ANY, wxString::Format("Build %s", build_commit_label), wxDefaultPosition, wxDefaultSize);
|
||||
credits_string->SetFont(_build_string_font);
|
||||
wxFont version_font = GetFont();
|
||||
version_font = version_font.Scaled(1.85f); // SetPointSize(20) not works on macOS because it uses a 72 PPI reference
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "BuildCommit.hpp"
|
||||
#include "git_commit_hash.h"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
const char *const build_commit_hash = GIT_COMMIT_HASH;
|
||||
const char *const build_commit_label = GIT_COMMIT_HASH GIT_COMMIT_SUFFIX;
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
// Read these rather than including git_commit_hash.h, which changes with every
|
||||
// commit and rebuilds everything that includes it.
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
// The commit alone, safe to use in a commit URL.
|
||||
extern const char *const build_commit_hash;
|
||||
|
||||
// The same, with "-dirty" when the build had uncommitted changes. Use this
|
||||
// wherever the build is shown to a person.
|
||||
extern const char *const build_commit_label;
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "slic3r/GUI/TaskManager.hpp"
|
||||
#include "format.hpp"
|
||||
#include "libslic3r_version.h"
|
||||
#include "BuildCommit.hpp"
|
||||
#include "Downloader.hpp"
|
||||
#include <boost/chrono/duration.hpp>
|
||||
#include <boost/log/detail/native_typeof.hpp>
|
||||
@@ -2580,7 +2581,7 @@ void GUI_App::init_app_config()
|
||||
set_log_path_and_level(log_filename, 3);
|
||||
#endif
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("gui mode, Current OrcaSlicer Version %1% build %2%") % SoftFever_VERSION % GIT_COMMIT_HASH;
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("gui mode, Current OrcaSlicer Version %1% build %2%") % SoftFever_VERSION % build_commit_label;
|
||||
|
||||
//BBS: remove GCodeViewer as seperate APP logic
|
||||
if (!app_config)
|
||||
|
||||
@@ -494,13 +494,13 @@ void MediaPlayCtrl::ToggleStream()
|
||||
DownloadProgressDialog2(MediaPlayCtrl *ctrl) : DownloadProgressDialog(_L("Downloading Virtual Camera Tools")), ctrl(ctrl) {}
|
||||
struct UpgradeNetworkJob2 : UpgradeNetworkJob
|
||||
{
|
||||
UpgradeNetworkJob2(std::shared_ptr<ProgressIndicator> pri) : UpgradeNetworkJob() {
|
||||
UpgradeNetworkJob2() {
|
||||
name = "cameratools";
|
||||
package_name = "camera_tools.zip";
|
||||
}
|
||||
};
|
||||
std::shared_ptr<UpgradeNetworkJob> make_job(std::shared_ptr<ProgressIndicator> pri)
|
||||
{ return std::make_shared<UpgradeNetworkJob2>(pri); }
|
||||
std::unique_ptr<UpgradeNetworkJob> make_job() override
|
||||
{ return std::make_unique<UpgradeNetworkJob2>(); }
|
||||
void on_finish() override
|
||||
{
|
||||
ctrl->CallAfter([ctrl = this->ctrl] { ctrl->ToggleStream(); });
|
||||
|
||||
@@ -157,7 +157,7 @@ PartPlate::PartPlate()
|
||||
init();
|
||||
}
|
||||
|
||||
PartPlate::PartPlate(PartPlateList *partplate_list, Vec3d origin, int width, int depth, int height, Plater* platerObj, Model* modelObj, bool printable, PrinterTechnology tech)
|
||||
PartPlate::PartPlate(PartPlateList *partplate_list, Vec3d origin, int width, int depth, double height, Plater* platerObj, Model* modelObj, bool printable, PrinterTechnology tech)
|
||||
:m_partplate_list(partplate_list), m_plater(platerObj), m_model(modelObj), printer_technology(tech), m_origin(origin), m_width(width), m_depth(depth), m_height(height), m_printable(printable)
|
||||
{
|
||||
init();
|
||||
@@ -1757,26 +1757,25 @@ std::vector<int> PartPlate::get_extruders_under_cli(bool conside_custom_gcode, D
|
||||
else
|
||||
obj_support = glb_support;
|
||||
|
||||
if (!obj_support)
|
||||
continue;
|
||||
if (obj_support) {
|
||||
int obj_support_intf_extr = 0;
|
||||
const ConfigOption* support_intf_extr_opt = object->config.option("support_interface_filament");
|
||||
if (support_intf_extr_opt != nullptr)
|
||||
obj_support_intf_extr = support_intf_extr_opt->getInt();
|
||||
if (obj_support_intf_extr != 0)
|
||||
plate_extruders.push_back(obj_support_intf_extr);
|
||||
else if (glb_support_intf_extr != 0)
|
||||
plate_extruders.push_back(glb_support_intf_extr);
|
||||
|
||||
int obj_support_intf_extr = 0;
|
||||
const ConfigOption* support_intf_extr_opt = object->config.option("support_interface_filament");
|
||||
if (support_intf_extr_opt != nullptr)
|
||||
obj_support_intf_extr = support_intf_extr_opt->getInt();
|
||||
if (obj_support_intf_extr != 0)
|
||||
plate_extruders.push_back(obj_support_intf_extr);
|
||||
else if (glb_support_intf_extr != 0)
|
||||
plate_extruders.push_back(glb_support_intf_extr);
|
||||
|
||||
int obj_support_extr = 0;
|
||||
const ConfigOption* support_extr_opt = object->config.option("support_filament");
|
||||
if (support_extr_opt != nullptr)
|
||||
obj_support_extr = support_extr_opt->getInt();
|
||||
if (obj_support_extr != 0)
|
||||
plate_extruders.push_back(obj_support_extr);
|
||||
else if (glb_support_extr != 0)
|
||||
plate_extruders.push_back(glb_support_extr);
|
||||
int obj_support_extr = 0;
|
||||
const ConfigOption* support_extr_opt = object->config.option("support_filament");
|
||||
if (support_extr_opt != nullptr)
|
||||
obj_support_extr = support_extr_opt->getInt();
|
||||
if (obj_support_extr != 0)
|
||||
plate_extruders.push_back(obj_support_extr);
|
||||
else if (glb_support_extr != 0)
|
||||
plate_extruders.push_back(glb_support_extr);
|
||||
}
|
||||
|
||||
int obj_outer_wall_extr = 0;
|
||||
if (const ConfigOption* wall_opt = object->config.option("outer_wall_filament_id"); wall_opt != nullptr)
|
||||
@@ -2473,7 +2472,7 @@ void PartPlate::clear(bool clear_sliced_result)
|
||||
|
||||
/* size and position related functions*/
|
||||
//set position and size
|
||||
void PartPlate::set_pos_and_size(Vec3d& origin, int width, int depth, int height, bool with_instance_move, bool do_clear)
|
||||
void PartPlate::set_pos_and_size(Vec3d& origin, int width, int depth, double height, bool with_instance_move, bool do_clear)
|
||||
{
|
||||
bool size_changed = false; //size changed means the machine changed
|
||||
bool pos_changed = false;
|
||||
@@ -2772,10 +2771,10 @@ bool PartPlate::check_outside(int obj_id, int instance_id, BoundingBoxf3* boundi
|
||||
|
||||
if (instance_box.min.z() < SINKING_Z_THRESHOLD) {
|
||||
// Orca: For sinking object, we use a more expensive algorithm so part below build plate won't be considered
|
||||
// m_plater is null in CLI mode.
|
||||
if (m_plater && plate_box.intersects(instance_box)) {
|
||||
// m_height mirrors the printer's printable height and is set in CLI mode too, unlike m_plater.
|
||||
if (plate_box.intersects(instance_box)) {
|
||||
// TODO: FIXME: this does not take exclusion area into account
|
||||
const BuildVolume build_volume(get_shape(), m_plater->build_volume().printable_height(), m_extruder_areas, m_extruder_heights);
|
||||
const BuildVolume build_volume(get_shape(), m_height, m_extruder_areas, m_extruder_heights);
|
||||
const auto state = instance->calc_print_volume_state(build_volume);
|
||||
outside = state == ModelInstancePVS_Partly_Outside;
|
||||
}
|
||||
@@ -4099,7 +4098,7 @@ void PartPlate::on_filament_deleted(int filament_count, int filament_id)
|
||||
|
||||
|
||||
/* PartPlate List related functions*/
|
||||
PartPlateList::PartPlateList(int width, int depth, int height, Plater* platerObj, Model* modelObj, PrinterTechnology tech)
|
||||
PartPlateList::PartPlateList(int width, int depth, double height, Plater* platerObj, Model* modelObj, PrinterTechnology tech)
|
||||
:m_plate_width(width), m_plate_depth(depth), m_plate_height(height), m_plater(platerObj), m_model(modelObj), printer_technology(tech),
|
||||
unprintable_plate(this, Vec3d(0.0 + width * (1. + LOGICAL_PART_PLATE_GAP), 0.0, 0.0), width, depth, height, platerObj, modelObj, false, tech)
|
||||
{
|
||||
@@ -4544,7 +4543,7 @@ void PartPlateList::set_default_wipe_tower_pos_for_plate(int plate_idx, bool ini
|
||||
}
|
||||
|
||||
//this may be happened after machine changed
|
||||
void PartPlateList::reset_size(int width, int depth, int height, bool reload_objects, bool update_shapes)
|
||||
void PartPlateList::reset_size(int width, int depth, double height, bool reload_objects, bool update_shapes)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":before size: plate_width %1%, plate_depth %2%, plate_height %3%") % m_plate_width % m_plate_depth % m_plate_height;
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":after size: plate_width %1%, plate_depth %2%, plate_height %3%") % width % depth % height;
|
||||
@@ -6699,7 +6698,7 @@ int PartPlateList::load_gcode_files()
|
||||
//BoundingBoxf3 print_volume = m_plate_list[i]->get_bounding_box(false);
|
||||
//print_volume.max(2) = this->m_plate_height;
|
||||
//print_volume.min(2) = -1e10;
|
||||
m_model->update_print_volume_state({m_plate_list[i]->get_shape(), (double)this->m_plate_height, m_plate_list[i]->get_extruder_areas(), m_plate_list[i]->get_extruder_heights() });
|
||||
m_model->update_print_volume_state({m_plate_list[i]->get_shape(), this->m_plate_height, m_plate_list[i]->get_extruder_areas(), m_plate_list[i]->get_extruder_heights() });
|
||||
|
||||
if (!m_plate_list[i]->load_gcode_from_file(m_plate_list[i]->m_gcode_path_from_3mf))
|
||||
ret ++;
|
||||
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
Vec3d m_origin;
|
||||
int m_width;
|
||||
int m_depth;
|
||||
int m_height;
|
||||
double m_height;
|
||||
float m_height_to_lid;
|
||||
float m_height_to_rod;
|
||||
bool m_printable;
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
static void load_render_colors();
|
||||
|
||||
PartPlate();
|
||||
PartPlate(PartPlateList *partplate_list, Vec3d origin, int width, int depth, int height, Plater* platerObj, Model* modelObj, bool printable=true, PrinterTechnology tech = ptFFF);
|
||||
PartPlate(PartPlateList *partplate_list, Vec3d origin, int width, int depth, double height, Plater* platerObj, Model* modelObj, bool printable=true, PrinterTechnology tech = ptFFF);
|
||||
~PartPlate();
|
||||
|
||||
bool operator<(PartPlate&) const;
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
Vec3d get_center_origin();
|
||||
/* size and position related functions*/
|
||||
//set position and size
|
||||
void set_pos_and_size(Vec3d& origin, int width, int depth, int height, bool with_instance_move, bool do_clear = true);
|
||||
void set_pos_and_size(Vec3d& origin, int width, int depth, double height, bool with_instance_move, bool do_clear = true);
|
||||
|
||||
// BBS
|
||||
Vec2d get_size() const { return Vec2d(m_width, m_depth); }
|
||||
@@ -590,7 +590,7 @@ class PartPlateList : public ObjectBase
|
||||
|
||||
int m_plate_width;
|
||||
int m_plate_depth;
|
||||
int m_plate_height;
|
||||
double m_plate_height;
|
||||
|
||||
float m_height_to_lid;
|
||||
float m_height_to_rod;
|
||||
@@ -675,16 +675,6 @@ public:
|
||||
offset = Vec2d(0, 0);
|
||||
}
|
||||
|
||||
TexturePart(const TexturePart& part) {
|
||||
this->x = part.x;
|
||||
this->y = part.y;
|
||||
this->w = part.w;
|
||||
this->h = part.h;
|
||||
this->offset = part.offset;
|
||||
this->buffer = part.buffer;
|
||||
this->filename = part.filename;
|
||||
this->texture = part.texture;
|
||||
}
|
||||
void update_pos(float xx, float yy, float ww, float hh) {
|
||||
x = xx;
|
||||
y = yy;
|
||||
@@ -708,12 +698,12 @@ public:
|
||||
static bool is_load_cali_texture;
|
||||
static bool is_load_extruder_only_area_textures;
|
||||
|
||||
PartPlateList(int width, int depth, int height, Plater* platerObj, Model* modelObj, PrinterTechnology tech = ptFFF);
|
||||
PartPlateList(int width, int depth, double height, Plater* platerObj, Model* modelObj, PrinterTechnology tech = ptFFF);
|
||||
PartPlateList(Plater* platerObj, Model* modelObj, PrinterTechnology tech = ptFFF);
|
||||
~PartPlateList();
|
||||
|
||||
//this may be happened after machine changed
|
||||
void reset_size(int width, int depth, int height, bool reload_objects = true, bool update_shapes = false);
|
||||
void reset_size(int width, int depth, double height, bool reload_objects = true, bool update_shapes = false);
|
||||
//clear all the instances in the plate, but keep the plates
|
||||
void clear(bool delete_plates = false, bool release_print_list = false, bool except_locked = false, int plate_index = -1);
|
||||
//clear all the instances in the plate, and delete the plates, only keep the first default plate
|
||||
@@ -727,7 +717,7 @@ public:
|
||||
//get the plate stride
|
||||
double plate_stride_x();
|
||||
double plate_stride_y();
|
||||
void get_plate_size(int& width, int& depth, int& height) {
|
||||
void get_plate_size(int& width, int& depth, double& height) {
|
||||
width = m_plate_width;
|
||||
depth = m_plate_depth;
|
||||
height = m_plate_height;
|
||||
|
||||
@@ -3988,16 +3988,16 @@ void Sidebar::update_mixed_filament_list()
|
||||
p->m_panel_mixed_warning->Show(false);
|
||||
|
||||
// Show/dismiss 3D canvas notification for broken mixed filaments
|
||||
if (has_mixed && !broken_set.empty()) {
|
||||
auto* notify = wxGetApp().plater()->get_notification_manager();
|
||||
if (notify)
|
||||
auto* notify = plater->get_notification_manager();
|
||||
GLCanvas3D* view3d_canvas = plater->get_view3D_canvas3D();
|
||||
if(view3d_canvas && view3d_canvas->is_initialized() && notify){
|
||||
if (has_mixed && !broken_set.empty()) {
|
||||
notify->push_notification(NotificationType::BBLMixedFilamentBroken,
|
||||
NotificationManager::NotificationLevel::ErrorNotificationLevel,
|
||||
_u8L("Mixed filament has invalid or mismatched components. Please re-edit affected entries."));
|
||||
} else {
|
||||
auto* notify = wxGetApp().plater()->get_notification_manager();
|
||||
if (notify)
|
||||
} else {
|
||||
notify->close_notification_of_type(NotificationType::BBLMixedFilamentBroken);
|
||||
}
|
||||
}
|
||||
|
||||
if (has_mixed) {
|
||||
@@ -8278,7 +8278,8 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||
bool dlg_cont = true;
|
||||
bool is_user_cancel = false;
|
||||
bool translate_old = false;
|
||||
int current_width = 0, current_depth = 0, current_height = 0, project_filament_count = 1;
|
||||
int current_width = 0, current_depth = 0, project_filament_count = 1;
|
||||
double current_height = 0;
|
||||
|
||||
if (input_files.empty())
|
||||
return std::vector<size_t>();
|
||||
@@ -16272,6 +16273,7 @@ void Plater::calib_retraction(const Calib_Params& params)
|
||||
obj->config.set_key_value("wall_sequence", new ConfigOptionEnum<WallSequence>(WallSequence::InnerOuter));
|
||||
obj->config.set_key_value("overhang_reverse", new ConfigOptionBool(false));
|
||||
obj->config.set_key_value("precise_z_height", new ConfigOptionBool(false));
|
||||
obj->config.set_key_value("seam_slope_type", new ConfigOptionEnum<SeamScarfType>(SeamScarfType::None));
|
||||
|
||||
|
||||
changed_objects({ 0 });
|
||||
|
||||
@@ -149,7 +149,10 @@ SavePresetDialog::Item::Item(Preset::Type type, const std::string &suffix, wxBox
|
||||
// Set initial state (unchecked by default)
|
||||
detach_checkbox->SetValue(m_detach);
|
||||
// Bind the checkbox event to update the detach state for this item
|
||||
detach_checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, detach_checkbox](wxCommandEvent&) { m_detach = detach_checkbox->GetValue(); });
|
||||
detach_checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, detach_checkbox](wxCommandEvent& event) {
|
||||
m_detach = detach_checkbox->GetValue();
|
||||
event.Skip(); // Let CheckBox update its bitmap for the new state.
|
||||
});
|
||||
|
||||
detach_label->SetForegroundColour(wxColour("#363636"));
|
||||
|
||||
|
||||
@@ -5130,7 +5130,7 @@ void TabPrinter::build_fff()
|
||||
optgroup->append_single_option_line("adaptive_bed_mesh_margin", "printer_basic_information_adaptive_bed_mesh#mesh-margin");
|
||||
|
||||
optgroup = page->new_optgroup(L("Accessory"), "param_accessory");
|
||||
optgroup->append_single_option_line("nozzle_type", "printer_basic_information_accessory#nozzle-type");
|
||||
optgroup->append_single_option_line("nozzle_type", "printer_basic_information_accessory#nozzle-type", 0);
|
||||
optgroup->append_single_option_line("nozzle_hrc", "printer_basic_information_accessory#nozzle-hrc");
|
||||
optgroup->append_single_option_line("auxiliary_fan", "printer_basic_information_accessory#auxiliary-part-cooling-fan");
|
||||
optgroup->append_single_option_line("fan_direction");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "TroubleshootDialog.hpp"
|
||||
#include "I18N.hpp"
|
||||
|
||||
#include "BuildCommit.hpp"
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "MainFrame.hpp"
|
||||
@@ -137,9 +138,9 @@ TroubleshootDialog::TroubleshootDialog()
|
||||
version->SetFont(version_font);
|
||||
version->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636")));
|
||||
|
||||
auto build = new Button(this, wxString(GIT_COMMIT_HASH));
|
||||
auto build = new Button(this, wxString(build_commit_label));
|
||||
build->SetStyle(ButtonStyle::Regular, ButtonType::Window);
|
||||
auto hash_url = "https://github.com/OrcaSlicer/OrcaSlicer/commit/" + wxString(GIT_COMMIT_HASH);
|
||||
auto hash_url = "https://github.com/OrcaSlicer/OrcaSlicer/commit/" + wxString(build_commit_hash);
|
||||
build->SetToolTip(hash_url);
|
||||
build->Bind(wxEVT_BUTTON, [hash_url](wxCommandEvent &e) {
|
||||
wxLaunchDefaultBrowser(hash_url);
|
||||
@@ -371,7 +372,7 @@ wxString TroubleshootDialog::GetSysInfoAll()
|
||||
{
|
||||
wxString info;
|
||||
info += "Version : " + wxString(SoftFever_VERSION) + "\n"
|
||||
+ "Build : " + wxString(GIT_COMMIT_HASH) + "\n"
|
||||
+ "Build : " + wxString(build_commit_label) + "\n"
|
||||
+ "Package : " + GetPackageType() + "\n"
|
||||
+ "Platform : " + GetOSinfo() + "\n"
|
||||
+ "Processor : " + GetCPUinfo() + "\n"
|
||||
|
||||
Reference in New Issue
Block a user