Allow TABS in config
[clinton/Smoothieware.git] / src / modules / robot / Conveyor.h
1 /*
2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4 Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8 #ifndef CONVEYOR_H
9 #define CONVEYOR_H
10
11 #include "libs/Module.h"
12 #include "libs/Kernel.h"
13 #include "HeapRing.h"
14
15 using namespace std;
16 #include <string>
17 #include <vector>
18
19 class Gcode;
20 class Block;
21
22 class Conveyor : public Module
23 {
24 public:
25 Conveyor();
26
27 void on_module_loaded(void);
28 void on_idle(void*);
29 void on_main_loop(void*);
30 void on_block_end(void*);
31 void on_config_reload(void*);
32
33 void notify_block_finished(Block*);
34
35 void wait_for_empty_queue();
36
37 void ensure_running(void);
38
39 void append_gcode(Gcode*);
40 void queue_head_block(void);
41
42 void dump_queue(void);
43
44 // right now block queue size can only be changed at compile time by changing the value below
45 typedef HeapRing<Block> Queue_t;
46
47 Queue_t queue; // Queue of Blocks
48
49 volatile bool running;
50
51 volatile unsigned int gc_pending;
52 };
53
54 #endif // CONVEYOR_H