FIX: 1. the status of ams item is not correct
2. fix the status cali button of stat page is sometimes incorrect 3. when the nozzle volume type is not the same as printer, prompt user to sync 4. fix the incorrect nozzle volume type of cali preset page jira: STUDIO-8856 STUDIO-8832 Change-Id: I83569f41533681b3d2f68d7b86be68955bd957f1
This commit is contained in:
parent
7b5818fe6c
commit
9dffa8d002
|
@ -62,7 +62,7 @@ std::map<int, TrayInfo> get_cached_selected_filament_for_multi_extruder(MachineO
|
||||||
|
|
||||||
bool is_pa_params_valid(const Calib_Params& params)
|
bool is_pa_params_valid(const Calib_Params& params)
|
||||||
{
|
{
|
||||||
if (params.start < MIN_PA_K_VALUE || params.end > MAX_PA_K_VALUE || params.step < EPSILON || params.end < params.start + params.step) {
|
if (params.start <= MIN_PA_K_VALUE || params.end >= MAX_PA_K_VALUE || params.step < EPSILON || params.end < params.start + params.step) {
|
||||||
MessageDialog msg_dlg(nullptr,
|
MessageDialog msg_dlg(nullptr,
|
||||||
wxString::Format(_L("Please input valid values:\nStart value: >= %.1f\nEnd value: <= %.1f\nEnd value: > Start value\nValue step: >= %.3f)"), MIN_PA_K_VALUE, MAX_PA_K_VALUE, MIN_PA_K_VALUE_STEP),
|
wxString::Format(_L("Please input valid values:\nStart value: >= %.1f\nEnd value: <= %.1f\nEnd value: > Start value\nValue step: >= %.3f)"), MIN_PA_K_VALUE, MAX_PA_K_VALUE, MIN_PA_K_VALUE_STEP),
|
||||||
wxEmptyString, wxICON_WARNING | wxOK);
|
wxEmptyString, wxICON_WARNING | wxOK);
|
||||||
|
|
|
@ -1890,7 +1890,10 @@ void CalibrationPresetPage::init_with_machine(MachineObject* obj)
|
||||||
if (obj->is_multi_extruders()) {
|
if (obj->is_multi_extruders()) {
|
||||||
for (int i = 0; i < m_comboBox_nozzle_volume_types.size(); ++i) {
|
for (int i = 0; i < m_comboBox_nozzle_volume_types.size(); ++i) {
|
||||||
m_comboBox_nozzle_volume_types[i]->Show();
|
m_comboBox_nozzle_volume_types[i]->Show();
|
||||||
m_comboBox_nozzle_volume_types[i]->SetSelection(obj->m_extder_data.extders[i].current_nozzle_flow_type);
|
if (obj->m_extder_data.extders[i].current_nozzle_flow_type != NozzleFlowType::NONE_FLOWTYPE)
|
||||||
|
m_comboBox_nozzle_volume_types[i]->SetSelection(obj->m_extder_data.extders[i].current_nozzle_flow_type - 1);
|
||||||
|
else
|
||||||
|
m_comboBox_nozzle_volume_types[i]->SetSelection(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!obj->is_main_extruder_on_left() && m_main_extruder_on_left) {
|
if (!obj->is_main_extruder_on_left() && m_main_extruder_on_left) {
|
||||||
|
|
|
@ -146,7 +146,7 @@ void CalibrationPAStartPage::on_reset_page()
|
||||||
|
|
||||||
void CalibrationPAStartPage::on_device_connected(MachineObject* obj)
|
void CalibrationPAStartPage::on_device_connected(MachineObject* obj)
|
||||||
{
|
{
|
||||||
update(obj);
|
update(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalibrationPAStartPage::msw_rescale()
|
void CalibrationPAStartPage::msw_rescale()
|
||||||
|
@ -166,7 +166,7 @@ void CalibrationPAStartPage::update(MachineObject *obj)
|
||||||
return;
|
return;
|
||||||
curr_obj = obj;
|
curr_obj = obj;
|
||||||
|
|
||||||
//enable all button
|
// enable all button
|
||||||
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANAGE_RESULT, true);
|
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_AUTO_CALI, true);
|
||||||
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
||||||
|
|
|
@ -18,7 +18,7 @@ ExtrusionCalibration::ExtrusionCalibration(wxWindow *parent, wxWindowID id)
|
||||||
wxGetApp().UpdateDlgDarkUI(this);
|
wxGetApp().UpdateDlgDarkUI(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtrusionCalibration::init_bitmaps()
|
void ExtrusionCalibration::init_bitmaps()
|
||||||
{
|
{
|
||||||
auto lan = wxGetApp().app_config->get_language_code();
|
auto lan = wxGetApp().app_config->get_language_code();
|
||||||
if (lan == "zh-cn") {
|
if (lan == "zh-cn") {
|
||||||
|
@ -211,7 +211,7 @@ void ExtrusionCalibration::create()
|
||||||
cali_sizer->Add(m_button_cali, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, FromDIP(10));
|
cali_sizer->Add(m_button_cali, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, FromDIP(10));
|
||||||
cali_sizer->Add(m_cali_cancel, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, FromDIP(10));
|
cali_sizer->Add(m_cali_cancel, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, FromDIP(10));
|
||||||
cali_sizer->Add(m_button_next_step, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, FromDIP(10));
|
cali_sizer->Add(m_button_next_step, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, FromDIP(10));
|
||||||
|
|
||||||
step_1_sizer->Add(cali_sizer, 0, wxEXPAND);
|
step_1_sizer->Add(cali_sizer, 0, wxEXPAND);
|
||||||
step_1_sizer->Add(0, EXTRUSION_CALIBRATION_WIDGET_GAP, 0, 0);
|
step_1_sizer->Add(0, EXTRUSION_CALIBRATION_WIDGET_GAP, 0, 0);
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ void ExtrusionCalibration::open_bitmap(wxMouseEvent& event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtrusionCalibration::input_value_finish()
|
void ExtrusionCalibration::input_value_finish()
|
||||||
{
|
{
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ void ExtrusionCalibration::show_info(bool show, bool is_error, wxString text)
|
||||||
void ExtrusionCalibration::update()
|
void ExtrusionCalibration::update()
|
||||||
{
|
{
|
||||||
if (obj) {
|
if (obj) {
|
||||||
if (obj->is_in_extrusion_cali()) {
|
if (obj->is_in_extrusion_cali()) {
|
||||||
show_info(true, false, wxString::Format(_L("Calibrating... %d%%"), obj->mc_print_percent));
|
show_info(true, false, wxString::Format(_L("Calibrating... %d%%"), obj->mc_print_percent));
|
||||||
m_cali_cancel->Show();
|
m_cali_cancel->Show();
|
||||||
m_cali_cancel->Enable();
|
m_cali_cancel->Enable();
|
||||||
|
@ -510,7 +510,7 @@ bool ExtrusionCalibration::check_k_validation(wxString k_text)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k < MIN_PA_K_VALUE || k > MAX_PA_K_VALUE)
|
if (k <= MIN_PA_K_VALUE || k >= MAX_PA_K_VALUE)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -534,7 +534,7 @@ bool ExtrusionCalibration::check_k_n_validation(wxString k_text, wxString n_text
|
||||||
catch (...) {
|
catch (...) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
if (k < MIN_PA_K_VALUE || k > MAX_PA_K_VALUE)
|
if (k <= MIN_PA_K_VALUE || k >= MAX_PA_K_VALUE)
|
||||||
return false;
|
return false;
|
||||||
if (n < 0.6 || n > 2.0)
|
if (n < 0.6 || n > 2.0)
|
||||||
return false;
|
return false;
|
||||||
|
@ -613,13 +613,13 @@ void ExtrusionCalibration::on_click_next(wxCommandEvent& event)
|
||||||
set_step(2);
|
set_step(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExtrusionCalibration::Show(bool show)
|
bool ExtrusionCalibration::Show(bool show)
|
||||||
{
|
{
|
||||||
if (show) {
|
if (show) {
|
||||||
m_k_val->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
|
m_k_val->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
|
||||||
m_n_val->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
|
m_n_val->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
|
||||||
}
|
}
|
||||||
return DPIDialog::Show(show);
|
return DPIDialog::Show(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtrusionCalibration::update_combobox_filaments()
|
void ExtrusionCalibration::update_combobox_filaments()
|
||||||
|
@ -809,7 +809,7 @@ void ExtrusionCalibration::update_filament_info()
|
||||||
bed_temp_int = get_bed_temp(&filament_it->config);
|
bed_temp_int = get_bed_temp(&filament_it->config);
|
||||||
wxString bed_temp_text = wxString::Format("%d", bed_temp_int);
|
wxString bed_temp_text = wxString::Format("%d", bed_temp_int);
|
||||||
m_bed_temp->GetTextCtrl()->SetValue(bed_temp_text);
|
m_bed_temp->GetTextCtrl()->SetValue(bed_temp_text);
|
||||||
|
|
||||||
// update max flow speed
|
// update max flow speed
|
||||||
ConfigOption* opt_flow_speed = filament_it->config.option("filament_max_volumetric_speed");
|
ConfigOption* opt_flow_speed = filament_it->config.option("filament_max_volumetric_speed");
|
||||||
if (opt_flow_speed) {
|
if (opt_flow_speed) {
|
||||||
|
|
|
@ -8524,6 +8524,17 @@ bool Plater::priv::check_ams_status_impl()
|
||||||
|
|
||||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||||
if (preset_bundle && preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle) == obj->printer_type) {
|
if (preset_bundle && preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle) == obj->printer_type) {
|
||||||
|
bool is_same_as_printer = true;
|
||||||
|
auto nozzle_volumes_values = preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type")->values;
|
||||||
|
assert(obj->m_extder_data.extders.size() == 2 && nozzle_volumes_values.size() == 2);
|
||||||
|
if (obj->m_extder_data.extders.size() == 2 && nozzle_volumes_values.size() == 2) {
|
||||||
|
NozzleVolumeType right_nozzle_type = NozzleVolumeType(obj->m_extder_data.extders[0].current_nozzle_flow_type - 1);
|
||||||
|
NozzleVolumeType left_nozzle_type = NozzleVolumeType(obj->m_extder_data.extders[1].current_nozzle_flow_type - 1);
|
||||||
|
NozzleVolumeType preset_left_type = NozzleVolumeType(nozzle_volumes_values[0]);
|
||||||
|
NozzleVolumeType preset_right_type = NozzleVolumeType(nozzle_volumes_values[1]);
|
||||||
|
is_same_as_printer = (left_nozzle_type == preset_left_type && right_nozzle_type == preset_right_type);
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::map<int, int>> ams_count_info;
|
std::vector<std::map<int, int>> ams_count_info;
|
||||||
ams_count_info.resize(2);
|
ams_count_info.resize(2);
|
||||||
int deputy_4 = 0, main_4 = 0, deputy_1 = 0, main_1 = 0;
|
int deputy_4 = 0, main_4 = 0, deputy_1 = 0, main_1 = 0;
|
||||||
|
@ -8553,9 +8564,8 @@ bool Plater::priv::check_ams_status_impl()
|
||||||
right_1 = main_1;
|
right_1 = main_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_same_as_printer = false;
|
|
||||||
if (!preset_bundle->extruder_ams_counts.empty() && !preset_bundle->extruder_ams_counts.front().empty()) {
|
if (!preset_bundle->extruder_ams_counts.empty() && !preset_bundle->extruder_ams_counts.front().empty()) {
|
||||||
is_same_as_printer = preset_bundle->extruder_ams_counts[0][4] == left_4
|
is_same_as_printer &= preset_bundle->extruder_ams_counts[0][4] == left_4
|
||||||
&& preset_bundle->extruder_ams_counts[0][1] == left_1
|
&& preset_bundle->extruder_ams_counts[0][1] == left_1
|
||||||
&& preset_bundle->extruder_ams_counts[1][4] == right_4
|
&& preset_bundle->extruder_ams_counts[1][4] == right_4
|
||||||
&& preset_bundle->extruder_ams_counts[1][1] == right_1;
|
&& preset_bundle->extruder_ams_counts[1][1] == right_1;
|
||||||
|
|
|
@ -1107,11 +1107,14 @@ void AMSLib::render_generic_text(wxDC &dc)
|
||||||
if (m_info.material_name.empty()) {
|
if (m_info.material_name.empty()) {
|
||||||
show_k_value = false;
|
show_k_value = false;
|
||||||
}
|
}
|
||||||
else if (m_obj && m_obj->is_multi_extruders() && m_info.cali_idx == -1) {
|
|
||||||
show_k_value = false;
|
|
||||||
}
|
|
||||||
else if (m_info.cali_idx == -1 || (m_obj && (CalibUtils::get_selected_calib_idx(m_obj->pa_calib_tab, m_info.cali_idx) == -1))) {
|
else if (m_info.cali_idx == -1 || (m_obj && (CalibUtils::get_selected_calib_idx(m_obj->pa_calib_tab, m_info.cali_idx) == -1))) {
|
||||||
get_default_k_n_value(m_info.filament_id, m_info.k, m_info.n);
|
if (m_obj && m_obj->is_multi_extruders())
|
||||||
|
show_k_value = false;
|
||||||
|
else
|
||||||
|
get_default_k_n_value(m_info.filament_id, m_info.k, m_info.n);
|
||||||
|
}
|
||||||
|
else if (abs(m_info.k) < EPSILON) {
|
||||||
|
show_k_value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tmp_lib_colour = m_info.material_colour;
|
auto tmp_lib_colour = m_info.material_colour;
|
||||||
|
|
|
@ -272,7 +272,7 @@ bool CalibUtils::validate_input_k_value(wxString k_text, float* output_value)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k_value < MIN_PA_K_VALUE || k_value > MAX_PA_K_VALUE) {
|
if (k_value <= MIN_PA_K_VALUE || k_value >= MAX_PA_K_VALUE) {
|
||||||
*output_value = default_k;
|
*output_value = default_k;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue