FIX: modify for get pa cali result
jira: none Change-Id: I3c57ccaac3b7e73e0b2eb0e26678635478480298
This commit is contained in:
parent
d050aa4d36
commit
6bf3969051
|
@ -139,10 +139,11 @@ struct PACalibIndexInfo
|
|||
|
||||
struct PACalibExtruderInfo
|
||||
{
|
||||
int extruder_id;
|
||||
int extruder_id = -1;
|
||||
NozzleVolumeType nozzle_volume_type;
|
||||
float nozzle_diameter;
|
||||
std::string filament_id = "";
|
||||
bool use_extruder_id{true};
|
||||
bool use_nozzle_volume_type{true};
|
||||
};
|
||||
|
||||
|
|
|
@ -519,7 +519,9 @@ void AMSMaterialsSetting::on_select_reset(wxCommandEvent& event) {
|
|||
}
|
||||
else {
|
||||
PACalibIndexInfo select_index_info;
|
||||
select_index_info.tray_id = slot_id;
|
||||
select_index_info.tray_id = ams_id * 4 + slot_id;
|
||||
select_index_info.ams_id = ams_id;
|
||||
select_index_info.slot_id = slot_id;
|
||||
select_index_info.nozzle_diameter = obj->m_extder_data.extders[0].current_nozzle_diameter;
|
||||
select_index_info.cali_idx = -1;
|
||||
select_index_info.filament_id = selected_ams_id;
|
||||
|
@ -661,6 +663,8 @@ void AMSMaterialsSetting::on_select_ok(wxCommandEvent &event)
|
|||
if (obj->cali_version >= 0) {
|
||||
PACalibIndexInfo select_index_info;
|
||||
select_index_info.tray_id = vt_tray;
|
||||
select_index_info.ams_id = vt_tray;
|
||||
select_index_info.slot_id = 0;
|
||||
select_index_info.nozzle_diameter = obj->m_extder_data.extders[0].current_nozzle_diameter;
|
||||
|
||||
auto cali_select_id = m_comboBox_cali_result->GetSelection();
|
||||
|
@ -700,6 +704,8 @@ void AMSMaterialsSetting::on_select_ok(wxCommandEvent &event)
|
|||
if (obj->cali_version >= 0) {
|
||||
PACalibIndexInfo select_index_info;
|
||||
select_index_info.tray_id = cali_tray_id;
|
||||
select_index_info.ams_id = ams_id;
|
||||
select_index_info.slot_id = slot_id;
|
||||
select_index_info.nozzle_diameter = obj->m_extder_data.extders[0].current_nozzle_diameter;
|
||||
|
||||
auto cali_select_id = m_comboBox_cali_result->GetSelection();
|
||||
|
|
|
@ -620,7 +620,9 @@ void PressureAdvanceWizard::update(MachineObject* obj)
|
|||
cali_version = obj->cali_version;
|
||||
PACalibExtruderInfo cali_info;
|
||||
cali_info.nozzle_diameter = obj->m_extder_data.extders[0].current_nozzle_diameter;
|
||||
CalibUtils::emit_get_PA_calib_info(cali_info);
|
||||
cali_info.use_extruder_id = false;
|
||||
cali_info.use_nozzle_volume_type = false;
|
||||
CalibUtils::emit_get_PA_calib_infos(cali_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -258,7 +258,9 @@ wxString generate_nozzle_id(NozzleVolumeType nozzle_type, const std::string& dia
|
|||
nozzle_id += "H";
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
default:
|
||||
nozzle_id += "H";
|
||||
break;
|
||||
}
|
||||
nozzle_id += "00";
|
||||
nozzle_id += "-";
|
||||
|
@ -2406,7 +2408,8 @@ int MachineObject::command_get_pa_calibration_tab(const PACalibExtruderInfo &cal
|
|||
j["print"]["command"] = "extrusion_cali_get";
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
j["print"]["filament_id"] = calib_info.filament_id;
|
||||
j["print"]["extruder_id"] = calib_info.extruder_id;
|
||||
if (calib_info.use_extruder_id)
|
||||
j["print"]["extruder_id"] = calib_info.extruder_id;
|
||||
if (calib_info.use_nozzle_volume_type)
|
||||
j["print"]["nozzle_id"] = generate_nozzle_id(calib_info.nozzle_volume_type, to_string_nozzle_diameter(calib_info.nozzle_diameter)).ToStdString();
|
||||
j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(calib_info.nozzle_diameter);
|
||||
|
|
|
@ -2954,7 +2954,9 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
last_cali_version = obj->cali_version;
|
||||
PACalibExtruderInfo cali_info;
|
||||
cali_info.nozzle_diameter = obj->m_extder_data.extders[0].current_nozzle_diameter;
|
||||
CalibUtils::emit_get_PA_calib_info(cali_info);
|
||||
cali_info.use_extruder_id = false;
|
||||
cali_info.use_nozzle_volume_type = false;
|
||||
CalibUtils::emit_get_PA_calib_infos(cali_info);
|
||||
}
|
||||
|
||||
bool is_support_virtual_tray = obj->ams_support_virtual_tray;
|
||||
|
|
|
@ -426,31 +426,6 @@ bool CalibUtils::get_PA_calib_tab(std::vector<PACalibResult> &pa_calib_infos)
|
|||
return obj_->has_get_pa_calib_tab;
|
||||
}
|
||||
|
||||
void CalibUtils::emit_get_PA_calib_info(const PACalibExtruderInfo &cali_info)
|
||||
{
|
||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) return;
|
||||
|
||||
MachineObject *obj_ = dev->get_selected_machine();
|
||||
if (obj_ == nullptr) return;
|
||||
|
||||
obj_->command_get_pa_calibration_tab(cali_info);
|
||||
}
|
||||
|
||||
bool CalibUtils::get_PA_calib_info(PACalibResult & pa_calib_info) {
|
||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) return false;
|
||||
|
||||
MachineObject *obj_ = dev->get_selected_machine();
|
||||
if (obj_ == nullptr) return false;
|
||||
|
||||
if (!obj_->pa_calib_tab.empty()) {
|
||||
pa_calib_info = obj_->pa_calib_tab.front();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CalibUtils::set_PA_calib_result(const std::vector<PACalibResult> &pa_calib_values, bool is_auto_cali)
|
||||
{
|
||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
|
|
|
@ -46,9 +46,6 @@ public:
|
|||
static void emit_get_PA_calib_infos(const PACalibExtruderInfo &cali_info);
|
||||
static bool get_PA_calib_tab(std::vector<PACalibResult> &pa_calib_infos);
|
||||
|
||||
static void emit_get_PA_calib_info(const PACalibExtruderInfo& cali_info);
|
||||
static bool get_PA_calib_info(PACalibResult &pa_calib_info);
|
||||
|
||||
static void set_PA_calib_result(const std::vector<PACalibResult>& pa_calib_values, bool is_auto_cali);
|
||||
static void select_PA_calib_result(const PACalibIndexInfo &pa_calib_info);
|
||||
static void delete_PA_calib_result(const PACalibIndexInfo &pa_calib_info);
|
||||
|
|
Loading…
Reference in New Issue