Skip to content

Commit 3b5f628

Browse files
committed
Added bridgesnum option & minor fixes
1 parent 0301fff commit 3b5f628

File tree

2 files changed

+42
-9
lines changed

2 files changed

+42
-9
lines changed

mainwindow.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ MainWindow::MainWindow(QWidget *parent) :
9797
args[ OUTLINEARGS ].insert("outline-width", ui->outlinewidthDoubleSpinBox);
9898
args[ OUTLINEARGS ].insert("bridges", ui->bridgesDoubleSpinBox);
9999
args[ OUTLINEARGS ].insert("zbridges", ui->zbridgesDoubleSpinBox);
100+
args[ OUTLINEARGS ].insert("bridgesnum", ui->bridgesnumSpinBox);
100101
args[ OUTLINEARGS ].insert("cut-front", ui->cutfrontCheckBox);
101102
args[ OUTLINEARGS ].insert("fill-outline", ui->filloutlineCheckBox);
102103

@@ -132,6 +133,10 @@ MainWindow::MainWindow(QWidget *parent) :
132133
connect(ui->g64CheckBox, SIGNAL(toggled(bool)), ui->g64DoubleSpinBox, SLOT(setEnabled(bool)));
133134
connect(ui->filloutlineCheckBox, SIGNAL(toggled(bool)), ui->outlinewidthDoubleSpinBox, SLOT(setEnabled(bool)));
134135
connect(ui->svgCheckBox, SIGNAL(toggled(bool)), ui->svgLineEdit, SLOT(setEnabled(bool)));
136+
connect(ui->optimiseCheckBox, SIGNAL(toggled(bool)), ui->bridgesDoubleSpinBox, SLOT(setEnabled(bool)));
137+
connect(ui->optimiseCheckBox, SIGNAL(toggled(bool)), ui->zbridgesDoubleSpinBox, SLOT(setEnabled(bool)));
138+
connect(ui->optimiseCheckBox, SIGNAL(toggled(bool)), ui->bridgesnumSpinBox, SLOT(setEnabled(bool)));
139+
135140
connect(ui->startPushButton, SIGNAL(clicked()), this, SLOT(startPcb2gcode()));
136141
connect(ui->inputMetricRadioButton, SIGNAL(toggled(bool)), this, SLOT(changeMetricInputUnits(bool)));
137142

@@ -516,7 +521,6 @@ bool MainWindow::loadConfFile(const QString filename)
516521
QMessageBox::information(this, tr("Error"), tr("Invalid parameter in configuration file: key=") + key + tr(" value=") + value);
517522
}
518523
}
519-
520524
ui->g64CheckBox->setChecked(ui->g64DoubleSpinBox->isEnabled()); //Sync checkBox checked state with doubleSpinBox enabled state
521525
ui->svgCheckBox->setChecked(ui->svgLineEdit->isEnabled()); //Sync checkBox checked state with lineEdit enabled state
522526

mainwindow.ui

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<string>custom g64</string>
7171
</property>
7272
<property name="checked">
73-
<bool>true</bool>
73+
<bool>false</bool>
7474
</property>
7575
<property name="tristate">
7676
<bool>false</bool>
@@ -166,6 +166,9 @@
166166
<property name="text">
167167
<string>optimise</string>
168168
</property>
169+
<property name="checked">
170+
<bool>true</bool>
171+
</property>
169172
</widget>
170173
</item>
171174
<item row="7" column="0">
@@ -184,7 +187,7 @@
184187
<item row="5" column="1">
185188
<widget class="QDoubleSpinBox" name="g64DoubleSpinBox">
186189
<property name="enabled">
187-
<bool>true</bool>
190+
<bool>false</bool>
188191
</property>
189192
<property name="toolTip">
190193
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Set a custom g64 value (maximum deviation from toolpath), overrides internal calculation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@@ -706,7 +709,7 @@
706709
<x>10</x>
707710
<y>10</y>
708711
<width>311</width>
709-
<height>331</height>
712+
<height>321</height>
710713
</rect>
711714
</property>
712715
<layout class="QGridLayout" name="outlineGridLayout">
@@ -716,7 +719,7 @@
716719
<property name="verticalSpacing">
717720
<number>6</number>
718721
</property>
719-
<item row="8" column="0">
722+
<item row="9" column="0">
720723
<widget class="QCheckBox" name="cutfrontCheckBox">
721724
<property name="toolTip">
722725
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Cut from the front side. Default is from the back side&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@@ -732,7 +735,7 @@
732735
<item row="6" column="1">
733736
<widget class="QDoubleSpinBox" name="bridgesDoubleSpinBox">
734737
<property name="toolTip">
735-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add four bridges with the given width to the outline cut&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
738+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add bridges with the given width to the outline cut. --bridgesnum bridges will be created for each outline closed line. This option requires --optimise&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
736739
</property>
737740
<property name="suffix">
738741
<string> mm</string>
@@ -747,7 +750,7 @@
747750
<double>0.050000000000000</double>
748751
</property>
749752
<property name="value">
750-
<double>1.000000000000000</double>
753+
<double>0.500000000000000</double>
751754
</property>
752755
</widget>
753756
</item>
@@ -853,7 +856,7 @@
853856
<item row="6" column="0">
854857
<widget class="QLabel" name="bridgesLabel">
855858
<property name="toolTip">
856-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add four bridges with the given width to the outline cut&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
859+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add bridges with the given width to the outline cut. --bridgesnum bridges will be created for each outline closed line. This option requires --optimise&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
857860
</property>
858861
<property name="text">
859862
<string>bridges</string>
@@ -947,7 +950,7 @@
947950
</property>
948951
</widget>
949952
</item>
950-
<item row="9" column="0">
953+
<item row="10" column="0">
951954
<widget class="QCheckBox" name="filloutlineCheckBox">
952955
<property name="toolTip">
953956
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If fill-outline is given, it is assumed that the outline file contains not a polygon but a closed chain of lines. The board will be cut along the centres of these lines&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@@ -998,6 +1001,32 @@
9981001
</property>
9991002
</widget>
10001003
</item>
1004+
<item row="8" column="0">
1005+
<widget class="QLabel" name="bridgesnumLabel">
1006+
<property name="toolTip">
1007+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Sets the numer of bridges to be created (--bridgesnum bridges for each closed line)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1008+
</property>
1009+
<property name="text">
1010+
<string>bridgesnum</string>
1011+
</property>
1012+
</widget>
1013+
</item>
1014+
<item row="8" column="1">
1015+
<widget class="QSpinBox" name="bridgesnumSpinBox">
1016+
<property name="toolTip">
1017+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Sets the numer of bridges to be created (--bridgesnum bridges for each closed line)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1018+
</property>
1019+
<property name="minimum">
1020+
<number>1</number>
1021+
</property>
1022+
<property name="maximum">
1023+
<number>100</number>
1024+
</property>
1025+
<property name="value">
1026+
<number>2</number>
1027+
</property>
1028+
</widget>
1029+
</item>
10011030
</layout>
10021031
</widget>
10031032
</widget>

0 commit comments

Comments
 (0)