Skip to content

Commit 83f0248

Browse files
committed
Added custom software command line options
* Replaced "TurboCNC" with "custom" in softwareComboBox * Added "al-probecode" * Added "al-probevar" * Added "al-setzzero"
1 parent abb6e9e commit 83f0248

File tree

3 files changed

+113
-8
lines changed

3 files changed

+113
-8
lines changed

mainwindow.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ MainWindow::MainWindow(QWidget *parent) :
110110
args[ AUTOLEVELLERARGS ].insert("al-probefeed", ui->alprobefeedSpinBox);
111111
args[ AUTOLEVELLERARGS ].insert("al-probe-on", ui->alprobeonLineEdit);
112112
args[ AUTOLEVELLERARGS ].insert("al-probe-off", ui->alprobeoffLineEdit);
113+
args[ AUTOLEVELLERARGS ].insert("al-probecode", ui->alprobecodeLineEdit);
114+
args[ AUTOLEVELLERARGS ].insert("al-probevar", ui->alprobevarSpinBox);
115+
args[ AUTOLEVELLERARGS ].insert("al-setzzero", ui->alsetzzeroLineEdit);
113116

114117
connect(ui->actionQuit, SIGNAL(triggered()), this, SLOT(close()));
115118
connect(ui->actionAbout_pcb2gcode, SIGNAL(triggered()), this, SLOT(menu_aboutpcb2gcode()));
@@ -137,6 +140,7 @@ MainWindow::MainWindow(QWidget *parent) :
137140
connect(ui->optimiseCheckBox, SIGNAL(toggled(bool)), ui->bridgesDoubleSpinBox, SLOT(setEnabled(bool)));
138141
connect(ui->optimiseCheckBox, SIGNAL(toggled(bool)), ui->zbridgesDoubleSpinBox, SLOT(setEnabled(bool)));
139142
connect(ui->optimiseCheckBox, SIGNAL(toggled(bool)), ui->bridgesnumSpinBox, SLOT(setEnabled(bool)));
143+
connect(ui->softwareComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(updateAlCustomEnableState(QString)));
140144

141145
connect(ui->startPushButton, SIGNAL(clicked()), this, SLOT(startPcb2gcode()));
142146
connect(ui->inputMetricRadioButton, SIGNAL(toggled(bool)), this, SLOT(changeMetricInputUnits(bool)));
@@ -633,3 +637,12 @@ void MainWindow::resetDefaultConfFile()
633637
loadDefaultConfFile();
634638
}
635639
}
640+
641+
void MainWindow::updateAlCustomEnableState(QString text)
642+
{
643+
bool enabled = text == "custom";
644+
645+
ui->alprobecodeLineEdit->setEnabled(enabled);
646+
ui->alprobevarSpinBox->setEnabled(enabled);
647+
ui->alsetzzeroLineEdit->setEnabled(enabled);
648+
}

mainwindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ private slots:
7676
void resetDefaultConfFile();
7777
void loadDefaultConfFile();
7878

79+
void updateAlCustomEnableState(QString text);
80+
7981
private:
8082
enum ArgsType { FILEARGS = 0, COMMONARGS = 1, MILLARGS = 2, DRILLARGS = 3, OUTLINEARGS = 4, AUTOLEVELLERARGS = 5 };
8183
static const QString names[];

mainwindow.ui

Lines changed: 98 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
<item row="6" column="0">
162162
<widget class="QCheckBox" name="optimiseCheckBox">
163163
<property name="toolTip">
164-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Optimize output gcode, reducing its output size up to 40%, while accepting a little loss of precision&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
164+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;optimise output gcode, reducing its output size up to 95%, while accepting a very little loss of precision&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
165165
</property>
166166
<property name="text">
167167
<string>optimise</string>
@@ -541,7 +541,7 @@
541541
<x>10</x>
542542
<y>10</y>
543543
<width>311</width>
544-
<height>211</height>
544+
<height>214</height>
545545
</rect>
546546
</property>
547547
<layout class="QGridLayout" name="drillGridLayout">
@@ -709,7 +709,7 @@
709709
<x>10</x>
710710
<y>10</y>
711711
<width>311</width>
712-
<height>321</height>
712+
<height>360</height>
713713
</rect>
714714
</property>
715715
<layout class="QGridLayout" name="outlineGridLayout">
@@ -1040,7 +1040,7 @@
10401040
<x>10</x>
10411041
<y>10</y>
10421042
<width>311</width>
1043-
<height>291</height>
1043+
<height>371</height>
10441044
</rect>
10451045
</property>
10461046
<layout class="QGridLayout" name="autolevellerGridLayout">
@@ -1063,6 +1063,19 @@
10631063
</property>
10641064
</widget>
10651065
</item>
1066+
<item row="8" column="0">
1067+
<widget class="QLabel" name="alprobecodeLabel">
1068+
<property name="enabled">
1069+
<bool>true</bool>
1070+
</property>
1071+
<property name="toolTip">
1072+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;custom Z probe code. For example, LinuxCNC uses G38.2 while Mach3, Mach4 and TurboCNC use G31. If unspecified, G31 will be used. This option is relevant only when --software=custom&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1073+
</property>
1074+
<property name="text">
1075+
<string>al-probecode</string>
1076+
</property>
1077+
</widget>
1078+
</item>
10661079
<item row="3" column="0">
10671080
<widget class="QLabel" name="alxLabel">
10681081
<property name="toolTip">
@@ -1150,7 +1163,7 @@
11501163
<item row="2" column="0">
11511164
<widget class="QLabel" name="softwareLabel">
11521165
<property name="toolTip">
1153-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The height probing commands are different from software to software. Use this option to select the used software; currently supported softwares are LinuxCNC, &lt;font color=&quot;Red&quot;&gt;Mach3 (UNTESTED)&lt;/font&gt; and &lt;font color=&quot;Red&quot;&gt;TurboCNC (UNTESTED)&lt;/font&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1166+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;the height probing commands are different from software to software. Use this option to select the used software; currently supported softwares are LinuxCNC, Mach3, Mach4 and custom. With custom you can specify al-probecode, al-probevar and al-setzzero, in order to generate gcode for an unsupported software. For compatibility reasons, the custom gcode is much bigger (3-4 times) than the gcode for a supported software.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
11541167
</property>
11551168
<property name="text">
11561169
<string>software</string>
@@ -1177,7 +1190,7 @@
11771190
<item row="2" column="1">
11781191
<widget class="QComboBox" name="softwareComboBox">
11791192
<property name="toolTip">
1180-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The height probing commands are different from software to software. Use this option to select the used software; currently supported softwares are LinuxCNC, &lt;span style=&quot; color:#ff0000;&quot;&gt;Mach3 (UNTESTED)&lt;/span&gt;,&lt;span style=&quot; color:#ff0000;&quot;&gt; Mach4 (UNTESTED)&lt;/span&gt; and &lt;span style=&quot; color:#ff0000;&quot;&gt;TurboCNC (UNTESTED)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1193+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;the height probing commands are different from software to software. Use this option to select the used software; currently supported softwares are LinuxCNC, Mach3, Mach4 and custom. With custom you can specify al-probecode, al-probevar and al-setzzero, in order to generate gcode for an unsupported software. For compatibility reasons, the custom gcode is much bigger (3-4 times) than the gcode for a supported software.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
11811194
</property>
11821195
<item>
11831196
<property name="text">
@@ -1196,7 +1209,7 @@
11961209
</item>
11971210
<item>
11981211
<property name="text">
1199-
<string>TurboCNC</string>
1212+
<string>custom</string>
12001213
</property>
12011214
</item>
12021215
</widget>
@@ -1246,6 +1259,83 @@
12461259
</property>
12471260
</widget>
12481261
</item>
1262+
<item row="9" column="0">
1263+
<widget class="QLabel" name="alprobevarLabel">
1264+
<property name="enabled">
1265+
<bool>true</bool>
1266+
</property>
1267+
<property name="toolTip">
1268+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;custom Z probe result variable. For example, LinuxCNC uses 5063 while Mach3, Mach4 and TurboCNC use 2002. If unspecified, 2002 will be used. This option is relevant only when --software=custom&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1269+
</property>
1270+
<property name="text">
1271+
<string>al-probevar</string>
1272+
</property>
1273+
</widget>
1274+
</item>
1275+
<item row="10" column="0">
1276+
<widget class="QLabel" name="alsetzzeroLabel">
1277+
<property name="enabled">
1278+
<bool>true</bool>
1279+
</property>
1280+
<property name="toolTip">
1281+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;custom gcode for setting the actual height as the zero of the Z axis. For example, LinuxCNC uses G10 L20 P0 Z0 while Mach3, Mach4 and TurboCNC use G92 Z0. If unspecified, G92 Z0 will be used. This option is relevant only when --software=custom&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1282+
</property>
1283+
<property name="text">
1284+
<string>al-setzzero</string>
1285+
</property>
1286+
</widget>
1287+
</item>
1288+
<item row="8" column="1">
1289+
<widget class="QLineEdit" name="alprobecodeLineEdit">
1290+
<property name="enabled">
1291+
<bool>false</bool>
1292+
</property>
1293+
<property name="toolTip">
1294+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;custom Z probe code. For example, LinuxCNC uses G38.2 while Mach3, Mach4 and TurboCNC use G31. If unspecified, G31 will be used. This option is relevant only when --software=custom&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1295+
</property>
1296+
<property name="text">
1297+
<string>G31</string>
1298+
</property>
1299+
</widget>
1300+
</item>
1301+
<item row="10" column="1">
1302+
<widget class="QLineEdit" name="alsetzzeroLineEdit">
1303+
<property name="enabled">
1304+
<bool>false</bool>
1305+
</property>
1306+
<property name="toolTip">
1307+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;custom gcode for setting the actual height as the zero of the Z axis. For example, LinuxCNC uses G10 L20 P0 Z0 while Mach3, Mach4 and TurboCNC use G92 Z0. If unspecified, G92 Z0 will be used. This option is relevant only when --software=custom&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1308+
</property>
1309+
<property name="text">
1310+
<string>G92 Z0</string>
1311+
</property>
1312+
</widget>
1313+
</item>
1314+
<item row="9" column="1">
1315+
<widget class="QSpinBox" name="alprobevarSpinBox">
1316+
<property name="enabled">
1317+
<bool>false</bool>
1318+
</property>
1319+
<property name="toolTip">
1320+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;custom Z probe result variable. For example, LinuxCNC uses 5063 while Mach3, Mach4 and TurboCNC use 2002. If unspecified, 2002 will be used. This option is relevant only when --software=custom&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1321+
</property>
1322+
<property name="suffix">
1323+
<string/>
1324+
</property>
1325+
<property name="prefix">
1326+
<string/>
1327+
</property>
1328+
<property name="minimum">
1329+
<number>1</number>
1330+
</property>
1331+
<property name="maximum">
1332+
<number>100000</number>
1333+
</property>
1334+
<property name="value">
1335+
<number>2002</number>
1336+
</property>
1337+
</widget>
1338+
</item>
12491339
</layout>
12501340
</widget>
12511341
</widget>
@@ -1563,7 +1653,7 @@
15631653
<x>0</x>
15641654
<y>0</y>
15651655
<width>795</width>
1566-
<height>21</height>
1656+
<height>24</height>
15671657
</rect>
15681658
</property>
15691659
<widget class="QMenu" name="menuFile">

0 commit comments

Comments
 (0)