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

GCodePressureEqualizer.xsp « xsp « xs - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 39372e0e00d20e54c9b37f02232b4c0f133ba14a (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
%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

%}

};