* fixed logic error in PLA jamming gcode for P1S
* Fix use after free bug in LinesBucketQueue::emplace_back_bucket
I found a use after free bug in LinesBucketQueue::emplace_back_bucket. This was found by enabling address sanitizer.
The LinesBucketQueue class has two related members:
std::vector<LinesBucket> line_buckets;
std::priority_queue<LinesBucket *, std::vector<LinesBucket *>, LinesBucketPtrComp> line_bucket_ptr_queue;
line_bucket_ptr_queue holds pointers into line_buckets. However, since items are inserted into line_buckets one at a time, existing pointers that were stored inside line_bucket_ptr_queue become invalid. Specifically:
void LinesBucketQueue::emplace_back_bucket(ExtrusionLayers &&els, const void *objPtr, Point offset)
{
auto oldSize = line_buckets.capacity();
line_buckets.emplace_back(std::move(els), objPtr, offset); <--- Causes a reallocation, making previous pointers invalid
line_bucket_ptr_queue.push(&line_buckets.back()); <-- priority queue compares against old, now invalid pointers
...
The proposed fix is to calculate the required number of entries in ConflictChecker::find_inter_of_lines_in_diff_objs, and then calling line_buckets.reserve(count). This ensures that sufficient buffer is allocated up front and the pointers are stable as items are added.
* Updated to fix the handling of the capacity change, and removed the code I previously added to reserve upfront since it is not really needed
* Remove accidentally added whitespace
* Removed unused method
* ENH:add mz_zip_reader_extract_to_file_w api
to solove plugin install failed problem by special wide char
jira: none
Change-Id: Ic7d3efe3fdf852387650abf9df65803da9e46a60
(cherry picked from commit b68ad03717a63675fef2f3ef73d4058bf311adea)
* FIX: PrinterFileSystem report real connect error
Change-Id: I99d6ff7f6dcb1f53ccf59854f5f19d0bd39fa9fc
Jira: none
* rename preference name
* FIX:Relax restrictions on importing obj files
jira: none
Change-Id: I61a0156a8424a5f59922956918d37d38e2c3306a
* FIX: [6469] popup dialog too mach when reload object
Jira: 6469
Change-Id: I4097e3a3b018c7a676fea93bf63f8f778bb3148b
* FIX:fixed incorrect display of printer options page on Linux
jira:[STUDIO-6220]
Change-Id: Id1f084658b0b340b7f17ab97ba82c0fd3ae83fae
* FIX: handle exception of dividing by zero in arranging
jira: none
Change-Id: I0d20464dbe81a80293539100f06d72dee456a27b
(cherry picked from commit 94746ae9bf7f467243849570450567b4fdc78e3a)
* ENH:delete no use code
jira: none
Change-Id: I40e7ffa7ea47bb3cd4039eef9f6c28c604eb3abc
* FIX: PrinterFileSystem::FileRemoved
Change-Id: I891aaa8d58ff379dc1ebd8581064865a33388f74
* FIX: resend ttcode to printer on -90 error
Change-Id: I96dc45102a2759a9f1a0002f42c3a91b2c6b2d75
Jira: STUDIO-5947
(cherry picked from commit 97d687b7c88f8cd51b8eddd39120349d8eac42b1)
* FIX: fix some issue in multi machine
JIRA: STUDIO-6934 STUDIO-6888
1. Fix the issue of incomplete display caused by excessively long file names
2. Fix the issue of icon display being too large
3. Fix the issue of garbled Chinese characters in the task list
Change-Id: I36bc10bf2067f44aaa7e3651b58e526ea323c8ad
* FIX: Incorrect multiplier, when the multiplier is set to below 1
github: #3987 #3805
1. In some languages that use commas as decimal points, setting multiplier below 1 will resolve to 0
2. Unable to save multiplier correctly
Change-Id: I62bc55e270929ebb5e910eb79c6f97106e842b93
* Arrange
* FIX: wrong wipe tower when open 3mf file
1.wipe tower pos in 3mf was overwritten by default pos when opening 3mf
with a different printer profile.This patch fix it
jira: STUDIO-5890
Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I12e5d4b80a0ad86194db0682c1763ba4a9492521
* ENH: update A1 machine gcode
1.Adjust the y position of the A1 extrusion compensation line
jira:NEW
Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iea690a0184ae10a47f53e1532272c31fc0a04cfa
* FIX: minor spelling mistake in gcode
github:#3477
Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Id3201bf8b8125ce060e2cac102ab2525877e27c1
* FIX: slice crash with height_range
github: 3917
Change-Id: Icdf83013213b47935b7a795ed75cc3d49057665d
* FIX: ERROR_RES_BUSY text
Change-Id: Ifde1a7b0c6ab915eb226c2072c46edd40f60cf9a
Jira: STUDIO-6436
* ENH:Unable to send printing without selecting a device
jira:[STUDIO-6850]
Change-Id: Ic537579727fd1618af364db93fce8fbbe4cd635a
* FIX:add exit_gizmo before slice model
jira: STUDIO-5531
Change-Id: Icddc9d73b3d91bb68e9768d13e48cbae0680e58e
* FIX: PrinterFileSystem report real connect error
Change-Id: Id6750cfa2a98fe8325ba677dabb606a0a701b495
* FIX: add can slice judgement in slice all plates processing
jira: STUDIO-6325
Change-Id: Ic7fb8cef000c03210bb77289a570ee6b60b6083e
* FIX:Fixed error in displaying the name of Bambu filaments
Change-Id: Ib42194c07b6eefe793eec81a588debc9d622d951
* FIX: text hidden in calibration tab
jira: STUDIO-6264
Change-Id: I24fbc590638a3213d948a973422e010486113923
* FIX: logic error in PLA fan control
github PR: #3948
Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I28e4a673e590e83d151e92cc82caab45012aeabe
* FIX:upgrade cluster algorithm to remove duplicate labels
jira: none
Change-Id: I4d68d8cd8e080932c7c308bc8f69e27546ffe309
* FIX: can not parse json float in ES on macOS
jira: STUDIO-5889
Change-Id: I622f4b474c378d77b0e43d67a320f023be2d5811
* ENH:Clear the value of the previous nozzle type
jira:[for nozzle check]
Change-Id: I9a932b833fb07de6cb0a91abe6372b0e91f273f1
* ENH: update A1 gcode
1.Modify the width of extrusion compensation line
jira:NEW
Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I90543758c866d74f2154e3135d7569109def84b8
* FIX: the height range is not valid in assemble object
github: 3876
Change-Id: Id38672bbf0c01bc9b9f0a3e2bf1052d945b45131
* FIX: calibration page text hidden in linux
jira: STUDIO-6264
Change-Id: If210abf64057eb2e9c2c5b11d41fa33f18684c72
* ENH:clear nozzle information
jira:[STUDIO-7050]
Change-Id: I15ca4973d09132ddb5cb5a56bedd795ba6976b27
* update plugin version
---------
Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Co-authored-by: afriede <me@afriede.dev>
Co-authored-by: Momin Al-Ghosien <momin@sanestudios.com>
Co-authored-by: zhou.xu <zhou.xu@bambulab.com>
Co-authored-by: chunmao.guo <chunmao.guo@bambulab.com>
Co-authored-by: maosheng.wei <maosheng.wei@bambulab.com>
Co-authored-by: tao wang <tao.wang@bambulab.com>
Co-authored-by: Arthur <arthur.tang@bambulab.com>
Co-authored-by: Kunlong Ma <kunlong.ma@bambulab.com>
Co-authored-by: xun.zhang <xun.zhang@bambulab.com>
Co-authored-by: zhimin.zeng <zhimin.zeng@bambulab.com>
Co-authored-by: liz.li <liz.li@bambulab.com>
400 lines
19 KiB
C++
400 lines
19 KiB
C++
#include "CalibrationWizardStartPage.hpp"
|
|
#include "I18N.hpp"
|
|
#include "Widgets/Label.hpp"
|
|
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
#define CALIBRATION_START_PAGE_TEXT_MAX_LENGTH FromDIP(1000)
|
|
CalibrationStartPage::CalibrationStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
|
:CalibrationWizardPage(parent, id, pos, size, style)
|
|
{
|
|
m_top_sizer = new wxBoxSizer(wxVERTICAL);
|
|
}
|
|
|
|
void CalibrationStartPage::create_when(wxWindow* parent, wxString title, wxString content)
|
|
{
|
|
m_when_title = new Label(this, title);
|
|
m_when_title->SetFont(Label::Head_14);
|
|
m_when_title->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
m_when_title->SetMinSize({CALIBRATION_START_PAGE_TEXT_MAX_LENGTH, -1});
|
|
|
|
m_when_content = new Label(this, content);;
|
|
m_when_content->SetFont(Label::Body_14);
|
|
m_when_content->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
m_when_content->SetMinSize({CALIBRATION_START_PAGE_TEXT_MAX_LENGTH, -1});
|
|
}
|
|
|
|
void CalibrationStartPage::create_about(wxWindow* parent, wxString title, wxString content)
|
|
{
|
|
m_about_title = new Label(this, title);
|
|
m_about_title->SetFont(Label::Head_14);
|
|
m_about_title->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
m_about_title->SetMinSize({CALIBRATION_START_PAGE_TEXT_MAX_LENGTH, -1});
|
|
|
|
m_about_content = new Label(this, content);
|
|
m_about_content->SetFont(Label::Body_14);
|
|
m_about_content->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
m_about_content->SetMinSize({CALIBRATION_START_PAGE_TEXT_MAX_LENGTH, -1});
|
|
}
|
|
|
|
void CalibrationStartPage::create_bitmap(wxWindow* parent, const wxBitmap& before_img, const wxBitmap& after_img)
|
|
{
|
|
if (!m_before_bmp)
|
|
m_before_bmp = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
|
m_before_bmp->SetBitmap(before_img);
|
|
if (!m_after_bmp)
|
|
m_after_bmp = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
|
m_after_bmp->SetBitmap(after_img);
|
|
if (!m_images_sizer) {
|
|
m_images_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
m_images_sizer->Add(m_before_bmp, 0, wxALL, 0);
|
|
m_images_sizer->AddSpacer(FromDIP(20));
|
|
m_images_sizer->Add(m_after_bmp, 0, wxALL, 0);
|
|
}
|
|
}
|
|
|
|
void CalibrationStartPage::create_bitmap(wxWindow* parent, std::string before_img, std::string after_img)
|
|
{
|
|
wxBitmap before_bmp = create_scaled_bitmap(before_img, this, 350);
|
|
wxBitmap after_bmp = create_scaled_bitmap(after_img, this, 350);
|
|
|
|
create_bitmap(parent, before_bmp, after_bmp);
|
|
}
|
|
|
|
void CalibrationStartPage::create_bitmap(wxWindow* parent, std::string img) {
|
|
wxBitmap before_bmp = create_scaled_bitmap(img, this, 350);
|
|
if (!m_bmp_intro)
|
|
m_bmp_intro = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
|
|
m_bmp_intro->SetBitmap(before_bmp);
|
|
if (!m_images_sizer) {
|
|
m_images_sizer = new wxBoxSizer(wxHORIZONTAL);
|
|
m_images_sizer->Add(m_bmp_intro, 0, wxALL, 0);
|
|
}
|
|
}
|
|
|
|
CalibrationPAStartPage::CalibrationPAStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
|
: CalibrationStartPage(parent, id, pos, size, style)
|
|
{
|
|
m_cali_mode = CalibMode::Calib_PA_Line;
|
|
m_page_type = CaliPageType::CALI_PAGE_START;
|
|
|
|
create_page(this);
|
|
|
|
this->SetSizer(m_top_sizer);
|
|
Layout();
|
|
m_top_sizer->Fit(this);
|
|
}
|
|
|
|
void CalibrationPAStartPage::create_page(wxWindow* parent)
|
|
{
|
|
m_page_caption = new CaliPageCaption(parent, CalibMode::Calib_PA_Line);
|
|
m_page_caption->show_prev_btn(false);
|
|
m_top_sizer->Add(m_page_caption, 0, wxEXPAND, 0);
|
|
create_when(parent,
|
|
_L("When do you need Flow Dynamics Calibration"),
|
|
_L("We now have added the auto-calibration for different filaments, which is fully automated and the result will be saved into the printer for future use. You only need to do the calibration in the following limited cases:\
|
|
\n1. If you introduce a new filament of different brands/models or the filament is damp;\
|
|
\n2. if the nozzle is worn out or replaced with a new one;\
|
|
\n3. If the max volumetric speed or print temperature is changed in the filament setting."));
|
|
|
|
m_top_sizer->Add(m_when_title);
|
|
m_top_sizer->Add(m_when_content);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
|
create_bitmap(parent, "cali_page_before_pa_CN", "cali_page_after_pa_CN");
|
|
} else {
|
|
create_bitmap(parent, "cali_page_before_pa", "cali_page_after_pa");
|
|
}
|
|
m_top_sizer->Add(m_images_sizer, 0, wxALL, 0);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
m_help_panel = new PAPageHelpPanel(parent, false);
|
|
m_top_sizer->Add(m_help_panel, 0, wxALL, 0);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
create_about(parent,
|
|
_L("About this calibration"),
|
|
_L("Please find the details of Flow Dynamics Calibration from our wiki.\
|
|
\n\nUsually the calibration is unnecessary. When you start a single color/material print, with the \"flow dynamics calibration\" option checked in the print start menu, the printer will follow the old way, calibrate the filament before the print; When you start a multi color/material print, the printer will use the default compensation parameter for the filament during every filament switch which will have a good result in most cases.\
|
|
\n\nPlease note there are a few cases that will make the calibration result not reliable: using a texture plate to do the calibration; the build plate does not have good adhesion (please wash the build plate or apply gluestick!) ...You can find more from our wiki.\
|
|
\n\nThe calibration results have about 10 percent jitter in our test, which may cause the result not exactly the same in each calibration. We are still investigating the root cause to do improvements with new updates."));
|
|
m_top_sizer->Add(m_about_title);
|
|
m_top_sizer->Add(m_about_content);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
m_action_panel = new CaliPageActionPanel(parent, CalibMode::Calib_PA_Line, CaliPageType::CALI_PAGE_START);
|
|
|
|
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
|
|
|
|
#ifdef __linux__
|
|
wxGetApp().CallAfter([this]() {
|
|
m_when_content->SetMinSize(m_when_content->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() });
|
|
m_about_content->SetMinSize(m_about_content->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() });
|
|
Layout();
|
|
Fit();
|
|
});
|
|
#endif
|
|
}
|
|
|
|
void CalibrationPAStartPage::on_reset_page()
|
|
{
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, false);
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, false);
|
|
}
|
|
|
|
void CalibrationPAStartPage::on_device_connected(MachineObject* obj)
|
|
{
|
|
//enable all button
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, true);
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, true);
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
|
|
|
if (obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, true);
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, true);
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
|
|
|
if (obj->cali_version <= -1) {
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, true);
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, true);
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
|
}
|
|
else {
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, false);
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, false);
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
|
}
|
|
|
|
// is support auto cali
|
|
bool is_support_pa_auto = (obj->home_flag >> 16 & 1) == 1;
|
|
if (!is_support_pa_auto) {
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
|
}
|
|
}
|
|
else if (obj->get_printer_series() == PrinterSeries::SERIES_P1P || obj->get_printer_arch() == PrinterArch::ARCH_I3) {
|
|
if (obj->cali_version >= 0) {
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, true);
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, false);
|
|
}
|
|
else
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, false);
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, false);
|
|
}
|
|
}
|
|
|
|
void CalibrationPAStartPage::msw_rescale()
|
|
{
|
|
CalibrationWizardPage::msw_rescale();
|
|
m_help_panel->msw_rescale();
|
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
|
create_bitmap(this, "cali_page_before_pa_CN", "cali_page_after_pa_CN");
|
|
} else {
|
|
create_bitmap(this, "cali_page_before_pa", "cali_page_after_pa");
|
|
}
|
|
}
|
|
|
|
CalibrationFlowRateStartPage::CalibrationFlowRateStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
|
: CalibrationStartPage(parent, id, pos, size, style)
|
|
{
|
|
m_cali_mode = CalibMode::Calib_Flow_Rate;
|
|
|
|
create_page(this);
|
|
|
|
this->SetSizer(m_top_sizer);
|
|
Layout();
|
|
m_top_sizer->Fit(this);
|
|
}
|
|
|
|
void CalibrationFlowRateStartPage::create_page(wxWindow* parent)
|
|
{
|
|
m_page_caption = new CaliPageCaption(parent, CalibMode::Calib_Flow_Rate);
|
|
m_page_caption->show_prev_btn(false);
|
|
m_top_sizer->Add(m_page_caption, 0, wxEXPAND, 0);
|
|
create_when(parent,
|
|
_L("When to use Flow Rate Calibration"),
|
|
_L("After using Flow Dynamics Calibration, there might still be some extrusion issues, such as:\
|
|
\n1. Over-Extrusion: Excess material on your printed object, forming blobs or zits, or the layers seem thicker than expected and not uniform.\
|
|
\n2. Under-Extrusion: Very thin layers, weak infill strength, or gaps in the top layer of the model, even when printing slowly.\
|
|
\n3. Poor Surface Quality: The surface of your prints seems rough or uneven.\
|
|
\n4. Weak Structural Integrity: Prints break easily or don't seem as sturdy as they should be."));
|
|
|
|
m_top_sizer->Add(m_when_title);
|
|
m_top_sizer->Add(m_when_content);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
|
create_bitmap(parent, "cali_page_flow_introduction_CN");
|
|
} else {
|
|
create_bitmap(parent, "cali_page_flow_introduction");
|
|
}
|
|
m_top_sizer->Add(m_images_sizer, 0, wxALL, 0);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
auto extra_text = new Label(parent, _L("In addition, Flow Rate Calibration is crucial for foaming materials like LW-PLA used in RC planes. These materials expand greatly when heated, and calibration provides a useful reference flow rate."));
|
|
extra_text->SetFont(Label::Body_14);
|
|
extra_text->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
extra_text->SetMinSize({CALIBRATION_START_PAGE_TEXT_MAX_LENGTH, -1});
|
|
m_top_sizer->Add(extra_text);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
create_about(parent,
|
|
_L("About this calibration"),
|
|
_L("Flow Rate Calibration measures the ratio of expected to actual extrusion volumes. The default setting works well in Bambu Lab printers and official filaments as they were pre-calibrated and fine-tuned. For a regular filament, you usually won't need to perform a Flow Rate Calibration unless you still see the listed defects after you have done other calibrations. For more details, please check out the wiki article."));
|
|
|
|
m_top_sizer->Add(m_about_title);
|
|
m_top_sizer->Add(m_about_content);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
auto auto_cali_title = new Label(parent, _L("Auto-Calibration"));
|
|
auto_cali_title->SetFont(Label::Head_14);
|
|
auto_cali_title->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
auto_cali_title->SetMinSize({CALIBRATION_START_PAGE_TEXT_MAX_LENGTH, -1});
|
|
|
|
auto auto_cali_content = new Label(this,
|
|
_L("Auto Flow Rate Calibration utilizes Bambu Lab's Micro-Lidar technology, directly measuring the calibration patterns. However, please be advised that the efficacy and accuracy of this method may be compromised with specific types of materials. Particularly, filaments that are transparent or semi-transparent, sparkling-particled, or have a high-reflective finish may not be suitable for this calibration and can produce less-than-desirable results.\
|
|
\n\nThe calibration results may vary between each calibration or filament. We are still improving the accuracy and compatibility of this calibration through firmware updates over time.\
|
|
\n\nCaution: Flow Rate Calibration is an advanced process, to be attempted only by those who fully understand its purpose and implications. Incorrect usage can lead to sub-par prints or printer damage. Please make sure to carefully read and understand the process before doing it."));
|
|
auto_cali_content->SetFont(Label::Body_14);
|
|
auto_cali_content->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
auto_cali_content->SetMinSize({CALIBRATION_START_PAGE_TEXT_MAX_LENGTH, -1});
|
|
|
|
m_top_sizer->Add(auto_cali_title);
|
|
m_top_sizer->Add(auto_cali_content);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
m_action_panel = new CaliPageActionPanel(parent, CalibMode::Calib_Flow_Rate, CaliPageType::CALI_PAGE_START);
|
|
|
|
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
|
|
|
|
#ifdef __linux__
|
|
wxGetApp().CallAfter([this, auto_cali_content, extra_text]() {
|
|
m_when_content->SetMinSize(m_when_content->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() });
|
|
auto_cali_content->SetMinSize(auto_cali_content->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() });
|
|
extra_text->SetMinSize(extra_text->GetSize() + wxSize{ 0, wxWindow::GetCharHeight() });
|
|
Layout();
|
|
Fit();
|
|
});
|
|
#endif
|
|
}
|
|
|
|
void CalibrationFlowRateStartPage::on_reset_page()
|
|
{
|
|
//disable all button
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, false);
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, false);
|
|
}
|
|
|
|
void CalibrationFlowRateStartPage::on_device_connected(MachineObject* obj)
|
|
{
|
|
//enable all button
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, true);
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, true);
|
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
|
|
|
if (obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, false);
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, true);
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
|
|
|
if (obj->cali_version <= -1) {
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, true);
|
|
}
|
|
else {
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, false);
|
|
}
|
|
}
|
|
else if (obj->get_printer_series() == PrinterSeries::SERIES_P1P) {
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, false);
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
|
|
|
m_action_panel->bind_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, false);
|
|
}
|
|
|
|
//is support auto cali
|
|
bool is_support_flow_rate_auto = (obj->home_flag >> 15 & 1) == 1;
|
|
if (!is_support_flow_rate_auto) {
|
|
m_action_panel->show_button(CaliPageActionType::CALI_ACTION_AUTO_CALI, false);
|
|
}
|
|
}
|
|
|
|
void CalibrationFlowRateStartPage::msw_rescale()
|
|
{
|
|
CalibrationWizardPage::msw_rescale();
|
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
|
create_bitmap(this, "cali_page_flow_introduction_CN");
|
|
} else {
|
|
create_bitmap(this, "cali_page_flow_introduction");
|
|
}
|
|
}
|
|
|
|
CalibrationMaxVolumetricSpeedStartPage::CalibrationMaxVolumetricSpeedStartPage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
|
|
: CalibrationStartPage(parent, id, pos, size, style)
|
|
{
|
|
m_cali_mode = CalibMode::Calib_Vol_speed_Tower;
|
|
|
|
create_page(this);
|
|
|
|
this->SetSizer(m_top_sizer);
|
|
Layout();
|
|
m_top_sizer->Fit(this);
|
|
}
|
|
|
|
void CalibrationMaxVolumetricSpeedStartPage::create_page(wxWindow* parent)
|
|
{
|
|
m_page_caption = new CaliPageCaption(parent, m_cali_mode);
|
|
m_page_caption->show_prev_btn(false);
|
|
m_top_sizer->Add(m_page_caption, 0, wxEXPAND, 0);
|
|
create_when(parent, _L("When you need Max Volumetric Speed Calibration"), _L("Over-extrusion or under extrusion"));
|
|
|
|
m_top_sizer->Add(m_when_title);
|
|
m_top_sizer->Add(m_when_content);
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
auto recommend_title = new Label(parent, _L("Max Volumetric Speed calibration is recommended when you print with:"));
|
|
recommend_title->SetFont(Label::Head_14);
|
|
recommend_title->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
m_top_sizer->Add(recommend_title);
|
|
auto recommend_text1 = new Label(parent, _L("material with significant thermal shrinkage/expansion, such as..."));
|
|
recommend_text1->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
recommend_text1->SetFont(Label::Body_14);
|
|
m_top_sizer->Add(recommend_text1);
|
|
auto recommend_text2 = new Label(parent, _L("materials with inaccurate filament diameter"));
|
|
recommend_text2->Wrap(CALIBRATION_START_PAGE_TEXT_MAX_LENGTH);
|
|
recommend_text2->SetFont(Label::Body_14);
|
|
m_top_sizer->Add(recommend_text2);
|
|
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
|
create_bitmap(parent, "cali_page_before_pa_CN", "cali_page_after_pa_CN");
|
|
} else {
|
|
create_bitmap(parent, "cali_page_before_pa", "cali_page_after_pa");
|
|
}
|
|
|
|
m_top_sizer->Add(m_images_sizer, 0, wxALL, 0);
|
|
|
|
m_top_sizer->AddSpacer(PRESET_GAP);
|
|
|
|
m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_START);
|
|
|
|
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
|
|
}
|
|
|
|
void CalibrationMaxVolumetricSpeedStartPage::msw_rescale()
|
|
{
|
|
CalibrationWizardPage::msw_rescale();
|
|
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
|
create_bitmap(this, "cali_page_before_pa_CN", "cali_page_after_pa_CN");
|
|
} else {
|
|
create_bitmap(this, "cali_page_before_pa", "cali_page_after_pa");
|
|
}
|
|
}
|
|
|
|
}} |