mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 19:12:17 +00:00
FIX: modify for virtual slot when multi_extruder
jira: none Change-Id: Ic7284018ecb44e24536788b05dba572b96460e66 (cherry picked from commit 52e890fba1584bf9687a24ee46890c00f531e383)
This commit is contained in:
@@ -667,9 +667,14 @@ void AMSMaterialsSetting::on_select_ok(wxCommandEvent &event)
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto vt_tray = ams_id;
|
||||||
|
if (!obj->is_enable_np) {
|
||||||
|
vt_tray = VIRTUAL_TRAY_ID;
|
||||||
|
}
|
||||||
|
|
||||||
if (obj->cali_version >= 0) {
|
if (obj->cali_version >= 0) {
|
||||||
PACalibIndexInfo select_index_info;
|
PACalibIndexInfo select_index_info;
|
||||||
select_index_info.tray_id = tray_id;
|
select_index_info.tray_id = vt_tray;
|
||||||
select_index_info.nozzle_diameter = obj->m_nozzle_data.nozzles[0].diameter;
|
select_index_info.nozzle_diameter = obj->m_nozzle_data.nozzles[0].diameter;
|
||||||
|
|
||||||
auto cali_select_id = m_comboBox_cali_result->GetSelection();
|
auto cali_select_id = m_comboBox_cali_result->GetSelection();
|
||||||
@@ -685,7 +690,7 @@ void AMSMaterialsSetting::on_select_ok(wxCommandEvent &event)
|
|||||||
CalibUtils::select_PA_calib_result(select_index_info);
|
CalibUtils::select_PA_calib_result(select_index_info);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
obj->command_extrusion_cali_set(VIRTUAL_TRAY_ID, "", "", k, n);
|
obj->command_extrusion_cali_set(vt_tray, "", "", k, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1169,7 +1174,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_comboBox_cali_result->Set(items);
|
m_comboBox_cali_result->Set(items);
|
||||||
if (tray_id == VIRTUAL_TRAY_ID) {
|
if (ams_id == VIRTUAL_TRAY_ID) {
|
||||||
AmsTray selected_tray = this->obj->vt_tray;
|
AmsTray selected_tray = this->obj->vt_tray;
|
||||||
cali_select_idx = CalibUtils::get_selected_calib_idx(m_pa_profile_items,selected_tray.cali_idx);
|
cali_select_idx = CalibUtils::get_selected_calib_idx(m_pa_profile_items,selected_tray.cali_idx);
|
||||||
if (cali_select_idx >= 0) {
|
if (cali_select_idx >= 0) {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ wxDEFINE_EVENT(EVT_CALIBRATION_JOB_FINISHED, wxCommandEvent);
|
|||||||
static const wxString NA_STR = _L("N/A");
|
static const wxString NA_STR = _L("N/A");
|
||||||
static const float MIN_PA_K_VALUE_STEP = 0.001;
|
static const float MIN_PA_K_VALUE_STEP = 0.001;
|
||||||
static const int MAX_PA_HISTORY_RESULTS_NUMS = 16;
|
static const int MAX_PA_HISTORY_RESULTS_NUMS = 16;
|
||||||
|
|
||||||
std::map<int, Preset*> get_cached_selected_filament(MachineObject* obj) {
|
std::map<int, Preset*> get_cached_selected_filament(MachineObject* obj) {
|
||||||
std::map<int, Preset*> selected_filament_map;
|
std::map<int, Preset*> selected_filament_map;
|
||||||
if (!obj) return selected_filament_map;
|
if (!obj) return selected_filament_map;
|
||||||
@@ -103,6 +102,26 @@ CalibrationWizard::~CalibrationWizard()
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CalibrationWizard::get_tray_ams_and_slot_id(int in_tray_id, int &ams_id, int &slot_id, int &tray_id)
|
||||||
|
{
|
||||||
|
assert(curr_obj);
|
||||||
|
if (!curr_obj)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (in_tray_id == VIRTUAL_TRAY_ID || in_tray_id == VIRTUAL_TRAY_ID) {
|
||||||
|
ams_id = in_tray_id;
|
||||||
|
slot_id = 0;
|
||||||
|
tray_id = ams_id;
|
||||||
|
if (!curr_obj->is_enable_np)
|
||||||
|
tray_id = VIRTUAL_TRAY_ID;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ams_id = in_tray_id / 4;
|
||||||
|
slot_id = in_tray_id % 4;
|
||||||
|
tray_id = in_tray_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CalibrationWizard::on_cali_job_finished(wxCommandEvent& event)
|
void CalibrationWizard::on_cali_job_finished(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
this->on_cali_job_finished(event.GetString());
|
this->on_cali_job_finished(event.GetString());
|
||||||
@@ -591,7 +610,7 @@ void PressureAdvanceWizard::on_cali_start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
X1CCalibInfos::X1CCalibInfo calib_info;
|
X1CCalibInfos::X1CCalibInfo calib_info;
|
||||||
calib_info.tray_id = item.first;
|
get_tray_ams_and_slot_id(item.first, calib_info.ams_id, calib_info.slot_id, calib_info.tray_id);
|
||||||
calib_info.nozzle_diameter = nozzle_dia;
|
calib_info.nozzle_diameter = nozzle_dia;
|
||||||
calib_info.filament_id = item.second->filament_id;
|
calib_info.filament_id = item.second->filament_id;
|
||||||
calib_info.setting_id = item.second->setting_id;
|
calib_info.setting_id = item.second->setting_id;
|
||||||
@@ -623,9 +642,11 @@ void PressureAdvanceWizard::on_cali_start()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int selected_tray_id = 0;
|
||||||
CalibInfo calib_info;
|
CalibInfo calib_info;
|
||||||
calib_info.dev_id = curr_obj->dev_id;
|
calib_info.dev_id = curr_obj->dev_id;
|
||||||
calib_info.select_ams = "[" + std::to_string(selected_filaments.begin()->first) + "]";
|
get_tray_ams_and_slot_id(selected_filaments.begin()->first, calib_info.ams_id, calib_info.slot_id, selected_tray_id);
|
||||||
|
calib_info.select_ams = "[" + std::to_string(selected_tray_id) + "]";
|
||||||
Preset *preset = selected_filaments.begin()->second;
|
Preset *preset = selected_filaments.begin()->second;
|
||||||
Preset * temp_filament_preset = new Preset(preset->type, preset->name + "_temp");
|
Preset * temp_filament_preset = new Preset(preset->type, preset->name + "_temp");
|
||||||
temp_filament_preset->config = preset->config;
|
temp_filament_preset->config = preset->config;
|
||||||
@@ -991,6 +1012,7 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
|
|||||||
|
|
||||||
X1CCalibInfos::X1CCalibInfo calib_info;
|
X1CCalibInfos::X1CCalibInfo calib_info;
|
||||||
calib_info.tray_id = item.first;
|
calib_info.tray_id = item.first;
|
||||||
|
get_tray_ams_and_slot_id(item.first, calib_info.ams_id, calib_info.slot_id, calib_info.tray_id);
|
||||||
calib_info.nozzle_diameter = nozzle_dia;
|
calib_info.nozzle_diameter = nozzle_dia;
|
||||||
calib_info.filament_id = item.second->filament_id;
|
calib_info.filament_id = item.second->filament_id;
|
||||||
calib_info.setting_id = item.second->setting_id;
|
calib_info.setting_id = item.second->setting_id;
|
||||||
@@ -1041,7 +1063,9 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!selected_filaments.empty()) {
|
if (!selected_filaments.empty()) {
|
||||||
calib_info.select_ams = "[" + std::to_string(selected_filaments.begin()->first) + "]";
|
int selected_tray_id = 0;
|
||||||
|
get_tray_ams_and_slot_id(selected_filaments.begin()->first, calib_info.ams_id, calib_info.slot_id, selected_tray_id);
|
||||||
|
calib_info.select_ams = "[" + std::to_string(selected_tray_id) + "]";
|
||||||
Preset* preset = selected_filaments.begin()->second;
|
Preset* preset = selected_filaments.begin()->second;
|
||||||
temp_filament_preset = new Preset(preset->type, preset->name + "_temp");
|
temp_filament_preset = new Preset(preset->type, preset->name + "_temp");
|
||||||
temp_filament_preset->config = preset->config;
|
temp_filament_preset->config = preset->config;
|
||||||
@@ -1417,7 +1441,9 @@ void MaxVolumetricSpeedWizard::on_cali_start()
|
|||||||
calib_info.params = params;
|
calib_info.params = params;
|
||||||
calib_info.dev_id = curr_obj->dev_id;
|
calib_info.dev_id = curr_obj->dev_id;
|
||||||
if (!selected_filaments.empty()) {
|
if (!selected_filaments.empty()) {
|
||||||
calib_info.select_ams = "[" + std::to_string(selected_filaments.begin()->first) + "]";
|
int selected_tray_id = 0;
|
||||||
|
get_tray_ams_and_slot_id(selected_filaments.begin()->first, calib_info.ams_id, calib_info.slot_id, selected_tray_id);
|
||||||
|
calib_info.select_ams = "[" + std::to_string(selected_tray_id) + "]";
|
||||||
calib_info.filament_prest = selected_filaments.begin()->second;
|
calib_info.filament_prest = selected_filaments.begin()->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void on_cali_go_home();
|
void on_cali_go_home();
|
||||||
|
void get_tray_ams_and_slot_id(int in_tray_id, int &ams_id, int &slot_id, int &tray_id);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* wx widgets*/
|
/* wx widgets*/
|
||||||
|
|||||||
@@ -1780,7 +1780,7 @@ void CalibrationPresetPage::update_filament_combobox(std::string ams_id)
|
|||||||
empty_config.set_key_value("filament_colour", new ConfigOptionStrings{ "" });
|
empty_config.set_key_value("filament_colour", new ConfigOptionStrings{ "" });
|
||||||
empty_config.set_key_value("filament_exist", new ConfigOptionBools{ false });
|
empty_config.set_key_value("filament_exist", new ConfigOptionBools{ false });
|
||||||
|
|
||||||
/* update virtual tray combo box*/
|
// update virtual tray combo box
|
||||||
m_virtual_tray_comboBox->update_from_preset();
|
m_virtual_tray_comboBox->update_from_preset();
|
||||||
auto it = std::find_if(filament_ams_list.begin(), filament_ams_list.end(), [](auto& entry) {
|
auto it = std::find_if(filament_ams_list.begin(), filament_ams_list.end(), [](auto& entry) {
|
||||||
return entry.first == VIRTUAL_TRAY_ID;
|
return entry.first == VIRTUAL_TRAY_ID;
|
||||||
|
|||||||
Reference in New Issue
Block a user