mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-27 01:58:36 -07:00
FIX: modify for virtual slot when multi_extruder
jira: none Change-Id: Ic7284018ecb44e24536788b05dba572b96460e66 (cherry picked from commit 52e890fba1584bf9687a24ee46890c00f531e383)
This commit is contained in:
parent
11cc964352
commit
8a89c159db
4 changed files with 44 additions and 12 deletions
|
|
@ -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) {
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
else {
|
||||
obj->command_extrusion_cali_set(VIRTUAL_TRAY_ID, "", "", k, n);
|
||||
obj->command_extrusion_cali_set(vt_tray, "", "", k, n);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -1169,7 +1174,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
|
|||
}
|
||||
|
||||
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;
|
||||
cali_select_idx = CalibUtils::get_selected_calib_idx(m_pa_profile_items,selected_tray.cali_idx);
|
||||
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 float MIN_PA_K_VALUE_STEP = 0.001;
|
||||
static const int MAX_PA_HISTORY_RESULTS_NUMS = 16;
|
||||
|
||||
std::map<int, Preset*> get_cached_selected_filament(MachineObject* obj) {
|
||||
std::map<int, Preset*> 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)
|
||||
{
|
||||
this->on_cali_job_finished(event.GetString());
|
||||
|
|
@ -591,7 +610,7 @@ void PressureAdvanceWizard::on_cali_start()
|
|||
}
|
||||
|
||||
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.filament_id = item.second->filament_id;
|
||||
calib_info.setting_id = item.second->setting_id;
|
||||
|
|
@ -623,9 +642,11 @@ void PressureAdvanceWizard::on_cali_start()
|
|||
return;
|
||||
}
|
||||
|
||||
int selected_tray_id = 0;
|
||||
CalibInfo calib_info;
|
||||
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 * temp_filament_preset = new Preset(preset->type, preset->name + "_temp");
|
||||
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;
|
||||
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.filament_id = item.second->filament_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()) {
|
||||
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;
|
||||
temp_filament_preset = new Preset(preset->type, preset->name + "_temp");
|
||||
temp_filament_preset->config = preset->config;
|
||||
|
|
@ -1417,7 +1441,9 @@ void MaxVolumetricSpeedWizard::on_cali_start()
|
|||
calib_info.params = params;
|
||||
calib_info.dev_id = curr_obj->dev_id;
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public:
|
|||
CalibrationWizardPageStep(CalibrationWizardPage* data) {
|
||||
page = data;
|
||||
}
|
||||
|
||||
|
||||
CalibrationWizardPageStep* prev { nullptr };
|
||||
CalibrationWizardPageStep* next { nullptr };
|
||||
CalibrationWizardPage* page { nullptr };
|
||||
|
|
@ -57,7 +57,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void set_cali_method(CalibrationMethod method);
|
||||
|
||||
|
||||
CalibMode get_calibration_mode() { return m_mode; }
|
||||
|
||||
bool save_preset(const std::string &old_preset_name, const std::string &new_preset_name, const std::map<std::string, ConfigOption *> &key_values, wxString& message);
|
||||
|
|
@ -71,6 +71,7 @@ public:
|
|||
|
||||
protected:
|
||||
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:
|
||||
/* wx widgets*/
|
||||
|
|
@ -89,7 +90,7 @@ protected:
|
|||
CalibrationWizardPageStep* preset_step { nullptr };
|
||||
CalibrationWizardPageStep* cali_step { nullptr };
|
||||
CalibrationWizardPageStep* save_step { nullptr };
|
||||
|
||||
|
||||
CalibrationWizardPageStep* cali_coarse_step { nullptr };
|
||||
CalibrationWizardPageStep* coarse_save_step { nullptr };
|
||||
CalibrationWizardPageStep* cali_fine_step { nullptr };
|
||||
|
|
|
|||
|
|
@ -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_exist", new ConfigOptionBools{ false });
|
||||
|
||||
/* update virtual tray combo box*/
|
||||
// update virtual tray combo box
|
||||
m_virtual_tray_comboBox->update_from_preset();
|
||||
auto it = std::find_if(filament_ams_list.begin(), filament_ams_list.end(), [](auto& entry) {
|
||||
return entry.first == VIRTUAL_TRAY_ID;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue