Bläddra i källkod

- 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.

Marius Stanciu 7 år sedan
förälder
incheckning
783604f2aa
4 ändrade filer med 38 tillägg och 3 borttagningar
  1. 2 0
      FlatCAMApp.py
  2. 15 2
      FlatCAMGUI.py
  3. 1 0
      README.md
  4. 20 1
      flatcamTools/ToolPanelize.py

+ 2 - 0
FlatCAMApp.py

@@ -458,6 +458,7 @@ class App(QtCore.QObject):
             "tools_panelize_constrain": self.tools_defaults_form.tools_panelize_group.pconstrain_cb,
             "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_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_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_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,
             "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_constrain": False,
             "tools_panelize_constrainx": 0.0,
             "tools_panelize_constrainx": 0.0,
             "tools_panelize_constrainy": 0.0,
             "tools_panelize_constrainy": 0.0,
+            "tools_panelize_panel_type": 'gerber',
 
 
             "tools_calc_vshape_tip_dia": 0.007874,
             "tools_calc_vshape_tip_dia": 0.007874,
             "tools_calc_vshape_tip_angle": 30,
             "tools_calc_vshape_tip_angle": 30,

+ 15 - 2
FlatCAMGUI.py

@@ -3833,8 +3833,8 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI):
         # Plot options
         # Plot options
         self.export_options_label = QtWidgets.QLabel("<b>Export Options:</b>")
         self.export_options_label = QtWidgets.QLabel("<b>Export Options:</b>")
         self.export_options_label.setToolTip(
         self.export_options_label.setToolTip(
-            "The parameters set here are used in the file exported<cr>"
-            "when using the <b>File -> Export -> Export Excellon</b> 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)
         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.y_height_lbl, 6, 0)
         grid0.addWidget(self.py_height_entry, 6, 1)
         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()
         self.layout.addStretch()
 
 
 
 

+ 1 - 0
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) 
 - 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.
 - 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
 - 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
 17.02.2019
 
 

+ 20 - 1
flatcamTools/ToolPanelize.py

@@ -156,6 +156,17 @@ class Panelize(FlatCAMTool):
         self.constrain_sel = OptionalInputSection(
         self.constrain_sel = OptionalInputSection(
             self.constrain_cb, [self.x_width_lbl, self.x_width_entry, self.y_height_lbl, self.y_height_entry])
             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
         ## Buttons
         hlay_2 = QtWidgets.QHBoxLayout()
         hlay_2 = QtWidgets.QHBoxLayout()
@@ -232,6 +243,10 @@ class Panelize(FlatCAMTool):
             self.app.defaults["tools_panelize_constrainy"] else 0.0
             self.app.defaults["tools_panelize_constrainy"] else 0.0
         self.y_height_entry.set_value(float(y_w))
         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):
     def on_type_obj_index_changed(self):
         obj_type = self.type_obj_combo.currentIndex()
         obj_type = self.type_obj_combo.currentIndex()
         self.object_combo.setRootModelIndex(self.app.collection.index(obj_type, 0, QtCore.QModelIndex()))
         self.object_combo.setRootModelIndex(self.app.collection.index(obj_type, 0, QtCore.QModelIndex()))
@@ -344,6 +359,9 @@ class Panelize(FlatCAMTool):
                                      "use a number.")
                                      "use a number.")
                 return
                 return
 
 
+        panel_type = str(self.panel_type_radio.get_value())
+
+
         if 0 in {columns, rows}:
         if 0 in {columns, rows}:
             self.app.inform.emit("[ERROR_NOTCL]Columns or Rows are zero value. Change them to a positive integer.")
             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."
             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)
                     self.app.new_object("excellon", self.outname, job_init_excellon, plot=True, autoselected=True)
                 else:
                 else:
                     self.app.progress.emit(50)
                     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:
         if self.constrain_flag is False:
             self.app.inform.emit("[success]Panel done...")
             self.app.inform.emit("[success]Panel done...")