FIX:add "check_objects_empty_and_gcode3mf" api
jira: none Change-Id: I8ffa72f5898292dbb8c539b743acd18d12e8dbb7
This commit is contained in:
parent
960af84f8f
commit
3a233b06db
|
@ -977,14 +977,9 @@ void PartPlate::release_opengl_resource()
|
|||
std::vector<int> PartPlate::get_extruders(bool conside_custom_gcode) const
|
||||
{
|
||||
std::vector<int> plate_extruders;
|
||||
// if gcode.3mf file
|
||||
if (m_model->objects.empty()) {
|
||||
for (int i = 0; i < slice_filaments_info.size(); i++) {
|
||||
plate_extruders.push_back(slice_filaments_info[i].id + 1);
|
||||
}
|
||||
return plate_extruders;
|
||||
}
|
||||
|
||||
if (check_objects_empty_and_gcode3mf(plate_extruders)) {
|
||||
return plate_extruders;
|
||||
}
|
||||
// if 3mf file
|
||||
const DynamicPrintConfig& glb_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
int glb_support_intf_extr = glb_config.opt_int("support_interface_filament");
|
||||
|
@ -1155,17 +1150,25 @@ std::vector<int> PartPlate::get_extruders_under_cli(bool conside_custom_gcode, D
|
|||
return plate_extruders;
|
||||
}
|
||||
|
||||
bool PartPlate::check_objects_empty_and_gcode3mf(std::vector<int> &result) const
|
||||
{
|
||||
if (m_model->objects.empty()) {//objects is empty
|
||||
if (wxGetApp().plater()->is_gcode_3mf()) { // if gcode.3mf file
|
||||
for (int i = 0; i < slice_filaments_info.size(); i++) {
|
||||
result.push_back(slice_filaments_info[i].id + 1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<int> PartPlate::get_extruders_without_support(bool conside_custom_gcode) const
|
||||
{
|
||||
std::vector<int> plate_extruders;
|
||||
// if gcode.3mf file
|
||||
if (m_model->objects.empty()) {
|
||||
for (int i = 0; i < slice_filaments_info.size(); i++) {
|
||||
plate_extruders.push_back(slice_filaments_info[i].id + 1);
|
||||
}
|
||||
return plate_extruders;
|
||||
}
|
||||
|
||||
if (check_objects_empty_and_gcode3mf(plate_extruders)) {
|
||||
return plate_extruders;
|
||||
}
|
||||
// if 3mf file
|
||||
const DynamicPrintConfig& glb_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
|
||||
|
@ -1203,13 +1206,9 @@ std::vector<int> PartPlate::get_extruders_without_support(bool conside_custom_gc
|
|||
std::vector<int> PartPlate::get_used_extruders()
|
||||
{
|
||||
std::vector<int> used_extruders;
|
||||
// if gcode.3mf file
|
||||
if (m_model->objects.empty()) {
|
||||
for (int i = 0; i < slice_filaments_info.size(); i++) {
|
||||
used_extruders.push_back(slice_filaments_info[i].id + 1);
|
||||
}
|
||||
return used_extruders;
|
||||
}
|
||||
if (check_objects_empty_and_gcode3mf(used_extruders)) {
|
||||
return used_extruders;
|
||||
}
|
||||
|
||||
GCodeProcessorResult* result = get_slice_result();
|
||||
if (!result)
|
||||
|
|
|
@ -288,6 +288,7 @@ public:
|
|||
Vec3d get_origin() { return m_origin; }
|
||||
Vec3d estimate_wipe_tower_size(const DynamicPrintConfig & config, const double w, const double wipe_volume, int plate_extruder_size = 0, bool use_global_objects = false) const;
|
||||
arrangement::ArrangePolygon estimate_wipe_tower_polygon(const DynamicPrintConfig & config, int plate_index, int plate_extruder_size = 0, bool use_global_objects = false) const;
|
||||
bool check_objects_empty_and_gcode3mf(std::vector<int> &result) const;
|
||||
std::vector<int> get_extruders(bool conside_custom_gcode = false) 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;
|
||||
|
|
|
@ -265,6 +265,7 @@ public:
|
|||
void calib_VFA(const Calib_Params ¶ms);
|
||||
|
||||
//BBS: add only gcode mode
|
||||
bool is_gcode_3mf() { return m_only_gcode && m_exported_file; }
|
||||
bool only_gcode_mode() { return m_only_gcode; }
|
||||
void set_only_gcode(bool only_gcode) { m_only_gcode = only_gcode; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue