Documentation for "Adding Layer Parameters" ?

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Indicate the post processor used.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
artisanicview
Junior Member
Posts: 12
Joined: Sat Jun 19, 2010 6:23 pm

Documentation for "Adding Layer Parameters" ?

Post by artisanicview » Sun Mar 13, 2016 11:03 am

I'm just trying to test CAM module, and searching for documentation I found this page QCAD/CAM: Configuration

At the section "Adding Layer Parameters" appears to be "This is work in progress".

Any chance to see a proper documentation for the missing chapters from this page?

There is a real problem with the lack of documentation for this add-on.

Thank you.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Documentation for "Adding Layer Parameters" ?

Post by andrew » Mon Mar 14, 2016 9:20 am

The GCode configuration has example code for adding layer parameters.

The key parts are:

Tell QCAD/CAM that there is a user interface component for layer options which should be displayed. This line means there's a file called "GCodeLayer.ui":
this.layerOptions = "GCodeLayer";
Initialize the user interface components if desired. This function is called by QCAD/CAM to give your configuration a chance to initialize the various user interface elements (line edits, combo boxes, etc). Here, we add some default values to the combo box for the 'ZCutting' combo box and set the current text to "default":
GCode.prototype.initLayerOptionWidget = function(w) {
    switch (w.objectName) {
    case "ZCutting":
        w.addItems(["default", "-1", "-2", "-3"]);
        w.currentText = "default";
        break;
    }
};
.ui files can be created and edited as XML files or using the Qt Creator IDE.

The parameters chosen by the user during CAM export can be queried in your configuration file using:
this.getGlobalOption("ZCutting", -1.0);
Where "ZCutting" is the object name of the user interface element (widget) and -1.0 is the default fall back value if no such option is available.

I understand that this is very brief but I hope it helps to get started. The complete story is that you can do anything in your configuration file (using the entire Qt and QCAD APIs). You can also come up with your own system to define layer parameters using a custom dialog, a database, an XML file, a web service, etc. The example GCode configuration is just a simple suggestion of how this can be achieved.

Post Reply

Return to “QCAD/CAM”