blob: bdea61fe04dd2e5f158122b4674691847e521e10 (
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
|
#pragma once
#include "firmware.h"
#include <cstring>
#include <fstream>
#include "gcode_position.h"
#define DEFAULT_GCODE_BUFFER_SIZE 50
struct arc_interpolation_args
{
arc_interpolation_args()
{
source_path = "";
target_path = "";
}
/// <summary>
/// Firmware arguments. Not all options will apply to all firmware types.
/// </summary>
firmware_arguments firmware_args;
/// <summary>
/// Required: the path to the source file containing G2/G3 commands.
/// </summary>
std::string source_path;
/// <summary>
/// Optional: the path to the target file. If left blank the source file will be overwritten by the target.
/// </summary>
std::string target_path;
};
class arc_interpolation
{
public:
arc_interpolation();
arc_interpolation(arc_interpolation_args args);
virtual ~arc_interpolation();
void process();
/// <summary>
/// Outputs a string description of the firmware arguments.
/// </summary>
/// <returns></returns>
std::string get_firmware_argument_description() const;
private:
arc_interpolation_args args_;
gcode_position_args get_args_(bool g90_g91_influences_extruder, int buffer_size);
std::string source_path_;
std::string target_path_;
gcode_position* p_source_position_;
std::ofstream output_file_;
int lines_processed_ = 0;
firmware* p_current_firmware_;
int num_arc_commands_;
};
|