← All bug reports

FS#1981I would like an external post processor

Type
Feature Request
Status
Closed
Resolution
Works for me
Category
QCAD/CAM
Severity
Low
Priority
Low
Reported version
3.23.0
Operating system
All
Reported
2019-10-23 by chuckt
Closed
2019-10-24 by andrew

I use gcode ripper for some of my jobs. (see here: https://www.scorchworks.com/Gcoderipper/gcoderipper.html) This is a large python script that I use to wrap flat code around a cylinder for engraving. What I would like to see is a way to run it from my own custom post processor that I wrote for my machine. Maybe some kind of keyword that allows me to specify an arbitrary external command with some parameters. It would be very helpful to me. I create a lot of ad-hock jobs to run.

Thanks,
Chuck Tilbury

Comments (1)

andrew 2019-10-24

You can use QProcess to start external commands in your post processor:

    var process = new QProcess();
    process.error.connect(function(e) { qDebug("Error: ", e); });
    var stdout = "";
    var stderr = "";

    process.readyReadStandardOutput.connect(function() { stdout += process.readAllStandardOutput(); });
    process.readyReadStandardError.connect(function() { stderr += process.readAllStandardError(); });

    // set up environment variables (if needed):
    var env = QProcessEnvironment.systemEnvironment();
    env.insert("MYENV", "1");
    process.setProcessEnvironment(env);

    process.start("path/to/executable", ["-f", "-b", ...]);

    qDebug("stdout: " + stdout);
    qDebug("stderr: " + stderr);