FIX: wrong check while send print
jira: [STUDIO-9489] Change-Id: I7ad5cc2a55cd9b55de3d98ad7bd30150b1f448af
This commit is contained in:
parent
c75285002a
commit
1e712f19c9
|
@ -1259,16 +1259,28 @@ std::vector<int> PartPlate::get_extruders_without_support(bool conside_custom_gc
|
||||||
return plate_extruders;
|
return plate_extruders;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int> PartPlate::get_used_extruders()
|
/* -1 is invalid, return extruder 0 or 1*/
|
||||||
|
int PartPlate::get_used_nozzle_by_filament_id(int idx) const
|
||||||
{
|
{
|
||||||
std::vector<int> used_extruders;
|
const std::vector<int>& filament_map = get_filament_maps();
|
||||||
if (check_objects_empty_and_gcode3mf(used_extruders)) {
|
if (filament_map.size() < idx)
|
||||||
return used_extruders;
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return filament_map[idx - 1] - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<int> PartPlate::get_used_filaments()
|
||||||
|
{
|
||||||
|
std::vector<int> used_filaments;
|
||||||
|
if (check_objects_empty_and_gcode3mf(used_filaments)) {
|
||||||
|
return used_filaments;
|
||||||
}
|
}
|
||||||
|
|
||||||
GCodeProcessorResult* result = get_slice_result();
|
GCodeProcessorResult* result = get_slice_result();
|
||||||
if (!result)
|
if (!result)
|
||||||
return used_extruders;
|
return used_filaments;
|
||||||
|
|
||||||
std::set<int> used_extruders_set;
|
std::set<int> used_extruders_set;
|
||||||
PrintEstimatedStatistics& ps = result->print_statistics;
|
PrintEstimatedStatistics& ps = result->print_statistics;
|
||||||
|
|
|
@ -309,7 +309,8 @@ public:
|
||||||
std::vector<int> get_extruders_under_cli(bool conside_custom_gcode, DynamicPrintConfig& full_config) const;
|
std::vector<int> get_extruders_under_cli(bool conside_custom_gcode, DynamicPrintConfig& full_config) const;
|
||||||
std::vector<int> get_extruders_without_support(bool conside_custom_gcode = false) const;
|
std::vector<int> get_extruders_without_support(bool conside_custom_gcode = false) const;
|
||||||
// get used filaments, 1 based idx
|
// get used filaments, 1 based idx
|
||||||
std::vector<int> get_used_extruders();
|
std::vector<int> get_used_filaments();
|
||||||
|
int get_used_nozzle_by_filament_id(int idx) const;
|
||||||
bool check_tpu_printable_status(const DynamicPrintConfig & config, const std::vector<int> &tpu_filaments);
|
bool check_tpu_printable_status(const DynamicPrintConfig & config, const std::vector<int> &tpu_filaments);
|
||||||
|
|
||||||
/* instance related operations*/
|
/* instance related operations*/
|
||||||
|
|
|
@ -1510,7 +1510,7 @@ bool SelectMachineDialog::is_nozzle_type_match(ExtderData data) {
|
||||||
|
|
||||||
const auto& project_config = wxGetApp().preset_bundle->project_config;
|
const auto& project_config = wxGetApp().preset_bundle->project_config;
|
||||||
//check nozzle used
|
//check nozzle used
|
||||||
auto used_filaments = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_extruders(); // 1 based
|
auto used_filaments = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_filaments(); // 1 based
|
||||||
auto filament_maps = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config); // 1 based
|
auto filament_maps = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config); // 1 based
|
||||||
std::map<int, std::string> used_extruders_flow;
|
std::map<int, std::string> used_extruders_flow;
|
||||||
std::vector<int> used_extruders; // 0 based
|
std::vector<int> used_extruders; // 0 based
|
||||||
|
@ -1991,21 +1991,19 @@ bool SelectMachineDialog::is_same_nozzle_diameters(float& tag_nozzle_diameter) c
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto used_extruder_idxs = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_extruders();/*the index is started from 1*/
|
PartPlate* cur_plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
|
||||||
for (int extruder_idx : used_extruder_idxs)
|
auto used_filament_idxs = cur_plate->get_used_filaments();/*the index is started from 1*/
|
||||||
|
for (int used_filament_idx : used_filament_idxs)
|
||||||
{
|
{
|
||||||
if (opt_nozzle_diameters->size() < extruder_idx)
|
int used_nozzle_idx = cur_plate->get_used_nozzle_by_filament_id(used_filament_idx);
|
||||||
|
if (used_nozzle_idx == -1)
|
||||||
{
|
{
|
||||||
|
assert(0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
tag_nozzle_diameter = float(opt_nozzle_diameters->get_at(extruder_idx));
|
tag_nozzle_diameter = float(opt_nozzle_diameters->get_at(used_nozzle_idx));
|
||||||
if (obj_->m_extder_data.extders.size() < extruder_idx)
|
if (tag_nozzle_diameter != obj_->m_extder_data.extders[used_nozzle_idx].current_nozzle_diameter)
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tag_nozzle_diameter != obj_->m_extder_data.extders[extruder_idx - 1].current_nozzle_diameter)
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2221,7 +2219,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
||||||
if (m_print_type == PrintFromType::FROM_NORMAL)
|
if (m_print_type == PrintFromType::FROM_NORMAL)
|
||||||
{
|
{
|
||||||
/*check nozzle diameter*/
|
/*check nozzle diameter*/
|
||||||
float nozzle_diameter;
|
float nozzle_diameter = 0;
|
||||||
if (!is_same_nozzle_diameters(nozzle_diameter))
|
if (!is_same_nozzle_diameters(nozzle_diameter))
|
||||||
{
|
{
|
||||||
has_slice_warnings = true;
|
has_slice_warnings = true;
|
||||||
|
@ -3700,7 +3698,7 @@ void SelectMachineDialog::reset_and_sync_ams_list()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_extruders();
|
auto extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_filaments();
|
||||||
BitmapCache bmcache;
|
BitmapCache bmcache;
|
||||||
MaterialHash::iterator iter = m_materialList.begin();
|
MaterialHash::iterator iter = m_materialList.begin();
|
||||||
while (iter != m_materialList.end()) {
|
while (iter != m_materialList.end()) {
|
||||||
|
|
|
@ -1382,7 +1382,7 @@ void SendMultiMachinePage::sync_ams_list()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_extruders();
|
auto extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_filaments();
|
||||||
BitmapCache bmcache;
|
BitmapCache bmcache;
|
||||||
MaterialHash::iterator iter = m_material_list.begin();
|
MaterialHash::iterator iter = m_material_list.begin();
|
||||||
while (iter != m_material_list.end()) {
|
while (iter != m_material_list.end()) {
|
||||||
|
|
Loading…
Reference in New Issue