mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Smoother manual control movements
This commit is contained in:
		
							parent
							
								
									37ecc61d06
								
							
						
					
					
						commit
						9febb10bd7
					
				
					 4 changed files with 12 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -58,6 +58,9 @@ sub new {
 | 
			
		|||
        $canvas->interactive(1);
 | 
			
		||||
        $canvas->on_move(sub {
 | 
			
		||||
            my ($pos) = @_;
 | 
			
		||||
            
 | 
			
		||||
            # delete any pending commands to get a smoother movement
 | 
			
		||||
            $self->purge_queue(1);
 | 
			
		||||
            $self->abs_xy_move($pos);
 | 
			
		||||
        });
 | 
			
		||||
        $bed_sizer->Add($canvas, 0, wxEXPAND | wxRIGHT, 3);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -172,15 +172,18 @@ GCodeSender::resume_queue()
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
GCodeSender::purge_queue()
 | 
			
		||||
GCodeSender::purge_queue(bool priority)
 | 
			
		||||
{
 | 
			
		||||
    boost::lock_guard<boost::mutex> l(this->queue_mutex);
 | 
			
		||||
    {
 | 
			
		||||
    std::queue<std::string> empty;
 | 
			
		||||
    if (priority) {
 | 
			
		||||
        // clear priority queue
 | 
			
		||||
        std::swap(this->priqueue, empty);
 | 
			
		||||
    } else {
 | 
			
		||||
        // clear queue
 | 
			
		||||
        std::queue<std::string> empty;
 | 
			
		||||
        std::swap(this->queue, empty);
 | 
			
		||||
        this->queue_paused = false;
 | 
			
		||||
    }
 | 
			
		||||
    this->queue_paused = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// purge log and return its contents
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,7 +28,7 @@ class GCodeSender : private boost::noncopyable {
 | 
			
		|||
    size_t queue_size() const;
 | 
			
		||||
    void pause_queue();
 | 
			
		||||
    void resume_queue();
 | 
			
		||||
    void purge_queue();
 | 
			
		||||
    void purge_queue(bool priority = false);
 | 
			
		||||
    std::vector<std::string> purge_log();
 | 
			
		||||
    std::string getT() const;
 | 
			
		||||
    std::string getB() const;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@
 | 
			
		|||
    void send(std::string s, bool priority = false);
 | 
			
		||||
    void pause_queue();
 | 
			
		||||
    void resume_queue();
 | 
			
		||||
    void purge_queue();
 | 
			
		||||
    void purge_queue(bool priority = false);
 | 
			
		||||
    std::vector<std::string> purge_log();
 | 
			
		||||
    std::string getT();
 | 
			
		||||
    std::string getB();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue