mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
FIX: the API return wrong extruder number; remove the assert
jira: [STUDIO-9532] Change-Id: Ia91a1d277e35f17588de417aee68f418eceb0a11 (cherry picked from commit 2034cadb562d2d4f39a84d0e7c72bc02a23a5f3e)
This commit is contained in:
@@ -1679,16 +1679,27 @@ std::vector<int> PartPlate::get_extruders_without_support(bool conside_custom_gc
|
|||||||
return plate_extruders;
|
return plate_extruders;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -1 is invalid, return extruder 0 or 1*/
|
/* -1 is invalid, return physical extruder idx*/
|
||||||
int PartPlate::get_used_nozzle_by_filament_id(int idx) const
|
/* logical extruder: 1-left, 2-right*/
|
||||||
|
/* physical extruder: 0-right, 1-left*/
|
||||||
|
int PartPlate::get_physical_extruder_by_filament_id(const DynamicConfig& g_config, int idx) const
|
||||||
{
|
{
|
||||||
const std::vector<int>& filament_map = get_filament_maps();
|
const std::vector<int>& filament_map = get_real_filament_maps(g_config);
|
||||||
if (filament_map.size() < idx)
|
if (filament_map.size() < idx)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return filament_map[idx - 1] - 1;
|
int logical_ext_idx = filament_map[idx - 1];
|
||||||
|
switch (logical_ext_idx)
|
||||||
|
{
|
||||||
|
case 1: return 1;
|
||||||
|
case 2: return 0;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(0);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int> PartPlate::get_used_filaments()
|
std::vector<int> PartPlate::get_used_filaments()
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ public:
|
|||||||
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_filaments();
|
std::vector<int> get_used_filaments();
|
||||||
int get_used_nozzle_by_filament_id(int idx) const;
|
int get_physical_extruder_by_filament_id(const DynamicConfig& g_config, 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*/
|
||||||
|
|||||||
@@ -1994,7 +1994,7 @@ bool SelectMachineDialog::is_same_nozzle_diameters(float& tag_nozzle_diameter) c
|
|||||||
auto used_filament_idxs = cur_plate->get_used_filaments();/*the index is started from 1*/
|
auto used_filament_idxs = cur_plate->get_used_filaments();/*the index is started from 1*/
|
||||||
for (int used_filament_idx : used_filament_idxs)
|
for (int used_filament_idx : used_filament_idxs)
|
||||||
{
|
{
|
||||||
int used_nozzle_idx = cur_plate->get_used_nozzle_by_filament_id(used_filament_idx);
|
int used_nozzle_idx = cur_plate->get_physical_extruder_by_filament_id(preset_bundle->project_config, used_filament_idx);
|
||||||
if (used_nozzle_idx == -1)
|
if (used_nozzle_idx == -1)
|
||||||
{
|
{
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user