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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'xs/xsp/GCodePressureEqualizer.xsp')
-rw-r--r--xs/xsp/GCodePressureEqualizer.xsp32
1 files changed, 32 insertions, 0 deletions
diff --git a/xs/xsp/GCodePressureEqualizer.xsp b/xs/xsp/GCodePressureEqualizer.xsp
new file mode 100644
index 000000000..39372e0e0
--- /dev/null
+++ b/xs/xsp/GCodePressureEqualizer.xsp
@@ -0,0 +1,32 @@
+%module{Slic3r::XS};
+
+%{
+#include <xsinit.h>
+#include "libslic3r/GCode/PressureEqualizer.hpp"
+%}
+
+%name{Slic3r::GCode::PressureEqualizer} class GCodePressureEqualizer {
+ GCodePressureEqualizer(StaticPrintConfig* config)
+ %code%{ RETVAL = new GCodePressureEqualizer(dynamic_cast<GCodeConfig*>(config)); %};
+ ~GCodePressureEqualizer();
+
+ void reset();
+
+ // Process a next batch of G-code lines. Flush the internal buffers if asked for.
+// const char* process(const char *szGCode, bool flush);
+// std::string process(const char *szGCode, bool flush)
+// %code{% const char *out = THIS->process(szGCode, flush); RETVAL = (out == NULL) ? "" : std::string(out); %};
+
+%{
+
+SV*
+GCodePressureEqualizer::process(const char *szGCode, bool flush)
+ CODE:
+ const char *out = THIS->process(szGCode, flush);
+ RETVAL = newSVpv(out, THIS->get_output_buffer_length());
+ OUTPUT:
+ RETVAL
+
+%}
+
+};