Backport arrange alignment for XL printers

This commit is contained in:
tamasmeszaros 2023-02-28 09:33:50 +01:00
parent 8a134c2225
commit 1e5bfbabb8
6 changed files with 128 additions and 26 deletions

View file

@ -444,6 +444,7 @@ public:
// float distance_sla = 6.;
float accuracy = 0.65f; // Unused currently
bool enable_rotation = false;
int alignment = 0;
};
private:
@ -525,8 +526,10 @@ private:
PrinterTechnology current_printer_technology() const;
bool is_arrange_alignment_enabled() const;
template<class Self>
static auto & get_arrange_settings(Self *self) {
static auto & get_arrange_settings_ref(Self *self) {
PrinterTechnology ptech = self->current_printer_technology();
auto *ptr = &self->m_arrange_settings_fff;
@ -544,8 +547,22 @@ private:
return *ptr;
}
ArrangeSettings &get_arrange_settings() { return get_arrange_settings(this); }
public:
ArrangeSettings get_arrange_settings() const {
const ArrangeSettings &settings = get_arrange_settings_ref(this);
ArrangeSettings ret = settings;
if (&settings == &m_arrange_settings_fff_seq_print) {
ret.distance = std::max(ret.distance,
float(min_object_distance(*m_config)));
}
if (!is_arrange_alignment_enabled())
ret.alignment = -1;
return ret;
}
private:
void load_arrange_settings();
class SequentialPrintClearance
@ -831,17 +848,6 @@ public:
void highlight_toolbar_item(const std::string& item_name);
void highlight_gizmo(const std::string& gizmo_name);
ArrangeSettings get_arrange_settings() const {
const ArrangeSettings &settings = get_arrange_settings(this);
ArrangeSettings ret = settings;
if (&settings == &m_arrange_settings_fff_seq_print) {
ret.distance = std::max(ret.distance,
float(min_object_distance(*m_config)));
}
return ret;
}
// Timestamp for FPS calculation and notification fade-outs.
static int64_t timestamp_now() {
#ifdef _WIN32