Radio Button

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
jthornton
Full Member
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm

Radio Button

Post by jthornton » Thu Nov 21, 2013 2:07 pm

I'm trying to figure out a way to limit the thickness list for each nozzle. So I came up with using a radio button for each nozzle and next to it a combo box that only list thickness that would be appropriate for that nozzle. What I'm having trouble with is finding out which radio button is checked.
CAM Configuration.png
CAM Configuration.png (20.69 KiB) Viewed 10896 times
Thanks
JT
Attachments
Plasma.js
(8.14 KiB) Downloaded 686 times

jthornton
Full Member
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm

Re: Radio Button

Post by jthornton » Sat Nov 23, 2013 1:12 am

Anyone have an idea on how to get the currently selected radio button? I've searched and guessed till the cows came home...

Thanks
JT

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

Re: Radio Button

Post by andrew » Sat Nov 23, 2013 11:44 am

If you assigned the object name "MyRadioButton" to a radio button, its value should be available as property with key "Cam/MyRadioButton":
layer.getCustomProperty("QCADCAM", "Cam/MyRadioButton");

jthornton
Full Member
Posts: 66
Joined: Fri Oct 25, 2013 1:31 pm

Re: Radio Button

Post by jthornton » Sat Nov 23, 2013 2:03 pm

It is a global option so I get errors trying to use layer.

I'm calling the function from writeToolDown:

Code: Select all

// probe for material top and fire the torch
Plasma.prototype.writeToolDown = function() {
    this.g = GCode.Mode.Normal;
    this.z = this.getToolDownLevel();
    this.nozzle = this.getNozzle();
    this.thickness = this.getThickness();
    this.settings = this.getCuttingInfo(this.getNozzle(),this.getThickness());
    qDebug("radio " + this.getRadio());
    this.toolIsDown();
};

I tried many things including this:

Code: Select all

Plasma.prototype.getRadio = function() {
  var layerId = entity.getLayerId();
  var layer = this.document.queryLayer(layerId);
  qDebug("button group " + layer.getCustomProperty("QCADCAM", "Cam/radioFC"));
  return;
};
Thanks for your help
JT

Post Reply

Return to “QCAD/CAM”