mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 05:22:01 +08:00
Tab: Trimmed printer_model prefix for detecting if SLA printer is Prusa printer
+ Added SLAPrint::is_prusa_print()
This commit is contained in:
parent
2d65803057
commit
70ea6fc977
@ -713,6 +713,16 @@ void SLAPrint::export_print(const std::string &fname, const ThumbnailsList &thum
|
||||
}
|
||||
}
|
||||
|
||||
bool SLAPrint::is_prusa_print(const std::string& printer_model)
|
||||
{
|
||||
static const std::vector<std::string> prusa_printer_models = { "SL1", "SL1S", "M1", "SLX" };
|
||||
for (const std::string& model : prusa_printer_models)
|
||||
if (model == printer_model)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SLAPrint::invalidate_step(SLAPrintStep step)
|
||||
{
|
||||
bool invalidated = Inherited::invalidate_step(step);
|
||||
|
@ -582,6 +582,8 @@ public:
|
||||
void export_print(const std::string &fname,
|
||||
const ThumbnailsList &thumbnails,
|
||||
const std::string &projectname = "");
|
||||
|
||||
static bool is_prusa_print(const std::string& printer_model);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -1148,8 +1148,7 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
|
||||
ExposureProfile above(material_config, 1);
|
||||
|
||||
const int first_slow_layers = fade_layers_cnt + first_extra_slow_layers;
|
||||
const std::string printer_model = printer_config.printer_model;
|
||||
const bool is_prusa_print = printer_model == "SL1" || printer_model == "SL1S" || printer_model == "M1";
|
||||
const bool is_prusa_print = SLAPrint::is_prusa_print(printer_config.printer_model);
|
||||
|
||||
const auto width = scaled<double>(printer_config.display_width.getFloat());
|
||||
const auto height = scaled<double>(printer_config.display_height.getFloat());
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "libslic3r/Utils.hpp"
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "libslic3r/SLAPrint.hpp"
|
||||
#include "libslic3r/GCode/GCodeProcessor.hpp"
|
||||
#include "libslic3r/GCode/GCodeWriter.hpp"
|
||||
#include "libslic3r/GCode/Thumbnails.hpp"
|
||||
@ -3671,8 +3672,9 @@ void TabPrinter::update_fff()
|
||||
|
||||
bool Tab::is_prusa_printer() const
|
||||
{
|
||||
std::string printer_model = m_preset_bundle->printers.get_edited_preset().config.opt_string("printer_model");
|
||||
return printer_model == "SL1" || printer_model == "SL1S" || printer_model == "M1";
|
||||
const Preset& edited_preset = m_preset_bundle->printers.get_edited_preset();
|
||||
std::string printer_model = edited_preset.trim_vendor_repo_prefix(edited_preset.config.opt_string("printer_model"));
|
||||
return SLAPrint::is_prusa_print(printer_model);
|
||||
}
|
||||
|
||||
void TabPrinter::update_sla()
|
||||
|
Loading…
x
Reference in New Issue
Block a user