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)
|
||||
{
|
||||
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,
|
||||
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);
|
||||
|
|
|
@ -1890,7 +1890,10 @@ void CalibrationPresetPage::init_with_machine(MachineObject* obj)
|
|||
if (obj->is_multi_extruders()) {
|
||||
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]->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) {
|
||||
|
|
|
@ -166,7 +166,7 @@ void CalibrationPAStartPage::update(MachineObject *obj)
|
|||
return;
|
||||
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_AUTO_CALI, true);
|
||||
m_action_panel->enable_button(CaliPageActionType::CALI_ACTION_MANUAL_CALI, true);
|
||||
|
|
|
@ -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 true;
|
||||
}
|
||||
|
@ -534,7 +534,7 @@ bool ExtrusionCalibration::check_k_n_validation(wxString k_text, wxString n_text
|
|||
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;
|
||||
if (n < 0.6 || n > 2.0)
|
||||
return false;
|
||||
|
|
|
@ -8524,6 +8524,17 @@ bool Plater::priv::check_ams_status_impl()
|
|||
|
||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||
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;
|
||||
ams_count_info.resize(2);
|
||||
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;
|
||||
}
|
||||
|
||||
bool is_same_as_printer = false;
|
||||
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[1][4] == right_4
|
||||
&& preset_bundle->extruder_ams_counts[1][1] == right_1;
|
||||
|
|
|
@ -1107,12 +1107,15 @@ void AMSLib::render_generic_text(wxDC &dc)
|
|||
if (m_info.material_name.empty()) {
|
||||
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))) {
|
||||
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;
|
||||
change_the_opacity(tmp_lib_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;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue