From 53e8e4d486e7d36c676a5daed625bda1b3d3e0db Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 13 Feb 2019 22:34:56 +0200 Subject: [PATCH] - made the Gerber aperture table hidden by default and added a checkbox to show it --- FlatCAMObj.py | 7 +++++++ ObjectUI.py | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index 375dc655..9817d35d 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -473,6 +473,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber): self.ui.generate_cutout_button.clicked.connect(self.app.cutout_tool.run) self.ui.generate_bb_button.clicked.connect(self.on_generatebb_button_click) self.ui.generate_noncopper_button.clicked.connect(self.on_generatenoncopper_button_click) + self.ui.aperture_table_visibility_cb.stateChanged.connect(self.on_aperture_table_visibility_change) self.build_ui() @@ -862,6 +863,12 @@ class FlatCAMGerber(FlatCAMObj, Gerber): self.read_form_item('multicolored') self.plot() + def on_aperture_table_visibility_change(self): + if self.ui.aperture_table_visibility_cb.isChecked(): + self.ui.apertures_table.setVisible(True) + else: + self.ui.apertures_table.setVisible(False) + def convert_units(self, units): """ Converts the units of the object by scaling dimensions in all geometry diff --git a/ObjectUI.py b/ObjectUI.py index fea35b81..5fe03193 100644 --- a/ObjectUI.py +++ b/ObjectUI.py @@ -151,6 +151,10 @@ class GerberObjectUI(ObjectUI): ) hlay_plot.addWidget(self.apertures_table_label) + # Aperture Table Visibility CB + self.aperture_table_visibility_cb = FCCheckBox() + hlay_plot.addWidget(self.aperture_table_visibility_cb) + # Plot CB self.plot_cb = FCCheckBox('Plot Object') self.plot_cb.setToolTip( @@ -164,7 +168,7 @@ class GerberObjectUI(ObjectUI): self.custom_box.addWidget(self.apertures_table) self.apertures_table.setColumnCount(6) - self.apertures_table.setHorizontalHeaderLabels(['#', 'D', 'Type', 'Size', 'Dim', 'P']) + self.apertures_table.setHorizontalHeaderLabels(['#', 'Code', 'Type', 'Size', 'Dim', 'P']) self.apertures_table.setSortingEnabled(False) self.apertures_table.horizontalHeaderItem(0).setToolTip( @@ -182,8 +186,14 @@ class GerberObjectUI(ObjectUI): self.apertures_table.horizontalHeaderItem(5).setToolTip( "Toggle display of the aperture instances.") - self.empty_label = QtWidgets.QLabel('') - self.custom_box.addWidget(self.empty_label) + # start with apertures table hidden + self.apertures_table.setVisible(False) + + # hide the plot column. for now I can't plot individually the apertures without making the plot really ugly + self.apertures_table.setColumnHidden(5, True) + # + # self.empty_label = QtWidgets.QLabel('') + # self.custom_box.addWidget(self.empty_label) # Isolation Routing self.isolation_routing_label = QtWidgets.QLabel("Isolation Routing:") @@ -318,7 +328,7 @@ class GerberObjectUI(ObjectUI): ) grid2.addWidget(self.clearcopper_label, 0, 0) - self.generate_ncc_button = QtWidgets.QPushButton('Non-Copper Clear Tool') + self.generate_ncc_button = QtWidgets.QPushButton('NCC Tool') self.generate_ncc_button.setToolTip( "Create the Geometry Object\n" "for non-copper routing."