mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 15:51:10 -06:00
Merge branch 'SoftFever' into feature/small_perimeter
This commit is contained in:
commit
397e0f0a29
151 changed files with 7256 additions and 357 deletions
|
@ -244,11 +244,8 @@ AboutDialog::AboutDialog()
|
|||
// version
|
||||
{
|
||||
vesizer->Add(0, FromDIP(165), 1, wxEXPAND, FromDIP(5));
|
||||
#if BBL_INTERNAL_TESTING
|
||||
auto version_string = _L("Internal Version") + " " + std::string(SLIC3R_VERSION);
|
||||
#else
|
||||
auto version_string = _L("Version") + " " + std::string(SLIC3R_VERSION);
|
||||
#endif
|
||||
|
||||
auto version_string = _L("SoftFever Version") + " " + std::string(SoftFever_VERSION);
|
||||
wxStaticText* version = new wxStaticText(this, wxID_ANY, version_string.c_str(), wxDefaultPosition, wxDefaultSize);
|
||||
wxFont version_font = GetFont();
|
||||
#ifdef __WXMSW__
|
||||
|
|
|
@ -250,13 +250,13 @@ void BBLTopbar::Init(wxFrame* parent)
|
|||
this->AddSpacer(FromDIP(10));
|
||||
this->AddStretchSpacer(1);
|
||||
|
||||
#if !BBL_RELEASE_TO_PUBLIC
|
||||
// #if !BBL_RELEASE_TO_PUBLIC
|
||||
/*wxBitmap m_publish_bitmap = create_scaled_bitmap("topbar_publish", nullptr, TOPBAR_ICON_SIZE);
|
||||
m_publish_item = this->AddTool(ID_PUBLISH, "", m_publish_bitmap);
|
||||
wxBitmap m_publish_disable_bitmap = create_scaled_bitmap("topbar_publish_disable", nullptr, TOPBAR_ICON_SIZE);
|
||||
m_publish_item->SetDisabledBitmap(m_publish_disable_bitmap);
|
||||
this->AddSpacer(FromDIP(12));*/
|
||||
#endif
|
||||
// #endif
|
||||
|
||||
/*wxBitmap model_store_bitmap = create_scaled_bitmap("topbar_store", nullptr, TOPBAR_ICON_SIZE);
|
||||
m_model_store_item = this->AddTool(ID_MODEL_STORE, "", model_store_bitmap);
|
||||
|
|
|
@ -183,6 +183,13 @@ std::string BackgroundSlicingProcess::output_filepath_for_project(const boost::f
|
|||
void BackgroundSlicingProcess::process_fff()
|
||||
{
|
||||
assert(m_print == m_fff_print);
|
||||
PresetBundle &preset_bundle = *wxGetApp().preset_bundle;
|
||||
|
||||
m_fff_print->is_BBL_printer() =
|
||||
preset_bundle.printers.get_edited_preset().is_bbl_vendor_preset(
|
||||
&preset_bundle);
|
||||
|
||||
|
||||
//BBS: add the logic to process from an existed gcode file
|
||||
if (m_print->finished()) {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" %1%: skip slicing, to process previous gcode file")%__LINE__;
|
||||
|
@ -837,8 +844,9 @@ void BackgroundSlicingProcess::prepare_upload()
|
|||
m_upload_job.upload_data.upload_path = output_name_str;
|
||||
} else {
|
||||
m_upload_job.upload_data.upload_path = m_sla_print->print_statistics().finalize_output_path(m_upload_job.upload_data.upload_path.string());
|
||||
|
||||
ThumbnailsList thumbnails = this->render_thumbnails(
|
||||
ThumbnailsParams{current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true, true});
|
||||
ThumbnailsParams{current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true, true});
|
||||
// true, false, true, true); // renders also supports and pad
|
||||
Zipper zipper{source_path.string()};
|
||||
m_sla_archive.export_print(zipper, *m_sla_print, m_upload_job.upload_data.upload_path.string());
|
||||
|
|
|
@ -56,6 +56,7 @@ void BedShape::append_option_line(ConfigOptionsGroupShp optgroup, Parameter para
|
|||
def.max = 600;
|
||||
def.label = get_option_label(param);
|
||||
def.tooltip = L("Distance of the 0,0 G-code coordinate from the front left corner of the rectangle.");
|
||||
def.readonly = true;
|
||||
key = "rect_origin";
|
||||
break;
|
||||
case Parameter::Diameter:
|
||||
|
@ -191,9 +192,9 @@ void BedShapePanel::build_panel(const ConfigOptionPoints& default_pt, const Conf
|
|||
BedShape::append_option_line(optgroup, BedShape::Parameter::RectOrigin);
|
||||
activate_options_page(optgroup);
|
||||
|
||||
optgroup = init_shape_options_page(BedShape::get_name(BedShape::PageType::Circle));
|
||||
BedShape::append_option_line(optgroup, BedShape::Parameter::Diameter);
|
||||
activate_options_page(optgroup);
|
||||
// optgroup = init_shape_options_page(BedShape::get_name(BedShape::PageType::Circle));
|
||||
// BedShape::append_option_line(optgroup, BedShape::Parameter::Diameter);
|
||||
// activate_options_page(optgroup);
|
||||
|
||||
optgroup = init_shape_options_page(BedShape::get_name(BedShape::PageType::Custom));
|
||||
|
||||
|
|
|
@ -554,17 +554,14 @@ void Camera::look_at(const Vec3d& position, const Vec3d& target, const Vec3d& up
|
|||
|
||||
void Camera::set_default_orientation()
|
||||
{
|
||||
// BBS modify default orientation
|
||||
look_at(m_target - 0.707 * m_distance * Vec3d::UnitY() + 0.707 * m_distance * Vec3d::UnitZ(), m_target, Vec3d::UnitY() + Vec3d::UnitZ());
|
||||
|
||||
/*m_zenit = 45.0f;
|
||||
m_zenit = 45.0f;
|
||||
const double theta_rad = Geometry::deg2rad(-(double)m_zenit);
|
||||
const double phi_rad = Geometry::deg2rad(45.0);
|
||||
const double sin_theta = ::sin(theta_rad);
|
||||
const Vec3d camera_pos = m_target + m_distance * Vec3d(sin_theta * ::sin(phi_rad), sin_theta * ::cos(phi_rad), ::cos(theta_rad));
|
||||
m_view_rotation = Eigen::AngleAxisd(theta_rad, Vec3d::UnitX()) * Eigen::AngleAxisd(phi_rad, Vec3d::UnitZ());
|
||||
m_view_rotation.normalize();
|
||||
m_view_matrix.fromPositionOrientationScale(m_view_rotation * (-camera_pos), m_view_rotation, Vec3d::Ones());*/
|
||||
m_view_matrix.fromPositionOrientationScale(m_view_rotation * (-camera_pos), m_view_rotation, Vec3d::Ones());
|
||||
}
|
||||
|
||||
Vec3d Camera::validate_target(const Vec3d& target) const
|
||||
|
|
|
@ -469,7 +469,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
toggle_field(el, has_solid_infill);
|
||||
|
||||
for (auto el : { "infill_direction", "sparse_infill_line_width",
|
||||
"sparse_infill_speed", "bridge_speed" })
|
||||
"sparse_infill_speed", "bridge_speed", "bridge_angle" })
|
||||
toggle_field(el, have_infill || has_solid_infill);
|
||||
|
||||
toggle_field("top_shell_thickness", ! has_spiral_vase && has_top_solid_infill);
|
||||
|
@ -483,9 +483,14 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
|
||||
bool have_default_acceleration = config->opt_float("default_acceleration") > 0;
|
||||
//BBS
|
||||
for (auto el : { "initial_layer_acceleration", "top_surface_acceleration" })
|
||||
for (auto el : { "outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration","travel_acceleration" })
|
||||
toggle_field(el, have_default_acceleration);
|
||||
|
||||
bool have_default_jerk = config->opt_float("default_jerk") > 0;
|
||||
|
||||
for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "top_surface_jerk","travel_jerk" })
|
||||
toggle_field(el, have_default_jerk);
|
||||
|
||||
bool have_skirt = config->opt_int("skirt_loops") > 0;
|
||||
toggle_field("skirt_height", have_skirt && config->opt_enum<DraftShield>("draft_shield") != dsEnabled);
|
||||
for (auto el : { "skirt_distance", "draft_shield"})
|
||||
|
|
|
@ -2394,7 +2394,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
|
|||
p->load_vendors();
|
||||
//BBS: add bed exclude areas
|
||||
p->custom_config.reset(DynamicPrintConfig::new_from_defaults_keys({
|
||||
"gcode_flavor", "printable_area", "bed_exclude_area", "nozzle_diameter", "filament_diameter", "nozzle_temperature", /*"bed_temperature",*/
|
||||
"gcode_flavor", "printable_area", "bed_exclude_area", "filament_diameter", "nozzle_temperature", "thumbnails"/*"bed_temperature",*/
|
||||
}));
|
||||
|
||||
auto *vsizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
|
|
@ -4708,12 +4708,12 @@ void GLCanvas3D::render_thumbnail_internal(ThumbnailData& thumbnail_data, const
|
|||
double width = volumes_box.max.x() - volumes_box.min.x();
|
||||
double depth = volumes_box.max.y() - volumes_box.min.y();
|
||||
double height = volumes_box.max.z() - volumes_box.min.z();
|
||||
volumes_box.max.x() = volumes_box.max.x() + width * 0.25f;
|
||||
volumes_box.min.x() = volumes_box.min.x() - width * 0.25f;
|
||||
volumes_box.max.y() = volumes_box.max.y() + depth * 0.25f;
|
||||
volumes_box.min.y() = volumes_box.min.y() - depth * 0.25f;
|
||||
volumes_box.max.z() = volumes_box.max.z() + height * 0.25f;
|
||||
volumes_box.min.z() = volumes_box.min.z() - height * 0.25f;
|
||||
volumes_box.max.x() = volumes_box.max.x() + width * 0.05f;
|
||||
volumes_box.min.x() = volumes_box.min.x() - width * 0.05f;
|
||||
volumes_box.max.y() = volumes_box.max.y() + depth * 0.05f;
|
||||
volumes_box.min.y() = volumes_box.min.y() - depth * 0.05f;
|
||||
volumes_box.max.z() = volumes_box.max.z() + height * 0.05f;
|
||||
volumes_box.min.z() = volumes_box.min.z() - height * 0.05f;
|
||||
|
||||
Camera camera;
|
||||
camera.set_type(camera_type);
|
||||
|
@ -4728,16 +4728,11 @@ void GLCanvas3D::render_thumbnail_internal(ThumbnailData& thumbnail_data, const
|
|||
camera.zoom_to_box(volumes_box);
|
||||
const Vec3d& target = camera.get_target();
|
||||
double distance = camera.get_distance();
|
||||
//camera.select_view("topfront");
|
||||
camera.look_at(target - 0.707 * distance * Vec3d::UnitY() + 0.3 * distance * Vec3d::UnitZ(), target, Vec3d::UnitY() + Vec3d::UnitZ());
|
||||
camera.select_view("iso");
|
||||
camera.apply_view_matrix();
|
||||
|
||||
camera.apply_projection(plate_build_volume);
|
||||
|
||||
//double near_z = -1.0;
|
||||
//double far_z = -1.0;
|
||||
//camera.apply_projection(volumes_box, near_z, far_z);
|
||||
|
||||
//GLShaderProgram* shader = wxGetApp().get_shader("gouraud_light");
|
||||
if (shader == nullptr) {
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("render_thumbnail: shader is null, return directly");
|
||||
|
@ -4745,7 +4740,7 @@ void GLCanvas3D::render_thumbnail_internal(ThumbnailData& thumbnail_data, const
|
|||
}
|
||||
|
||||
//if (thumbnail_params.transparent_background)
|
||||
glsafe(::glClearColor(0.906f, 0.906f, 0.906f, 1.0f));
|
||||
glsafe(::glClearColor(0.2f, 0.2f, 0.2f, 0.0f));
|
||||
|
||||
glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
|
||||
glsafe(::glEnable(GL_DEPTH_TEST));
|
||||
|
|
|
@ -197,7 +197,7 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
|
|||
}
|
||||
break;
|
||||
case coPoints:{
|
||||
if (opt_key == "printable_area" || opt_key == "bed_exclude_area") {
|
||||
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "thumbnails") {
|
||||
config.option<ConfigOptionPoints>(opt_key)->values = boost::any_cast<std::vector<Vec2d>>(value);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -280,14 +280,15 @@ public:
|
|||
memDc.SetTextForeground(wxColor(134, 134, 134));
|
||||
memDc.DrawLabel(m_constant_text.version, version_rect, wxALIGN_LEFT | wxALIGN_BOTTOM);
|
||||
|
||||
#if BBL_INTERNAL_TESTING
|
||||
wxSize text_rect = memDc.GetTextExtent("Internal Version");
|
||||
// #if BBL_INTERNAL_TESTING
|
||||
auto sf_version = wxString::Format("SoftFever %s",std::string(SoftFever_VERSION)).ToStdString();
|
||||
wxSize text_rect = memDc.GetTextExtent(sf_version);
|
||||
int start_x = (title_rect.GetLeft() + version_rect.GetRight()) / 2 - text_rect.GetWidth();
|
||||
int start_y = version_rect.GetBottom() + 10;
|
||||
wxRect internal_sign_rect(wxPoint(start_x, start_y), wxSize(text_rect));
|
||||
memDc.SetFont(m_constant_text.title_font);
|
||||
memDc.DrawLabel("Internal Version", internal_sign_rect, wxALIGN_TOP | wxALIGN_LEFT);
|
||||
#endif
|
||||
memDc.SetFont(m_constant_text.version_font);
|
||||
memDc.DrawLabel(sf_version, internal_sign_rect, wxALIGN_CENTER);
|
||||
// #endif
|
||||
|
||||
// load bitmap for logo
|
||||
BitmapCache bmp_cache;
|
||||
|
@ -554,11 +555,11 @@ private:
|
|||
title = wxGetApp().is_editor() ? SLIC3R_APP_FULL_NAME : GCODEVIEWER_APP_NAME;
|
||||
|
||||
// dynamically get the version to display
|
||||
#if BBL_INTERNAL_TESTING
|
||||
version = _L("Internal Version") + " " + std::string(SLIC3R_VERSION);
|
||||
#else
|
||||
version = _L("Version") + " " + std::string(SLIC3R_VERSION);
|
||||
#endif
|
||||
// #if BBL_INTERNAL_TESTING
|
||||
// version = _L("Internal Version") + " " + std::string(SLIC3R_VERSION);
|
||||
// #else
|
||||
version = _L("SoftFever Version") + " " + std::string(SoftFever_VERSION);
|
||||
// #endif
|
||||
|
||||
// credits infornation
|
||||
credits = title;
|
||||
|
@ -1812,7 +1813,7 @@ void GUI_App::init_download_path()
|
|||
void GUI_App::init_app_config()
|
||||
{
|
||||
// Profiles for the alpha are stored into the PrusaSlicer-alpha directory to not mix with the current release.
|
||||
SetAppName(SLIC3R_APP_KEY);
|
||||
SetAppName("BambuStudio-SoftFever");
|
||||
// SetAppName(SLIC3R_APP_KEY "-alpha");
|
||||
// SetAppName(SLIC3R_APP_KEY "-beta");
|
||||
// SetAppDisplayName(SLIC3R_APP_NAME);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "ConfigWizard.hpp"
|
||||
#include "OpenGLManager.hpp"
|
||||
#include "libslic3r/Preset.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "slic3r/GUI/DeviceManager.hpp"
|
||||
#include "slic3r/Utils/NetworkAgent.hpp"
|
||||
|
@ -45,6 +46,7 @@ class AppConfig;
|
|||
class PresetBundle;
|
||||
class PresetUpdater;
|
||||
class ModelObject;
|
||||
// class PrintHostJobQueue;
|
||||
class Model;
|
||||
class DeviceManager;
|
||||
class NetworkAgent;
|
||||
|
|
|
@ -94,7 +94,7 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::PART_CAT
|
|||
{ L("Strength"), {{"wall_loops", "",1},{"top_shell_layers", L("Top Solid Layers"),1},{"top_shell_thickness", L("Top Minimum Shell Thickness"),1},
|
||||
{"bottom_shell_layers", L("Bottom Solid Layers"),1}, {"bottom_shell_thickness", L("Bottom Minimum Shell Thickness"),1},
|
||||
{"sparse_infill_density", "",1},{"sparse_infill_pattern", "",1},{"top_surface_pattern", "",1},{"bottom_surface_pattern", "",1},
|
||||
{"infill_combination", "",1}, {"infill_wall_overlap", "",1}, {"infill_direction", "",1}, {"minimum_sparse_infill_area", "",1}
|
||||
{"infill_combination", "",1}, {"infill_wall_overlap", "",1}, {"infill_direction", "",1}, {"bridge_angle", "",1}, {"minimum_sparse_infill_area", "",1}
|
||||
}},
|
||||
{ L("Speed"), {{"outer_wall_speed", "",1},{"inner_wall_speed", "",2},{"sparse_infill_speed", "",3},{"top_surface_speed", "",4}, {"internal_solid_infill_speed", "",5},
|
||||
{"enable_overhang_speed", "",6}, {"overhang_1_4_speed", "",7}, {"overhang_2_4_speed", "",8}, {"overhang_3_4_speed", "",9}, {"overhang_4_4_speed", "",10},
|
||||
|
|
|
@ -73,6 +73,7 @@ wxDEFINE_EVENT(EVT_USER_LOGIN, wxCommandEvent);
|
|||
// BBS: backup
|
||||
wxDEFINE_EVENT(EVT_BACKUP_POST, wxCommandEvent);
|
||||
wxDEFINE_EVENT(EVT_LOAD_URL, wxCommandEvent);
|
||||
wxDEFINE_EVENT(EVT_LOAD_PRINTER_URL, wxCommandEvent);
|
||||
|
||||
enum class ERescaleTarget
|
||||
{
|
||||
|
@ -934,6 +935,13 @@ void MainFrame::init_tabpanel()
|
|||
m_monitor = new MonitorPanel(m_tabpanel, wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
||||
m_tabpanel->AddPage(m_monitor, _L("Device"), std::string("tab_monitor_active"), std::string("tab_monitor_active"));
|
||||
|
||||
m_printer_view = new PrinterWebView(m_tabpanel);
|
||||
Bind(EVT_LOAD_PRINTER_URL, [this](wxCommandEvent &evt) {
|
||||
wxString url = evt.GetString();
|
||||
//select_tab(MainFrame::tpMonitor);
|
||||
m_printer_view->load_url(url);
|
||||
});
|
||||
|
||||
m_auxiliary = new AuxiliaryPanel(m_tabpanel, wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
||||
m_tabpanel->AddPage(m_auxiliary, _L("Project"), std::string("tab_auxiliary_avtice"), std::string("tab_auxiliary_avtice"));
|
||||
|
||||
|
@ -951,6 +959,33 @@ void MainFrame::init_tabpanel()
|
|||
}
|
||||
}
|
||||
|
||||
// SoftFever
|
||||
void MainFrame::show_device(bool bBBLPrinter) {
|
||||
if (m_tabpanel->GetPage(3) != m_monitor &&
|
||||
m_tabpanel->GetPage(3) != m_printer_view) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Failed to find device tab";
|
||||
return;
|
||||
}
|
||||
if (bBBLPrinter) {
|
||||
if (m_tabpanel->GetPage(3) != m_monitor) {
|
||||
m_tabpanel->RemovePage(3);
|
||||
m_tabpanel->InsertPage(3, m_monitor, _L("Device"),
|
||||
std::string("tab_monitor_active"),
|
||||
std::string("tab_monitor_active"));
|
||||
}
|
||||
} else {
|
||||
if (m_tabpanel->GetPage(3) != m_printer_view) {
|
||||
m_tabpanel->RemovePage(3);
|
||||
m_tabpanel->InsertPage(3, m_printer_view, _L("Device"),
|
||||
std::string("tab_monitor_active"),
|
||||
std::string("tab_monitor_active"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
void MainFrame::register_win32_callbacks()
|
||||
{
|
||||
|
@ -2859,6 +2894,13 @@ void MainFrame::load_url(wxString url)
|
|||
wxQueueEvent(this, evt);
|
||||
}
|
||||
|
||||
void MainFrame::load_printer_url(wxString url)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "load_printer_url:" << url;
|
||||
auto evt = new wxCommandEvent(EVT_LOAD_PRINTER_URL, this->GetId());
|
||||
evt->SetString(url);
|
||||
wxQueueEvent(this, evt);
|
||||
}
|
||||
void MainFrame::refresh_plugin_tips()
|
||||
{
|
||||
if (m_webview != nullptr)
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include "BBLTopbar.hpp"
|
||||
|
||||
|
||||
#include "PrinterWebView.hpp"
|
||||
|
||||
#define ENABEL_PRINT_ALL 0
|
||||
|
||||
class Notebook;
|
||||
|
@ -307,9 +309,13 @@ public:
|
|||
|
||||
//BBS
|
||||
void load_url(wxString url);
|
||||
void load_printer_url(wxString url);
|
||||
void refresh_plugin_tips();
|
||||
void RunScript(wxString js);
|
||||
|
||||
//SoftFever
|
||||
void show_device(bool bBBLPrinter);
|
||||
|
||||
// BBS. Replace title bar and menu bar with top bar.
|
||||
BBLTopbar* m_topbar{ nullptr };
|
||||
PrintHostQueueDialog* printhost_queue_dlg() { return m_printhost_queue_dlg; }
|
||||
|
@ -318,6 +324,7 @@ public:
|
|||
MonitorPanel* m_monitor{ nullptr };
|
||||
AuxiliaryPanel* m_auxiliary{ nullptr };
|
||||
WebViewPanel* m_webview { nullptr };
|
||||
PrinterWebView* m_printer_view{nullptr};
|
||||
wxLogWindow* m_log_window { nullptr };
|
||||
// BBS
|
||||
//wxBookCtrlBase* m_tabpanel { nullptr };
|
||||
|
|
|
@ -114,9 +114,13 @@ Button* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, con
|
|||
else if (label.length() >= 5 && label.length() < 8) {
|
||||
type = ButtonSizeMiddle;
|
||||
btn->SetMinSize(MSG_DIALOG_MIDDLE_BUTTON_SIZE);
|
||||
}
|
||||
else if (label.length() >= 8 && label.length() < 12) {
|
||||
type = ButtonSizeMiddle;
|
||||
btn->SetMinSize(MSG_DIALOG_LONG_BUTTON_SIZE);
|
||||
} else {
|
||||
type = ButtonSizeLong;
|
||||
btn->SetMinSize(MSG_DIALOG_LONG_BUTTON_SIZE);
|
||||
btn->SetMinSize(MSG_DIALOG_LONGER_BUTTON_SIZE);
|
||||
}
|
||||
|
||||
btn->SetCornerRadius(FromDIP(12));
|
||||
|
|
|
@ -29,6 +29,7 @@ enum ButtonSizeType{
|
|||
#define MSG_DIALOG_BUTTON_SIZE wxSize(FromDIP(58), FromDIP(24))
|
||||
#define MSG_DIALOG_MIDDLE_BUTTON_SIZE wxSize(FromDIP(76), FromDIP(24))
|
||||
#define MSG_DIALOG_LONG_BUTTON_SIZE wxSize(FromDIP(90), FromDIP(24))
|
||||
#define MSG_DIALOG_LONGER_BUTTON_SIZE wxSize(FromDIP(120), FromDIP(24))
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
|
|
@ -670,7 +670,7 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
|
|||
else if (m_opt_map.find(opt_key) == m_opt_map.end() ||
|
||||
// This option don't have corresponded field
|
||||
opt_key == "printable_area" ||
|
||||
opt_key == "compatible_printers" || opt_key == "compatible_prints" ) {
|
||||
opt_key == "compatible_printers" || opt_key == "compatible_prints" || opt_key == "thumbnails" ) {
|
||||
value = get_config_value(config, opt_key);
|
||||
this->change_opt_value(opt_key, value);
|
||||
return;
|
||||
|
@ -950,6 +950,14 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
|
|||
case coInts:
|
||||
ret = config.option<ConfigOptionIntsNullable>(opt_key)->get_at(idx);
|
||||
break;
|
||||
case coPoints:
|
||||
if (opt_key == "bed_shape")
|
||||
ret = config.option<ConfigOptionPoints>(opt_key)->values;
|
||||
else if (opt_key == "thumbnails")
|
||||
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
|
||||
else
|
||||
ret = config.option<ConfigOptionPoints>(opt_key)->get_at(idx);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1026,6 +1034,8 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
|
|||
if (opt_key == "printable_area")
|
||||
ret = config.option<ConfigOptionPoints>(opt_key)->values;
|
||||
else if (opt_key == "bed_exclude_area")
|
||||
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
|
||||
else if (opt_key == "thumbnails")
|
||||
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
|
||||
else
|
||||
ret = config.option<ConfigOptionPoints>(opt_key)->get_at(idx);
|
||||
|
@ -1137,6 +1147,8 @@ boost::any ConfigOptionsGroup::get_config_value2(const DynamicPrintConfig& confi
|
|||
ret = config.option<ConfigOptionPoints>(opt_key)->values;
|
||||
else if (opt_key == "bed_exclude_area")
|
||||
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
|
||||
else if (opt_key == "thumbnails")
|
||||
ret = get_thumbnails_string(config.option<ConfigOptionPoints>(opt_key)->values);
|
||||
else
|
||||
ret = config.option<ConfigOptionPoints>(opt_key)->get_at(idx);
|
||||
break;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "format.hpp"
|
||||
#include "Tab.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
//#include "PrintHostDialogs.hpp"
|
||||
#include "PrintHostDialogs.hpp"
|
||||
#include "../Utils/ASCIIFolding.hpp"
|
||||
#include "../Utils/PrintHost.hpp"
|
||||
#include "../Utils/FixModelByWin10.hpp"
|
||||
|
@ -189,7 +189,6 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
|
|||
Option option = m_optgroup->get_option("print_host");
|
||||
option.opt.width = Field::def_width_wider();
|
||||
Line host_line = m_optgroup->create_single_option_line(option);
|
||||
//do not support now
|
||||
host_line.append_widget(printhost_browse);
|
||||
host_line.append_widget(print_host_test);
|
||||
m_optgroup->append_line(host_line);
|
||||
|
@ -228,36 +227,36 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
|
|||
};
|
||||
|
||||
cafile_line.append_widget(printhost_cafile_browse);
|
||||
//m_optgroup->append_line(cafile_line);
|
||||
m_optgroup->append_line(cafile_line);
|
||||
|
||||
/*Line cafile_hint{ "", "" };
|
||||
Line cafile_hint{ "", "" };
|
||||
cafile_hint.full_width = 1;
|
||||
cafile_hint.widget = [ca_file_hint](wxWindow* parent) {
|
||||
auto txt = new wxStaticText(parent, wxID_ANY, ca_file_hint);
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(txt);
|
||||
return sizer;
|
||||
};*/
|
||||
//m_optgroup->append_line(cafile_hint);
|
||||
};
|
||||
m_optgroup->append_line(cafile_hint);
|
||||
}
|
||||
else {
|
||||
|
||||
//Line line{ "", "" };
|
||||
//line.full_width = 1;
|
||||
Line line{ "", "" };
|
||||
line.full_width = 1;
|
||||
|
||||
//line.widget = [ca_file_hint](wxWindow* parent) {
|
||||
// std::string info = _u8L("HTTPS CA File") + ":\n\t" +
|
||||
// (boost::format(_u8L("On this system, %s uses HTTPS certificates from the system Certificate Store or Keychain.")) % SLIC3R_APP_NAME).str() +
|
||||
// "\n\t" + _u8L("To use a custom CA file, please import your CA file into Certificate Store / Keychain.");
|
||||
line.widget = [ca_file_hint](wxWindow* parent) {
|
||||
std::string info = _u8L("HTTPS CA File") + ":\n\t" +
|
||||
(boost::format(_u8L("On this system, %s uses HTTPS certificates from the system Certificate Store or Keychain.")) % SLIC3R_APP_NAME).str() +
|
||||
"\n\t" + _u8L("To use a custom CA file, please import your CA file into Certificate Store / Keychain.");
|
||||
|
||||
// //auto txt = new wxStaticText(parent, wxID_ANY, from_u8((boost::format("%1%\n\n\t%2%") % info % ca_file_hint).str()));
|
||||
// auto txt = new wxStaticText(parent, wxID_ANY, from_u8((boost::format("%1%\n\t%2%") % info % ca_file_hint).str()));
|
||||
// txt->SetFont(wxGetApp().normal_font());
|
||||
// auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
// sizer->Add(txt, 1, wxEXPAND);
|
||||
// return sizer;
|
||||
//};
|
||||
//m_optgroup->append_line(line);
|
||||
//auto txt = new wxStaticText(parent, wxID_ANY, from_u8((boost::format("%1%\n\n\t%2%") % info % ca_file_hint).str()));
|
||||
auto txt = new wxStaticText(parent, wxID_ANY, from_u8((boost::format("%1%\n\t%2%") % info % ca_file_hint).str()));
|
||||
txt->SetFont(wxGetApp().normal_font());
|
||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(txt, 1, wxEXPAND);
|
||||
return sizer;
|
||||
};
|
||||
m_optgroup->append_line(line);
|
||||
}
|
||||
|
||||
for (const std::string& opt_key : std::vector<std::string>{ "printhost_user", "printhost_password" }) {
|
||||
|
@ -267,13 +266,10 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
|
|||
}
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
option = m_optgroup->get_option("printhost_ssl_ignore_revoke");
|
||||
option.opt.width = Field::def_width_wider();
|
||||
m_optgroup->append_single_option_line(option);
|
||||
*/
|
||||
#endif
|
||||
|
||||
|
||||
m_optgroup->activate();
|
||||
|
||||
|
@ -422,6 +418,7 @@ void PhysicalPrinterDialog::update(bool printer_change)
|
|||
m_optgroup->hide_field(opt_key);
|
||||
supports_multiple_printers = opt && opt->value == htRepetier;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
m_optgroup->set_value("host_type", int(PrintHostType::htOctoPrint), false);
|
||||
|
|
|
@ -911,17 +911,22 @@ void Sidebar::update_all_preset_comboboxes()
|
|||
|
||||
bool is_bbl_preset = preset_bundle.printers.get_edited_preset().is_bbl_vendor_preset(&preset_bundle);
|
||||
|
||||
auto p_mainframe = wxGetApp().mainframe;
|
||||
|
||||
p_mainframe->show_device(is_bbl_preset);
|
||||
if (is_bbl_preset) {
|
||||
//only show connection button for not-BBL printer
|
||||
connection_btn->Hide();
|
||||
//only show sync-ams button for BBL printer
|
||||
ams_btn->Show();
|
||||
//update print button default value for bbl or third-party printer
|
||||
wxGetApp().mainframe->set_print_button_to_default(MainFrame::PrintSelectType::ePrintPlate);
|
||||
p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::ePrintPlate);
|
||||
|
||||
} else {
|
||||
connection_btn->Show();
|
||||
ams_btn->Hide();
|
||||
wxGetApp().mainframe->set_print_button_to_default(MainFrame::PrintSelectType::eSendGcode);
|
||||
p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::eSendGcode);
|
||||
p_mainframe->load_printer_url(wxString::Format("http://%s",preset_bundle.printers.get_edited_preset().config.opt_string("print_host")));
|
||||
}
|
||||
|
||||
// Update the print choosers to only contain the compatible presets, update the dirty flags.
|
||||
|
@ -9080,7 +9085,7 @@ void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn, bool up
|
|||
upload_job.printhost->get_groups(groups);
|
||||
}
|
||||
|
||||
PrintHostSendDialog dlg(default_output_file, upload_job.printhost->get_post_upload_actions(), groups, upload_only);
|
||||
PrintHostSendDialog dlg(default_output_file, upload_job.printhost->get_post_upload_actions(), groups);
|
||||
if (dlg.ShowModal() == wxID_OK) {
|
||||
upload_job.upload_data.upload_path = dlg.filename();
|
||||
upload_job.upload_data.post_action = dlg.post_action();
|
||||
|
@ -10646,4 +10651,4 @@ SuppressBackgroundProcessingUpdate::~SuppressBackgroundProcessingUpdate()
|
|||
wxGetApp().plater()->schedule_background_process(m_was_scheduled);
|
||||
}
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
}} // namespace Slic3r::GUI
|
|
@ -687,4 +687,4 @@ private:
|
|||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -36,8 +36,8 @@ namespace GUI {
|
|||
static const char *CONFIG_KEY_PATH = "printhost_path";
|
||||
static const char *CONFIG_KEY_GROUP = "printhost_group";
|
||||
|
||||
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUploadActions post_actions, const wxArrayString &groups, bool upload_only)
|
||||
: MsgDialog(static_cast<wxWindow*>(wxGetApp().mainframe), _L("Upload and Print"), _L("Upload to Printer Host with the following filename:"),0)
|
||||
PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUploadActions post_actions, const wxArrayString &groups)
|
||||
: MsgDialog(static_cast<wxWindow*>(wxGetApp().mainframe), _L("Send to print"), _L("Upload to Printer Host with the following filename:"),0)
|
||||
, txt_filename(new wxTextCtrl(this, wxID_ANY))
|
||||
, combo_groups(!groups.IsEmpty() ? new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, groups, wxCB_READONLY) : nullptr)
|
||||
, post_upload_action(PrintHostPostUploadAction::None)
|
||||
|
@ -88,19 +88,7 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
|||
return true;
|
||||
};
|
||||
|
||||
auto* btn_confirm = add_button(wxID_YES, false, _L("Confirm"));
|
||||
btn_confirm->Bind(wxEVT_BUTTON, [this, upload_only, validate_path](wxCommandEvent&) {
|
||||
if (validate_path(txt_filename->GetValue())) {
|
||||
if (upload_only) {
|
||||
post_upload_action = PrintHostPostUploadAction::None;
|
||||
} else {
|
||||
post_upload_action = PrintHostPostUploadAction::StartPrint;
|
||||
}
|
||||
EndDialog(wxID_OK);
|
||||
}
|
||||
});
|
||||
|
||||
/*auto* btn_upload = add_button(wxID_YES, false, _L("Upload"));
|
||||
auto* btn_upload = add_button(wxID_YES, false, _L("Upload"));
|
||||
btn_upload->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
|
||||
if (validate_path(txt_filename->GetValue())) {
|
||||
post_upload_action = PrintHostPostUploadAction::None;
|
||||
|
@ -108,7 +96,7 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
|||
}
|
||||
});
|
||||
|
||||
if (post_actions.has(PrintHostPostUploadAction::StartPrint) && !upload_only) {
|
||||
if (post_actions.has(PrintHostPostUploadAction::StartPrint)) {
|
||||
auto* btn_print = add_button(wxID_YES, false, _L("Upload and Print"));
|
||||
btn_print->Bind(wxEVT_BUTTON, [this, validate_path](wxCommandEvent&) {
|
||||
if (validate_path(txt_filename->GetValue())) {
|
||||
|
@ -128,9 +116,8 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
|||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
add_button(wxID_CANCEL, false, "Cancel");
|
||||
add_button(wxID_CANCEL,false,"Cancel");
|
||||
finalize();
|
||||
|
||||
#ifdef __linux__
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace GUI {
|
|||
class PrintHostSendDialog : public GUI::MsgDialog
|
||||
{
|
||||
public:
|
||||
PrintHostSendDialog(const boost::filesystem::path &path, PrintHostPostUploadActions post_actions, const wxArrayString& groups, bool upload_only);
|
||||
PrintHostSendDialog(const boost::filesystem::path &path, PrintHostPostUploadActions post_actions, const wxArrayString& groups);
|
||||
boost::filesystem::path filename() const;
|
||||
PrintHostPostUploadAction post_action() const;
|
||||
std::string group() const;
|
||||
|
|
125
src/slic3r/GUI/PrinterWebView.cpp
Normal file
125
src/slic3r/GUI/PrinterWebView.cpp
Normal file
|
@ -0,0 +1,125 @@
|
|||
#include "PrinterWebView.hpp"
|
||||
|
||||
#include "I18N.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/toolbar.h>
|
||||
#include <wx/textdlg.h>
|
||||
|
||||
#include <slic3r/GUI/Widgets/WebView.hpp>
|
||||
|
||||
namespace pt = boost::property_tree;
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
PrinterWebView::PrinterWebView(wxWindow *parent)
|
||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
|
||||
{
|
||||
|
||||
wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
// Create the button
|
||||
bSizer_toolbar = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
//m_button_reload = new wxButton(this, wxID_ANY, wxT("Reload"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
//bSizer_toolbar->Add(m_button_reload, 0, wxALL, 5);
|
||||
|
||||
m_url = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
|
||||
bSizer_toolbar->Add(m_url, 1, wxALL | wxEXPAND, 5);
|
||||
|
||||
|
||||
// Create the webview
|
||||
m_browser = WebView::CreateWebView(this, "");
|
||||
if (m_browser == nullptr) {
|
||||
wxLogError("Could not init m_browser");
|
||||
return;
|
||||
}
|
||||
|
||||
SetSizer(topsizer);
|
||||
|
||||
topsizer->Add(m_browser, wxSizerFlags().Expand().Proportion(1));
|
||||
|
||||
// Log backend information
|
||||
if (wxGetApp().get_mode() == comDevelop) {
|
||||
wxLogMessage(wxWebView::GetBackendVersionInfo().ToString());
|
||||
wxLogMessage("Backend: %s Version: %s", m_browser->GetClassInfo()->GetClassName(),
|
||||
wxWebView::GetBackendVersionInfo().ToString());
|
||||
wxLogMessage("User Agent: %s", m_browser->GetUserAgent());
|
||||
}
|
||||
|
||||
//Zoom
|
||||
m_zoomFactor = 100;
|
||||
|
||||
// Connect the button events
|
||||
//Bind(wxEVT_BUTTON, &PrinterWebView::OnReload, this, m_button_reload->GetId());
|
||||
Bind(wxEVT_TEXT_ENTER, &PrinterWebView::OnUrl, this, m_url->GetId());
|
||||
//Connect the idle events
|
||||
Bind(wxEVT_CLOSE_WINDOW, &PrinterWebView::OnClose, this);
|
||||
|
||||
}
|
||||
|
||||
PrinterWebView::~PrinterWebView()
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Start";
|
||||
SetEvtHandlerEnabled(false);
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " End";
|
||||
}
|
||||
|
||||
|
||||
void PrinterWebView::load_url(wxString& url)
|
||||
{
|
||||
//this->Show();
|
||||
//this->Raise();
|
||||
m_url->SetLabelText(url);
|
||||
|
||||
if (wxGetApp().get_mode() == comDevelop)
|
||||
wxLogMessage(m_url->GetValue());
|
||||
m_browser->LoadURL(url);
|
||||
//m_browser->SetFocus();
|
||||
UpdateState();
|
||||
}
|
||||
/**
|
||||
* Method that retrieves the current state from the web control and updates the
|
||||
* GUI the reflect this current state.
|
||||
*/
|
||||
void PrinterWebView::UpdateState() {
|
||||
// SetTitle(m_browser->GetCurrentTitle());
|
||||
m_url->SetValue(m_browser->GetCurrentURL());
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when user entered an URL and pressed enter
|
||||
*/
|
||||
void PrinterWebView::OnUrl(wxCommandEvent& WXUNUSED(evt))
|
||||
{
|
||||
if (wxGetApp().get_mode() == comDevelop)
|
||||
wxLogMessage(m_url->GetValue());
|
||||
m_browser->LoadURL(m_url->GetValue());
|
||||
m_browser->SetFocus();
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when user pressed the "reload" button
|
||||
*/
|
||||
void PrinterWebView::OnReload(wxCommandEvent& WXUNUSED(evt))
|
||||
{
|
||||
m_browser->Reload();
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
void PrinterWebView::OnClose(wxCloseEvent& evt)
|
||||
{
|
||||
this->Hide();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // GUI
|
||||
} // Slic3r
|
64
src/slic3r/GUI/PrinterWebView.hpp
Normal file
64
src/slic3r/GUI/PrinterWebView.hpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
#ifndef slic3r_PrinterWebView_hpp_
|
||||
#define slic3r_PrinterWebView_hpp_
|
||||
|
||||
|
||||
#include "wx/artprov.h"
|
||||
#include "wx/cmdline.h"
|
||||
#include "wx/notifmsg.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/webview.h"
|
||||
|
||||
#if wxUSE_WEBVIEW_EDGE
|
||||
#include "wx/msw/webview_edge.h"
|
||||
#endif
|
||||
|
||||
#include "wx/webviewarchivehandler.h"
|
||||
#include "wx/webviewfshandler.h"
|
||||
#include "wx/numdlg.h"
|
||||
#include "wx/infobar.h"
|
||||
#include "wx/filesys.h"
|
||||
#include "wx/fs_arc.h"
|
||||
#include "wx/fs_mem.h"
|
||||
#include "wx/stdpaths.h"
|
||||
#include <wx/panel.h>
|
||||
#include <wx/tbarbase.h>
|
||||
#include "wx/textctrl.h"
|
||||
#include <wx/timer.h>
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
|
||||
class PrinterWebView : public wxPanel {
|
||||
public:
|
||||
PrinterWebView(wxWindow *parent);
|
||||
virtual ~PrinterWebView();
|
||||
|
||||
void load_url(wxString& url);
|
||||
|
||||
void UpdateState();
|
||||
void OnUrl(wxCommandEvent& evt);
|
||||
void OnReload(wxCommandEvent& evt);
|
||||
void OnClose(wxCloseEvent& evt);
|
||||
|
||||
private:
|
||||
|
||||
wxWebView* m_browser;
|
||||
wxBoxSizer *bSizer_toolbar;
|
||||
wxButton * m_button_reload;
|
||||
wxTextCtrl *m_url;
|
||||
|
||||
long m_zoomFactor;
|
||||
|
||||
// Last executed JavaScript snippet, for convenience.
|
||||
// wxString m_javascript;
|
||||
// wxString m_response_js;
|
||||
|
||||
// DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
} // GUI
|
||||
} // Slic3r
|
||||
|
||||
#endif /* slic3r_Tab_hpp_ */
|
|
@ -43,6 +43,8 @@
|
|||
#include "MarkdownTip.hpp"
|
||||
#include "Search.hpp"
|
||||
|
||||
#include "BedShapeDialog.hpp"
|
||||
// #include "BonjourDialog.hpp"
|
||||
#ifdef WIN32
|
||||
#include <commctrl.h>
|
||||
#endif // WIN32
|
||||
|
@ -853,7 +855,7 @@ void TabPrinter::init_options_list()
|
|||
|
||||
for (const std::string& opt_key : m_config->keys())
|
||||
{
|
||||
if (opt_key == "printable_area" || opt_key == "bed_exclude_area") {
|
||||
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" | opt_key == "thumbnails") {
|
||||
m_options_list.emplace(opt_key, m_opt_status_value);
|
||||
continue;
|
||||
}
|
||||
|
@ -1779,8 +1781,11 @@ void TabPrint::build()
|
|||
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
|
||||
optgroup->append_single_option_line("wall_infill_order");
|
||||
optgroup->append_single_option_line("bridge_flow");
|
||||
optgroup->append_single_option_line("top_solid_infill_flow_ratio");
|
||||
optgroup->append_single_option_line("bottom_solid_infill_flow_ratio");
|
||||
optgroup->append_single_option_line("thick_bridges");
|
||||
optgroup->append_single_option_line("only_one_wall_top");
|
||||
optgroup->append_single_option_line("only_one_wall_first_layer");
|
||||
optgroup->append_single_option_line("detect_overhang_wall");
|
||||
optgroup->append_single_option_line("reduce_crossing_wall");
|
||||
optgroup->append_single_option_line("max_travel_detour_distance");
|
||||
|
@ -1805,6 +1810,7 @@ void TabPrint::build()
|
|||
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
|
||||
optgroup->append_single_option_line("infill_wall_overlap");
|
||||
optgroup->append_single_option_line("infill_direction");
|
||||
optgroup->append_single_option_line("bridge_angle");
|
||||
optgroup->append_single_option_line("minimum_sparse_infill_area");
|
||||
optgroup->append_single_option_line("infill_combination");
|
||||
optgroup->append_single_option_line("detect_narrow_internal_solid_infill");
|
||||
|
@ -1837,9 +1843,20 @@ void TabPrint::build()
|
|||
optgroup->append_single_option_line("travel_speed");
|
||||
|
||||
optgroup = page->new_optgroup(L("Acceleration"), L"param_acceleration", 15);
|
||||
optgroup->append_single_option_line("default_acceleration");
|
||||
optgroup->append_single_option_line("outer_wall_acceleration");
|
||||
optgroup->append_single_option_line("inner_wall_acceleration");
|
||||
optgroup->append_single_option_line("initial_layer_acceleration");
|
||||
optgroup->append_single_option_line("top_surface_acceleration");
|
||||
optgroup->append_single_option_line("default_acceleration");
|
||||
optgroup->append_single_option_line("travel_acceleration");
|
||||
|
||||
optgroup = page->new_optgroup(L("Jerk(XY)"));
|
||||
optgroup->append_single_option_line("default_jerk");
|
||||
optgroup->append_single_option_line("outer_wall_jerk");
|
||||
optgroup->append_single_option_line("inner_wall_jerk");
|
||||
optgroup->append_single_option_line("top_surface_jerk");
|
||||
optgroup->append_single_option_line("initial_layer_jerk");
|
||||
optgroup->append_single_option_line("travel_jerk");
|
||||
|
||||
#ifdef HAS_PRESSURE_EQUALIZER
|
||||
optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_positive");
|
||||
|
@ -1922,7 +1939,10 @@ void TabPrint::build()
|
|||
optgroup->append_single_option_line("reduce_infill_retraction");
|
||||
optgroup->append_single_option_line("gcode_add_line_number");
|
||||
Option option = optgroup->get_option("filename_format");
|
||||
option.opt.full_width = true;
|
||||
// option.opt.full_width = true;
|
||||
option.opt.is_code = true;
|
||||
option.opt.multiline = true;
|
||||
// option.opt.height = 5;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
||||
#if 0
|
||||
|
@ -2424,6 +2444,10 @@ void TabFilament::build()
|
|||
//optgroup->append_single_option_line("filament_colour");
|
||||
optgroup->append_single_option_line("filament_diameter");
|
||||
optgroup->append_single_option_line("filament_flow_ratio");
|
||||
|
||||
optgroup->append_single_option_line("enable_pressure_advance");
|
||||
optgroup->append_single_option_line("pressure_advance");
|
||||
|
||||
optgroup->append_single_option_line("filament_density");
|
||||
optgroup->append_single_option_line("filament_cost");
|
||||
//BBS
|
||||
|
@ -2439,6 +2463,10 @@ void TabFilament::build()
|
|||
optgroup = page->new_optgroup(L("Print temperature"), L"param_temperature");
|
||||
optgroup->split_multi_line = true;
|
||||
optgroup->option_label_at_right = true;
|
||||
line = { L("Chamber temperature"), L("Chamber temperature") };
|
||||
line.append_option(optgroup->get_option("chamber_temperature"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
line = { L("Nozzle"), L("Nozzle temperature when printing") };
|
||||
line.append_option(optgroup->get_option("nozzle_temperature_initial_layer"));
|
||||
line.append_option(optgroup->get_option("nozzle_temperature"));
|
||||
|
@ -2637,7 +2665,11 @@ void TabFilament::toggle_options()
|
|||
for (auto el : { "overhang_fan_speed", "overhang_fan_threshold" })
|
||||
toggle_option(el, has_enable_overhang_bridge_fan);
|
||||
}
|
||||
|
||||
if (m_active_page->title() == "Filament")
|
||||
{
|
||||
bool pa = m_config->opt_bool("enable_pressure_advance");
|
||||
toggle_option("pressure_advance", pa);
|
||||
}
|
||||
if (m_active_page->title() == "Setting Overrides")
|
||||
update_filament_overrides_page();
|
||||
}
|
||||
|
@ -2729,12 +2761,13 @@ void TabPrinter::build_fff()
|
|||
auto page = add_options_page(L("Basic information"), "printer");
|
||||
auto optgroup = page->new_optgroup(L("Printable space")/*, L"param_printable_space"*/);
|
||||
|
||||
//create_line_with_widget(optgroup.get(), "printable_area", "custom-svg-and-png-bed-textures_124612", [this](wxWindow* parent) {
|
||||
// return create_bed_shape_widget(parent);
|
||||
//});
|
||||
create_line_with_widget(optgroup.get(), "printable_area", "custom-svg-and-png-bed-textures_124612", [this](wxWindow* parent) {
|
||||
return create_bed_shape_widget(parent);
|
||||
});
|
||||
Option option = optgroup->get_option("bed_exclude_area");
|
||||
option.opt.full_width = true;
|
||||
optgroup->append_single_option_line(option);
|
||||
// optgroup->append_single_option_line("printable_area");
|
||||
optgroup->append_single_option_line("printable_height");
|
||||
optgroup->append_single_option_line("nozzle_volume");
|
||||
// BBS
|
||||
|
@ -2835,6 +2868,9 @@ void TabPrinter::build_fff()
|
|||
|
||||
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
|
||||
optgroup->append_single_option_line("gcode_flavor");
|
||||
option = optgroup->get_option("thumbnails");
|
||||
option.opt.full_width = true;
|
||||
optgroup->append_single_option_line(option);
|
||||
optgroup->append_single_option_line("scan_first_layer");
|
||||
// optgroup->append_single_option_line("spaghetti_detector");
|
||||
optgroup->append_single_option_line("machine_load_filament_time");
|
||||
|
@ -2870,8 +2906,8 @@ void TabPrinter::build_fff()
|
|||
option.opt.is_code = true;
|
||||
option.opt.height = gcode_field_height;//150;
|
||||
optgroup->append_single_option_line(option);
|
||||
#if 0
|
||||
optgroup = page->new_optgroup(L("Before layer change G-code"), 0);
|
||||
|
||||
optgroup = page->new_optgroup(L("Before layer change G-code"),"param_gcode", 0);
|
||||
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
|
||||
validate_custom_gcode_cb(this, optgroup, opt_key, value);
|
||||
};
|
||||
|
@ -2880,7 +2916,6 @@ void TabPrinter::build_fff()
|
|||
option.opt.is_code = true;
|
||||
option.opt.height = gcode_field_height;//150;
|
||||
optgroup->append_single_option_line(option);
|
||||
#endif
|
||||
|
||||
optgroup = page->new_optgroup(L("Layer change G-code"), L"param_gcode", 0);
|
||||
optgroup->m_on_change = [this, optgroup](const t_config_option_key& opt_key, const boost::any& value) {
|
||||
|
@ -2926,7 +2961,6 @@ void TabPrinter::build_fff()
|
|||
|
||||
// build_preset_description_line(optgroup.get());
|
||||
#endif
|
||||
|
||||
build_unregular_pages(true);
|
||||
}
|
||||
|
||||
|
@ -3100,7 +3134,7 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
|
|||
{
|
||||
size_t n_before_extruders = 2; // Count of pages before Extruder pages
|
||||
auto flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
||||
bool is_marlin_flavor = (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware);
|
||||
bool is_marlin_flavor = (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware || flavor == gcfKlipper);
|
||||
|
||||
/* ! Freeze/Thaw in this function is needed to avoid call OnPaint() for erased pages
|
||||
* and be cause of application crash, when try to change Preset in moment,
|
||||
|
@ -3231,6 +3265,7 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
|
|||
optgroup = page->new_optgroup(L("Retraction"), L"param_retraction");
|
||||
optgroup->append_single_option_line("retraction_length", "", extruder_idx);
|
||||
optgroup->append_single_option_line("z_hop", "", extruder_idx);
|
||||
optgroup->append_single_option_line("z_lift_type", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retraction_speed", "", extruder_idx);
|
||||
optgroup->append_single_option_line("deretraction_speed", "", extruder_idx);
|
||||
//optgroup->append_single_option_line("retract_restart_extra", "", extruder_idx);
|
||||
|
@ -3447,9 +3482,9 @@ void TabPrinter::toggle_options()
|
|||
toggle_option("retract_restart_extra_toolchange", have_multiple_extruders && toolchange_retraction, i);
|
||||
}
|
||||
|
||||
if (m_active_page->title() == "Motion ability") {
|
||||
assert(m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfMarlinLegacy
|
||||
|| m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfMarlinFirmware);
|
||||
auto gcf = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
||||
if (m_active_page->title() == "Motion ability") {
|
||||
assert(gcf == gcfMarlinLegacy || gcf == gcfMarlinFirmware || gcf == gcfKlipper);
|
||||
bool silent_mode = m_config->opt_bool("silent_mode");
|
||||
int max_field = silent_mode ? 2 : 1;
|
||||
//BBS: limits of BBL printer can't be edited.
|
||||
|
@ -3481,7 +3516,9 @@ void TabPrinter::update_fff()
|
|||
m_use_silent_mode = m_config->opt_bool("silent_mode");
|
||||
}
|
||||
|
||||
bool supports_travel_acceleration = (m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfMarlinFirmware);
|
||||
auto gcf_ =
|
||||
m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
||||
bool supports_travel_acceleration = (gcf_ == gcfMarlinFirmware || gcf_ == gcfMarlinLegacy || gcf_ == gcfKlipper);
|
||||
if (m_supports_travel_acceleration != supports_travel_acceleration) {
|
||||
m_rebuild_kinematics_page = true;
|
||||
m_supports_travel_acceleration = supports_travel_acceleration;
|
||||
|
@ -4609,7 +4646,7 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
|
|||
}
|
||||
|
||||
// Return a callback to create a TabPrinter widget to edit bed shape
|
||||
/*wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
|
||||
wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
|
||||
{
|
||||
ScalableButton* btn = new ScalableButton(parent, wxID_ANY, "printer", " " + _(L("Set")) + " " + dots,
|
||||
wxDefaultSize, wxDefaultPosition, wxBU_LEFT | wxBU_EXACTFIT, true);
|
||||
|
@ -4639,7 +4676,7 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
|
|||
}
|
||||
|
||||
return sizer;
|
||||
}*/
|
||||
}
|
||||
|
||||
void TabPrinter::cache_extruder_cnt()
|
||||
{
|
||||
|
|
|
@ -547,6 +547,7 @@ private:
|
|||
std::vector<PageShp> m_pages_fff;
|
||||
std::vector<PageShp> m_pages_sla;
|
||||
|
||||
wxBoxSizer* m_presets_sizer {nullptr};
|
||||
public:
|
||||
ScalableButton* m_reset_to_filament_color = nullptr;
|
||||
|
||||
|
@ -582,9 +583,10 @@ public:
|
|||
void msw_rescale() override;
|
||||
bool supports_printer_technology(const PrinterTechnology /* tech */) const override { return true; }
|
||||
|
||||
//wxSizer* create_bed_shape_widget(wxWindow* parent);
|
||||
wxSizer* create_bed_shape_widget(wxWindow* parent);
|
||||
void cache_extruder_cnt();
|
||||
bool apply_extruder_cnt_from_cache();
|
||||
|
||||
};
|
||||
|
||||
class TabSLAMaterial : public Tab
|
||||
|
|
|
@ -1315,7 +1315,7 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig&
|
|||
}
|
||||
case coPoints: {
|
||||
//BBS: add bed_exclude_area
|
||||
if (opt_key == "printable_area") {
|
||||
if (opt_key == "printable_area" || opt_key == "thumbnails") {
|
||||
ConfigOptionPoints points = *config.option<ConfigOptionPoints>(opt_key);
|
||||
//BuildVolume build_volume = {points.values, 0.};
|
||||
return get_thumbnails_string(points.values);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue