fix some stuff modify other stuff
[clinton/Smoothieware.git] / src / modules / tools / zprobe / CartGridStrategy.h
1 #pragma once
2
3 #include "LevelingStrategy.h"
4
5 #include <string.h>
6 #include <tuple>
7
8 #define cart_grid_leveling_strategy_checksum CHECKSUM("rectangular-grid")
9
10 class StreamOutput;
11 class Gcode;
12
13 class CartGridStrategy : public LevelingStrategy
14 {
15 public:
16 CartGridStrategy(ZProbe *zprobe);
17 ~CartGridStrategy();
18 bool handleGcode(Gcode* gcode);
19 bool handleConfig();
20
21 private:
22
23 void extrapolate_one_point(int x, int y, int xdir, int ydir);
24 void extrapolate_unprobed_bed_level();
25 bool doProbe(Gcode *gc);
26 float findBed();
27 void setAdjustFunction(bool on);
28 void print_bed_level(StreamOutput *stream);
29 void doCompensation(float *target, bool inverse);
30 void reset_bed_level();
31 void save_grid(StreamOutput *stream);
32 bool load_grid(StreamOutput *stream);
33 bool probe_grid(int n, float x_size, float y_size, StreamOutput *stream);
34
35 float initial_height;
36 float tolerance;
37
38 float *grid;
39 std::tuple<float, float, float> probe_offsets;
40 uint8_t grid_size;
41 float x_size,y_size;
42
43 struct {
44 bool save:1;
45 bool do_home:1;
46 };
47 };