Added compensation degragation function for rectangular grid
[clinton/Smoothieware.git] / src / modules / tools / zprobe / CartGridStrategy.h
CommitLineData
6c972e51
JL
1#pragma once
2
3#include "LevelingStrategy.h"
4
5#include <string.h>
6#include <tuple>
7
c77455c3 8#define cart_grid_leveling_strategy_checksum CHECKSUM("rectangular-grid")
6c972e51
JL
9
10class StreamOutput;
11class Gcode;
12
13class CartGridStrategy : public LevelingStrategy
14{
15public:
16 CartGridStrategy(ZProbe *zprobe);
17 ~CartGridStrategy();
18 bool handleGcode(Gcode* gcode);
19 bool handleConfig();
20
21private:
22
6c972e51 23 bool doProbe(Gcode *gc);
01cacfc9 24 bool findBed();
6c972e51
JL
25 void setAdjustFunction(bool on);
26 void print_bed_level(StreamOutput *stream);
27 void doCompensation(float *target, bool inverse);
28 void reset_bed_level();
29 void save_grid(StreamOutput *stream);
30 bool load_grid(StreamOutput *stream);
0ba48b60 31 bool probe_grid(int n, int m, float _x_start, float _y_start, float _x_size, float _y_size, StreamOutput *stream);
6c972e51
JL
32
33 float initial_height;
92143a7e
AI
34 float tolerance;
35
36 float height_limit;
37 float dampening_start;
38 float damping_interval;
39
6c972e51
JL
40 float *grid;
41 std::tuple<float, float, float> probe_offsets;
825e3420 42 float x_start,y_start;
6c972e51
JL
43 float x_size,y_size;
44
44b5bc10
VB
45 struct {
46 uint8_t configured_grid_x_size:8;
47 uint8_t configured_grid_y_size:8;
48 uint8_t current_grid_x_size:8;
49 uint8_t current_grid_y_size:8;
50 };
51
6c972e51
JL
52 struct {
53 bool save:1;
54 bool do_home:1;
825e3420 55 bool only_by_two_corners:1;
2f05c122 56 bool human_readable:1;
6c972e51
JL
57 };
58};