mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Suppress ColorPrint for the multi-material printing
This commit is contained in:
		
							parent
							
								
									360133246c
								
							
						
					
					
						commit
						c010e14460
					
				
					 5 changed files with 25 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -1326,7 +1326,7 @@ void GCode::process_layer(
 | 
			
		|||
        m_colorprint_heights.erase(m_colorprint_heights.begin());
 | 
			
		||||
        colorprint_change = true;
 | 
			
		||||
    }
 | 
			
		||||
    if (colorprint_change)
 | 
			
		||||
    if (colorprint_change && print.extruders().size()==1)
 | 
			
		||||
        gcode += "M600\n";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -426,6 +426,14 @@ void Preview::update_double_slider(const std::vector<double>& layers_z, bool for
 | 
			
		|||
    m_slider->SetTicksValues(ticks_from_config);
 | 
			
		||||
 | 
			
		||||
    set_double_slider_thumbs(layers_z, z_low, z_high);
 | 
			
		||||
 | 
			
		||||
    bool color_print_enable = (wxGetApp().plater()->printer_technology() == ptFFF);
 | 
			
		||||
    if (color_print_enable) {
 | 
			
		||||
        const auto& config = wxGetApp().preset_bundle->full_config();
 | 
			
		||||
        if (config.opt<ConfigOptionFloats>("nozzle_diameter")->values.size() > 1) 
 | 
			
		||||
            color_print_enable = false;
 | 
			
		||||
    }
 | 
			
		||||
    m_slider->EnableTickManipulation(color_print_enable);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Preview::fill_slider_values(std::vector<std::pair<int, double>> &values,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1606,6 +1606,10 @@ void Plater::priv::reset()
 | 
			
		|||
    sidebar->obj_list()->delete_all_objects_from_list();
 | 
			
		||||
    object_list_changed();
 | 
			
		||||
    update();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    auto& config = wxGetApp().preset_bundle->project_config;
 | 
			
		||||
    config.option<ConfigOptionFloats>("colorprint_heights")->values.clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Plater::priv::mirror(Axis axis)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1569,7 +1569,8 @@ void PrusaDoubleSlider::draw_info_line_with_icon(wxDC& dc, const wxPoint& pos, c
 | 
			
		|||
        dc.DrawLine(pt_beg, pt_end);
 | 
			
		||||
 | 
			
		||||
        //draw action icon
 | 
			
		||||
        draw_action_icon(dc, pt_beg, pt_end);
 | 
			
		||||
        if (m_is_enabled_tick_manipulation)
 | 
			
		||||
            draw_action_icon(dc, pt_beg, pt_end);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1677,7 +1678,7 @@ void PrusaDoubleSlider::draw_thumbs(wxDC& dc, const wxCoord& lower_pos, const wx
 | 
			
		|||
 | 
			
		||||
void PrusaDoubleSlider::draw_ticks(wxDC& dc)
 | 
			
		||||
{
 | 
			
		||||
    dc.SetPen(DARK_GREY_PEN);
 | 
			
		||||
    dc.SetPen(m_is_enabled_tick_manipulation ? DARK_GREY_PEN : LIGHT_GREY_PEN );
 | 
			
		||||
    int height, width;
 | 
			
		||||
    get_size(&width, &height);
 | 
			
		||||
    const wxCoord mid = is_horizontal() ? 0.5*height : 0.5*width;
 | 
			
		||||
| 
						 | 
				
			
			@ -1794,7 +1795,7 @@ void PrusaDoubleSlider::OnLeftDown(wxMouseEvent& event)
 | 
			
		|||
    this->CaptureMouse();
 | 
			
		||||
    wxClientDC dc(this);
 | 
			
		||||
    wxPoint pos = event.GetLogicalPosition(dc);
 | 
			
		||||
    if (is_point_in_rect(pos, m_rect_tick_action)) {
 | 
			
		||||
    if (is_point_in_rect(pos, m_rect_tick_action) && m_is_enabled_tick_manipulation) {
 | 
			
		||||
        action_tick(taOnIcon);
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -1812,7 +1813,7 @@ void PrusaDoubleSlider::OnLeftDown(wxMouseEvent& event)
 | 
			
		|||
    else
 | 
			
		||||
        detect_selected_slider(pos);
 | 
			
		||||
 | 
			
		||||
    if (!m_selection) {
 | 
			
		||||
    if (!m_selection && m_is_enabled_tick_manipulation) {
 | 
			
		||||
        const auto tick = is_point_near_tick(pos);
 | 
			
		||||
        if (tick >= 0)
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -683,6 +683,12 @@ public:
 | 
			
		|||
    void ChangeOneLayerLock();
 | 
			
		||||
    std::vector<double> GetTicksValues() const;
 | 
			
		||||
    void SetTicksValues(const std::vector<double>& heights);
 | 
			
		||||
    void EnableTickManipulation(bool enable = true) {
 | 
			
		||||
        m_is_enabled_tick_manipulation = enable;
 | 
			
		||||
    }
 | 
			
		||||
    void DisableTickManipulation() {
 | 
			
		||||
        EnableTickManipulation(false);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void OnPaint(wxPaintEvent& ) { render();}
 | 
			
		||||
    void OnLeftDown(wxMouseEvent& event);
 | 
			
		||||
| 
						 | 
				
			
			@ -753,6 +759,7 @@ private:
 | 
			
		|||
    bool        m_is_focused = false;
 | 
			
		||||
    bool        m_is_action_icon_focesed = false;
 | 
			
		||||
    bool        m_is_one_layer_icon_focesed = false;
 | 
			
		||||
    bool        m_is_enabled_tick_manipulation = true;
 | 
			
		||||
 | 
			
		||||
    wxRect      m_rect_lower_thumb;
 | 
			
		||||
    wxRect      m_rect_higher_thumb;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue