FIX: the extruder_id of cali is incorrect with N3S
jira: STUDIO-9888 Change-Id: I25c4a436e322923a247d1c6d3c3de9f0319bb420
This commit is contained in:
parent
5c1916d3a1
commit
13355ca669
|
@ -130,26 +130,6 @@ 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_MAIN_ID || in_tray_id == VIRTUAL_TRAY_DEPUTY_ID) {
|
||||
ams_id = in_tray_id;
|
||||
slot_id = 0;
|
||||
tray_id = ams_id;
|
||||
if (!curr_obj->is_enable_np)
|
||||
tray_id = VIRTUAL_TRAY_DEPUTY_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());
|
||||
|
@ -415,7 +395,7 @@ void CalibrationWizard::cache_preset_info(MachineObject* obj, float nozzle_dia)
|
|||
|
||||
if (obj->is_multi_extruders()) {
|
||||
int ams_id, slot_id, tray_id;
|
||||
get_tray_ams_and_slot_id(result.tray_id, ams_id, slot_id, tray_id);
|
||||
get_tray_ams_and_slot_id(curr_obj, result.tray_id, ams_id, slot_id, tray_id);
|
||||
result.extruder_id = preset_page->get_extruder_id(ams_id);
|
||||
result.nozzle_volume_type = preset_page->get_nozzle_volume_type(result.extruder_id);
|
||||
result.nozzle_diameter = preset_page->get_nozzle_diameter(result.extruder_id);
|
||||
|
@ -734,7 +714,7 @@ void PressureAdvanceWizard::on_cali_start()
|
|||
}
|
||||
|
||||
X1CCalibInfos::X1CCalibInfo calib_info;
|
||||
get_tray_ams_and_slot_id(item.first, calib_info.ams_id, calib_info.slot_id, calib_info.tray_id);
|
||||
get_tray_ams_and_slot_id(curr_obj, item.first, calib_info.ams_id, calib_info.slot_id, calib_info.tray_id);
|
||||
calib_info.extruder_id = preset_page->get_extruder_id(calib_info.ams_id);
|
||||
calib_info.extruder_type = preset_page->get_extruder_type(calib_info.extruder_id);
|
||||
calib_info.nozzle_volume_type = preset_page->get_nozzle_volume_type(calib_info.extruder_id);
|
||||
|
@ -772,7 +752,7 @@ void PressureAdvanceWizard::on_cali_start()
|
|||
int selected_tray_id = 0;
|
||||
CalibInfo calib_info;
|
||||
calib_info.dev_id = curr_obj->dev_id;
|
||||
get_tray_ams_and_slot_id(selected_filaments.begin()->first, calib_info.ams_id, calib_info.slot_id, selected_tray_id);
|
||||
get_tray_ams_and_slot_id(curr_obj, selected_filaments.begin()->first, calib_info.ams_id, calib_info.slot_id, selected_tray_id);
|
||||
calib_info.extruder_id = preset_page->get_extruder_id(calib_info.ams_id);
|
||||
calib_info.extruder_type = preset_page->get_extruder_type(calib_info.extruder_id);
|
||||
calib_info.nozzle_volume_type = preset_page->get_nozzle_volume_type(calib_info.extruder_id);
|
||||
|
@ -1191,7 +1171,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);
|
||||
get_tray_ams_and_slot_id(curr_obj, item.first, calib_info.ams_id, calib_info.slot_id, calib_info.tray_id);
|
||||
calib_info.extruder_id = preset_page->get_extruder_id(calib_info.ams_id);
|
||||
calib_info.extruder_type = preset_page->get_extruder_type(calib_info.extruder_id);
|
||||
calib_info.nozzle_volume_type = preset_page->get_nozzle_volume_type(calib_info.extruder_id);
|
||||
|
@ -1244,7 +1224,7 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
|
|||
|
||||
if (!selected_filaments.empty()) {
|
||||
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);
|
||||
get_tray_ams_and_slot_id(curr_obj, 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.extruder_id = preset_page->get_extruder_id(calib_info.ams_id);
|
||||
calib_info.extruder_type = preset_page->get_extruder_type(calib_info.extruder_id);
|
||||
|
@ -1653,7 +1633,7 @@ void MaxVolumetricSpeedWizard::on_cali_start()
|
|||
calib_info.dev_id = curr_obj->dev_id;
|
||||
if (!selected_filaments.empty()) {
|
||||
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);
|
||||
get_tray_ams_and_slot_id(curr_obj, 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.extruder_id = preset_page->get_extruder_id(calib_info.ams_id);
|
||||
calib_info.extruder_type = preset_page->get_extruder_type(calib_info.extruder_id);
|
||||
|
|
|
@ -78,7 +78,6 @@ 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*/
|
||||
|
|
|
@ -1428,6 +1428,11 @@ bool CalibrationPresetPage::is_filaments_compatiable(const std::map<int, Preset*
|
|||
|
||||
bool CalibrationPresetPage::is_filament_in_blacklist(int tray_id, Preset* preset, std::string& error_tips)
|
||||
{
|
||||
int ams_id;
|
||||
int slot_id;
|
||||
int out_tray_id;
|
||||
get_tray_ams_and_slot_id(curr_obj, tray_id, ams_id, slot_id, out_tray_id);
|
||||
|
||||
if (!m_ext_spool_radiobox->GetValue() && wxGetApp().app_config->get("skip_ams_blacklist_check") != "true") {
|
||||
bool in_blacklist = false;
|
||||
std::string action;
|
||||
|
@ -1438,7 +1443,7 @@ bool CalibrationPresetPage::is_filament_in_blacklist(int tray_id, Preset* preset
|
|||
auto vendor = dynamic_cast<ConfigOptionStrings*> (preset->config.option("filament_vendor"));
|
||||
if (vendor && (vendor->values.size() > 0)) {
|
||||
std::string vendor_name = vendor->values[0];
|
||||
DeviceManager::check_filaments_in_blacklist(vendor_name, filamnt_type, tray_id, in_blacklist, action, info);
|
||||
DeviceManager::check_filaments_in_blacklist(vendor_name, filamnt_type, ams_id, in_blacklist, action, info);
|
||||
}
|
||||
|
||||
if (in_blacklist) {
|
||||
|
|
|
@ -65,6 +65,25 @@ wxString get_nozzle_volume_type_name(NozzleVolumeType type)
|
|||
return wxString();
|
||||
}
|
||||
|
||||
void get_tray_ams_and_slot_id(MachineObject* obj, int in_tray_id, int &ams_id, int &slot_id, int &tray_id)
|
||||
{
|
||||
assert(obj);
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
if (in_tray_id == VIRTUAL_TRAY_MAIN_ID || in_tray_id == VIRTUAL_TRAY_DEPUTY_ID) {
|
||||
ams_id = in_tray_id;
|
||||
slot_id = 0;
|
||||
tray_id = ams_id;
|
||||
if (!obj->is_enable_np)
|
||||
tray_id = VIRTUAL_TRAY_DEPUTY_ID;
|
||||
} else {
|
||||
ams_id = in_tray_id / 4;
|
||||
slot_id = in_tray_id % 4;
|
||||
tray_id = in_tray_id;
|
||||
}
|
||||
}
|
||||
|
||||
std::string get_calib_mode_name(CalibMode cali_mode, int stage)
|
||||
{
|
||||
switch(cali_mode) {
|
||||
|
|
|
@ -79,6 +79,7 @@ private:
|
|||
static void send_to_print(const CalibInfo &calib_info, wxString& error_message, int flow_ratio_mode = 0); // 0: none 1: coarse 2: fine
|
||||
};
|
||||
|
||||
extern void get_tray_ams_and_slot_id(MachineObject* obj, int in_tray_id, int &ams_id, int &slot_id, int &tray_id);
|
||||
|
||||
extern void get_default_k_n_value(const std::string &filament_id, float &k, float &n);
|
||||
extern wxString get_nozzle_volume_type_name(NozzleVolumeType type);
|
||||
|
|
Loading…
Reference in New Issue