From 65b7d27def78810c02497679ab6b2e6ac2801b5b Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 10 May 2014 15:08:49 +0200 Subject: [PATCH] Draft for binary representation of G-code commands --- xs/MANIFEST | 1 + xs/src/GCode.hpp | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 xs/src/GCode.hpp diff --git a/xs/MANIFEST b/xs/MANIFEST index 0fdceff84..d8334bcd8 100644 --- a/xs/MANIFEST +++ b/xs/MANIFEST @@ -1668,6 +1668,7 @@ src/ExtrusionEntityCollection.cpp src/ExtrusionEntityCollection.hpp src/Flow.cpp src/Flow.hpp +src/GCode.hpp src/Geometry.cpp src/Geometry.hpp src/Layer.hpp diff --git a/xs/src/GCode.hpp b/xs/src/GCode.hpp new file mode 100644 index 000000000..a889532ea --- /dev/null +++ b/xs/src/GCode.hpp @@ -0,0 +1,35 @@ +#ifndef slic3r_GCode_hpp_ +#define slic3r_GCode_hpp_ + +#include +#include + +namespace Slic3r { + +// draft for a binary representation of a G-code line + +enum GCodeCmdType { + gcctSyncMotion, + gcctExtrude, + gcctResetE, + gcctSetTemp, + gcctSetTempWait, + gcctToolchange, + gcctCustom +}; + +class GCodeCmd { + public: + GCodeCmdType type; + float X, Y, Z, E, F; + unsigned short T, S; + std::string custom, comment; + float xy_dist; // cache + + GCodeCmd(GCodeCmdType type) + : type(type), X(0), Y(0), Z(0), E(0), F(0), T(-1), S(0), xy_dist(-1) {}; +}; + +} + +#endif