diff --git a/FlatCAMApp.py b/FlatCAMApp.py index ae3553aa..2491d33c 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -458,6 +458,7 @@ class App(QtCore.QObject): "tools_panelize_constrain": self.tools_defaults_form.tools_panelize_group.pconstrain_cb, "tools_panelize_constrainx": self.tools_defaults_form.tools_panelize_group.px_width_entry, "tools_panelize_constrainy": self.tools_defaults_form.tools_panelize_group.py_height_entry, + "tools_panelize_panel_type": self.tools_defaults_form.tools_panelize_group.panel_type_radio, "tools_calc_vshape_tip_dia": self.tools_defaults_form.tools_calculators_group.tip_dia_entry, "tools_calc_vshape_tip_angle": self.tools_defaults_form.tools_calculators_group.tip_angle_entry, @@ -681,6 +682,7 @@ class App(QtCore.QObject): "tools_panelize_constrain": False, "tools_panelize_constrainx": 0.0, "tools_panelize_constrainy": 0.0, + "tools_panelize_panel_type": 'gerber', "tools_calc_vshape_tip_dia": 0.007874, "tools_calc_vshape_tip_angle": 30, diff --git a/FlatCAMGUI.py b/FlatCAMGUI.py index 8be89029..b347eff7 100644 --- a/FlatCAMGUI.py +++ b/FlatCAMGUI.py @@ -3833,8 +3833,8 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): # Plot options self.export_options_label = QtWidgets.QLabel("Export Options:") self.export_options_label.setToolTip( - "The parameters set here are used in the file exported" - "when using the File -> Export -> Export Excellon menu entry." + "The parameters set here are used in the file exported\n" + "when using the File -> Export -> Export Excellon menu entry." ) self.layout.addWidget(self.export_options_label) @@ -4879,6 +4879,19 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): grid0.addWidget(self.y_height_lbl, 6, 0) grid0.addWidget(self.py_height_entry, 6, 1) + ## Type of resulting Panel object + self.panel_type_radio = RadioSet([{'label': 'Gerber', 'value': 'gerber'}, + {'label': 'Geometry', 'value': 'geometry'}]) + self.panel_type_label = QtWidgets.QLabel("Panel Type:") + self.panel_type_label.setToolTip( + "Choose the type of object for the panel object:\n" + "- Geometry\n" + "- Gerber" + ) + + grid0.addWidget(self.panel_type_label, 7, 0) + grid0.addWidget(self.panel_type_radio, 7, 1) + self.layout.addStretch() diff --git a/README.md b/README.md index 5ca2309f..85947971 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ CAD program, and create G-Code for Isolation routing. - adjusted the plotcanvas.zomm_fit() function so the objects are better fit into view (with a border around) - modified the GUI in Objects Selected Tab to accommodate 2 different modes: basic and Advanced. In Basic mode, some of the functionality's are hidden from the user. - added Tool Transform preferences in Edit -> Preferences and used them through out the app +- made the output of Panelization Tool a choice out of Gerber and Geometry type of objects. Useful for those who want to engrave multiple copies of the same design. 17.02.2019 diff --git a/flatcamTools/ToolPanelize.py b/flatcamTools/ToolPanelize.py index 5e748845..f73e2c4f 100644 --- a/flatcamTools/ToolPanelize.py +++ b/flatcamTools/ToolPanelize.py @@ -156,6 +156,17 @@ class Panelize(FlatCAMTool): self.constrain_sel = OptionalInputSection( self.constrain_cb, [self.x_width_lbl, self.x_width_entry, self.y_height_lbl, self.y_height_entry]) + ## Type of resulting Panel object + self.panel_type_radio = RadioSet([{'label': 'Gerber', 'value': 'gerber'}, + {'label': 'Geo', 'value': 'geometry'}]) + self.panel_type_label = QtWidgets.QLabel("Panel Type:") + self.panel_type_label.setToolTip( + "Choose the type of object for the panel object:\n" + "- Geometry\n" + "- Gerber" + ) + form_layout.addRow(self.panel_type_label) + form_layout.addRow(self.panel_type_radio) ## Buttons hlay_2 = QtWidgets.QHBoxLayout() @@ -232,6 +243,10 @@ class Panelize(FlatCAMTool): self.app.defaults["tools_panelize_constrainy"] else 0.0 self.y_height_entry.set_value(float(y_w)) + panel_type = self.app.defaults["tools_panelize_panel_type"] if \ + self.app.defaults["tools_panelize_panel_type"] else 'gerber' + self.panel_type_radio.set_value(panel_type) + def on_type_obj_index_changed(self): obj_type = self.type_obj_combo.currentIndex() self.object_combo.setRootModelIndex(self.app.collection.index(obj_type, 0, QtCore.QModelIndex())) @@ -344,6 +359,9 @@ class Panelize(FlatCAMTool): "use a number.") return + panel_type = str(self.panel_type_radio.get_value()) + + if 0 in {columns, rows}: self.app.inform.emit("[ERROR_NOTCL]Columns or Rows are zero value. Change them to a positive integer.") return "Columns or Rows are zero value. Change them to a positive integer." @@ -548,7 +566,8 @@ class Panelize(FlatCAMTool): self.app.new_object("excellon", self.outname, job_init_excellon, plot=True, autoselected=True) else: self.app.progress.emit(50) - self.app.new_object("geometry", self.outname, job_init_geometry, plot=True, autoselected=True) + self.app.new_object(panel_type, self.outname, job_init_geometry, + plot=True, autoselected=True) if self.constrain_flag is False: self.app.inform.emit("[success]Panel done...")