- replaced all usages of QFormLayout with QGridLayout

This commit is contained in:
Marius Stanciu
2020-12-31 18:03:43 +02:00
committed by Marius
parent 841f3f5fa3
commit e5cc47882f
19 changed files with 578 additions and 426 deletions

View File

@@ -452,63 +452,70 @@ class CalcUI:
grid_units_layout.addWidget(self.mm_entry, 1, 0)
grid_units_layout.addWidget(self.inch_entry, 1, 1)
# ##############################
# ## V-shape Tool Calculator ###
# ##############################
# #############################################################################################################
# ################################ V-shape Tool Calculator ####################################################
# #############################################################################################################
grid_vshape = QtWidgets.QGridLayout()
grid_vshape.setColumnStretch(0, 0)
grid_vshape.setColumnStretch(1, 1)
self.layout.addLayout(grid_vshape)
self.v_shape_spacer_label = FCLabel(" ")
self.layout.addWidget(self.v_shape_spacer_label)
grid_vshape.addWidget(self.v_shape_spacer_label, 0, 0, 1, 2)
# ## Title of the V-shape Tools Calculator
v_shape_title_label = FCLabel("<font size=3><b>%s</b></font>" % self.v_shapeName)
self.layout.addWidget(v_shape_title_label)
# ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout)
grid_vshape.addWidget(v_shape_title_label, 2, 0, 1, 2)
# Tip Diameter
self.tipDia_label = FCLabel('%s:' % _("Tip Diameter"))
self.tipDia_label.setToolTip(
_("This is the tool tip diameter.\n"
"It is specified by manufacturer.")
)
self.tipDia_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.tipDia_entry.set_precision(self.decimals)
self.tipDia_entry.set_range(0.0, 10000.0000)
self.tipDia_entry.setSingleStep(0.1)
# self.tipDia_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.tipDia_label.setToolTip(
_("This is the tool tip diameter.\n"
"It is specified by manufacturer.")
)
grid_vshape.addWidget(self.tipDia_label, 4, 0)
grid_vshape.addWidget(self.tipDia_entry, 4, 1)
# Tip Angle
self.tipAngle_label = FCLabel('%s:' % _("Tip Angle"))
self.tipAngle_label.setToolTip(_("This is the angle of the tip of the tool.\n"
"It is specified by manufacturer."))
self.tipAngle_entry = FCSpinner(callback=self.confirmation_message_int)
self.tipAngle_entry.set_range(0, 180)
self.tipAngle_entry.set_step(5)
# self.tipAngle_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.tipAngle_label.setToolTip(_("This is the angle of the tip of the tool.\n"
"It is specified by manufacturer."))
grid_vshape.addWidget(self.tipAngle_label, 6, 0)
grid_vshape.addWidget(self.tipAngle_entry, 6, 1)
# Cut Z
self.cutDepth_label = FCLabel('%s:' % _("Cut Z"))
self.cutDepth_label.setToolTip(_("This is the depth to cut into the material.\n"
"In the CNCJob is the CutZ parameter."))
self.cutDepth_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.cutDepth_entry.set_range(-10000.0000, 10000.0000)
self.cutDepth_entry.set_precision(self.decimals)
# self.cutDepth_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.cutDepth_label.setToolTip(_("This is the depth to cut into the material.\n"
"In the CNCJob is the CutZ parameter."))
grid_vshape.addWidget(self.cutDepth_label, 8, 0)
grid_vshape.addWidget(self.cutDepth_entry, 8, 1)
# Tool Diameter
self.effectiveToolDia_label = FCLabel('%s:' % _("Tool Diameter"))
self.effectiveToolDia_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.effectiveToolDia_entry.set_precision(self.decimals)
# self.effectiveToolDia_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.effectiveToolDia_label.setToolTip(_("This is the tool diameter to be entered into\n"
"FlatCAM Gerber section.\n"
"In the CNCJob section it is called >Tool dia<."))
# self.effectiveToolDia_entry.setEnabled(False)
self.effectiveToolDia_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.effectiveToolDia_entry.set_precision(self.decimals)
form_layout.addRow(self.tipDia_label, self.tipDia_entry)
form_layout.addRow(self.tipAngle_label, self.tipAngle_entry)
form_layout.addRow(self.cutDepth_label, self.cutDepth_entry)
form_layout.addRow(self.effectiveToolDia_label, self.effectiveToolDia_entry)
grid_vshape.addWidget(self.effectiveToolDia_label, 10, 0)
grid_vshape.addWidget(self.effectiveToolDia_entry, 10, 1)
# ## Buttons
self.calculate_vshape_button = FCButton(_("Calculate"))
@@ -519,13 +526,17 @@ class CalcUI:
"depending on which is desired and which is known. ")
)
self.layout.addWidget(self.calculate_vshape_button)
grid_vshape.addWidget(self.calculate_vshape_button, 12, 0, 1, 2)
# ####################################
# ## ElectroPlating Tool Calculator ##
# ####################################
# #############################################################################################################
# ############################## ElectroPlating Tool Calculator ###############################################
# #############################################################################################################
grid_electro = QtWidgets.QGridLayout()
grid_electro.setColumnStretch(0, 0)
grid_electro.setColumnStretch(1, 1)
self.layout.addLayout(grid_electro)
self.layout.addWidget(FCLabel(""))
grid_electro.addWidget(FCLabel(""), 0, 0, 1, 2)
# ## Title of the ElectroPlating Tools Calculator
plate_title_label = FCLabel("<font size=3><b>%s</b></font>" % self.eplateName)
@@ -533,13 +544,7 @@ class CalcUI:
_("This calculator is useful for those who plate the via/pad/drill holes,\n"
"using a method like graphite ink or calcium hypophosphite ink or palladium chloride.")
)
self.layout.addWidget(plate_title_label)
# ## Plate Form Layout
grid2 = QtWidgets.QGridLayout()
grid2.setColumnStretch(0, 0)
grid2.setColumnStretch(1, 1)
self.layout.addLayout(grid2)
grid_electro.addWidget(plate_title_label, 2, 0, 1, 2)
# Area Calculation
self.area_sel_label = FCLabel('%s:' % _("Area Calculation"))
@@ -551,8 +556,8 @@ class CalcUI:
{"label": _("Area"), "value": "a"}
], stretch=False)
grid2.addWidget(self.area_sel_label, 0, 0)
grid2.addWidget(self.area_sel_radio, 1, 0, 1, 2)
grid_electro.addWidget(self.area_sel_label, 4, 0)
grid_electro.addWidget(self.area_sel_radio, 6, 0, 1, 2)
# BOARD LENGTH
self.pcblengthlabel = FCLabel('%s:' % _("Board Length"))
@@ -569,8 +574,8 @@ class CalcUI:
l_hlay.addWidget(self.pcblength_entry)
l_hlay.addWidget(self.length_unit)
grid2.addWidget(self.pcblengthlabel, 2, 0)
grid2.addLayout(l_hlay, 2, 1)
grid_electro.addWidget(self.pcblengthlabel, 8, 0)
grid_electro.addLayout(l_hlay, 8, 1)
# BOARD WIDTH
self.pcbwidthlabel = FCLabel('%s:' % _("Board Width"))
@@ -587,8 +592,8 @@ class CalcUI:
w_hlay.addWidget(self.pcbwidth_entry)
w_hlay.addWidget(self.width_unit)
grid2.addWidget(self.pcbwidthlabel, 4, 0)
grid2.addLayout(w_hlay, 4, 1)
grid_electro.addWidget(self.pcbwidthlabel, 10, 0)
grid_electro.addLayout(w_hlay, 10, 1)
# AREA
self.area_label = FCLabel('%s:' % _("Area"))
@@ -605,13 +610,13 @@ class CalcUI:
a_hlay.addWidget(self.area_entry)
a_hlay.addWidget(self.area_unit)
grid2.addWidget(self.area_label, 6, 0)
grid2.addLayout(a_hlay, 6, 1)
grid_electro.addWidget(self.area_label, 12, 0)
grid_electro.addLayout(a_hlay, 12, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid2.addWidget(separator_line, 7, 0, 1, 2)
grid_electro.addWidget(separator_line, 14, 0, 1, 2)
# DENSITY
self.cdensity_label = FCLabel('%s:' % _("Current Density"))
@@ -630,8 +635,8 @@ class CalcUI:
d_hlay.addWidget(self.cdensity_entry)
d_hlay.addWidget(density_unit)
grid2.addWidget(self.cdensity_label, 8, 0)
grid2.addLayout(d_hlay, 8, 1)
grid_electro.addWidget(self.cdensity_label, 16, 0)
grid_electro.addLayout(d_hlay, 16, 1)
# COPPER GROWTH
self.growth_label = FCLabel('%s:' % _("Copper Growth"))
@@ -650,8 +655,8 @@ class CalcUI:
g_hlay.addWidget(self.growth_entry)
g_hlay.addWidget(growth_unit)
grid2.addWidget(self.growth_label, 10, 0)
grid2.addLayout(g_hlay, 10, 1)
grid_electro.addWidget(self.growth_label, 18, 0)
grid_electro.addLayout(g_hlay, 18, 1)
# CURRENT
self.cvaluelabel = FCLabel('%s:' % _("Current Value"))
@@ -671,8 +676,8 @@ class CalcUI:
c_hlay.addWidget(self.cvalue_entry)
c_hlay.addWidget(current_unit)
grid2.addWidget(self.cvaluelabel, 12, 0)
grid2.addLayout(c_hlay, 12, 1)
grid_electro.addWidget(self.cvaluelabel, 20, 0)
grid_electro.addLayout(c_hlay, 20, 1)
# TIME
self.timelabel = FCLabel('%s:' % _("Time"))
@@ -692,8 +697,8 @@ class CalcUI:
t_hlay.addWidget(self.time_entry)
t_hlay.addWidget(time_unit)
grid2.addWidget(self.timelabel, 14, 0)
grid2.addLayout(t_hlay, 14, 1)
grid_electro.addWidget(self.timelabel, 22, 0)
grid_electro.addLayout(t_hlay, 22, 1)
# ## Buttons
self.calculate_plate_button = FCButton(_("Calculate"))
@@ -702,9 +707,9 @@ class CalcUI:
_("Calculate the current intensity value and the procedure time,\n"
"depending on the parameters above")
)
self.layout.addWidget(self.calculate_plate_button)
grid_electro.addWidget(self.calculate_plate_button, 24, 0, 1, 2)
self.layout.addStretch()
self.layout.addStretch(1)
# ## Reset Tool
self.reset_button = FCButton(_("Reset Tool"))

View File

@@ -7,7 +7,7 @@
from PyQt5 import QtWidgets, QtCore
from appTool import AppTool
from appGUI.GUIElements import FCEntry
from appGUI.GUIElements import FCEntry, FCLabel, FCButton
from shapely.ops import nearest_points
from shapely.geometry import Point, MultiPolygon
@@ -239,95 +239,121 @@ class DistMinUI:
self.units = self.app.defaults['units'].lower()
# ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font><br>" % self.toolName)
title_label = FCLabel("<font size=4><b>%s</b></font><br>" % self.toolName)
self.layout.addWidget(title_label)
# ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout)
self.units_label = QtWidgets.QLabel('%s:' % _("Units"))
# ## Grid Layout
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
# Units
self.units_label = FCLabel('%s:' % _("Units"))
self.units_label.setToolTip(_("Those are the units in which the distance is measured."))
self.units_value = QtWidgets.QLabel("%s" % str({'mm': _("METRIC (mm)"), 'in': _("INCH (in)")}[self.units]))
self.units_value = FCLabel("%s" % str({'mm': _("METRIC (mm)"), 'in': _("INCH (in)")}[self.units]))
self.units_value.setDisabled(True)
self.start_label = QtWidgets.QLabel("%s:" % _('First object point'))
grid0.addWidget(self.units_label, 0, 0)
grid0.addWidget(self.units_value, 0, 1)
# Start
self.start_label = FCLabel("%s:" % _('First object point'))
self.start_label.setToolTip(_("This is first object point coordinates.\n"
"This is the start point for measuring distance."))
self.stop_label = QtWidgets.QLabel("%s:" % _('Second object point'))
self.stop_label.setToolTip(_("This is second object point coordinates.\n"
"This is the end point for measuring distance."))
self.distance_x_label = QtWidgets.QLabel('%s:' % _("Dx"))
self.distance_x_label.setToolTip(_("This is the distance measured over the X axis."))
self.distance_y_label = QtWidgets.QLabel('%s:' % _("Dy"))
self.distance_y_label.setToolTip(_("This is the distance measured over the Y axis."))
self.angle_label = QtWidgets.QLabel('%s:' % _("Angle"))
self.angle_label.setToolTip(_("This is orientation angle of the measuring line."))
self.total_distance_label = QtWidgets.QLabel("<b>%s:</b>" % _('DISTANCE'))
self.total_distance_label.setToolTip(_("This is the point to point Euclidean distance."))
self.half_point_label = QtWidgets.QLabel("<b>%s:</b>" % _('Half Point'))
self.half_point_label.setToolTip(_("This is the middle point of the point to point Euclidean distance."))
self.start_entry = FCEntry()
self.start_entry.setReadOnly(True)
self.start_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.start_entry.setToolTip(_("This is first object point coordinates.\n"
"This is the start point for measuring distance."))
grid0.addWidget(self.start_label, 2, 0)
grid0.addWidget(self.start_entry, 2, 1)
# Stop
self.stop_label = FCLabel("%s:" % _('Second object point'))
self.stop_label.setToolTip(_("This is second object point coordinates.\n"
"This is the end point for measuring distance."))
self.stop_entry = FCEntry()
self.stop_entry.setReadOnly(True)
self.stop_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.stop_entry.setToolTip(_("This is second object point coordinates.\n"
"This is the end point for measuring distance."))
grid0.addWidget(self.stop_label, 4, 0)
grid0.addWidget(self.stop_entry, 4, 1)
# DX
self.distance_x_label = FCLabel('%s:' % _("Dx"))
self.distance_x_label.setToolTip(_("This is the distance measured over the X axis."))
self.distance_x_entry = FCEntry()
self.distance_x_entry.setReadOnly(True)
self.distance_x_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.distance_x_entry.setToolTip(_("This is the distance measured over the X axis."))
grid0.addWidget(self.distance_x_label, 6, 0)
grid0.addWidget(self.distance_x_entry, 6, 1)
# DY
self.distance_y_label = FCLabel('%s:' % _("Dy"))
self.distance_y_label.setToolTip(_("This is the distance measured over the Y axis."))
self.distance_y_entry = FCEntry()
self.distance_y_entry.setReadOnly(True)
self.distance_y_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.distance_y_entry.setToolTip(_("This is the distance measured over the Y axis."))
grid0.addWidget(self.distance_y_label, 8, 0)
grid0.addWidget(self.distance_y_entry, 8, 1)
# Angle
self.angle_label = FCLabel('%s:' % _("Angle"))
self.angle_label.setToolTip(_("This is orientation angle of the measuring line."))
self.angle_entry = FCEntry()
self.angle_entry.setReadOnly(True)
self.angle_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.angle_entry.setToolTip(_("This is orientation angle of the measuring line."))
grid0.addWidget(self.angle_label, 10, 0)
grid0.addWidget(self.angle_entry, 10, 1)
# Total Distance
self.total_distance_label = FCLabel("<b>%s:</b>" % _('DISTANCE'))
self.total_distance_label.setToolTip(_("This is the point to point Euclidean distance."))
self.total_distance_entry = FCEntry()
self.total_distance_entry.setReadOnly(True)
self.total_distance_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.total_distance_entry.setToolTip(_("This is the point to point Euclidean distance."))
grid0.addWidget(self.total_distance_label, 12, 0)
grid0.addWidget(self.total_distance_entry, 12, 1)
# Half Point
self.half_point_label = FCLabel("<b>%s:</b>" % _('Half Point'))
self.half_point_label.setToolTip(_("This is the middle point of the point to point Euclidean distance."))
self.half_point_entry = FCEntry()
self.half_point_entry.setReadOnly(True)
self.half_point_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.half_point_entry.setToolTip(_("This is the middle point of the point to point Euclidean distance."))
self.measure_btn = QtWidgets.QPushButton(_("Measure"))
self.layout.addWidget(self.measure_btn)
grid0.addWidget(self.half_point_label, 14, 0)
grid0.addWidget(self.half_point_entry, 14, 1)
self.measure_btn = FCButton(_("Measure"))
grid0.addWidget(self.measure_btn, 16, 0, 1, 2)
self.jump_hp_btn = QtWidgets.QPushButton(_("Jump to Half Point"))
self.layout.addWidget(self.jump_hp_btn)
self.jump_hp_btn = FCButton(_("Jump to Half Point"))
self.jump_hp_btn.setDisabled(True)
grid0.addWidget(self.jump_hp_btn, 18, 0, 1, 2)
form_layout.addRow(self.units_label, self.units_value)
form_layout.addRow(self.start_label, self.start_entry)
form_layout.addRow(self.stop_label, self.stop_entry)
form_layout.addRow(self.distance_x_label, self.distance_x_entry)
form_layout.addRow(self.distance_y_label, self.distance_y_entry)
form_layout.addRow(self.angle_label, self.angle_entry)
form_layout.addRow(self.total_distance_label, self.total_distance_entry)
form_layout.addRow(self.half_point_label, self.half_point_entry)
self.layout.addStretch()
self.layout.addStretch(1)
# #################################### FINSIHED GUI ###########################
# #############################################################################

View File

@@ -8,7 +8,7 @@
from PyQt5 import QtGui, QtWidgets
from appTool import AppTool
from appGUI.GUIElements import RadioSet, FCComboBox, FCSpinner
from appGUI.GUIElements import RadioSet, FCComboBox, FCSpinner, FCLabel
import os
@@ -114,7 +114,7 @@ class ToolImage(AppTool):
filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import IMAGE"),
directory=self.app.get_last_folder(), filter=_filter)
except TypeError:
filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import IMAGE"), filter=filter)
filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import IMAGE"), filter=_filter)
filename = str(filename)
type_obj = self.ui.tf_type_obj_combo.get_value()
@@ -166,6 +166,7 @@ class ToolImage(AppTool):
return
def obj_init(geo_obj, app_obj):
app_obj.log.debug("ToolIamge.import_image() -> importing image as geometry")
geo_obj.import_image(filename, units=units, dpi=dpi, mode=mode, mask=mask)
geo_obj.multigeo = False
@@ -194,7 +195,7 @@ class ImageUI:
self.layout = layout
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label = FCLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
@@ -204,9 +205,11 @@ class ImageUI:
""")
self.layout.addWidget(title_label)
# Form Layout
ti_form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(ti_form_layout)
# Grid Layout
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
# Type of object to create for the image
self.tf_type_obj_combo = FCComboBox()
@@ -215,45 +218,44 @@ class ImageUI:
self.tf_type_obj_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.tf_type_obj_combo.setItemIcon(1, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.tf_type_obj_combo_label = QtWidgets.QLabel('%s:' % _("Object Type"))
self.tf_type_obj_combo_label = FCLabel('%s:' % _("Object Type"))
self.tf_type_obj_combo_label.setToolTip(
_("Specify the type of object to create from the image.\n"
"It can be of type: Gerber or Geometry.")
)
ti_form_layout.addRow(self.tf_type_obj_combo_label, self.tf_type_obj_combo)
grid0.addWidget(self.tf_type_obj_combo_label, 0, 0)
grid0.addWidget(self.tf_type_obj_combo, 0, 1)
# DPI value of the imported image
self.dpi_entry = FCSpinner(callback=self.confirmation_message_int)
self.dpi_entry.set_range(0, 99999)
self.dpi_label = QtWidgets.QLabel('%s:' % _("DPI value"))
self.dpi_label = FCLabel('%s:' % _("DPI value"))
self.dpi_label.setToolTip(_("Specify a DPI value for the image."))
ti_form_layout.addRow(self.dpi_label, self.dpi_entry)
grid0.addWidget(self.dpi_label, 2, 0)
grid0.addWidget(self.dpi_entry, 2, 1)
self.emty_lbl = QtWidgets.QLabel("")
self.layout.addWidget(self.emty_lbl)
grid0.addWidget(FCLabel(''), 4, 0, 1, 2)
self.detail_label = QtWidgets.QLabel("<font size=4><b>%s:</b></font>" % _('Level of detail'))
self.layout.addWidget(self.detail_label)
ti2_form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(ti2_form_layout)
self.detail_label = FCLabel("<font size=4><b>%s:</b></font>" % _('Level of detail'))
grid0.addWidget(self.detail_label, 6, 0, 1, 2)
# Type of image interpretation
self.image_type = RadioSet([{'label': 'B/W', 'value': 'black'},
{'label': 'Color', 'value': 'color'}])
self.image_type_label = QtWidgets.QLabel("<b>%s:</b>" % _('Image type'))
self.image_type_label = FCLabel("<b>%s:</b>" % _('Image type'))
self.image_type_label.setToolTip(
_("Choose a method for the image interpretation.\n"
"B/W means a black & white image. Color means a colored image.")
)
ti2_form_layout.addRow(self.image_type_label, self.image_type)
grid0.addWidget(self.image_type_label, 8, 0)
grid0.addWidget(self.image_type, 8, 1)
# Mask value of the imported image when image monochrome
self.mask_bw_entry = FCSpinner(callback=self.confirmation_message_int)
self.mask_bw_entry.set_range(0, 255)
self.mask_bw_label = QtWidgets.QLabel("%s <b>B/W</b>:" % _('Mask value'))
self.mask_bw_label = FCLabel("%s <b>B/W</b>:" % _('Mask value'))
self.mask_bw_label.setToolTip(
_("Mask for monochrome image.\n"
"Takes values between [0 ... 255].\n"
@@ -262,55 +264,59 @@ class ImageUI:
"0 means no detail and 255 means everything \n"
"(which is totally black).")
)
ti2_form_layout.addRow(self.mask_bw_label, self.mask_bw_entry)
grid0.addWidget(self.mask_bw_label, 10, 0)
grid0.addWidget(self.mask_bw_entry, 10, 1)
# Mask value of the imported image for RED color when image color
self.mask_r_entry = FCSpinner(callback=self.confirmation_message_int)
self.mask_r_entry.set_range(0, 255)
self.mask_r_label = QtWidgets.QLabel("%s <b>R:</b>" % _('Mask value'))
self.mask_r_label = FCLabel("%s <b>R:</b>" % _('Mask value'))
self.mask_r_label.setToolTip(
_("Mask for RED color.\n"
"Takes values between [0 ... 255].\n"
"Decides the level of details to include\n"
"in the resulting geometry.")
)
ti2_form_layout.addRow(self.mask_r_label, self.mask_r_entry)
grid0.addWidget(self.mask_r_label, 12, 0)
grid0.addWidget(self.mask_r_entry, 12, 1)
# Mask value of the imported image for GREEN color when image color
self.mask_g_entry = FCSpinner(callback=self.confirmation_message_int)
self.mask_g_entry.set_range(0, 255)
self.mask_g_label = QtWidgets.QLabel("%s <b>G:</b>" % _('Mask value'))
self.mask_g_label = FCLabel("%s <b>G:</b>" % _('Mask value'))
self.mask_g_label.setToolTip(
_("Mask for GREEN color.\n"
"Takes values between [0 ... 255].\n"
"Decides the level of details to include\n"
"in the resulting geometry.")
)
ti2_form_layout.addRow(self.mask_g_label, self.mask_g_entry)
grid0.addWidget(self.mask_g_label, 14, 0)
grid0.addWidget(self.mask_g_entry, 14, 1)
# Mask value of the imported image for BLUE color when image color
self.mask_b_entry = FCSpinner(callback=self.confirmation_message_int)
self.mask_b_entry.set_range(0, 255)
self.mask_b_label = QtWidgets.QLabel("%s <b>B:</b>" % _('Mask value'))
self.mask_b_label = FCLabel("%s <b>B:</b>" % _('Mask value'))
self.mask_b_label.setToolTip(
_("Mask for BLUE color.\n"
"Takes values between [0 ... 255].\n"
"Decides the level of details to include\n"
"in the resulting geometry.")
)
ti2_form_layout.addRow(self.mask_b_label, self.mask_b_entry)
grid0.addWidget(self.mask_b_label, 16, 0)
grid0.addWidget(self.mask_b_entry, 16, 1)
# Buttons
self.import_button = QtWidgets.QPushButton(_("Import image"))
self.import_button.setToolTip(
_("Open a image of raster type and then import it in FlatCAM.")
)
self.layout.addWidget(self.import_button)
grid0.addWidget(self.import_button, 18, 0, 1, 2)
self.layout.addStretch()
self.layout.addStretch(1)
self.on_image_type(val=False)

View File

@@ -4120,9 +4120,11 @@ class NccUI:
self.level.setCheckable(True)
self.title_box.addWidget(self.level)
# ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.tools_box.addLayout(form_layout)
# ## Grid Layout
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.tools_box.addLayout(grid0)
self.type_obj_combo_label = FCLabel('%s:' % _("Type"))
self.type_obj_combo_label.setToolTip(
@@ -4136,7 +4138,8 @@ class NccUI:
self.type_obj_radio = RadioSet([{'label': _("Geometry"), 'value': 'geometry'},
{'label': _("Gerber"), 'value': 'gerber'}])
form_layout.addRow(self.type_obj_combo_label, self.type_obj_radio)
grid0.addWidget(self.type_obj_combo_label, 0, 0)
grid0.addWidget(self.type_obj_radio, 0, 1)
# ################################################
# ##### The object to be copper cleaned ##########
@@ -4150,12 +4153,12 @@ class NccUI:
# self.object_label = FCLabel('%s:' % _("Object"))
# self.object_label.setToolTip(_("Object to be cleared of excess copper."))
form_layout.addRow(self.object_combo)
grid0.addWidget(self.object_combo, 2, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.tools_box.addWidget(separator_line)
grid0.addWidget(separator_line, 4, 0, 1, 2)
# ### Tools ## ##
self.tools_table_label = FCLabel('<b>%s</b>' % _('Tools Table'))
@@ -4163,10 +4166,10 @@ class NccUI:
_("Tools pool from which the algorithm\n"
"will pick the ones used for copper clearing.")
)
self.tools_box.addWidget(self.tools_table_label)
grid0.addWidget(self.tools_table_label, 6, 0, 1, 2)
self.tools_table = FCTable(drag_drop=True)
self.tools_box.addWidget(self.tools_table)
grid0.addWidget(self.tools_table, 8, 0, 1, 2)
self.tools_table.setColumnCount(4)
# 3rd column is reserved (and hidden) for the tool ID
@@ -4207,9 +4210,9 @@ class NccUI:
# "- Clear -> the regular non-copper clearing."))
grid1 = QtWidgets.QGridLayout()
self.tools_box.addLayout(grid1)
grid1.setColumnStretch(0, 0)
grid1.setColumnStretch(1, 1)
self.tools_box.addLayout(grid1)
# Tool order
self.ncc_order_label = FCLabel('%s:' % _('Tool order'))

View File

@@ -425,9 +425,11 @@ class OptimalUI:
self.layout.addWidget(title_label)
self.layout.addWidget(FCLabel(""))
# ## Form Layout
form_lay = QtWidgets.QFormLayout()
self.layout.addLayout(form_lay)
# ## Grid Layout
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
# ## Gerber Object to mirror
self.gerber_object_combo = FCComboBox()
@@ -440,13 +442,13 @@ class OptimalUI:
self.gerber_object_label.setToolTip(
"Gerber object for which to find the minimum distance between copper features."
)
form_lay.addRow(self.gerber_object_label)
form_lay.addRow(self.gerber_object_combo)
grid0.addWidget(self.gerber_object_label, 0, 0, 1, 2)
grid0.addWidget(self.gerber_object_combo, 2, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
form_lay.addRow(separator_line)
grid0.addWidget(separator_line, 4, 0, 1, 2)
# Precision = nr of decimals
self.precision_label = FCLabel('%s:' % _("Precision"))
@@ -455,12 +457,13 @@ class OptimalUI:
self.precision_spinner = FCSpinner(callback=self.confirmation_message_int)
self.precision_spinner.set_range(2, 10)
self.precision_spinner.setWrapping(True)
form_lay.addRow(self.precision_label, self.precision_spinner)
grid0.addWidget(self.precision_label, 6, 0)
grid0.addWidget(self.precision_spinner, 6, 1)
# Results Title
self.title_res_label = FCLabel('<b>%s:</b>' % _("Minimum distance"))
self.title_res_label.setToolTip(_("Display minimum distance between copper features."))
form_lay.addRow(self.title_res_label)
grid0.addWidget(self.title_res_label, 8, 0, 1, 2)
# Result value
self.result_label = FCLabel('%s:' % _("Determined"))
@@ -474,19 +477,21 @@ class OptimalUI:
hlay.addWidget(self.result_entry)
hlay.addWidget(self.units_lbl)
form_lay.addRow(self.result_label, hlay)
grid0.addWidget(self.units_lbl, 10, 0)
grid0.addLayout(hlay, 10, 1)
# Frequency of minimum encounter
self.freq_label = FCLabel('%s:' % _("Occurring"))
self.freq_label.setToolTip(_("How many times this minimum is found."))
self.freq_entry = FCEntry()
self.freq_entry.setReadOnly(True)
form_lay.addRow(self.freq_label, self.freq_entry)
grid0.addWidget(self.freq_label, 12, 0)
grid0.addWidget(self.freq_entry, 12, 1)
# Control if to display the locations of where the minimum was found
self.locations_cb = FCCheckBox(_("Minimum points coordinates"))
self.locations_cb.setToolTip(_("Coordinates for points where minimum distance was found."))
form_lay.addRow(self.locations_cb)
grid0.addWidget(self.locations_cb, 14, 0, 1, 2)
# Locations where minimum was found
self.locations_textb = FCTextArea()
@@ -501,7 +506,7 @@ class OptimalUI:
"""
self.locations_textb.setStyleSheet(stylesheet)
form_lay.addRow(self.locations_textb)
grid0.addWidget(self.locations_textb, 16, 0, 1, 2)
# Jump button
self.locate_button = FCButton(_("Jump to selected position"))
@@ -511,19 +516,19 @@ class OptimalUI:
)
self.locate_button.setMinimumWidth(60)
self.locate_button.setDisabled(True)
form_lay.addRow(self.locate_button)
grid0.addWidget(self.locate_button, 18, 0, 1, 2)
# Other distances in Gerber
self.title_second_res_label = FCLabel('<b>%s:</b>' % _("Other distances"))
self.title_second_res_label.setToolTip(_("Will display other distances in the Gerber file ordered from\n"
"the minimum to the maximum, not including the absolute minimum."))
form_lay.addRow(self.title_second_res_label)
grid0.addWidget(self.title_second_res_label, 20, 0, 1, 2)
# Control if to display the locations of where the minimum was found
self.sec_locations_cb = FCCheckBox(_("Other distances points coordinates"))
self.sec_locations_cb.setToolTip(_("Other distances and the coordinates for points\n"
"where the distance was found."))
form_lay.addRow(self.sec_locations_cb)
grid0.addWidget(self.sec_locations_cb, 22, 0, 1, 2)
# this way I can hide/show the frame
self.sec_locations_frame = QtWidgets.QFrame()
@@ -606,7 +611,7 @@ class OptimalUI:
self.calculate_button.setMinimumWidth(60)
self.layout.addWidget(self.calculate_button)
self.layout.addStretch()
self.layout.addStretch(1)
# ## Reset Tool
self.reset_button = FCButton(_("Reset Tool"))

View File

@@ -1000,6 +1000,11 @@ class PanelizeUI:
""")
self.layout.addWidget(title_label)
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
self.object_label = FCLabel('<b>%s:</b>' % _("Source Object"))
self.object_label.setToolTip(
_("Specify the type of object to be panelized\n"
@@ -1008,13 +1013,11 @@ class PanelizeUI:
"in the Object combobox.")
)
self.layout.addWidget(self.object_label)
# Form Layout
form_layout_0 = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout_0)
grid0.addWidget(self.object_label, 0, 0, 1, 2)
# Type of object to be panelized
self.type_object_label = FCLabel('%s:' % _("Object Type"))
self.type_obj_combo = FCComboBox()
self.type_obj_combo.addItems([_("Gerber"), _("Excellon"), _("Geometry")])
@@ -1022,9 +1025,8 @@ class PanelizeUI:
self.type_obj_combo.setItemIcon(1, QtGui.QIcon(self.app.resource_location + "/drill16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.type_object_label = FCLabel('%s:' % _("Object Type"))
form_layout_0.addRow(self.type_object_label, self.type_obj_combo)
grid0.addWidget(self.type_object_label, 2, 0)
grid0.addWidget( self.type_obj_combo, 2, 1)
# Object to be panelized
self.object_combo = FCComboBox()
@@ -1036,15 +1038,10 @@ class PanelizeUI:
_("Object to be panelized. This means that it will\n"
"be duplicated in an array of rows and columns.")
)
form_layout_0.addRow(self.object_combo)
# Form Layout
form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout)
grid0.addWidget(self.object_combo, 4, 0, 1, 2)
# Type of box Panel object
self.reference_radio = RadioSet([{'label': _('Object'), 'value': 'object'},
{'label': _('Bounding Box'), 'value': 'bbox'}])
self.box_label = FCLabel("<b>%s:</b>" % _("Penelization Reference"))
self.box_label.setToolTip(
_("Choose the reference for panelization:\n"
@@ -1056,8 +1053,11 @@ class PanelizeUI:
"to this reference object therefore maintaining the panelized\n"
"objects in sync.")
)
form_layout.addRow(self.box_label)
form_layout.addRow(self.reference_radio)
grid0.addWidget(self.box_label, 6, 0, 1, 2)
self.reference_radio = RadioSet([{'label': _('Object'), 'value': 'object'},
{'label': _('Bounding Box'), 'value': 'bbox'}])
grid0.addWidget(self.reference_radio, 8, 0, 1, 2)
# Type of Box Object to be used as an envelope for panelization
self.type_box_combo = FCComboBox()
@@ -1075,7 +1075,8 @@ class PanelizeUI:
"The selection here decide the type of objects that will be\n"
"in the Box Object combobox.")
)
form_layout.addRow(self.type_box_combo_label, self.type_box_combo)
grid0.addWidget(self.type_box_combo_label, 10, 0)
grid0.addWidget(self.type_box_combo, 10, 1)
# Box
self.box_combo = FCComboBox()
@@ -1087,12 +1088,12 @@ class PanelizeUI:
_("The actual object that is used as container for the\n "
"selected object that is to be panelized.")
)
form_layout.addRow(self.box_combo)
grid0.addWidget(self.box_combo, 12, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
form_layout.addRow(separator_line)
grid0.addWidget(separator_line, 14, 0, 1, 2)
panel_data_label = FCLabel("<b>%s:</b>" % _("Panel Data"))
panel_data_label.setToolTip(
@@ -1103,7 +1104,7 @@ class PanelizeUI:
"The spacings will set the distance between any two\n"
"elements of the panel array.")
)
form_layout.addRow(panel_data_label)
grid0.addWidget(panel_data_label, 16, 0, 1, 2)
# Spacing Columns
self.spacing_columns = FCDoubleSpinner(callback=self.confirmation_message)
@@ -1115,7 +1116,8 @@ class PanelizeUI:
_("Spacing between columns of the desired panel.\n"
"In current units.")
)
form_layout.addRow(self.spacing_columns_label, self.spacing_columns)
grid0.addWidget(self.spacing_columns_label, 18, 0)
grid0.addWidget(self.spacing_columns, 18, 1)
# Spacing Rows
self.spacing_rows = FCDoubleSpinner(callback=self.confirmation_message)
@@ -1127,32 +1129,35 @@ class PanelizeUI:
_("Spacing between rows of the desired panel.\n"
"In current units.")
)
form_layout.addRow(self.spacing_rows_label, self.spacing_rows)
grid0.addWidget(self.spacing_rows_label, 20, 0)
grid0.addWidget(self.spacing_rows, 20, 1)
# Columns
self.columns = FCSpinner(callback=self.confirmation_message_int)
self.columns.set_range(0, 9999)
self.columns.set_range(0, 10000)
self.columns_label = FCLabel('%s:' % _("Columns"))
self.columns_label.setToolTip(
_("Number of columns of the desired panel")
)
form_layout.addRow(self.columns_label, self.columns)
grid0.addWidget(self.columns_label, 22, 0)
grid0.addWidget(self.columns, 22, 1)
# Rows
self.rows = FCSpinner(callback=self.confirmation_message_int)
self.rows.set_range(0, 9999)
self.rows.set_range(0, 10000)
self.rows_label = FCLabel('%s:' % _("Rows"))
self.rows_label.setToolTip(
_("Number of rows of the desired panel")
)
form_layout.addRow(self.rows_label, self.rows)
grid0.addWidget(self.rows_label, 24, 0)
grid0.addWidget(self.rows, 24, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
form_layout.addRow(separator_line)
grid0.addWidget(separator_line, 26, 0, 1, 2)
# Type of resulting Panel object
self.panel_type_radio = RadioSet([{'label': _('Gerber'), 'value': 'gerber'},
@@ -1163,8 +1168,8 @@ class PanelizeUI:
"- Gerber\n"
"- Geometry")
)
form_layout.addRow(self.panel_type_label)
form_layout.addRow(self.panel_type_radio)
grid0.addWidget(self.panel_type_label, 28, 0)
grid0.addWidget(self.panel_type_radio, 28, 1)
# Path optimization
self.optimization_cb = FCCheckBox('%s' % _("Path Optimization"))
@@ -1174,7 +1179,7 @@ class PanelizeUI:
"any two overlapping Line elements in the panel\n"
"and will remove the overlapping parts, keeping only one of them.")
)
form_layout.addRow(self.optimization_cb)
grid0.addWidget(self.optimization_cb, 30, 0, 1, 2)
# Constrains
self.constrain_cb = FCCheckBox('%s:' % _("Constrain panel within"))
@@ -1185,29 +1190,31 @@ class PanelizeUI:
"the final panel will have as many columns and rows as\n"
"they fit completely within selected area.")
)
form_layout.addRow(self.constrain_cb)
grid0.addWidget(self.constrain_cb, 32, 0, 1, 2)
self.x_width_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.x_width_entry.set_precision(4)
self.x_width_entry.set_range(0, 9999)
self.x_width_entry.set_precision(self.decimals)
self.x_width_entry.set_range(0.0000, 10000.0000)
self.x_width_lbl = FCLabel('%s:' % _("Width (DX)"))
self.x_width_lbl.setToolTip(
_("The width (DX) within which the panel must fit.\n"
"In current units.")
)
form_layout.addRow(self.x_width_lbl, self.x_width_entry)
grid0.addWidget(self.x_width_lbl, 34, 0)
grid0.addWidget(self.x_width_entry, 34, 1)
self.y_height_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.y_height_entry.set_range(0, 9999)
self.y_height_entry.set_precision(4)
self.y_height_entry.set_range(0, 10000)
self.y_height_entry.set_precision(self.decimals)
self.y_height_lbl = FCLabel('%s:' % _("Height (DY)"))
self.y_height_lbl.setToolTip(
_("The height (DY)within which the panel must fit.\n"
"In current units.")
)
form_layout.addRow(self.y_height_lbl, self.y_height_entry)
grid0.addWidget(self.y_height_lbl, 36, 0)
grid0.addWidget(self.y_height_entry, 36, 1)
self.constrain_sel = OptionalInputSection(
self.constrain_cb, [self.x_width_lbl, self.x_width_entry, self.y_height_lbl, self.y_height_entry])
@@ -1215,7 +1222,7 @@ class PanelizeUI:
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
form_layout.addRow(separator_line)
grid0.addWidget(separator_line, 38, 0, 1, 2)
# Buttons
self.panelize_object_button = FCButton(_("Panelize Object"))
@@ -1231,9 +1238,9 @@ class PanelizeUI:
font-weight: bold;
}
""")
self.layout.addWidget(self.panelize_object_button)
grid0.addWidget(self.panelize_object_button, 40, 0, 1, 2)
self.layout.addStretch()
self.layout.addStretch(1)
# ## Reset Tool
self.reset_button = FCButton(_("Reset Tool"))

View File

@@ -398,9 +398,11 @@ class WizardUI:
self.layout.addWidget(FCLabel("<b>%s:</b>" % _("Load files")))
# Form Layout
form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout)
# Grid Layout
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
self.excellon_label = FCLabel('%s:' % _("Excellon file"))
self.excellon_label.setToolTip(
@@ -408,14 +410,16 @@ class WizardUI:
"Usually it has a .DRL extension")
)
self.excellon_brn = FCButton(_("Open"))
form_layout.addRow(self.excellon_label, self.excellon_brn)
grid0.addWidget(self.excellon_label, 0, 0)
grid0.addWidget(self.excellon_brn, 0, 1)
self.inf_label = FCLabel('%s:' % _("INF file"))
self.inf_label.setToolTip(
_("Load the INF file.")
)
self.inf_btn = FCButton(_("Open"))
form_layout.addRow(self.inf_label, self.inf_btn)
grid0.addWidget(self.inf_label, 2, 0)
grid0.addWidget(self.inf_btn, 2, 1)
self.tools_table = FCTable()
self.layout.addWidget(self.tools_table)
@@ -433,9 +437,12 @@ class WizardUI:
self.layout.addWidget(FCLabel(""))
self.layout.addWidget(FCLabel("<b>%s:</b>" % _("Excellon Format")))
# Form Layout
form_layout1 = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout1)
# Grid Layout
grid01 = QtWidgets.QGridLayout()
grid01.setColumnStretch(0, 0)
grid01.setColumnStretch(1, 1)
self.layout.addLayout(grid01)
# Integral part of the coordinates
self.int_entry = FCSpinner(callback=self.confirmation_message_int)
@@ -444,7 +451,8 @@ class WizardUI:
self.int_label.setToolTip(
_("The number of digits for the integral part of the coordinates.")
)
form_layout1.addRow(self.int_label, self.int_entry)
grid01.addWidget(self.int_label, 0, 0)
grid01.addWidget(self.int_entry, 0, 1)
# Fractional part of the coordinates
self.frac_entry = FCSpinner(callback=self.confirmation_message_int)
@@ -453,7 +461,8 @@ class WizardUI:
self.frac_label.setToolTip(
_("The number of digits for the fractional part of the coordinates.")
)
form_layout1.addRow(self.frac_label, self.frac_entry)
grid01.addWidget(self.frac_label, 2, 0)
grid01.addWidget(self.frac_entry, 2, 1)
# Zeros suppression for coordinates
self.zeros_radio = RadioSet([{'label': _('LZ'), 'value': 'LZ'},
@@ -467,7 +476,8 @@ class WizardUI:
"- TZ = trailing zeros are kept\n"
"- No Suppression = no zero suppression")
)
form_layout1.addRow(self.zeros_label, self.zeros_radio)
grid01.addWidget(self.zeros_label, 4, 0)
grid01.addWidget(self.zeros_radio, 4, 1)
# Units type
self.units_radio = RadioSet([{'label': _('Inch'), 'value': 'INCH'},
@@ -477,7 +487,8 @@ class WizardUI:
_("The type of units that the coordinates and tool\n"
"diameters are using. Can be INCH or MM.")
)
form_layout1.addRow(self.units_label, self.units_radio)
grid01.addWidget(self.units_label, 6, 0)
grid01.addWidget(self.units_radio, 6, 1)
# Buttons
@@ -488,9 +499,9 @@ class WizardUI:
"One usually has .DRL extension while\n"
"the other has .INF extension.")
)
self.layout.addWidget(self.import_button)
grid01.addWidget(self.import_button, 8, 0, 1, 2)
self.layout.addStretch()
self.layout.addStretch(1)
# #################################### FINSIHED GUI ###########################
# #############################################################################

View File

@@ -1384,29 +1384,33 @@ class RulesUI:
self.layout.addWidget(self.all_cb)
# Form Layout
self.form_layout_1 = QtWidgets.QFormLayout()
self.layout.addLayout(self.form_layout_1)
self.grid_lay1 = QtWidgets.QGridLayout()
self.grid_lay1.setColumnStretch(0, 0)
self.grid_lay1.setColumnStretch(1, 1)
self.layout.addLayout(self.grid_lay1)
self.form_layout_1.addRow(FCLabel(""))
self.grid_lay1.addWidget(FCLabel(""), 0, 0, 1, 2)
# Trace size
self.trace_size_cb = FCCheckBox('%s:' % _("Trace Size"))
self.trace_size_cb.setToolTip(
_("This checks if the minimum size for traces is met.")
)
self.form_layout_1.addRow(self.trace_size_cb)
self.grid_lay1.addWidget(self.trace_size_cb, 2, 0, 1, 2)
# Trace size value
self.trace_size_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.trace_size_entry.set_range(0.00001, 999.99999)
self.trace_size_entry.set_precision(self.decimals)
self.trace_size_entry.setSingleStep(0.1)
self.trace_size_lbl = FCLabel('%s:' % _("Min value"))
self.trace_size_lbl.setToolTip(
_("Minimum acceptable trace size.")
)
self.form_layout_1.addRow(self.trace_size_lbl, self.trace_size_entry)
self.trace_size_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.trace_size_entry.set_range(0.0000, 10000.0000)
self.trace_size_entry.set_precision(self.decimals)
self.trace_size_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.trace_size_lbl, 4, 0)
self.grid_lay1.addWidget(self.trace_size_entry, 4, 1)
self.ts = OptionalInputSection(self.trace_size_cb, [self.trace_size_lbl, self.trace_size_entry])
@@ -1416,19 +1420,21 @@ class RulesUI:
_("This checks if the minimum clearance between copper\n"
"features is met.")
)
self.form_layout_1.addRow(self.clearance_copper2copper_cb)
self.grid_lay1.addWidget(self.clearance_copper2copper_cb, 6, 0, 1, 2)
# Copper2copper clearance value
self.clearance_copper2copper_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_copper2copper_entry.set_range(0.00001, 999.99999)
self.clearance_copper2copper_entry.set_precision(self.decimals)
self.clearance_copper2copper_entry.setSingleStep(0.1)
self.clearance_copper2copper_lbl = FCLabel('%s:' % _("Min value"))
self.clearance_copper2copper_lbl.setToolTip(
_("Minimum acceptable clearance value.")
)
self.form_layout_1.addRow(self.clearance_copper2copper_lbl, self.clearance_copper2copper_entry)
self.clearance_copper2copper_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_copper2copper_entry.set_range(0.0000, 10000.0000)
self.clearance_copper2copper_entry.set_precision(self.decimals)
self.clearance_copper2copper_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.clearance_copper2copper_lbl, 8, 0)
self.grid_lay1.addWidget(self.clearance_copper2copper_entry, 8, 1)
self.c2c = OptionalInputSection(
self.clearance_copper2copper_cb, [self.clearance_copper2copper_lbl, self.clearance_copper2copper_entry])
@@ -1439,19 +1445,21 @@ class RulesUI:
_("This checks if the minimum clearance between copper\n"
"features and the outline is met.")
)
self.form_layout_1.addRow(self.clearance_copper2ol_cb)
self.grid_lay1.addWidget(self.clearance_copper2ol_cb, 10, 0, 1, 2)
# Copper2outline clearance value
self.clearance_copper2ol_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_copper2ol_entry.set_range(0.00001, 999.99999)
self.clearance_copper2ol_entry.set_precision(self.decimals)
self.clearance_copper2ol_entry.setSingleStep(0.1)
self.clearance_copper2ol_lbl = FCLabel('%s:' % _("Min value"))
self.clearance_copper2ol_lbl.setToolTip(
_("Minimum acceptable clearance value.")
)
self.form_layout_1.addRow(self.clearance_copper2ol_lbl, self.clearance_copper2ol_entry)
self.clearance_copper2ol_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_copper2ol_entry.set_range(0.0000, 10000.0000)
self.clearance_copper2ol_entry.set_precision(self.decimals)
self.clearance_copper2ol_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.clearance_copper2ol_lbl, 12, 0)
self.grid_lay1.addWidget(self.clearance_copper2ol_entry, 12, 1)
self.c2ol = OptionalInputSection(
self.clearance_copper2ol_cb, [self.clearance_copper2ol_lbl, self.clearance_copper2ol_entry])
@@ -1462,19 +1470,21 @@ class RulesUI:
_("This checks if the minimum clearance between silkscreen\n"
"features and silkscreen features is met.")
)
self.form_layout_1.addRow(self.clearance_silk2silk_cb)
self.grid_lay1.addWidget(self.clearance_silk2silk_cb, 14, 0, 1, 2)
# Copper2silkscreen clearance value
self.clearance_silk2silk_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_silk2silk_entry.set_range(0.00001, 999.99999)
self.clearance_silk2silk_entry.set_precision(self.decimals)
self.clearance_silk2silk_entry.setSingleStep(0.1)
self.clearance_silk2silk_lbl = FCLabel('%s:' % _("Min value"))
self.clearance_silk2silk_lbl.setToolTip(
_("Minimum acceptable clearance value.")
)
self.form_layout_1.addRow(self.clearance_silk2silk_lbl, self.clearance_silk2silk_entry)
self.clearance_silk2silk_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_silk2silk_entry.set_range(0.0000, 10000.0000)
self.clearance_silk2silk_entry.set_precision(self.decimals)
self.clearance_silk2silk_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.clearance_silk2silk_lbl, 16, 0)
self.grid_lay1.addWidget(self.clearance_silk2silk_entry, 16, 1)
self.s2s = OptionalInputSection(
self.clearance_silk2silk_cb, [self.clearance_silk2silk_lbl, self.clearance_silk2silk_entry])
@@ -1485,19 +1495,21 @@ class RulesUI:
_("This checks if the minimum clearance between silkscreen\n"
"features and soldermask features is met.")
)
self.form_layout_1.addRow(self.clearance_silk2sm_cb)
self.grid_lay1.addWidget(self.clearance_silk2sm_cb, 18, 0, 1, 2)
# Silkscreen2soldermask clearance value
self.clearance_silk2sm_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_silk2sm_entry.set_range(0.00001, 999.99999)
self.clearance_silk2sm_entry.set_precision(self.decimals)
self.clearance_silk2sm_entry.setSingleStep(0.1)
self.clearance_silk2sm_lbl = FCLabel('%s:' % _("Min value"))
self.clearance_silk2sm_lbl.setToolTip(
_("Minimum acceptable clearance value.")
)
self.form_layout_1.addRow(self.clearance_silk2sm_lbl, self.clearance_silk2sm_entry)
self.clearance_silk2sm_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_silk2sm_entry.set_range(0.0000, 10000.0000)
self.clearance_silk2sm_entry.set_precision(self.decimals)
self.clearance_silk2sm_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.clearance_silk2sm_lbl, 20, 0)
self.grid_lay1.addWidget(self.clearance_silk2sm_entry, 20, 1)
self.s2sm = OptionalInputSection(
self.clearance_silk2sm_cb, [self.clearance_silk2sm_lbl, self.clearance_silk2sm_entry])
@@ -1508,19 +1520,21 @@ class RulesUI:
_("This checks if the minimum clearance between silk\n"
"features and the outline is met.")
)
self.form_layout_1.addRow(self.clearance_silk2ol_cb)
self.grid_lay1.addWidget(self.clearance_silk2ol_cb, 22, 0, 1, 2)
# Silk2outline clearance value
self.clearance_silk2ol_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_silk2ol_entry.set_range(0.00001, 999.99999)
self.clearance_silk2ol_entry.set_precision(self.decimals)
self.clearance_silk2ol_entry.setSingleStep(0.1)
self.clearance_silk2ol_lbl = FCLabel('%s:' % _("Min value"))
self.clearance_silk2ol_lbl.setToolTip(
_("Minimum acceptable clearance value.")
)
self.form_layout_1.addRow(self.clearance_silk2ol_lbl, self.clearance_silk2ol_entry)
self.clearance_silk2ol_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_silk2ol_entry.set_range(0.0000, 10000.0000)
self.clearance_silk2ol_entry.set_precision(self.decimals)
self.clearance_silk2ol_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.clearance_silk2ol_lbl, 24, 0)
self.grid_lay1.addWidget(self.clearance_silk2ol_entry, 24, 1)
self.s2ol = OptionalInputSection(
self.clearance_silk2ol_cb, [self.clearance_silk2ol_lbl, self.clearance_silk2ol_entry])
@@ -1531,19 +1545,22 @@ class RulesUI:
_("This checks if the minimum clearance between soldermask\n"
"features and soldermask features is met.")
)
self.form_layout_1.addRow(self.clearance_sm2sm_cb)
self.grid_lay1.addWidget(self.clearance_sm2sm_cb, 26, 0, 1, 2)
# Soldermask2soldermask clearance value
self.clearance_sm2sm_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_sm2sm_entry.set_range(0.00001, 999.99999)
self.clearance_sm2sm_entry.set_precision(self.decimals)
self.clearance_sm2sm_entry.setSingleStep(0.1)
self.clearance_sm2sm_lbl = FCLabel('%s:' % _("Min value"))
self.clearance_sm2sm_lbl.setToolTip(
_("Minimum acceptable clearance value.")
)
self.form_layout_1.addRow(self.clearance_sm2sm_lbl, self.clearance_sm2sm_entry)
self.clearance_sm2sm_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_sm2sm_entry.set_range(0.0000, 10000.0000)
self.clearance_sm2sm_entry.set_precision(self.decimals)
self.clearance_sm2sm_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.clearance_sm2sm_lbl, 28, 0)
self.grid_lay1.addWidget(self.clearance_sm2sm_entry, 28, 1)
self.sm2sm = OptionalInputSection(
self.clearance_sm2sm_cb, [self.clearance_sm2sm_lbl, self.clearance_sm2sm_entry])
@@ -1554,24 +1571,26 @@ class RulesUI:
_("This checks if the minimum copper ring left by drilling\n"
"a hole into a pad is met.")
)
self.form_layout_1.addRow(self.ring_integrity_cb)
self.grid_lay1.addWidget(self.ring_integrity_cb, 30, 0, 1, 2)
# Ring integrity value
self.ring_integrity_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.ring_integrity_entry.set_range(0.00001, 999.99999)
self.ring_integrity_entry.set_precision(self.decimals)
self.ring_integrity_entry.setSingleStep(0.1)
self.ring_integrity_lbl = FCLabel('%s:' % _("Min value"))
self.ring_integrity_lbl.setToolTip(
_("Minimum acceptable ring value.")
)
self.form_layout_1.addRow(self.ring_integrity_lbl, self.ring_integrity_entry)
self.ring_integrity_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.ring_integrity_entry.set_range(0.0000, 10000.0000)
self.ring_integrity_entry.set_precision(self.decimals)
self.ring_integrity_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.ring_integrity_lbl, 32, 0)
self.grid_lay1.addWidget(self.ring_integrity_entry, 32, 1)
self.anr = OptionalInputSection(
self.ring_integrity_cb, [self.ring_integrity_lbl, self.ring_integrity_entry])
self.form_layout_1.addRow(FCLabel(""))
self.grid_lay1.addWidget(FCLabel(''), 34, 0, 1, 2)
# Hole2Hole clearance
self.clearance_d2d_cb = FCCheckBox('%s:' % _("Hole to Hole Clearance"))
@@ -1579,19 +1598,21 @@ class RulesUI:
_("This checks if the minimum clearance between a drill hole\n"
"and another drill hole is met.")
)
self.form_layout_1.addRow(self.clearance_d2d_cb)
self.grid_lay1.addWidget(self.clearance_d2d_cb, 36, 0, 1, 2)
# Hole2Hole clearance value
self.clearance_d2d_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_d2d_entry.set_range(0.00001, 999.99999)
self.clearance_d2d_entry.set_precision(self.decimals)
self.clearance_d2d_entry.setSingleStep(0.1)
self.clearance_d2d_lbl = FCLabel('%s:' % _("Min value"))
self.clearance_d2d_lbl.setToolTip(
_("Minimum acceptable clearance value.")
)
self.form_layout_1.addRow(self.clearance_d2d_lbl, self.clearance_d2d_entry)
self.clearance_d2d_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.clearance_d2d_entry.set_range(0.0000, 10000.0000)
self.clearance_d2d_entry.set_precision(self.decimals)
self.clearance_d2d_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.clearance_d2d_lbl, 38, 0)
self.grid_lay1.addWidget(self.clearance_d2d_entry, 38, 1)
self.d2d = OptionalInputSection(
self.clearance_d2d_cb, [self.clearance_d2d_lbl, self.clearance_d2d_entry])
@@ -1602,28 +1623,26 @@ class RulesUI:
_("This checks if the drill holes\n"
"sizes are above the threshold.")
)
self.form_layout_1.addRow(self.drill_size_cb)
# Drile holes value
self.drill_size_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.drill_size_entry.set_range(0.00001, 999.99999)
self.drill_size_entry.set_precision(self.decimals)
self.drill_size_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.drill_size_cb, 40, 0, 1, 2)
# Drills holes value
self.drill_size_lbl = FCLabel('%s:' % _("Min value"))
self.drill_size_lbl.setToolTip(
_("Minimum acceptable drill size.")
)
self.form_layout_1.addRow(self.drill_size_lbl, self.drill_size_entry)
self.drill_size_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.drill_size_entry.set_range(0.0000, 10000.0000)
self.drill_size_entry.set_precision(self.decimals)
self.drill_size_entry.setSingleStep(0.1)
self.grid_lay1.addWidget(self.drill_size_lbl, 42, 0)
self.grid_lay1.addWidget(self.drill_size_entry, 42, 1)
self.ds = OptionalInputSection(
self.drill_size_cb, [self.drill_size_lbl, self.drill_size_entry])
# Buttons
hlay_2 = QtWidgets.QHBoxLayout()
self.layout.addLayout(hlay_2)
# hlay_2.addStretch()
self.run_button = FCButton(_("Run Rules Check"))
self.run_button.setIcon(QtGui.QIcon(self.app.resource_location + '/rules32.png'))
self.run_button.setToolTip(
@@ -1637,9 +1656,9 @@ class RulesUI:
font-weight: bold;
}
""")
hlay_2.addWidget(self.run_button)
self.grid_lay1.addWidget(self.run_button, 44, 0, 1, 2)
self.layout.addStretch()
self.layout.addStretch(1)
# ## Reset Tool
self.reset_button = FCButton(_("Reset Tool"))
@@ -1658,8 +1677,8 @@ class RulesUI:
# #################################### FINSIHED GUI ###########################
# #############################################################################
def on_all_cb_changed(self, state):
cb_items = [self.form_layout_1.itemAt(i).widget() for i in range(self.form_layout_1.count())
if isinstance(self.form_layout_1.itemAt(i).widget(), FCCheckBox)]
cb_items = [self.grid_lay1.itemAt(i).widget() for i in range(self.grid_lay1.count())
if isinstance(self.grid_lay1.itemAt(i).widget(), FCCheckBox)]
for cb in cb_items:
if state:

View File

@@ -1159,26 +1159,28 @@ class SolderUI:
self.layout.addWidget(title_label)
# ## Form Layout
obj_form_layout = QtWidgets.QFormLayout()
obj_form_layout = QtWidgets.QGridLayout()
obj_form_layout.setColumnStretch(0, 0)
obj_form_layout.setColumnStretch(1, 1)
self.layout.addLayout(obj_form_layout)
# ## Gerber Object to be used for solderpaste dispensing
self.object_label = QtWidgets.QLabel('<b>%s</b>:' % _("GERBER"))
self.object_label.setToolTip(_("Gerber Solderpaste object."))
self.obj_combo = FCComboBox(callback=solder_class.on_rmb_combo)
self.obj_combo.setModel(self.app.collection)
self.obj_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
self.obj_combo.is_last = True
self.obj_combo.obj_type = "Gerber"
self.object_label = QtWidgets.QLabel('<b>%s</b>:' % _("GERBER"))
self.object_label.setToolTip(_("Gerber Solderpaste object.")
)
obj_form_layout.addRow(self.object_label)
obj_form_layout.addRow(self.obj_combo)
obj_form_layout.addWidget(self.object_label, 0, 0, 1, 2)
obj_form_layout.addWidget(self.obj_combo, 2, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
obj_form_layout.addRow(separator_line)
obj_form_layout.addWidget(separator_line, 4, 0, 1, 2)
# ### Tools ## ##
self.tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Tools Table'))
@@ -1186,10 +1188,10 @@ class SolderUI:
_("Tools pool from which the algorithm\n"
"will pick the ones used for dispensing solder paste.")
)
self.layout.addWidget(self.tools_table_label)
obj_form_layout.addWidget(self.tools_table_label, 6, 0, 1, 2)
self.tools_table = FCTable()
self.layout.addWidget(self.tools_table)
obj_form_layout.addWidget(self.tools_table, 8, 0, 1, 2)
self.tools_table.setColumnCount(3)
self.tools_table.setHorizontalHeaderLabels(['#', _('Diameter'), ''])