mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Auto color change improvements: Show info notification just ones, if there is new print
This commit is contained in:
parent
e054fe231e
commit
a6cf840540
3 changed files with 24 additions and 4 deletions
|
@ -424,6 +424,22 @@ void Control::SetExtruderColors( const std::vector<std::string>& extruder_colors
|
||||||
m_extruder_colors = extruder_colors;
|
m_extruder_colors = extruder_colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Control::IsNewPrint()
|
||||||
|
{
|
||||||
|
if (GUI::wxGetApp().plater()->printer_technology() == ptSLA)
|
||||||
|
return false;
|
||||||
|
const Print& print = GUI::wxGetApp().plater()->fff_print();
|
||||||
|
std::string idxs;
|
||||||
|
for (auto object : print.objects())
|
||||||
|
idxs += std::to_string(object->id().id) + "_";
|
||||||
|
|
||||||
|
if (idxs == m_print_obj_idxs)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
m_print_obj_idxs = idxs;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void Control::get_lower_and_higher_position(int& lower_pos, int& higher_pos)
|
void Control::get_lower_and_higher_position(int& lower_pos, int& higher_pos)
|
||||||
{
|
{
|
||||||
const double step = get_scroll_step();
|
const double step = get_scroll_step();
|
||||||
|
|
|
@ -233,6 +233,8 @@ public:
|
||||||
void SetModeAndOnlyExtruder(const bool is_one_extruder_printed_model, const int only_extruder);
|
void SetModeAndOnlyExtruder(const bool is_one_extruder_printed_model, const int only_extruder);
|
||||||
void SetExtruderColors(const std::vector<std::string>& extruder_colors);
|
void SetExtruderColors(const std::vector<std::string>& extruder_colors);
|
||||||
|
|
||||||
|
bool IsNewPrint();
|
||||||
|
|
||||||
void set_render_as_disabled(bool value) { m_render_as_disabled = value; }
|
void set_render_as_disabled(bool value) { m_render_as_disabled = value; }
|
||||||
bool is_rendering_as_disabled() const { return m_render_as_disabled; }
|
bool is_rendering_as_disabled() const { return m_render_as_disabled; }
|
||||||
|
|
||||||
|
@ -395,6 +397,7 @@ private:
|
||||||
TickCodeInfo m_ticks;
|
TickCodeInfo m_ticks;
|
||||||
std::vector<double> m_layers_times;
|
std::vector<double> m_layers_times;
|
||||||
std::vector<std::string> m_extruder_colors;
|
std::vector<std::string> m_extruder_colors;
|
||||||
|
std::string m_print_obj_idxs;
|
||||||
|
|
||||||
#if ENABLE_GCODE_LINES_ID_IN_H_SLIDER
|
#if ENABLE_GCODE_LINES_ID_IN_H_SLIDER
|
||||||
std::vector<double> m_alternate_values;
|
std::vector<double> m_alternate_values;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//#include "stdlib.h"
|
||||||
#include "libslic3r/libslic3r.h"
|
#include "libslic3r/libslic3r.h"
|
||||||
#include "libslic3r/Layer.hpp"
|
#include "libslic3r/Layer.hpp"
|
||||||
#include "GUI_Preview.hpp"
|
#include "GUI_Preview.hpp"
|
||||||
|
@ -642,10 +643,10 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
|
||||||
m_layers_slider->SetLayersTimes(m_gcode_result->time_statistics.modes.front().layers_times);
|
m_layers_slider->SetLayersTimes(m_gcode_result->time_statistics.modes.front().layers_times);
|
||||||
|
|
||||||
// Suggest the auto color change, if model looks like sign
|
// Suggest the auto color change, if model looks like sign
|
||||||
if (ticks_info_from_model.gcodes.empty())
|
if (m_layers_slider->IsNewPrint())
|
||||||
{
|
{
|
||||||
NotificationManager* notif_mngr = wxGetApp().plater()->get_notification_manager();
|
NotificationManager* notif_mngr = wxGetApp().plater()->get_notification_manager();
|
||||||
notif_mngr->close_notification_of_type(NotificationType::SignDetected);
|
// notif_mngr->close_notification_of_type(NotificationType::SignDetected);
|
||||||
|
|
||||||
const Print& print = wxGetApp().plater()->fff_print();
|
const Print& print = wxGetApp().plater()->fff_print();
|
||||||
double delta_area = scale_(scale_(25)); // equal to 25 mm2
|
double delta_area = scale_(scale_(25)); // equal to 25 mm2
|
||||||
|
@ -658,8 +659,8 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const ExPolygons& bottom = object->get_layer(0)->lslices;
|
const ExPolygons& bottom = object->get_layer(0)->lslices;
|
||||||
if (bottom.size() > 1 || !bottom[0].holes.empty())
|
//if (bottom.size() > 1 || !bottom[0].holes.empty())
|
||||||
continue;
|
// continue;
|
||||||
|
|
||||||
double bottom_area = area(bottom);
|
double bottom_area = area(bottom);
|
||||||
int i;
|
int i;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue