FIX: wrong check while send print

jira: [STUDIO-9489]
Change-Id: I7ad5cc2a55cd9b55de3d98ad7bd30150b1f448af
(cherry picked from commit 1e712f19c97837ccda9d5b381f0668488036131e)
This commit is contained in:
xin.zhang
2025-01-01 16:03:06 +08:00
committed by Noisyfox
parent 8c2f658c93
commit 33440082e6
4 changed files with 30 additions and 19 deletions

View File

@@ -1679,16 +1679,28 @@ std::vector<int> PartPlate::get_extruders_without_support(bool conside_custom_gc
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;
if (check_objects_empty_and_gcode3mf(used_extruders)) {
return used_extruders;
const std::vector<int>& filament_map = get_filament_maps();
if (filament_map.size() < idx)
{
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();
if (!result)
return used_extruders;
return used_filaments;
std::set<int> used_extruders_set;
PrintEstimatedStatistics& ps = result->print_statistics;