Welcome to mirror list, hosted at ThFree Co, Russian Federation.

position.h « GcodeProcessorLib - github.com/FormerLurker/ArcWelderLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a884adb2bc592779b7a7592a350c6ebb087118cd (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Gcode Processor Library
//
// Tools for parsing gcode and calculating printer state from parsed gcode commands.
//
// Copyright(C) 2021 - Brad Hochgesang
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This program is free software : you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program 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 Affero General Public License for more details.
//
//
// You can contact the author at the following email address: 
// FormerLurker@pm.me
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef POSITION_H
#define POSITION_H
#include <string>
#include "parsed_command.h"
#include "extruder.h"


struct position
{
	position();
	position(int extruder_count);
	position(const position &pos); // Copy Constructor
	virtual ~position();
	position& operator=(const position& pos);
	std::string to_string(bool rewrite, bool verbose, std::string additional_comment);
	void reset_state();
	parsed_command command;
	int feature_type_tag;
	double f;
	bool f_null;
	double x;
	bool x_null;
	double x_offset;
	double x_firmware_offset;
	bool x_homed;
	double y;
	bool y_null;
	double y_offset;
	double y_firmware_offset;
	bool y_homed;
	double z;
	bool z_null;
	double z_offset;
	double z_firmware_offset;
	bool z_homed;
	bool is_metric;
	bool is_metric_null;
	double last_extrusion_height;
	bool last_extrusion_height_null;
	long layer;
	double height;
	int height_increment;
	int height_increment_change_count;
	bool is_printer_primed;
	bool has_definite_position;
	double z_relative;
	bool is_relative;
	bool is_relative_null;
	bool is_extruder_relative;
	bool is_extruder_relative_null;
	bool is_layer_change;
	bool is_height_change;
	bool is_height_increment_change;
	bool is_xy_travel;
	bool is_xyz_travel;
	bool is_zhop;
	bool has_position_changed;
	bool has_xy_position_changed;
	bool has_received_home_command;
	bool is_in_position;
	bool in_path_position;
	long file_line_number;
	long gcode_number;
	long file_position;
	bool gcode_ignored;
	bool is_in_bounds;
	bool is_empty;
	int current_tool;
	int num_extruders;
	bool has_been_deleted;
	extruder * p_extruders;
	extruder& get_current_extruder() const;
	extruder& get_extruder(int index) const;
	void set_num_extruders(int num_extruders_);
	void delete_extruders();
	double get_gcode_x() const;
	double get_gcode_y() const;
	double get_gcode_z() const;
	void set_xyz_axis_mode(const std::string& xyz_axis_default_mode);
	void set_e_axis_mode(const std::string& e_axis_default_mode);
	void set_units_default(const std::string& units_default);
	bool can_take_snapshot();
	bool is_travel();
};
#endif