-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgcode-tools.h
More file actions
57 lines (46 loc) · 1.51 KB
/
gcode-tools.h
File metadata and controls
57 lines (46 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
============================================================================
Name : gcode-tools.h
Author : Radu - Eosif Mihailescu
Version : 1.0 (2012-08-11)
Copyright : (C) 2012 Radu - Eosif Mihailescu <radu.mihailescu@linux360.ro>
Description : G-Code Tool Table Handling Code
============================================================================
*/
#ifndef GCODE_TOOLS_H_
#define GCODE_TOOLS_H_
#include <stdbool.h>
#include "gcode-commons.h"
typedef enum {
GCODE_TOOL_UNDEFINED = -10,
GCODE_TOOL_DRILL = -11,
GCODE_TOOL_TAP = -12,
GCODE_TOOL_BORE = -13,
GCODE_TOOL_MILL = -14,
GCODE_TOOL_FACEMILL = -15,
GCODE_TOOL_BALLEND = -16,
GCODE_TOOL_BACKSPOTFACE = -17,
GCODE_TOOL_PROBE = -18,
GCODE_TOOL_GUNDRILL = -19
} TGCodeToolType;
typedef struct {
uint8_t index;
TGCodeToolType type;
double diameter;
double length;
/* Other/extended information would go here */
} TGCodeTool;
/* Initialize the tool engine, takes an opaque pointer to a data store/effector,
* returns true if all ok */
bool init_tools(void *data);
/* Fetch data for tool index out of the store */
TGCodeTool fetch_tool(uint8_t index);
/* Update data for tool index into the store, returns false if anything bad
* happened */
bool update_tool(TGCodeTool tool);
/* Returns radius of tool index or zero if zero passed */
double radiusof_tool(uint8_t index);
/* Returns length of tool index or zero if zero passed */
double lengthof_tool(uint8_t index);
bool done_tools(void);
#endif /* GCODE_TOOLS_H_ */