mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-18 22:31:13 -06:00
Merge branch 'main' into enh-port-edit-gcode-dlg
This commit is contained in:
commit
d5ee4ff1ab
87 changed files with 687 additions and 270 deletions
|
@ -2013,7 +2013,11 @@ void GLCanvas3D::render_thumbnail(ThumbnailData& thumbnail_data, unsigned int w,
|
|||
void GLCanvas3D::render_thumbnail(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, const ThumbnailsParams& thumbnail_params,
|
||||
const GLVolumeCollection& volumes, Camera::EType camera_type, bool use_top_view, bool for_picking)
|
||||
{
|
||||
GLShaderProgram* shader = wxGetApp().get_shader("thumbnail");
|
||||
GLShaderProgram* shader = nullptr;
|
||||
if (for_picking)
|
||||
shader = wxGetApp().get_shader("flat");
|
||||
else
|
||||
shader = wxGetApp().get_shader("thumbnail");
|
||||
ModelObjectPtrs& model_objects = GUI::wxGetApp().model().objects;
|
||||
std::vector<ColorRGBA> colors = ::get_extruders_colors();
|
||||
switch (OpenGLManager::get_framebuffers_type())
|
||||
|
@ -5678,6 +5682,7 @@ void GLCanvas3D::render_thumbnail_internal(ThumbnailData& thumbnail_data, const
|
|||
//if (OpenGLManager::can_multisample())
|
||||
// This flag is often ignored by NVIDIA drivers if rendering into a screen buffer.
|
||||
// glsafe(::glDisable(GL_MULTISAMPLE));
|
||||
shader->start_using();
|
||||
|
||||
glsafe(::glDisable(GL_BLEND));
|
||||
|
||||
|
@ -5709,8 +5714,6 @@ void GLCanvas3D::render_thumbnail_internal(ThumbnailData& thumbnail_data, const
|
|||
const Transform3d model_matrix = vol->world_matrix();
|
||||
shader->set_uniform("view_model_matrix", view_matrix * model_matrix);
|
||||
shader->set_uniform("projection_matrix", projection_matrix);
|
||||
const Matrix3d view_normal_matrix = view_matrix.matrix().block(0, 0, 3, 3) * model_matrix.matrix().block(0, 0, 3, 3).inverse().transpose();
|
||||
shader->set_uniform("view_normal_matrix", view_normal_matrix);
|
||||
vol->simple_render(shader, model_objects, extruder_colors);
|
||||
vol->is_active = is_active;
|
||||
}
|
||||
|
|
|
@ -114,47 +114,15 @@ void SendJob::process(Ctl &ctl)
|
|||
unsigned int http_code;
|
||||
std::string http_body;
|
||||
|
||||
|
||||
|
||||
|
||||
// local print access
|
||||
params.dev_ip = m_dev_ip;
|
||||
params.username = "bblp";
|
||||
params.password = m_access_code;
|
||||
params.use_ssl_for_ftp = m_local_use_ssl_for_ftp;
|
||||
params.use_ssl_for_mqtt = m_local_use_ssl_for_mqtt;
|
||||
|
||||
// check access code and ip address
|
||||
params.dev_id = m_dev_id;
|
||||
params.project_name = "verify_job";
|
||||
params.filename = job_data._temp_path.string();
|
||||
params.connection_type = this->connection_type;
|
||||
|
||||
result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr, nullptr);
|
||||
if (result != 0) {
|
||||
BOOST_LOG_TRIVIAL(error) << "access code is invalid";
|
||||
m_enter_ip_address_fun_fail(result);
|
||||
m_job_finished = true;
|
||||
return;
|
||||
}
|
||||
else if(m_is_check_mode && !m_check_and_continue){
|
||||
m_enter_ip_address_fun_success();
|
||||
m_job_finished = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* display info */
|
||||
msg = _u8L("Sending gcode file over LAN");
|
||||
/* if (this->connection_type == "lan") {
|
||||
msg = _u8L("Sending gcode file over LAN");
|
||||
if (this->connection_type == "lan") {
|
||||
msg = _u8L("Sending print job over LAN");
|
||||
}
|
||||
else {
|
||||
msg = _u8L("Sending gcode file through cloud service");
|
||||
}*/
|
||||
msg = _u8L("Sending print job through cloud service");
|
||||
}
|
||||
|
||||
ctl.call_on_main_thread([this] { prepare(); }).wait();
|
||||
ctl.update_status(0, msg);
|
||||
|
||||
int total_plate_num = m_plater->get_partplate_list().get_plate_count();
|
||||
|
||||
PartPlate* plate = m_plater->get_partplate_list().get_plate(job_data.plate_idx);
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
///|/
|
||||
#include "Plater.hpp"
|
||||
#include "libslic3r/Config.hpp"
|
||||
#include "libslic3r_version.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <algorithm>
|
||||
|
@ -1132,6 +1133,7 @@ void Sidebar::update_all_preset_comboboxes()
|
|||
// Orca:: show device tab based on vendor type
|
||||
auto p_mainframe = wxGetApp().mainframe;
|
||||
p_mainframe->show_device(is_bbl_vendor);
|
||||
auto cfg = preset_bundle.printers.get_edited_preset().config;
|
||||
|
||||
if (is_bbl_vendor) {
|
||||
//only show connection button for not-BBL printer
|
||||
|
@ -1140,32 +1142,9 @@ void Sidebar::update_all_preset_comboboxes()
|
|||
ams_btn->Show();
|
||||
//update print button default value for bbl or third-party printer
|
||||
p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::ePrintPlate);
|
||||
AppConfig* config = wxGetApp().app_config;
|
||||
if (config && !config->get("curr_bed_type").empty()) {
|
||||
int bed_type_idx = 0;
|
||||
std::string str_bed_type = config->get("curr_bed_type");
|
||||
int bed_type_value = (int)btPC;
|
||||
try {
|
||||
bed_type_value = atoi(str_bed_type.c_str());
|
||||
} catch(...) {}
|
||||
bed_type_idx = bed_type_value - 1;
|
||||
m_bed_type_list->SelectAndNotify(bed_type_idx);
|
||||
} else {
|
||||
BedType bed_type = preset_bundle.printers.get_edited_preset().get_default_bed_type(&preset_bundle);
|
||||
m_bed_type_list->SelectAndNotify((int)bed_type - 1);
|
||||
}
|
||||
m_bed_type_list->Enable();
|
||||
auto str_bed_type = wxGetApp().app_config->get_printer_setting(wxGetApp().preset_bundle->printers.get_selected_preset_name(), "curr_bed_type");
|
||||
if(!str_bed_type.empty()){
|
||||
int bed_type_value = atoi(str_bed_type.c_str());
|
||||
if(bed_type_value == 0)
|
||||
bed_type_value = 1;
|
||||
m_bed_type_list->SelectAndNotify(bed_type_value - 1);
|
||||
}
|
||||
} else {
|
||||
connection_btn->Show();
|
||||
ams_btn->Hide();
|
||||
auto cfg = preset_bundle.printers.get_edited_preset().config;
|
||||
auto print_btn_type = MainFrame::PrintSelectType::eExportGcode;
|
||||
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
|
||||
if(!url.empty())
|
||||
|
@ -1182,7 +1161,23 @@ void Sidebar::update_all_preset_comboboxes()
|
|||
}
|
||||
p_mainframe->set_print_button_to_default(print_btn_type);
|
||||
|
||||
m_bed_type_list->SelectAndNotify(btPEI-1);
|
||||
}
|
||||
|
||||
if (is_bbl_vendor || cfg.opt_bool("support_multi_bed_types")) {
|
||||
m_bed_type_list->Enable();
|
||||
auto str_bed_type = wxGetApp().app_config->get_printer_setting(wxGetApp().preset_bundle->printers.get_selected_preset_name(),
|
||||
"curr_bed_type");
|
||||
if (!str_bed_type.empty()) {
|
||||
int bed_type_value = atoi(str_bed_type.c_str());
|
||||
if (bed_type_value == 0)
|
||||
bed_type_value = 1;
|
||||
m_bed_type_list->SelectAndNotify(bed_type_value - 1);
|
||||
} else {
|
||||
BedType bed_type = preset_bundle.printers.get_edited_preset().get_default_bed_type(&preset_bundle);
|
||||
m_bed_type_list->SelectAndNotify((int) bed_type - 1);
|
||||
}
|
||||
} else {
|
||||
m_bed_type_list->SelectAndNotify(btPEI - 1);
|
||||
m_bed_type_list->Disable();
|
||||
}
|
||||
|
||||
|
@ -3492,69 +3487,71 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||
load_type = static_cast<LoadType>(std::stoi(import_project_action));
|
||||
|
||||
// BBS: version check
|
||||
Semver app_version = *(Semver::parse(SLIC3R_VERSION));
|
||||
Semver app_version = *(Semver::parse(SoftFever_VERSION));
|
||||
if (en_3mf_file_type == En3mfType::From_Prusa) {
|
||||
// do not reset the model config
|
||||
load_config = false;
|
||||
if(load_type != LoadType::LoadGeometry)
|
||||
show_info(q, _L("The 3mf is not supported by OrcaSlicer, load geometry data only."), _L("Load 3mf"));
|
||||
}
|
||||
else if (load_config && (file_version.maj() != app_version.maj())) {
|
||||
// version mismatch, only load geometries
|
||||
load_config = false;
|
||||
if (!load_model) {
|
||||
// only load config case, return directly
|
||||
show_info(q, _L("The Config can not be loaded."), _L("Load 3mf"));
|
||||
q->skip_thumbnail_invalid = false;
|
||||
return empty_result;
|
||||
}
|
||||
load_old_project = true;
|
||||
// select view to 3D
|
||||
q->select_view_3D("3D");
|
||||
// select plate 0 as default
|
||||
q->select_plate(0);
|
||||
if (load_type != LoadType::LoadGeometry) {
|
||||
if (en_3mf_file_type == En3mfType::From_BBS)
|
||||
show_info(q, _L("The 3mf is generated by old Orca Slicer, load geometry data only."), _L("Load 3mf"));
|
||||
else
|
||||
show_info(q, _L("The 3mf is not supported by OrcaSlicer, load geometry data only."), _L("Load 3mf"));
|
||||
}
|
||||
for (ModelObject *model_object : model.objects) {
|
||||
model_object->config.reset();
|
||||
// Is there any modifier or advanced config data?
|
||||
for (ModelVolume *model_volume : model_object->volumes) model_volume->config.reset();
|
||||
}
|
||||
}
|
||||
// else if (load_config && (file_version > app_version)) {
|
||||
// if (config_substitutions.unrecogized_keys.size() > 0) {
|
||||
// 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;
|
||||
// // std::string context = into_u8(text);
|
||||
// wxString context = text;
|
||||
// for (auto &key : config_substitutions.unrecogized_keys) {
|
||||
// context += " -";
|
||||
// context += key;
|
||||
// context += ";\n";
|
||||
// first = false;
|
||||
// }
|
||||
// wxString append = _L("You'd better upgrade your software.\n");
|
||||
// context += "\n\n";
|
||||
// // context += into_u8(append);
|
||||
// context += append;
|
||||
// show_info(q, context, _L("Newer 3mf version"));
|
||||
// else if (load_config && (file_version.maj() != app_version.maj())) {
|
||||
// // version mismatch, only load geometries
|
||||
// load_config = false;
|
||||
// if (!load_model) {
|
||||
// // only load config case, return directly
|
||||
// show_info(q, _L("The Config can not be loaded."), _L("Load 3mf"));
|
||||
// q->skip_thumbnail_invalid = false;
|
||||
// return empty_result;
|
||||
// }
|
||||
// else {
|
||||
// //if the minor version is not matched
|
||||
// if (file_version.min() != app_version.min()) {
|
||||
// wxString text = wxString::Format(_L("The 3mf's version %s is newer than %s's version %s, Suggest to upgrade your software."),
|
||||
// file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string());
|
||||
// text += "\n";
|
||||
// show_info(q, text, _L("Newer 3mf version"));
|
||||
// }
|
||||
// load_old_project = true;
|
||||
// // select view to 3D
|
||||
// q->select_view_3D("3D");
|
||||
// // select plate 0 as default
|
||||
// q->select_plate(0);
|
||||
// if (load_type != LoadType::LoadGeometry) {
|
||||
// if (en_3mf_file_type == En3mfType::From_BBS)
|
||||
// show_info(q, _L("The 3mf is generated by old Orca Slicer, load geometry data only."), _L("Load 3mf"));
|
||||
// else
|
||||
// show_info(q, _L("The 3mf is not supported by OrcaSlicer, load geometry data only."), _L("Load 3mf"));
|
||||
// }
|
||||
// for (ModelObject *model_object : model.objects) {
|
||||
// model_object->config.reset();
|
||||
// // Is there any modifier or advanced config data?
|
||||
// for (ModelVolume *model_volume : model_object->volumes) model_volume->config.reset();
|
||||
// }
|
||||
// }
|
||||
else if (load_config && (file_version > app_version)) {
|
||||
if (config_substitutions.unrecogized_keys.size() > 0) {
|
||||
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;
|
||||
// std::string context = into_u8(text);
|
||||
wxString context = text;
|
||||
// if (wxGetApp().app_config->get("user_mode") == "develop") {
|
||||
// for (auto &key : config_substitutions.unrecogized_keys) {
|
||||
// context += " -";
|
||||
// context += key;
|
||||
// context += ";\n";
|
||||
// first = false;
|
||||
// }
|
||||
// }
|
||||
wxString append = _L("You'd better upgrade your software.\n");
|
||||
context += "\n\n";
|
||||
// context += into_u8(append);
|
||||
context += append;
|
||||
show_info(q, context, _L("Newer 3mf version"));
|
||||
}
|
||||
else {
|
||||
//if the minor version is not matched
|
||||
if (file_version.min() != app_version.min()) {
|
||||
wxString text = wxString::Format(_L("The 3mf's version %s is newer than %s's version %s, Suggest to upgrade your software."),
|
||||
file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string());
|
||||
text += "\n";
|
||||
show_info(q, text, _L("Newer 3mf version"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!load_config) {
|
||||
// reset config except color
|
||||
for (ModelObject *model_object : model.objects) {
|
||||
|
|
|
@ -3084,6 +3084,7 @@ void TabFilament::build()
|
|||
line.append_option(optgroup->get_option("nozzle_temperature"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
optgroup = page->new_optgroup(L("Bed temperature"), L"param_temperature");
|
||||
line = { L("Cool plate"), L("Bed temperature when cool plate is installed. Value 0 means the filament does not support to print on the Cool Plate") };
|
||||
line.append_option(optgroup->get_option("cool_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("cool_plate_temp"));
|
||||
|
@ -3337,23 +3338,22 @@ void TabFilament::toggle_options()
|
|||
wxGetApp().preset_bundle->is_bbl_vendor();
|
||||
}
|
||||
|
||||
auto cfg = m_preset_bundle->printers.get_edited_preset().config;
|
||||
if (m_active_page->title() == L("Cooling")) {
|
||||
bool has_enable_overhang_bridge_fan = m_config->opt_bool("enable_overhang_bridge_fan", 0);
|
||||
for (auto el : {"overhang_fan_speed", "overhang_fan_threshold"})
|
||||
toggle_option(el, has_enable_overhang_bridge_fan);
|
||||
|
||||
toggle_option(
|
||||
"additional_cooling_fan_speed",
|
||||
m_preset_bundle->printers.get_edited_preset().config.option<ConfigOptionBool>("auxiliary_fan")->value);
|
||||
toggle_option("additional_cooling_fan_speed", cfg.opt_bool("auxiliary_fan"));
|
||||
}
|
||||
if (m_active_page->title() == L("Filament"))
|
||||
{
|
||||
bool pa = m_config->opt_bool("enable_pressure_advance", 0);
|
||||
toggle_option("pressure_advance", pa);
|
||||
|
||||
toggle_line("cool_plate_temp_initial_layer", is_BBL_printer);
|
||||
toggle_line("eng_plate_temp_initial_layer", is_BBL_printer);
|
||||
toggle_line("textured_plate_temp_initial_layer", is_BBL_printer);
|
||||
auto support_multi_bed_types = is_BBL_printer || cfg.opt_bool("support_multi_bed_types");
|
||||
toggle_line("cool_plate_temp_initial_layer", support_multi_bed_types );
|
||||
toggle_line("eng_plate_temp_initial_layer", support_multi_bed_types);
|
||||
toggle_line("textured_plate_temp_initial_layer", support_multi_bed_types);
|
||||
|
||||
}
|
||||
if (m_active_page->title() == L("Setting Overrides"))
|
||||
|
@ -3466,6 +3466,7 @@ void TabPrinter::build_fff()
|
|||
optgroup->append_single_option_line(option);
|
||||
// optgroup->append_single_option_line("printable_area");
|
||||
optgroup->append_single_option_line("printable_height");
|
||||
optgroup->append_single_option_line("support_multi_bed_types");
|
||||
optgroup->append_single_option_line("nozzle_volume");
|
||||
optgroup->append_single_option_line("best_object_pos");
|
||||
optgroup->append_single_option_line("z_offset");
|
||||
|
@ -4128,7 +4129,7 @@ void TabPrinter::toggle_options()
|
|||
toggle_line(el, is_BBL_printer);
|
||||
|
||||
// SoftFever: hide non-BBL settings
|
||||
for (auto el : {"use_firmware_retraction", "use_relative_e_distances"})
|
||||
for (auto el : {"use_firmware_retraction", "use_relative_e_distances", "support_multi_bed_types"})
|
||||
toggle_line(el, !is_BBL_printer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue