diff options
author | FormerLurker <hochgebe@gmail.com> | 2020-04-26 01:20:39 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2020-04-26 01:20:39 +0300 |
commit | 4fcf89d4995921b89b579d06052df11b66e4879f (patch) | |
tree | 390bbfcab87591e802f9ac91ac2d531b4ae53946 /GcodeProcessorLib/position.h |
Add project files.
Diffstat (limited to 'GcodeProcessorLib/position.h')
-rw-r--r-- | GcodeProcessorLib/position.h | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/GcodeProcessorLib/position.h b/GcodeProcessorLib/position.h new file mode 100644 index 0000000..0958cd5 --- /dev/null +++ b/GcodeProcessorLib/position.h @@ -0,0 +1,106 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Gcode Processor Library +// +// Tools for parsing gcode and calculating printer state from parsed gcode commands. +// +// Copyright(C) 2020 - 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(); +}; +#endif
\ No newline at end of file |