- renamed classes to have shorter names and grouped

This commit is contained in:
Marius Stanciu
2020-05-18 16:02:41 +03:00
committed by Marius
parent 4c83e87feb
commit ba3f10d355
185 changed files with 749 additions and 748 deletions

View File

@@ -0,0 +1,274 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2CThievingPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2CThievingPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Copper Thieving Tool Options")))
self.decimals = decimals
# ## Grid Layout
grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay)
grid_lay.setColumnStretch(0, 0)
grid_lay.setColumnStretch(1, 1)
# ## Parameters
self.cflabel = QtWidgets.QLabel('<b>%s</b>' % _('Parameters'))
self.cflabel.setToolTip(
_("A tool to generate a Copper Thieving that can be added\n"
"to a selected Gerber file.")
)
grid_lay.addWidget(self.cflabel, 0, 0, 1, 2)
# CIRCLE STEPS - to be used when buffering
self.circle_steps_lbl = QtWidgets.QLabel('%s:' % _("Circle Steps"))
self.circle_steps_lbl.setToolTip(
_("Number of steps (lines) used to interpolate circles.")
)
self.circlesteps_entry = FCSpinner()
self.circlesteps_entry.set_range(1, 9999)
grid_lay.addWidget(self.circle_steps_lbl, 1, 0)
grid_lay.addWidget(self.circlesteps_entry, 1, 1)
# CLEARANCE #
self.clearance_label = QtWidgets.QLabel('%s:' % _("Clearance"))
self.clearance_label.setToolTip(
_("This set the distance between the copper Thieving components\n"
"(the polygon fill may be split in multiple polygons)\n"
"and the copper traces in the Gerber file.")
)
self.clearance_entry = FCDoubleSpinner()
self.clearance_entry.setMinimum(0.00001)
self.clearance_entry.set_precision(self.decimals)
self.clearance_entry.setSingleStep(0.1)
grid_lay.addWidget(self.clearance_label, 2, 0)
grid_lay.addWidget(self.clearance_entry, 2, 1)
# MARGIN #
self.margin_label = QtWidgets.QLabel('%s:' % _("Margin"))
self.margin_label.setToolTip(
_("Bounding box margin.")
)
self.margin_entry = FCDoubleSpinner()
self.margin_entry.setMinimum(0.0)
self.margin_entry.set_precision(self.decimals)
self.margin_entry.setSingleStep(0.1)
grid_lay.addWidget(self.margin_label, 3, 0)
grid_lay.addWidget(self.margin_entry, 3, 1)
# Reference #
self.reference_radio = RadioSet([
{'label': _('Itself'), 'value': 'itself'},
{"label": _("Area Selection"), "value": "area"},
{'label': _("Reference Object"), 'value': 'box'}
], orientation='vertical', stretch=False)
self.reference_label = QtWidgets.QLabel(_("Reference:"))
self.reference_label.setToolTip(
_("- 'Itself' - the copper Thieving extent is based on the object extent.\n"
"- 'Area Selection' - left mouse click to start selection of the area to be filled.\n"
"- 'Reference Object' - will do copper thieving within the area specified by another object.")
)
grid_lay.addWidget(self.reference_label, 4, 0)
grid_lay.addWidget(self.reference_radio, 4, 1)
# Bounding Box Type #
self.bbox_type_radio = RadioSet([
{'label': _('Rectangular'), 'value': 'rect'},
{"label": _("Minimal"), "value": "min"}
], stretch=False)
self.bbox_type_label = QtWidgets.QLabel(_("Box Type:"))
self.bbox_type_label.setToolTip(
_("- 'Rectangular' - the bounding box will be of rectangular shape.\n"
"- 'Minimal' - the bounding box will be the convex hull shape.")
)
grid_lay.addWidget(self.bbox_type_label, 5, 0)
grid_lay.addWidget(self.bbox_type_radio, 5, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid_lay.addWidget(separator_line, 6, 0, 1, 2)
# Fill Type
self.fill_type_radio = RadioSet([
{'label': _('Solid'), 'value': 'solid'},
{"label": _("Dots Grid"), "value": "dot"},
{"label": _("Squares Grid"), "value": "square"},
{"label": _("Lines Grid"), "value": "line"}
], orientation='vertical', stretch=False)
self.fill_type_label = QtWidgets.QLabel(_("Fill Type:"))
self.fill_type_label.setToolTip(
_("- 'Solid' - copper thieving will be a solid polygon.\n"
"- 'Dots Grid' - the empty area will be filled with a pattern of dots.\n"
"- 'Squares Grid' - the empty area will be filled with a pattern of squares.\n"
"- 'Lines Grid' - the empty area will be filled with a pattern of lines.")
)
grid_lay.addWidget(self.fill_type_label, 7, 0)
grid_lay.addWidget(self.fill_type_radio, 7, 1)
self.dots_label = QtWidgets.QLabel('<b>%s</b>:' % _("Dots Grid Parameters"))
grid_lay.addWidget(self.dots_label, 8, 0, 1, 2)
# Dot diameter #
self.dotdia_label = QtWidgets.QLabel('%s:' % _("Dia"))
self.dotdia_label.setToolTip(
_("Dot diameter in Dots Grid.")
)
self.dot_dia_entry = FCDoubleSpinner()
self.dot_dia_entry.set_range(0.0, 9999.9999)
self.dot_dia_entry.set_precision(self.decimals)
self.dot_dia_entry.setSingleStep(0.1)
grid_lay.addWidget(self.dotdia_label, 9, 0)
grid_lay.addWidget(self.dot_dia_entry, 9, 1)
# Dot spacing #
self.dotspacing_label = QtWidgets.QLabel('%s:' % _("Spacing"))
self.dotspacing_label.setToolTip(
_("Distance between each two dots in Dots Grid.")
)
self.dot_spacing_entry = FCDoubleSpinner()
self.dot_spacing_entry.set_range(0.0, 9999.9999)
self.dot_spacing_entry.set_precision(self.decimals)
self.dot_spacing_entry.setSingleStep(0.1)
grid_lay.addWidget(self.dotspacing_label, 10, 0)
grid_lay.addWidget(self.dot_spacing_entry, 10, 1)
self.squares_label = QtWidgets.QLabel('<b>%s</b>:' % _("Squares Grid Parameters"))
grid_lay.addWidget(self.squares_label, 11, 0, 1, 2)
# Square Size #
self.square_size_label = QtWidgets.QLabel('%s:' % _("Size"))
self.square_size_label.setToolTip(
_("Square side size in Squares Grid.")
)
self.square_size_entry = FCDoubleSpinner()
self.square_size_entry.set_range(0.0, 9999.9999)
self.square_size_entry.set_precision(self.decimals)
self.square_size_entry.setSingleStep(0.1)
grid_lay.addWidget(self.square_size_label, 12, 0)
grid_lay.addWidget(self.square_size_entry, 12, 1)
# Squares spacing #
self.squares_spacing_label = QtWidgets.QLabel('%s:' % _("Spacing"))
self.squares_spacing_label.setToolTip(
_("Distance between each two squares in Squares Grid.")
)
self.squares_spacing_entry = FCDoubleSpinner()
self.squares_spacing_entry.set_range(0.0, 9999.9999)
self.squares_spacing_entry.set_precision(self.decimals)
self.squares_spacing_entry.setSingleStep(0.1)
grid_lay.addWidget(self.squares_spacing_label, 13, 0)
grid_lay.addWidget(self.squares_spacing_entry, 13, 1)
self.lines_label = QtWidgets.QLabel('<b>%s</b>:' % _("Lines Grid Parameters"))
grid_lay.addWidget(self.lines_label, 14, 0, 1, 2)
# Square Size #
self.line_size_label = QtWidgets.QLabel('%s:' % _("Size"))
self.line_size_label.setToolTip(
_("Line thickness size in Lines Grid.")
)
self.line_size_entry = FCDoubleSpinner()
self.line_size_entry.set_range(0.0, 9999.9999)
self.line_size_entry.set_precision(self.decimals)
self.line_size_entry.setSingleStep(0.1)
grid_lay.addWidget(self.line_size_label, 15, 0)
grid_lay.addWidget(self.line_size_entry, 15, 1)
# Lines spacing #
self.lines_spacing_label = QtWidgets.QLabel('%s:' % _("Spacing"))
self.lines_spacing_label.setToolTip(
_("Distance between each two lines in Lines Grid.")
)
self.lines_spacing_entry = FCDoubleSpinner()
self.lines_spacing_entry.set_range(0.0, 9999.9999)
self.lines_spacing_entry.set_precision(self.decimals)
self.lines_spacing_entry.setSingleStep(0.1)
grid_lay.addWidget(self.lines_spacing_label, 16, 0)
grid_lay.addWidget(self.lines_spacing_entry, 16, 1)
self.robber_bar_label = QtWidgets.QLabel('<b>%s</b>' % _('Robber Bar Parameters'))
self.robber_bar_label.setToolTip(
_("Parameters used for the robber bar.\n"
"Robber bar = copper border to help in pattern hole plating.")
)
grid_lay.addWidget(self.robber_bar_label, 17, 0, 1, 2)
# ROBBER BAR MARGIN #
self.rb_margin_label = QtWidgets.QLabel('%s:' % _("Margin"))
self.rb_margin_label.setToolTip(
_("Bounding box margin for robber bar.")
)
self.rb_margin_entry = FCDoubleSpinner()
self.rb_margin_entry.set_range(-9999.9999, 9999.9999)
self.rb_margin_entry.set_precision(self.decimals)
self.rb_margin_entry.setSingleStep(0.1)
grid_lay.addWidget(self.rb_margin_label, 18, 0)
grid_lay.addWidget(self.rb_margin_entry, 18, 1)
# THICKNESS #
self.rb_thickness_label = QtWidgets.QLabel('%s:' % _("Thickness"))
self.rb_thickness_label.setToolTip(
_("The robber bar thickness.")
)
self.rb_thickness_entry = FCDoubleSpinner()
self.rb_thickness_entry.set_range(0.0000, 9999.9999)
self.rb_thickness_entry.set_precision(self.decimals)
self.rb_thickness_entry.setSingleStep(0.1)
grid_lay.addWidget(self.rb_thickness_label, 19, 0)
grid_lay.addWidget(self.rb_thickness_entry, 19, 1)
self.patern_mask_label = QtWidgets.QLabel('<b>%s</b>' % _('Pattern Plating Mask'))
self.patern_mask_label.setToolTip(
_("Generate a mask for pattern plating.")
)
grid_lay.addWidget(self.patern_mask_label, 20, 0, 1, 2)
# Openings CLEARANCE #
self.clearance_ppm_label = QtWidgets.QLabel('%s:' % _("Clearance"))
self.clearance_ppm_label.setToolTip(
_("The distance between the possible copper thieving elements\n"
"and/or robber bar and the actual openings in the mask.")
)
self.clearance_ppm_entry = FCDoubleSpinner()
self.clearance_ppm_entry.set_range(-9999.9999, 9999.9999)
self.clearance_ppm_entry.set_precision(self.decimals)
self.clearance_ppm_entry.setSingleStep(0.1)
grid_lay.addWidget(self.clearance_ppm_label, 21, 0)
grid_lay.addWidget(self.clearance_ppm_entry, 21, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,138 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCEntry
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2CalPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2CalPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Calibration Tool Options")))
self.decimals = decimals
# ## Grid Layout
grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay)
grid_lay.setColumnStretch(0, 0)
grid_lay.setColumnStretch(1, 1)
self.param_label = QtWidgets.QLabel('<b>%s:</b>' % _('Parameters'))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
grid_lay.addWidget(self.param_label, 0, 0, 1, 2)
# Calibration source
self.cal_source_lbl = QtWidgets.QLabel("<b>%s:</b>" % _("Source Type"))
self.cal_source_lbl.setToolTip(_("The source of calibration points.\n"
"It can be:\n"
"- Object -> click a hole geo for Excellon or a pad for Gerber\n"
"- Free -> click freely on canvas to acquire the calibration points"))
self.cal_source_radio = RadioSet([{'label': _('Object'), 'value': 'object'},
{'label': _('Free'), 'value': 'free'}],
stretch=False)
grid_lay.addWidget(self.cal_source_lbl, 1, 0)
grid_lay.addWidget(self.cal_source_radio, 1, 1, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid_lay.addWidget(separator_line, 2, 0, 1, 2)
# Travel Z entry
travelz_lbl = QtWidgets.QLabel('%s:' % _("Travel Z"))
travelz_lbl.setToolTip(
_("Height (Z) for travelling between the points.")
)
self.travelz_entry = FCDoubleSpinner()
self.travelz_entry.set_range(-9999.9999, 9999.9999)
self.travelz_entry.set_precision(self.decimals)
self.travelz_entry.setSingleStep(0.1)
grid_lay.addWidget(travelz_lbl, 3, 0)
grid_lay.addWidget(self.travelz_entry, 3, 1, 1, 2)
# Verification Z entry
verz_lbl = QtWidgets.QLabel('%s:' % _("Verification Z"))
verz_lbl.setToolTip(
_("Height (Z) for checking the point.")
)
self.verz_entry = FCDoubleSpinner()
self.verz_entry.set_range(-9999.9999, 9999.9999)
self.verz_entry.set_precision(self.decimals)
self.verz_entry.setSingleStep(0.1)
grid_lay.addWidget(verz_lbl, 4, 0)
grid_lay.addWidget(self.verz_entry, 4, 1, 1, 2)
# Zero the Z of the verification tool
self.zeroz_cb = FCCheckBox('%s' % _("Zero Z tool"))
self.zeroz_cb.setToolTip(
_("Include a sequence to zero the height (Z)\n"
"of the verification tool.")
)
grid_lay.addWidget(self.zeroz_cb, 5, 0, 1, 3)
# Toochange Z entry
toolchangez_lbl = QtWidgets.QLabel('%s:' % _("Toolchange Z"))
toolchangez_lbl.setToolTip(
_("Height (Z) for mounting the verification probe.")
)
self.toolchangez_entry = FCDoubleSpinner()
self.toolchangez_entry.set_range(0.0000, 9999.9999)
self.toolchangez_entry.set_precision(self.decimals)
self.toolchangez_entry.setSingleStep(0.1)
grid_lay.addWidget(toolchangez_lbl, 6, 0)
grid_lay.addWidget(self.toolchangez_entry, 6, 1, 1, 2)
# Toolchange X-Y entry
toolchangexy_lbl = QtWidgets.QLabel('%s:' % _('Toolchange X-Y'))
toolchangexy_lbl.setToolTip(
_("Toolchange X,Y position.\n"
"If no value is entered then the current\n"
"(x, y) point will be used,")
)
self.toolchange_xy_entry = FCEntry()
grid_lay.addWidget(toolchangexy_lbl, 7, 0)
grid_lay.addWidget(self.toolchange_xy_entry, 7, 1, 1, 2)
# Second point choice
second_point_lbl = QtWidgets.QLabel('%s:' % _("Second point"))
second_point_lbl.setToolTip(
_("Second point in the Gcode verification can be:\n"
"- top-left -> the user will align the PCB vertically\n"
"- bottom-right -> the user will align the PCB horizontally")
)
self.second_point_radio = RadioSet([{'label': _('Top-Left'), 'value': 'tl'},
{'label': _('Bottom-Right'), 'value': 'br'}],
orientation='vertical')
grid_lay.addWidget(second_point_lbl, 8, 0)
grid_lay.addWidget(self.second_point_radio, 8, 1, 1, 2)
self.layout.addStretch()

View File

@@ -0,0 +1,231 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2EDrillsPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Extract Drills Options")))
self.decimals = decimals
# ## Grid Layout
grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay)
grid_lay.setColumnStretch(0, 0)
grid_lay.setColumnStretch(1, 1)
self.param_label = QtWidgets.QLabel('<b>%s:</b>' % _('Parameters'))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
grid_lay.addWidget(self.param_label, 0, 0, 1, 2)
self.padt_label = QtWidgets.QLabel("<b>%s:</b>" % _("Processed Pads Type"))
self.padt_label.setToolTip(
_("The type of pads shape to be processed.\n"
"If the PCB has many SMD pads with rectangular pads,\n"
"disable the Rectangular aperture.")
)
grid_lay.addWidget(self.padt_label, 2, 0, 1, 2)
# Circular Aperture Selection
self.circular_cb = FCCheckBox('%s' % _("Circular"))
self.circular_cb.setToolTip(
_("Process Circular Pads.")
)
grid_lay.addWidget(self.circular_cb, 3, 0, 1, 2)
# Oblong Aperture Selection
self.oblong_cb = FCCheckBox('%s' % _("Oblong"))
self.oblong_cb.setToolTip(
_("Process Oblong Pads.")
)
grid_lay.addWidget(self.oblong_cb, 4, 0, 1, 2)
# Square Aperture Selection
self.square_cb = FCCheckBox('%s' % _("Square"))
self.square_cb.setToolTip(
_("Process Square Pads.")
)
grid_lay.addWidget(self.square_cb, 5, 0, 1, 2)
# Rectangular Aperture Selection
self.rectangular_cb = FCCheckBox('%s' % _("Rectangular"))
self.rectangular_cb.setToolTip(
_("Process Rectangular Pads.")
)
grid_lay.addWidget(self.rectangular_cb, 6, 0, 1, 2)
# Others type of Apertures Selection
self.other_cb = FCCheckBox('%s' % _("Others"))
self.other_cb.setToolTip(
_("Process pads not in the categories above.")
)
grid_lay.addWidget(self.other_cb, 7, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid_lay.addWidget(separator_line, 8, 0, 1, 2)
# ## Axis
self.hole_size_radio = RadioSet(
[
{'label': _("Fixed Diameter"), 'value': 'fixed'},
{'label': _("Fixed Annular Ring"), 'value': 'ring'},
{'label': _("Proportional"), 'value': 'prop'}
],
orientation='vertical',
stretch=False)
self.hole_size_label = QtWidgets.QLabel('<b>%s:</b>' % _("Method"))
self.hole_size_label.setToolTip(
_("The method for processing pads. Can be:\n"
"- Fixed Diameter -> all holes will have a set size\n"
"- Fixed Annular Ring -> all holes will have a set annular ring\n"
"- Proportional -> each hole size will be a fraction of the pad size"))
grid_lay.addWidget(self.hole_size_label, 9, 0)
grid_lay.addWidget(self.hole_size_radio, 9, 1)
# grid_lay1.addWidget(QtWidgets.QLabel(''))
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid_lay.addWidget(separator_line, 10, 0, 1, 2)
# Annular Ring
self.fixed_label = QtWidgets.QLabel('<b>%s</b>' % _("Fixed Diameter"))
grid_lay.addWidget(self.fixed_label, 11, 0, 1, 2)
# Diameter value
self.dia_entry = FCDoubleSpinner()
self.dia_entry.set_precision(self.decimals)
self.dia_entry.set_range(0.0000, 9999.9999)
self.dia_label = QtWidgets.QLabel('%s:' % _("Value"))
self.dia_label.setToolTip(
_("Fixed hole diameter.")
)
grid_lay.addWidget(self.dia_label, 12, 0)
grid_lay.addWidget(self.dia_entry, 12, 1)
# Annular Ring value
self.ring_label = QtWidgets.QLabel('<b>%s</b>' % _("Fixed Annular Ring"))
self.ring_label.setToolTip(
_("The size of annular ring.\n"
"The copper sliver between the hole exterior\n"
"and the margin of the copper pad.")
)
grid_lay.addWidget(self.ring_label, 13, 0, 1, 2)
# Circular Annular Ring Value
self.circular_ring_label = QtWidgets.QLabel('%s:' % _("Circular"))
self.circular_ring_label.setToolTip(
_("The size of annular ring for circular pads.")
)
self.circular_ring_entry = FCDoubleSpinner()
self.circular_ring_entry.set_precision(self.decimals)
self.circular_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.circular_ring_label, 14, 0)
grid_lay.addWidget(self.circular_ring_entry, 14, 1)
# Oblong Annular Ring Value
self.oblong_ring_label = QtWidgets.QLabel('%s:' % _("Oblong"))
self.oblong_ring_label.setToolTip(
_("The size of annular ring for oblong pads.")
)
self.oblong_ring_entry = FCDoubleSpinner()
self.oblong_ring_entry.set_precision(self.decimals)
self.oblong_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.oblong_ring_label, 15, 0)
grid_lay.addWidget(self.oblong_ring_entry, 15, 1)
# Square Annular Ring Value
self.square_ring_label = QtWidgets.QLabel('%s:' % _("Square"))
self.square_ring_label.setToolTip(
_("The size of annular ring for square pads.")
)
self.square_ring_entry = FCDoubleSpinner()
self.square_ring_entry.set_precision(self.decimals)
self.square_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.square_ring_label, 16, 0)
grid_lay.addWidget(self.square_ring_entry, 16, 1)
# Rectangular Annular Ring Value
self.rectangular_ring_label = QtWidgets.QLabel('%s:' % _("Rectangular"))
self.rectangular_ring_label.setToolTip(
_("The size of annular ring for rectangular pads.")
)
self.rectangular_ring_entry = FCDoubleSpinner()
self.rectangular_ring_entry.set_precision(self.decimals)
self.rectangular_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.rectangular_ring_label, 17, 0)
grid_lay.addWidget(self.rectangular_ring_entry, 17, 1)
# Others Annular Ring Value
self.other_ring_label = QtWidgets.QLabel('%s:' % _("Others"))
self.other_ring_label.setToolTip(
_("The size of annular ring for other pads.")
)
self.other_ring_entry = FCDoubleSpinner()
self.other_ring_entry.set_precision(self.decimals)
self.other_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.other_ring_label, 18, 0)
grid_lay.addWidget(self.other_ring_entry, 18, 1)
self.prop_label = QtWidgets.QLabel('<b>%s</b>' % _("Proportional Diameter"))
grid_lay.addWidget(self.prop_label, 19, 0, 1, 2)
# Factor value
self.factor_entry = FCDoubleSpinner(suffix='%')
self.factor_entry.set_precision(self.decimals)
self.factor_entry.set_range(0.0000, 100.0000)
self.factor_entry.setSingleStep(0.1)
self.factor_label = QtWidgets.QLabel('%s:' % _("Factor"))
self.factor_label.setToolTip(
_("Proportional Diameter.\n"
"The hole diameter will be a fraction of the pad size.")
)
grid_lay.addWidget(self.factor_label, 20, 0)
grid_lay.addWidget(self.factor_entry, 20, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,135 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCDoubleSpinner, RadioSet
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2FiducialsPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2FiducialsPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Fiducials Tool Options")))
self.decimals = decimals
# ## Grid Layout
grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay)
grid_lay.setColumnStretch(0, 0)
grid_lay.setColumnStretch(1, 1)
self.param_label = QtWidgets.QLabel('<b>%s:</b>' % _('Parameters'))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
grid_lay.addWidget(self.param_label, 0, 0, 1, 2)
# DIAMETER #
self.dia_label = QtWidgets.QLabel('%s:' % _("Size"))
self.dia_label.setToolTip(
_("This set the fiducial diameter if fiducial type is circular,\n"
"otherwise is the size of the fiducial.\n"
"The soldermask opening is double than that.")
)
self.dia_entry = FCDoubleSpinner()
self.dia_entry.set_range(1.0000, 3.0000)
self.dia_entry.set_precision(self.decimals)
self.dia_entry.setWrapping(True)
self.dia_entry.setSingleStep(0.1)
grid_lay.addWidget(self.dia_label, 1, 0)
grid_lay.addWidget(self.dia_entry, 1, 1)
# MARGIN #
self.margin_label = QtWidgets.QLabel('%s:' % _("Margin"))
self.margin_label.setToolTip(
_("Bounding box margin.")
)
self.margin_entry = FCDoubleSpinner()
self.margin_entry.set_range(-9999.9999, 9999.9999)
self.margin_entry.set_precision(self.decimals)
self.margin_entry.setSingleStep(0.1)
grid_lay.addWidget(self.margin_label, 2, 0)
grid_lay.addWidget(self.margin_entry, 2, 1)
# Mode #
self.mode_radio = RadioSet([
{'label': _('Auto'), 'value': 'auto'},
{"label": _("Manual"), "value": "manual"}
], stretch=False)
self.mode_label = QtWidgets.QLabel(_("Mode:"))
self.mode_label.setToolTip(
_("- 'Auto' - automatic placement of fiducials in the corners of the bounding box.\n"
"- 'Manual' - manual placement of fiducials.")
)
grid_lay.addWidget(self.mode_label, 3, 0)
grid_lay.addWidget(self.mode_radio, 3, 1)
# Position for second fiducial #
self.pos_radio = RadioSet([
{'label': _('Up'), 'value': 'up'},
{"label": _("Down"), "value": "down"},
{"label": _("None"), "value": "no"}
], stretch=False)
self.pos_label = QtWidgets.QLabel('%s:' % _("Second fiducial"))
self.pos_label.setToolTip(
_("The position for the second fiducial.\n"
"- 'Up' - the order is: bottom-left, top-left, top-right.\n"
"- 'Down' - the order is: bottom-left, bottom-right, top-right.\n"
"- 'None' - there is no second fiducial. The order is: bottom-left, top-right.")
)
grid_lay.addWidget(self.pos_label, 4, 0)
grid_lay.addWidget(self.pos_radio, 4, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid_lay.addWidget(separator_line, 5, 0, 1, 2)
# Fiducial type #
self.fid_type_radio = RadioSet([
{'label': _('Circular'), 'value': 'circular'},
{"label": _("Cross"), "value": "cross"},
{"label": _("Chess"), "value": "chess"}
], stretch=False)
self.fid_type_label = QtWidgets.QLabel('%s:' % _("Fiducial Type"))
self.fid_type_label.setToolTip(
_("The type of fiducial.\n"
"- 'Circular' - this is the regular fiducial.\n"
"- 'Cross' - cross lines fiducial.\n"
"- 'Chess' - chess pattern fiducial.")
)
grid_lay.addWidget(self.fid_type_label, 6, 0)
grid_lay.addWidget(self.fid_type_radio, 6, 1)
# Line Thickness #
self.line_thickness_label = QtWidgets.QLabel('%s:' % _("Line thickness"))
self.line_thickness_label.setToolTip(
_("Bounding box margin.")
)
self.line_thickness_entry = FCDoubleSpinner()
self.line_thickness_entry.set_range(0.00001, 9999.9999)
self.line_thickness_entry.set_precision(self.decimals)
self.line_thickness_entry.setSingleStep(0.1)
grid_lay.addWidget(self.line_thickness_label, 7, 0)
grid_lay.addWidget(self.line_thickness_entry, 7, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,75 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCDoubleSpinner, RadioSet
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2InvertPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2InvertPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Invert Gerber Tool Options")))
self.decimals = decimals
# ## Subtractor Tool Parameters
self.sublabel = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.sublabel.setToolTip(
_("A tool to invert Gerber geometry from positive to negative\n"
"and in revers.")
)
self.layout.addWidget(self.sublabel)
# Grid Layout
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
# Margin
self.margin_label = QtWidgets.QLabel('%s:' % _('Margin'))
self.margin_label.setToolTip(
_("Distance by which to avoid\n"
"the edges of the Gerber object.")
)
self.margin_entry = FCDoubleSpinner()
self.margin_entry.set_precision(self.decimals)
self.margin_entry.set_range(0.0000, 9999.9999)
self.margin_entry.setObjectName(_("Margin"))
grid0.addWidget(self.margin_label, 2, 0, 1, 2)
grid0.addWidget(self.margin_entry, 3, 0, 1, 2)
self.join_label = QtWidgets.QLabel('%s:' % _("Lines Join Style"))
self.join_label.setToolTip(
_("The way that the lines in the object outline will be joined.\n"
"Can be:\n"
"- rounded -> an arc is added between two joining lines\n"
"- square -> the lines meet in 90 degrees angle\n"
"- bevel -> the lines are joined by a third line")
)
self.join_radio = RadioSet([
{'label': 'Rounded', 'value': 'r'},
{'label': 'Square', 'value': 's'},
{'label': 'Bevel', 'value': 'b'}
], orientation='vertical', stretch=False)
grid0.addWidget(self.join_label, 5, 0, 1, 2)
grid0.addWidget(self.join_radio, 7, 0, 1, 2)
self.layout.addStretch()

View File

@@ -0,0 +1,56 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCSpinner
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2OptimalPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2OptimalPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Optimal Tool Options")))
self.decimals = decimals
# ## Parameters
self.optlabel = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.optlabel.setToolTip(
_("A tool to find the minimum distance between\n"
"every two Gerber geometric elements")
)
self.layout.addWidget(self.optlabel)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.precision_sp = FCSpinner()
self.precision_sp.set_range(2, 10)
self.precision_sp.set_step(1)
self.precision_sp.setWrapping(True)
self.precision_lbl = QtWidgets.QLabel('%s:' % _("Precision"))
self.precision_lbl.setToolTip(
_("Number of decimals for the distances and coordinates in this tool.")
)
grid0.addWidget(self.precision_lbl, 0, 0)
grid0.addWidget(self.precision_sp, 0, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,89 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.preferences.tools.Tools2InvertPrefGroupUI import Tools2InvertPrefGroupUI
from AppGUI.preferences.tools.Tools2PunchGerberPrefGroupUI import Tools2PunchGerberPrefGroupUI
from AppGUI.preferences.tools.Tools2EDrillsPrefGroupUI import Tools2EDrillsPrefGroupUI
from AppGUI.preferences.tools.Tools2CalPrefGroupUI import Tools2CalPrefGroupUI
from AppGUI.preferences.tools.Tools2FiducialsPrefGroupUI import Tools2FiducialsPrefGroupUI
from AppGUI.preferences.tools.Tools2CThievingPrefGroupUI import Tools2CThievingPrefGroupUI
from AppGUI.preferences.tools.Tools2QRCodePrefGroupUI import Tools2QRCodePrefGroupUI
from AppGUI.preferences.tools.Tools2OptimalPrefGroupUI import Tools2OptimalPrefGroupUI
from AppGUI.preferences.tools.Tools2RulesCheckPrefGroupUI import Tools2RulesCheckPrefGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2PreferencesUI(QtWidgets.QWidget):
def __init__(self, decimals, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
self.setLayout(self.layout)
self.decimals = decimals
self.tools2_checkrules_group = Tools2RulesCheckPrefGroupUI(decimals=self.decimals)
self.tools2_checkrules_group.setMinimumWidth(220)
self.tools2_optimal_group = Tools2OptimalPrefGroupUI(decimals=self.decimals)
self.tools2_optimal_group.setMinimumWidth(220)
self.tools2_qrcode_group = Tools2QRCodePrefGroupUI(decimals=self.decimals)
self.tools2_qrcode_group.setMinimumWidth(220)
self.tools2_cfill_group = Tools2CThievingPrefGroupUI(decimals=self.decimals)
self.tools2_cfill_group.setMinimumWidth(220)
self.tools2_fiducials_group = Tools2FiducialsPrefGroupUI(decimals=self.decimals)
self.tools2_fiducials_group.setMinimumWidth(220)
self.tools2_cal_group = Tools2CalPrefGroupUI(decimals=self.decimals)
self.tools2_cal_group.setMinimumWidth(220)
self.tools2_edrills_group = Tools2EDrillsPrefGroupUI(decimals=self.decimals)
self.tools2_edrills_group.setMinimumWidth(220)
self.tools2_punch_group = Tools2PunchGerberPrefGroupUI(decimals=self.decimals)
self.tools2_punch_group.setMinimumWidth(220)
self.tools2_invert_group = Tools2InvertPrefGroupUI(decimals=self.decimals)
self.tools2_invert_group.setMinimumWidth(220)
self.vlay = QtWidgets.QVBoxLayout()
self.vlay.addWidget(self.tools2_checkrules_group)
self.vlay.addWidget(self.tools2_optimal_group)
self.vlay1 = QtWidgets.QVBoxLayout()
self.vlay1.addWidget(self.tools2_qrcode_group)
self.vlay1.addWidget(self.tools2_fiducials_group)
self.vlay2 = QtWidgets.QVBoxLayout()
self.vlay2.addWidget(self.tools2_cfill_group)
self.vlay3 = QtWidgets.QVBoxLayout()
self.vlay3.addWidget(self.tools2_cal_group)
self.vlay3.addWidget(self.tools2_edrills_group)
self.vlay4 = QtWidgets.QVBoxLayout()
self.vlay4.addWidget(self.tools2_punch_group)
self.vlay4.addWidget(self.tools2_invert_group)
self.layout.addLayout(self.vlay)
self.layout.addLayout(self.vlay1)
self.layout.addLayout(self.vlay2)
self.layout.addLayout(self.vlay3)
self.layout.addLayout(self.vlay4)
self.layout.addStretch()

View File

@@ -0,0 +1,233 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2PunchGerberPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2PunchGerberPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Punch Gerber Options")))
self.decimals = decimals
# ## Grid Layout
grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay)
grid_lay.setColumnStretch(0, 0)
grid_lay.setColumnStretch(1, 1)
self.param_label = QtWidgets.QLabel('<b>%s:</b>' % _('Parameters'))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
grid_lay.addWidget(self.param_label, 0, 0, 1, 2)
self.padt_label = QtWidgets.QLabel("<b>%s:</b>" % _("Processed Pads Type"))
self.padt_label.setToolTip(
_("The type of pads shape to be processed.\n"
"If the PCB has many SMD pads with rectangular pads,\n"
"disable the Rectangular aperture.")
)
grid_lay.addWidget(self.padt_label, 2, 0, 1, 2)
# Circular Aperture Selection
self.circular_cb = FCCheckBox('%s' % _("Circular"))
self.circular_cb.setToolTip(
_("Process Circular Pads.")
)
grid_lay.addWidget(self.circular_cb, 3, 0, 1, 2)
# Oblong Aperture Selection
self.oblong_cb = FCCheckBox('%s' % _("Oblong"))
self.oblong_cb.setToolTip(
_("Process Oblong Pads.")
)
grid_lay.addWidget(self.oblong_cb, 4, 0, 1, 2)
# Square Aperture Selection
self.square_cb = FCCheckBox('%s' % _("Square"))
self.square_cb.setToolTip(
_("Process Square Pads.")
)
grid_lay.addWidget(self.square_cb, 5, 0, 1, 2)
# Rectangular Aperture Selection
self.rectangular_cb = FCCheckBox('%s' % _("Rectangular"))
self.rectangular_cb.setToolTip(
_("Process Rectangular Pads.")
)
grid_lay.addWidget(self.rectangular_cb, 6, 0, 1, 2)
# Others type of Apertures Selection
self.other_cb = FCCheckBox('%s' % _("Others"))
self.other_cb.setToolTip(
_("Process pads not in the categories above.")
)
grid_lay.addWidget(self.other_cb, 7, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid_lay.addWidget(separator_line, 8, 0, 1, 2)
# ## Axis
self.hole_size_radio = RadioSet(
[
{'label': _("Excellon"), 'value': 'exc'},
{'label': _("Fixed Diameter"), 'value': 'fixed'},
{'label': _("Fixed Annular Ring"), 'value': 'ring'},
{'label': _("Proportional"), 'value': 'prop'}
],
orientation='vertical',
stretch=False)
self.hole_size_label = QtWidgets.QLabel('<b>%s:</b>' % _("Method"))
self.hole_size_label.setToolTip(
_("The punch hole source can be:\n"
"- Excellon Object-> the Excellon object drills center will serve as reference.\n"
"- Fixed Diameter -> will try to use the pads center as reference adding fixed diameter holes.\n"
"- Fixed Annular Ring -> will try to keep a set annular ring.\n"
"- Proportional -> will make a Gerber punch hole having the diameter a percentage of the pad diameter.")
)
grid_lay.addWidget(self.hole_size_label, 9, 0)
grid_lay.addWidget(self.hole_size_radio, 9, 1)
# grid_lay1.addWidget(QtWidgets.QLabel(''))
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid_lay.addWidget(separator_line, 10, 0, 1, 2)
# Annular Ring
self.fixed_label = QtWidgets.QLabel('<b>%s</b>' % _("Fixed Diameter"))
grid_lay.addWidget(self.fixed_label, 11, 0, 1, 2)
# Diameter value
self.dia_entry = FCDoubleSpinner()
self.dia_entry.set_precision(self.decimals)
self.dia_entry.set_range(0.0000, 9999.9999)
self.dia_label = QtWidgets.QLabel('%s:' % _("Value"))
self.dia_label.setToolTip(
_("Fixed hole diameter.")
)
grid_lay.addWidget(self.dia_label, 12, 0)
grid_lay.addWidget(self.dia_entry, 12, 1)
# Annular Ring value
self.ring_label = QtWidgets.QLabel('<b>%s</b>' % _("Fixed Annular Ring"))
self.ring_label.setToolTip(
_("The size of annular ring.\n"
"The copper sliver between the hole exterior\n"
"and the margin of the copper pad.")
)
grid_lay.addWidget(self.ring_label, 13, 0, 1, 2)
# Circular Annular Ring Value
self.circular_ring_label = QtWidgets.QLabel('%s:' % _("Circular"))
self.circular_ring_label.setToolTip(
_("The size of annular ring for circular pads.")
)
self.circular_ring_entry = FCDoubleSpinner()
self.circular_ring_entry.set_precision(self.decimals)
self.circular_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.circular_ring_label, 14, 0)
grid_lay.addWidget(self.circular_ring_entry, 14, 1)
# Oblong Annular Ring Value
self.oblong_ring_label = QtWidgets.QLabel('%s:' % _("Oblong"))
self.oblong_ring_label.setToolTip(
_("The size of annular ring for oblong pads.")
)
self.oblong_ring_entry = FCDoubleSpinner()
self.oblong_ring_entry.set_precision(self.decimals)
self.oblong_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.oblong_ring_label, 15, 0)
grid_lay.addWidget(self.oblong_ring_entry, 15, 1)
# Square Annular Ring Value
self.square_ring_label = QtWidgets.QLabel('%s:' % _("Square"))
self.square_ring_label.setToolTip(
_("The size of annular ring for square pads.")
)
self.square_ring_entry = FCDoubleSpinner()
self.square_ring_entry.set_precision(self.decimals)
self.square_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.square_ring_label, 16, 0)
grid_lay.addWidget(self.square_ring_entry, 16, 1)
# Rectangular Annular Ring Value
self.rectangular_ring_label = QtWidgets.QLabel('%s:' % _("Rectangular"))
self.rectangular_ring_label.setToolTip(
_("The size of annular ring for rectangular pads.")
)
self.rectangular_ring_entry = FCDoubleSpinner()
self.rectangular_ring_entry.set_precision(self.decimals)
self.rectangular_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.rectangular_ring_label, 17, 0)
grid_lay.addWidget(self.rectangular_ring_entry, 17, 1)
# Others Annular Ring Value
self.other_ring_label = QtWidgets.QLabel('%s:' % _("Others"))
self.other_ring_label.setToolTip(
_("The size of annular ring for other pads.")
)
self.other_ring_entry = FCDoubleSpinner()
self.other_ring_entry.set_precision(self.decimals)
self.other_ring_entry.set_range(0.0000, 9999.9999)
grid_lay.addWidget(self.other_ring_label, 18, 0)
grid_lay.addWidget(self.other_ring_entry, 18, 1)
self.prop_label = QtWidgets.QLabel('<b>%s</b>' % _("Proportional Diameter"))
grid_lay.addWidget(self.prop_label, 19, 0, 1, 2)
# Factor value
self.factor_entry = FCDoubleSpinner(suffix='%')
self.factor_entry.set_precision(self.decimals)
self.factor_entry.set_range(0.0000, 100.0000)
self.factor_entry.setSingleStep(0.1)
self.factor_label = QtWidgets.QLabel('%s:' % _("Factor"))
self.factor_label.setToolTip(
_("Proportional Diameter.\n"
"The hole diameter will be a fraction of the pad size.")
)
grid_lay.addWidget(self.factor_label, 20, 0)
grid_lay.addWidget(self.factor_entry, 20, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,207 @@
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import Qt, QSettings
from AppGUI.GUIElements import FCSpinner, RadioSet, FCTextArea, FCEntry
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2QRCodePrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2QRCodePrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("QRCode Tool Options")))
self.decimals = decimals
# ## Parameters
self.qrlabel = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.qrlabel.setToolTip(
_("A tool to create a QRCode that can be inserted\n"
"into a selected Gerber file, or it can be exported as a file.")
)
self.layout.addWidget(self.qrlabel)
# ## Grid Layout
grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay)
grid_lay.setColumnStretch(0, 0)
grid_lay.setColumnStretch(1, 1)
# VERSION #
self.version_label = QtWidgets.QLabel('%s:' % _("Version"))
self.version_label.setToolTip(
_("QRCode version can have values from 1 (21x21 boxes)\n"
"to 40 (177x177 boxes).")
)
self.version_entry = FCSpinner()
self.version_entry.set_range(1, 40)
self.version_entry.setWrapping(True)
grid_lay.addWidget(self.version_label, 1, 0)
grid_lay.addWidget(self.version_entry, 1, 1)
# ERROR CORRECTION #
self.error_label = QtWidgets.QLabel('%s:' % _("Error correction"))
self.error_label.setToolTip(
_("Parameter that controls the error correction used for the QR Code.\n"
"L = maximum 7%% errors can be corrected\n"
"M = maximum 15%% errors can be corrected\n"
"Q = maximum 25%% errors can be corrected\n"
"H = maximum 30%% errors can be corrected.")
)
self.error_radio = RadioSet([{'label': 'L', 'value': 'L'},
{'label': 'M', 'value': 'M'},
{'label': 'Q', 'value': 'Q'},
{'label': 'H', 'value': 'H'}])
self.error_radio.setToolTip(
_("Parameter that controls the error correction used for the QR Code.\n"
"L = maximum 7%% errors can be corrected\n"
"M = maximum 15%% errors can be corrected\n"
"Q = maximum 25%% errors can be corrected\n"
"H = maximum 30%% errors can be corrected.")
)
grid_lay.addWidget(self.error_label, 2, 0)
grid_lay.addWidget(self.error_radio, 2, 1)
# BOX SIZE #
self.bsize_label = QtWidgets.QLabel('%s:' % _("Box Size"))
self.bsize_label.setToolTip(
_("Box size control the overall size of the QRcode\n"
"by adjusting the size of each box in the code.")
)
self.bsize_entry = FCSpinner()
self.bsize_entry.set_range(1, 9999)
self.bsize_entry.setWrapping(True)
grid_lay.addWidget(self.bsize_label, 3, 0)
grid_lay.addWidget(self.bsize_entry, 3, 1)
# BORDER SIZE #
self.border_size_label = QtWidgets.QLabel('%s:' % _("Border Size"))
self.border_size_label.setToolTip(
_("Size of the QRCode border. How many boxes thick is the border.\n"
"Default value is 4. The width of the clearance around the QRCode.")
)
self.border_size_entry = FCSpinner()
self.border_size_entry.set_range(1, 9999)
self.border_size_entry.setWrapping(True)
grid_lay.addWidget(self.border_size_label, 4, 0)
grid_lay.addWidget(self.border_size_entry, 4, 1)
# Text box
self.text_label = QtWidgets.QLabel('%s:' % _("QRCode Data"))
self.text_label.setToolTip(
_("QRCode Data. Alphanumeric text to be encoded in the QRCode.")
)
self.text_data = FCTextArea()
self.text_data.setPlaceholderText(
_("Add here the text to be included in the QRCode...")
)
grid_lay.addWidget(self.text_label, 5, 0)
grid_lay.addWidget(self.text_data, 6, 0, 1, 2)
# POLARITY CHOICE #
self.pol_label = QtWidgets.QLabel('%s:' % _("Polarity"))
self.pol_label.setToolTip(
_("Choose the polarity of the QRCode.\n"
"It can be drawn in a negative way (squares are clear)\n"
"or in a positive way (squares are opaque).")
)
self.pol_radio = RadioSet([{'label': _('Negative'), 'value': 'neg'},
{'label': _('Positive'), 'value': 'pos'}])
self.pol_radio.setToolTip(
_("Choose the type of QRCode to be created.\n"
"If added on a Silkscreen Gerber file the QRCode may\n"
"be added as positive. If it is added to a Copper Gerber\n"
"file then perhaps the QRCode can be added as negative.")
)
grid_lay.addWidget(self.pol_label, 7, 0)
grid_lay.addWidget(self.pol_radio, 7, 1)
# BOUNDING BOX TYPE #
self.bb_label = QtWidgets.QLabel('%s:' % _("Bounding Box"))
self.bb_label.setToolTip(
_("The bounding box, meaning the empty space that surrounds\n"
"the QRCode geometry, can have a rounded or a square shape.")
)
self.bb_radio = RadioSet([{'label': _('Rounded'), 'value': 'r'},
{'label': _('Square'), 'value': 's'}])
self.bb_radio.setToolTip(
_("The bounding box, meaning the empty space that surrounds\n"
"the QRCode geometry, can have a rounded or a square shape.")
)
grid_lay.addWidget(self.bb_label, 8, 0)
grid_lay.addWidget(self.bb_radio, 8, 1)
# FILL COLOR #
self.fill_color_label = QtWidgets.QLabel('%s:' % _('Fill Color'))
self.fill_color_label.setToolTip(
_("Set the QRCode fill color (squares color).")
)
self.fill_color_entry = FCEntry()
self.fill_color_button = QtWidgets.QPushButton()
self.fill_color_button.setFixedSize(15, 15)
fill_lay_child = QtWidgets.QHBoxLayout()
fill_lay_child.setContentsMargins(0, 0, 0, 0)
fill_lay_child.addWidget(self.fill_color_entry)
fill_lay_child.addWidget(self.fill_color_button, alignment=Qt.AlignRight)
fill_lay_child.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
fill_color_widget = QtWidgets.QWidget()
fill_color_widget.setLayout(fill_lay_child)
grid_lay.addWidget(self.fill_color_label, 9, 0)
grid_lay.addWidget(fill_color_widget, 9, 1)
# BACK COLOR #
self.back_color_label = QtWidgets.QLabel('%s:' % _('Back Color'))
self.back_color_label.setToolTip(
_("Set the QRCode background color.")
)
self.back_color_entry = FCEntry()
self.back_color_button = QtWidgets.QPushButton()
self.back_color_button.setFixedSize(15, 15)
back_lay_child = QtWidgets.QHBoxLayout()
back_lay_child.setContentsMargins(0, 0, 0, 0)
back_lay_child.addWidget(self.back_color_entry)
back_lay_child.addWidget(self.back_color_button, alignment=Qt.AlignRight)
back_lay_child.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
back_color_widget = QtWidgets.QWidget()
back_color_widget.setLayout(back_lay_child)
grid_lay.addWidget(self.back_color_label, 10, 0)
grid_lay.addWidget(back_color_widget, 10, 1)
# Selection Limit
self.sel_limit_label = QtWidgets.QLabel('%s:' % _("Selection limit"))
self.sel_limit_label.setToolTip(
_("Set the number of selected geometry\n"
"items above which the utility geometry\n"
"becomes just a selection rectangle.\n"
"Increases the performance when moving a\n"
"large number of geometric elements.")
)
self.sel_limit_entry = FCSpinner()
self.sel_limit_entry.set_range(0, 9999)
grid_lay.addWidget(self.sel_limit_label, 11, 0)
grid_lay.addWidget(self.sel_limit_entry, 11, 1)
# self.layout.addStretch()

View File

@@ -0,0 +1,242 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCCheckBox, FCDoubleSpinner
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2RulesCheckPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(Tools2RulesCheckPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Check Rules Tool Options")))
self.decimals = decimals
self.crlabel = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.crlabel.setToolTip(
_("A tool to check if Gerber files are within a set\n"
"of Manufacturing Rules.")
)
self.layout.addWidget(self.crlabel)
# Form Layout
self.form_layout_1 = QtWidgets.QFormLayout()
self.layout.addLayout(self.form_layout_1)
# 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)
# Trace size value
self.trace_size_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%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)
# Copper2copper clearance
self.clearance_copper2copper_cb = FCCheckBox('%s:' % _("Copper to Copper clearance"))
self.clearance_copper2copper_cb.setToolTip(
_("This checks if the minimum clearance between copper\n"
"features is met.")
)
self.form_layout_1.addRow(self.clearance_copper2copper_cb)
# Copper2copper clearance value
self.clearance_copper2copper_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%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)
# Copper2outline clearance
self.clearance_copper2ol_cb = FCCheckBox('%s:' % _("Copper to Outline clearance"))
self.clearance_copper2ol_cb.setToolTip(
_("This checks if the minimum clearance between copper\n"
"features and the outline is met.")
)
self.form_layout_1.addRow(self.clearance_copper2ol_cb)
# Copper2outline clearance value
self.clearance_copper2ol_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%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)
# Silkscreen2silkscreen clearance
self.clearance_silk2silk_cb = FCCheckBox('%s:' % _("Silk to Silk Clearance"))
self.clearance_silk2silk_cb.setToolTip(
_("This checks if the minimum clearance between silkscreen\n"
"features and silkscreen features is met.")
)
self.form_layout_1.addRow(self.clearance_silk2silk_cb)
# Copper2silkscreen clearance value
self.clearance_silk2silk_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%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)
# Silkscreen2soldermask clearance
self.clearance_silk2sm_cb = FCCheckBox('%s:' % _("Silk to Solder Mask Clearance"))
self.clearance_silk2sm_cb.setToolTip(
_("This checks if the minimum clearance between silkscreen\n"
"features and soldermask features is met.")
)
self.form_layout_1.addRow(self.clearance_silk2sm_cb)
# Silkscreen2soldermask clearance value
self.clearance_silk2sm_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%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)
# Silk2outline clearance
self.clearance_silk2ol_cb = FCCheckBox('%s:' % _("Silk to Outline Clearance"))
self.clearance_silk2ol_cb.setToolTip(
_("This checks if the minimum clearance between silk\n"
"features and the outline is met.")
)
self.form_layout_1.addRow(self.clearance_silk2ol_cb)
# Silk2outline clearance value
self.clearance_silk2ol_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%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)
# Soldermask2soldermask clearance
self.clearance_sm2sm_cb = FCCheckBox('%s:' % _("Minimum Solder Mask Sliver"))
self.clearance_sm2sm_cb.setToolTip(
_("This checks if the minimum clearance between soldermask\n"
"features and soldermask features is met.")
)
self.form_layout_1.addRow(self.clearance_sm2sm_cb)
# Soldermask2soldermask clearance value
self.clearance_sm2sm_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%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)
# Ring integrity check
self.ring_integrity_cb = FCCheckBox('%s:' % _("Minimum Annular Ring"))
self.ring_integrity_cb.setToolTip(
_("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)
# Ring integrity value
self.ring_integrity_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%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.form_layout_1.addRow(QtWidgets.QLabel(""))
# Hole2Hole clearance
self.clearance_d2d_cb = FCCheckBox('%s:' % _("Hole to Hole Clearance"))
self.clearance_d2d_cb.setToolTip(
_("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)
# Hole2Hole clearance value
self.clearance_d2d_entry = FCDoubleSpinner()
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 = QtWidgets.QLabel('%s:' % _("Min value"))
self.clearance_d2d_lbl.setToolTip(
_("Minimum acceptable drill size.")
)
self.form_layout_1.addRow(self.clearance_d2d_lbl, self.clearance_d2d_entry)
# Drill holes size check
self.drill_size_cb = FCCheckBox('%s:' % _("Hole Size"))
self.drill_size_cb.setToolTip(
_("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()
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.drill_size_lbl = QtWidgets.QLabel('%s:' % _("Min value"))
self.drill_size_lbl.setToolTip(
_("Minimum acceptable clearance value.")
)
self.form_layout_1.addRow(self.drill_size_lbl, self.drill_size_entry)
self.layout.addStretch()

View File

@@ -0,0 +1,92 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCDoubleSpinner, RadioSet
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class Tools2sidedPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "2sided Tool Options", parent=parent)
super(Tools2sidedPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("2Sided Tool Options")))
self.decimals = decimals
# ## Board cuttout
self.dblsided_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.dblsided_label.setToolTip(
_("A tool to help in creating a double sided\n"
"PCB using alignment holes.")
)
self.layout.addWidget(self.dblsided_label)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
# ## Drill diameter for alignment holes
self.drill_dia_entry = FCDoubleSpinner()
self.drill_dia_entry.set_range(0.000001, 9999.9999)
self.drill_dia_entry.set_precision(self.decimals)
self.drill_dia_entry.setSingleStep(0.1)
self.dd_label = QtWidgets.QLabel('%s:' % _("Drill dia"))
self.dd_label.setToolTip(
_("Diameter of the drill for the "
"alignment holes.")
)
grid0.addWidget(self.dd_label, 0, 0)
grid0.addWidget(self.drill_dia_entry, 0, 1)
# ## Alignment Axis
self.align_ax_label = QtWidgets.QLabel('%s:' % _("Align Axis"))
self.align_ax_label.setToolTip(
_("Mirror vertically (X) or horizontally (Y).")
)
self.align_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
{'label': 'Y', 'value': 'Y'}])
grid0.addWidget(self.align_ax_label, 1, 0)
grid0.addWidget(self.align_axis_radio, 1, 1)
# ## Axis
self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
{'label': 'Y', 'value': 'Y'}])
self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:"))
self.mirax_label.setToolTip(
_("Mirror vertically (X) or horizontally (Y).")
)
self.empty_lb1 = QtWidgets.QLabel("")
grid0.addWidget(self.empty_lb1, 2, 0)
grid0.addWidget(self.mirax_label, 3, 0)
grid0.addWidget(self.mirror_axis_radio, 3, 1)
# ## Axis Location
self.axis_location_radio = RadioSet([{'label': _('Point'), 'value': 'point'},
{'label': _('Box'), 'value': 'box'}])
self.axloc_label = QtWidgets.QLabel('%s:' % _("Axis Ref"))
self.axloc_label.setToolTip(
_("The axis should pass through a <b>point</b> or cut\n "
"a specified <b>box</b> (in a FlatCAM object) through \n"
"the center.")
)
grid0.addWidget(self.axloc_label, 4, 0)
grid0.addWidget(self.axis_location_radio, 4, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,142 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCDoubleSpinner
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Calculators Tool Options", parent=parent)
super(ToolsCalculatorsPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Calculators Tool Options")))
self.decimals = decimals
# ## V-shape Calculator Tool
self.vshape_tool_label = QtWidgets.QLabel("<b>%s:</b>" % _("V-Shape Tool Calculator"))
self.vshape_tool_label.setToolTip(
_("Calculate the tool diameter for a given V-shape tool,\n"
"having the tip diameter, tip angle and\n"
"depth-of-cut as parameters.")
)
self.layout.addWidget(self.vshape_tool_label)
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
# ## Tip Diameter
self.tip_dia_entry = FCDoubleSpinner()
self.tip_dia_entry.set_range(0.000001, 9999.9999)
self.tip_dia_entry.set_precision(self.decimals)
self.tip_dia_entry.setSingleStep(0.1)
self.tip_dia_label = QtWidgets.QLabel('%s:' % _("Tip Diameter"))
self.tip_dia_label.setToolTip(
_("This is the tool tip diameter.\n"
"It is specified by manufacturer.")
)
grid0.addWidget(self.tip_dia_label, 0, 0)
grid0.addWidget(self.tip_dia_entry, 0, 1)
# ## Tip angle
self.tip_angle_entry = FCDoubleSpinner()
self.tip_angle_entry.set_range(0.0, 180.0)
self.tip_angle_entry.set_precision(self.decimals)
self.tip_angle_entry.setSingleStep(5)
self.tip_angle_label = QtWidgets.QLabel('%s:' % _("Tip Angle"))
self.tip_angle_label.setToolTip(
_("This is the angle on the tip of the tool.\n"
"It is specified by manufacturer.")
)
grid0.addWidget(self.tip_angle_label, 1, 0)
grid0.addWidget(self.tip_angle_entry, 1, 1)
# ## Depth-of-cut Cut Z
self.cut_z_entry = FCDoubleSpinner()
self.cut_z_entry.set_range(-9999.9999, 0.0000)
self.cut_z_entry.set_precision(self.decimals)
self.cut_z_entry.setSingleStep(0.01)
self.cut_z_label = QtWidgets.QLabel('%s:' % _("Cut Z"))
self.cut_z_label.setToolTip(
_("This is depth to cut into material.\n"
"In the CNCJob object it is the CutZ parameter.")
)
grid0.addWidget(self.cut_z_label, 2, 0)
grid0.addWidget(self.cut_z_entry, 2, 1)
# ## Electroplating Calculator Tool
self.plate_title_label = QtWidgets.QLabel("<b>%s:</b>" % _("ElectroPlating Calculator"))
self.plate_title_label.setToolTip(
_("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.")
)
grid0.addWidget(self.plate_title_label, 3, 0, 1, 2)
# ## PCB Length
self.pcblength_entry = FCDoubleSpinner()
self.pcblength_entry.set_range(0.000001, 9999.9999)
self.pcblength_entry.set_precision(self.decimals)
self.pcblength_entry.setSingleStep(0.1)
self.pcblengthlabel = QtWidgets.QLabel('%s:' % _("Board Length"))
self.pcblengthlabel.setToolTip(_('This is the board length. In centimeters.'))
grid0.addWidget(self.pcblengthlabel, 4, 0)
grid0.addWidget(self.pcblength_entry, 4, 1)
# ## PCB Width
self.pcbwidth_entry = FCDoubleSpinner()
self.pcbwidth_entry.set_range(0.000001, 9999.9999)
self.pcbwidth_entry.set_precision(self.decimals)
self.pcbwidth_entry.setSingleStep(0.1)
self.pcbwidthlabel = QtWidgets.QLabel('%s:' % _("Board Width"))
self.pcbwidthlabel.setToolTip(_('This is the board width.In centimeters.'))
grid0.addWidget(self.pcbwidthlabel, 5, 0)
grid0.addWidget(self.pcbwidth_entry, 5, 1)
# ## Current Density
self.cdensity_label = QtWidgets.QLabel('%s:' % _("Current Density"))
self.cdensity_entry = FCDoubleSpinner()
self.cdensity_entry.set_range(0.000001, 9999.9999)
self.cdensity_entry.set_precision(self.decimals)
self.cdensity_entry.setSingleStep(0.1)
self.cdensity_label.setToolTip(_("Current density to pass through the board. \n"
"In Amps per Square Feet ASF."))
grid0.addWidget(self.cdensity_label, 6, 0)
grid0.addWidget(self.cdensity_entry, 6, 1)
# ## PCB Copper Growth
self.growth_label = QtWidgets.QLabel('%s:' % _("Copper Growth"))
self.growth_entry = FCDoubleSpinner()
self.growth_entry.set_range(0.000001, 9999.9999)
self.growth_entry.set_precision(self.decimals)
self.growth_entry.setSingleStep(0.01)
self.growth_label.setToolTip(_("How thick the copper growth is intended to be.\n"
"In microns."))
grid0.addWidget(self.growth_label, 7, 0)
grid0.addWidget(self.growth_entry, 7, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,81 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCDoubleSpinner
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsCornersPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Calculators Tool Options", parent=parent)
super(ToolsCornersPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Corner Markers Options")))
self.decimals = decimals
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
self.param_label = QtWidgets.QLabel('<b>%s:</b>' % _('Parameters'))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
grid0.addWidget(self.param_label, 0, 0, 1, 2)
# Thickness #
self.thick_label = QtWidgets.QLabel('%s:' % _("Thickness"))
self.thick_label.setToolTip(
_("The thickness of the line that makes the corner marker.")
)
self.thick_entry = FCDoubleSpinner()
self.thick_entry.set_range(0.0000, 9.9999)
self.thick_entry.set_precision(self.decimals)
self.thick_entry.setWrapping(True)
self.thick_entry.setSingleStep(10 ** -self.decimals)
grid0.addWidget(self.thick_label, 1, 0)
grid0.addWidget(self.thick_entry, 1, 1)
# Length #
self.l_label = QtWidgets.QLabel('%s:' % _("Length"))
self.l_label.setToolTip(
_("The length of the line that makes the corner marker.")
)
self.l_entry = FCDoubleSpinner()
self.l_entry.set_range(-9999.9999, 9999.9999)
self.l_entry.set_precision(self.decimals)
self.l_entry.setSingleStep(10 ** -self.decimals)
# Margin #
self.margin_label = QtWidgets.QLabel('%s:' % _("Margin"))
self.margin_label.setToolTip(
_("Bounding box margin.")
)
self.margin_entry = FCDoubleSpinner()
self.margin_entry.set_range(-9999.9999, 9999.9999)
self.margin_entry.set_precision(self.decimals)
self.margin_entry.setSingleStep(0.1)
grid0.addWidget(self.margin_label, 2, 0)
grid0.addWidget(self.margin_entry, 2, 1)
grid0.addWidget(self.l_label, 4, 0)
grid0.addWidget(self.l_entry, 4, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,177 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox
from AppGUI.preferences import machinist_setting
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsCutoutPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Cutout Tool Options", parent=parent)
super(ToolsCutoutPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Cutout Tool Options")))
self.decimals = decimals
# ## Board cutout
self.board_cutout_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n"
"the PCB and separate it from\n"
"the original board.")
)
self.layout.addWidget(self.board_cutout_label)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
tdclabel = QtWidgets.QLabel('%s:' % _('Tool Diameter'))
tdclabel.setToolTip(
_("Diameter of the tool used to cutout\n"
"the PCB shape out of the surrounding material.")
)
self.cutout_tooldia_entry = FCDoubleSpinner()
self.cutout_tooldia_entry.set_range(0.000001, 9999.9999)
self.cutout_tooldia_entry.set_precision(self.decimals)
self.cutout_tooldia_entry.setSingleStep(0.1)
grid0.addWidget(tdclabel, 0, 0)
grid0.addWidget(self.cutout_tooldia_entry, 0, 1)
# Cut Z
cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
cutzlabel.setToolTip(
_(
"Cutting depth (negative)\n"
"below the copper surface."
)
)
self.cutz_entry = FCDoubleSpinner()
self.cutz_entry.set_precision(self.decimals)
if machinist_setting == 0:
self.cutz_entry.setRange(-9999.9999, 0.0000)
else:
self.cutz_entry.setRange(-9999.9999, 9999.9999)
self.cutz_entry.setSingleStep(0.1)
grid0.addWidget(cutzlabel, 1, 0)
grid0.addWidget(self.cutz_entry, 1, 1)
# Multi-pass
self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth"))
self.mpass_cb.setToolTip(
_(
"Use multiple passes to limit\n"
"the cut depth in each pass. Will\n"
"cut multiple times until Cut Z is\n"
"reached."
)
)
self.maxdepth_entry = FCDoubleSpinner()
self.maxdepth_entry.set_precision(self.decimals)
self.maxdepth_entry.setRange(0, 9999.9999)
self.maxdepth_entry.setSingleStep(0.1)
self.maxdepth_entry.setToolTip(_("Depth of each pass (positive)."))
grid0.addWidget(self.mpass_cb, 2, 0)
grid0.addWidget(self.maxdepth_entry, 2, 1)
# Object kind
kindlabel = QtWidgets.QLabel('%s:' % _('Object kind'))
kindlabel.setToolTip(
_("Choice of what kind the object we want to cutout is.<BR>"
"- <B>Single</B>: contain a single PCB Gerber outline object.<BR>"
"- <B>Panel</B>: a panel PCB Gerber object, which is made\n"
"out of many individual PCB outlines.")
)
self.obj_kind_combo = RadioSet([
{"label": _("Single"), "value": "single"},
{"label": _("Panel"), "value": "panel"},
])
grid0.addWidget(kindlabel, 3, 0)
grid0.addWidget(self.obj_kind_combo, 3, 1)
marginlabel = QtWidgets.QLabel('%s:' % _('Margin'))
marginlabel.setToolTip(
_("Margin over bounds. A positive value here\n"
"will make the cutout of the PCB further from\n"
"the actual PCB border")
)
self.cutout_margin_entry = FCDoubleSpinner()
self.cutout_margin_entry.set_range(-9999.9999, 9999.9999)
self.cutout_margin_entry.set_precision(self.decimals)
self.cutout_margin_entry.setSingleStep(0.1)
grid0.addWidget(marginlabel, 4, 0)
grid0.addWidget(self.cutout_margin_entry, 4, 1)
gaplabel = QtWidgets.QLabel('%s:' % _('Gap size'))
gaplabel.setToolTip(
_("The size of the bridge gaps in the cutout\n"
"used to keep the board connected to\n"
"the surrounding material (the one \n"
"from which the PCB is cutout).")
)
self.cutout_gap_entry = FCDoubleSpinner()
self.cutout_gap_entry.set_range(0.000001, 9999.9999)
self.cutout_gap_entry.set_precision(self.decimals)
self.cutout_gap_entry.setSingleStep(0.1)
grid0.addWidget(gaplabel, 5, 0)
grid0.addWidget(self.cutout_gap_entry, 5, 1)
gaps_label = QtWidgets.QLabel('%s:' % _('Gaps'))
gaps_label.setToolTip(
_("Number of gaps used for the cutout.\n"
"There can be maximum 8 bridges/gaps.\n"
"The choices are:\n"
"- None - no gaps\n"
"- lr - left + right\n"
"- tb - top + bottom\n"
"- 4 - left + right +top + bottom\n"
"- 2lr - 2*left + 2*right\n"
"- 2tb - 2*top + 2*bottom\n"
"- 8 - 2*left + 2*right +2*top + 2*bottom")
)
self.gaps_combo = FCComboBox()
grid0.addWidget(gaps_label, 6, 0)
grid0.addWidget(self.gaps_combo, 6, 1)
gaps_items = ['None', 'LR', 'TB', '4', '2LR', '2TB', '8']
for it in gaps_items:
self.gaps_combo.addItem(it)
self.gaps_combo.setStyleSheet('background-color: rgb(255,255,255)')
# Surrounding convex box shape
self.convex_box = FCCheckBox('%s' % _("Convex Shape"))
self.convex_box.setToolTip(
_("Create a convex shape surrounding the entire PCB.\n"
"Used only if the source object type is Gerber.")
)
grid0.addWidget(self.convex_box, 7, 0, 1, 2)
self.layout.addStretch()

View File

@@ -0,0 +1,316 @@
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import Qt, QSettings
from AppGUI.GUIElements import RadioSet, FCEntry, FCDoubleSpinner, FCCheckBox, FCComboBox
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsFilmPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Cutout Tool Options", parent=parent)
super(ToolsFilmPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Film Tool Options")))
self.decimals = decimals
# ## Parameters
self.film_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.film_label.setToolTip(
_("Create a PCB film from a Gerber or Geometry\n"
"FlatCAM object.\n"
"The file is saved in SVG format.")
)
self.layout.addWidget(self.film_label)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
self.film_type_radio = RadioSet([{'label': 'Pos', 'value': 'pos'},
{'label': 'Neg', 'value': 'neg'}])
ftypelbl = QtWidgets.QLabel('%s:' % _('Film Type'))
ftypelbl.setToolTip(
_("Generate a Positive black film or a Negative film.\n"
"Positive means that it will print the features\n"
"with black on a white canvas.\n"
"Negative means that it will print the features\n"
"with white on a black canvas.\n"
"The Film format is SVG.")
)
grid0.addWidget(ftypelbl, 0, 0)
grid0.addWidget(self.film_type_radio, 0, 1)
# Film Color
self.film_color_label = QtWidgets.QLabel('%s:' % _('Film Color'))
self.film_color_label.setToolTip(
_("Set the film color when positive film is selected.")
)
self.film_color_entry = FCEntry()
self.film_color_button = QtWidgets.QPushButton()
self.film_color_button.setFixedSize(15, 15)
self.form_box_child = QtWidgets.QHBoxLayout()
self.form_box_child.setContentsMargins(0, 0, 0, 0)
self.form_box_child.addWidget(self.film_color_entry)
self.form_box_child.addWidget(self.film_color_button, alignment=Qt.AlignRight)
self.form_box_child.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
film_color_widget = QtWidgets.QWidget()
film_color_widget.setLayout(self.form_box_child)
grid0.addWidget(self.film_color_label, 1, 0)
grid0.addWidget(film_color_widget, 1, 1)
# Film Border
self.film_boundary_entry = FCDoubleSpinner()
self.film_boundary_entry.set_precision(self.decimals)
self.film_boundary_entry.set_range(0, 9999.9999)
self.film_boundary_entry.setSingleStep(0.1)
self.film_boundary_label = QtWidgets.QLabel('%s:' % _("Border"))
self.film_boundary_label.setToolTip(
_("Specify a border around the object.\n"
"Only for negative film.\n"
"It helps if we use as a Box Object the same \n"
"object as in Film Object. It will create a thick\n"
"black bar around the actual print allowing for a\n"
"better delimitation of the outline features which are of\n"
"white color like the rest and which may confound with the\n"
"surroundings if not for this border.")
)
grid0.addWidget(self.film_boundary_label, 2, 0)
grid0.addWidget(self.film_boundary_entry, 2, 1)
self.film_scale_stroke_entry = FCDoubleSpinner()
self.film_scale_stroke_entry.set_precision(self.decimals)
self.film_scale_stroke_entry.set_range(0, 9999.9999)
self.film_scale_stroke_entry.setSingleStep(0.1)
self.film_scale_stroke_label = QtWidgets.QLabel('%s:' % _("Scale Stroke"))
self.film_scale_stroke_label.setToolTip(
_("Scale the line stroke thickness of each feature in the SVG file.\n"
"It means that the line that envelope each SVG feature will be thicker or thinner,\n"
"therefore the fine features may be more affected by this parameter.")
)
grid0.addWidget(self.film_scale_stroke_label, 3, 0)
grid0.addWidget(self.film_scale_stroke_entry, 3, 1)
self.film_adj_label = QtWidgets.QLabel('<b>%s</b>' % _("Film Adjustments"))
self.film_adj_label.setToolTip(
_("Sometime the printers will distort the print shape, especially the Laser types.\n"
"This section provide the tools to compensate for the print distortions.")
)
grid0.addWidget(self.film_adj_label, 4, 0, 1, 2)
# Scale Geometry
self.film_scale_cb = FCCheckBox('%s' % _("Scale Film geometry"))
self.film_scale_cb.setToolTip(
_("A value greater than 1 will stretch the film\n"
"while a value less than 1 will jolt it.")
)
self.film_scale_cb.setStyleSheet(
"""
QCheckBox {font-weight: bold; color: black}
"""
)
grid0.addWidget(self.film_scale_cb, 5, 0, 1, 2)
self.film_scalex_label = QtWidgets.QLabel('%s:' % _("X factor"))
self.film_scalex_entry = FCDoubleSpinner()
self.film_scalex_entry.set_range(-999.9999, 999.9999)
self.film_scalex_entry.set_precision(self.decimals)
self.film_scalex_entry.setSingleStep(0.01)
grid0.addWidget(self.film_scalex_label, 6, 0)
grid0.addWidget(self.film_scalex_entry, 6, 1)
self.film_scaley_label = QtWidgets.QLabel('%s:' % _("Y factor"))
self.film_scaley_entry = FCDoubleSpinner()
self.film_scaley_entry.set_range(-999.9999, 999.9999)
self.film_scaley_entry.set_precision(self.decimals)
self.film_scaley_entry.setSingleStep(0.01)
grid0.addWidget(self.film_scaley_label, 7, 0)
grid0.addWidget(self.film_scaley_entry, 7, 1)
# Skew Geometry
self.film_skew_cb = FCCheckBox('%s' % _("Skew Film geometry"))
self.film_skew_cb.setToolTip(
_("Positive values will skew to the right\n"
"while negative values will skew to the left.")
)
self.film_skew_cb.setStyleSheet(
"""
QCheckBox {font-weight: bold; color: black}
"""
)
grid0.addWidget(self.film_skew_cb, 8, 0, 1, 2)
self.film_skewx_label = QtWidgets.QLabel('%s:' % _("X angle"))
self.film_skewx_entry = FCDoubleSpinner()
self.film_skewx_entry.set_range(-999.9999, 999.9999)
self.film_skewx_entry.set_precision(self.decimals)
self.film_skewx_entry.setSingleStep(0.01)
grid0.addWidget(self.film_skewx_label, 9, 0)
grid0.addWidget(self.film_skewx_entry, 9, 1)
self.film_skewy_label = QtWidgets.QLabel('%s:' % _("Y angle"))
self.film_skewy_entry = FCDoubleSpinner()
self.film_skewy_entry.set_range(-999.9999, 999.9999)
self.film_skewy_entry.set_precision(self.decimals)
self.film_skewy_entry.setSingleStep(0.01)
grid0.addWidget(self.film_skewy_label, 10, 0)
grid0.addWidget(self.film_skewy_entry, 10, 1)
self.film_skew_ref_label = QtWidgets.QLabel('%s:' % _("Reference"))
self.film_skew_ref_label.setToolTip(
_("The reference point to be used as origin for the skew.\n"
"It can be one of the four points of the geometry bounding box.")
)
self.film_skew_reference = RadioSet([{'label': _('Bottom Left'), 'value': 'bottomleft'},
{'label': _('Top Left'), 'value': 'topleft'},
{'label': _('Bottom Right'), 'value': 'bottomright'},
{'label': _('Top right'), 'value': 'topright'}],
orientation='vertical',
stretch=False)
grid0.addWidget(self.film_skew_ref_label, 11, 0)
grid0.addWidget(self.film_skew_reference, 11, 1)
# Mirror Geometry
self.film_mirror_cb = FCCheckBox('%s' % _("Mirror Film geometry"))
self.film_mirror_cb.setToolTip(
_("Mirror the film geometry on the selected axis or on both.")
)
self.film_mirror_cb.setStyleSheet(
"""
QCheckBox {font-weight: bold; color: black}
"""
)
grid0.addWidget(self.film_mirror_cb, 12, 0, 1, 2)
self.film_mirror_axis = RadioSet([{'label': _('None'), 'value': 'none'},
{'label': _('X'), 'value': 'x'},
{'label': _('Y'), 'value': 'y'},
{'label': _('Both'), 'value': 'both'}],
stretch=False)
self.film_mirror_axis_label = QtWidgets.QLabel('%s:' % _("Mirror axis"))
grid0.addWidget(self.film_mirror_axis_label, 13, 0)
grid0.addWidget(self.film_mirror_axis, 13, 1)
separator_line3 = QtWidgets.QFrame()
separator_line3.setFrameShape(QtWidgets.QFrame.HLine)
separator_line3.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line3, 14, 0, 1, 2)
self.file_type_radio = RadioSet([{'label': _('SVG'), 'value': 'svg'},
{'label': _('PNG'), 'value': 'png'},
{'label': _('PDF'), 'value': 'pdf'}
], stretch=False)
self.file_type_label = QtWidgets.QLabel(_("Film Type:"))
self.file_type_label.setToolTip(
_("The file type of the saved film. Can be:\n"
"- 'SVG' -> open-source vectorial format\n"
"- 'PNG' -> raster image\n"
"- 'PDF' -> portable document format")
)
grid0.addWidget(self.file_type_label, 15, 0)
grid0.addWidget(self.file_type_radio, 15, 1)
# Page orientation
self.orientation_label = QtWidgets.QLabel('%s:' % _("Page Orientation"))
self.orientation_label.setToolTip(_("Can be:\n"
"- Portrait\n"
"- Landscape"))
self.orientation_radio = RadioSet([{'label': _('Portrait'), 'value': 'p'},
{'label': _('Landscape'), 'value': 'l'},
], stretch=False)
grid0.addWidget(self.orientation_label, 16, 0)
grid0.addWidget(self.orientation_radio, 16, 1)
# Page Size
self.pagesize_label = QtWidgets.QLabel('%s:' % _("Page Size"))
self.pagesize_label.setToolTip(_("A selection of standard ISO 216 page sizes."))
self.pagesize_combo = FCComboBox()
self.pagesize = {}
self.pagesize.update(
{
'Bounds': None,
'A0': (841, 1189),
'A1': (594, 841),
'A2': (420, 594),
'A3': (297, 420),
'A4': (210, 297),
'A5': (148, 210),
'A6': (105, 148),
'A7': (74, 105),
'A8': (52, 74),
'A9': (37, 52),
'A10': (26, 37),
'B0': (1000, 1414),
'B1': (707, 1000),
'B2': (500, 707),
'B3': (353, 500),
'B4': (250, 353),
'B5': (176, 250),
'B6': (125, 176),
'B7': (88, 125),
'B8': (62, 88),
'B9': (44, 62),
'B10': (31, 44),
'C0': (917, 1297),
'C1': (648, 917),
'C2': (458, 648),
'C3': (324, 458),
'C4': (229, 324),
'C5': (162, 229),
'C6': (114, 162),
'C7': (81, 114),
'C8': (57, 81),
'C9': (40, 57),
'C10': (28, 40),
# American paper sizes
'LETTER': (8.5, 11),
'LEGAL': (8.5, 14),
'ELEVENSEVENTEEN': (11, 17),
# From https://en.wikipedia.org/wiki/Paper_size
'JUNIOR_LEGAL': (5, 8),
'HALF_LETTER': (5.5, 8),
'GOV_LETTER': (8, 10.5),
'GOV_LEGAL': (8.5, 13),
'LEDGER': (17, 11),
}
)
page_size_list = list(self.pagesize.keys())
self.pagesize_combo.addItems(page_size_list)
grid0.addWidget(self.pagesize_label, 17, 0)
grid0.addWidget(self.pagesize_combo, 17, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,349 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCEntry, RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsNCCPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "NCC Tool Options", parent=parent)
super(ToolsNCCPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("NCC Tool Options")))
self.decimals = decimals
# ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
"toolpaths to cut all non-copper regions.")
)
self.layout.addWidget(self.clearcopper_label)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
ncctdlabel = QtWidgets.QLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia'))
ncctdlabel.setToolTip(
_("Diameters of the tools, separated by comma.\n"
"The value of the diameter has to use the dot decimals separator.\n"
"Valid values: 0.3, 1.0")
)
grid0.addWidget(ncctdlabel, 0, 0)
self.ncc_tool_dia_entry = FCEntry(border_color='#0069A9')
self.ncc_tool_dia_entry.setPlaceholderText(_("Comma separated values"))
grid0.addWidget(self.ncc_tool_dia_entry, 0, 1)
# Tool Type Radio Button
self.tool_type_label = QtWidgets.QLabel('%s:' % _('Tool Type'))
self.tool_type_label.setToolTip(
_("Default tool type:\n"
"- 'V-shape'\n"
"- Circular")
)
self.tool_type_radio = RadioSet([{'label': _('V-shape'), 'value': 'V'},
{'label': _('Circular'), 'value': 'C1'}])
self.tool_type_radio.setToolTip(
_("Default tool type:\n"
"- 'V-shape'\n"
"- Circular")
)
grid0.addWidget(self.tool_type_label, 1, 0)
grid0.addWidget(self.tool_type_radio, 1, 1)
# Tip Dia
self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia'))
self.tipdialabel.setToolTip(
_("The tip diameter for V-Shape Tool"))
self.tipdia_entry = FCDoubleSpinner()
self.tipdia_entry.set_precision(self.decimals)
self.tipdia_entry.set_range(0, 1000)
self.tipdia_entry.setSingleStep(0.1)
grid0.addWidget(self.tipdialabel, 2, 0)
grid0.addWidget(self.tipdia_entry, 2, 1)
# Tip Angle
self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle'))
self.tipanglelabel.setToolTip(
_("The tip angle for V-Shape Tool.\n"
"In degree."))
self.tipangle_entry = FCDoubleSpinner()
self.tipangle_entry.set_precision(self.decimals)
self.tipangle_entry.set_range(1, 180)
self.tipangle_entry.setSingleStep(5)
self.tipangle_entry.setWrapping(True)
grid0.addWidget(self.tipanglelabel, 3, 0)
grid0.addWidget(self.tipangle_entry, 3, 1)
# Cut Z entry
cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
cutzlabel.setToolTip(
_("Depth of cut into material. Negative value.\n"
"In FlatCAM units.")
)
self.cutz_entry = FCDoubleSpinner()
self.cutz_entry.set_precision(self.decimals)
self.cutz_entry.set_range(-9999.9999, 0.0000)
self.cutz_entry.setSingleStep(0.1)
self.cutz_entry.setToolTip(
_("Depth of cut into material. Negative value.\n"
"In FlatCAM units.")
)
grid0.addWidget(cutzlabel, 4, 0)
grid0.addWidget(self.cutz_entry, 4, 1)
# New Diameter
self.newdialabel = QtWidgets.QLabel('%s:' % _('New Dia'))
self.newdialabel.setToolTip(
_("Diameter for the new tool to add in the Tool Table.\n"
"If the tool is V-shape type then this value is automatically\n"
"calculated from the other parameters.")
)
self.newdia_entry = FCDoubleSpinner()
self.newdia_entry.set_precision(self.decimals)
self.newdia_entry.set_range(0.0001, 9999.9999)
self.newdia_entry.setSingleStep(0.1)
grid0.addWidget(self.newdialabel, 5, 0)
grid0.addWidget(self.newdia_entry, 5, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 6, 0, 1, 2)
# Milling Type Radio Button
self.milling_type_label = QtWidgets.QLabel('%s:' % _('Milling Type'))
self.milling_type_label.setToolTip(
_("Milling type when the selected tool is of type: 'iso_op':\n"
"- climb / best for precision milling and to reduce tool usage\n"
"- conventional / useful when there is no backlash compensation")
)
self.milling_type_radio = RadioSet([{'label': _('Climb'), 'value': 'cl'},
{'label': _('Conventional'), 'value': 'cv'}])
self.milling_type_radio.setToolTip(
_("Milling type when the selected tool is of type: 'iso_op':\n"
"- climb / best for precision milling and to reduce tool usage\n"
"- conventional / useful when there is no backlash compensation")
)
grid0.addWidget(self.milling_type_label, 7, 0)
grid0.addWidget(self.milling_type_radio, 7, 1)
# Tool order Radio Button
self.ncc_order_label = QtWidgets.QLabel('%s:' % _('Tool order'))
self.ncc_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control."))
self.ncc_order_radio = RadioSet([{'label': _('No'), 'value': 'no'},
{'label': _('Forward'), 'value': 'fwd'},
{'label': _('Reverse'), 'value': 'rev'}])
self.ncc_order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control."))
grid0.addWidget(self.ncc_order_label, 8, 0)
grid0.addWidget(self.ncc_order_radio, 8, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 9, 0, 1, 2)
# Overlap Entry
nccoverlabel = QtWidgets.QLabel('%s:' % _('Overlap'))
nccoverlabel.setToolTip(
_("How much (percentage) of the tool width to overlap each tool pass.\n"
"Adjust the value starting with lower values\n"
"and increasing it if areas that should be cleared are still \n"
"not cleared.\n"
"Lower values = faster processing, faster execution on CNC.\n"
"Higher values = slow processing and slow execution on CNC\n"
"due of too many paths.")
)
self.ncc_overlap_entry = FCDoubleSpinner(suffix='%')
self.ncc_overlap_entry.set_precision(self.decimals)
self.ncc_overlap_entry.setWrapping(True)
self.ncc_overlap_entry.setRange(0.0000, 99.9999)
self.ncc_overlap_entry.setSingleStep(0.1)
grid0.addWidget(nccoverlabel, 10, 0)
grid0.addWidget(self.ncc_overlap_entry, 10, 1)
# Margin entry
nccmarginlabel = QtWidgets.QLabel('%s:' % _('Margin'))
nccmarginlabel.setToolTip(
_("Bounding box margin.")
)
self.ncc_margin_entry = FCDoubleSpinner()
self.ncc_margin_entry.set_precision(self.decimals)
self.ncc_margin_entry.set_range(-10000, 10000)
self.ncc_margin_entry.setSingleStep(0.1)
grid0.addWidget(nccmarginlabel, 11, 0)
grid0.addWidget(self.ncc_margin_entry, 11, 1)
# Method
methodlabel = QtWidgets.QLabel('%s:' % _('Method'))
methodlabel.setToolTip(
_("Algorithm for copper clearing:\n"
"- Standard: Fixed step inwards.\n"
"- Seed-based: Outwards from seed.\n"
"- Line-based: Parallel lines.")
)
# self.ncc_method_radio = RadioSet([
# {"label": _("Standard"), "value": "standard"},
# {"label": _("Seed-based"), "value": "seed"},
# {"label": _("Straight lines"), "value": "lines"}
# ], orientation='vertical', stretch=False)
self.ncc_method_combo = FCComboBox()
self.ncc_method_combo.addItems(
[_("Standard"), _("Seed"), _("Lines"), _("Combo")]
)
grid0.addWidget(methodlabel, 12, 0)
grid0.addWidget(self.ncc_method_combo, 12, 1)
# Connect lines
self.ncc_connect_cb = FCCheckBox('%s' % _("Connect"))
self.ncc_connect_cb.setToolTip(
_("Draw lines between resulting\n"
"segments to minimize tool lifts.")
)
grid0.addWidget(self.ncc_connect_cb, 13, 0)
# Contour Checkbox
self.ncc_contour_cb = FCCheckBox('%s' % _("Contour"))
self.ncc_contour_cb.setToolTip(
_("Cut around the perimeter of the polygon\n"
"to trim rough edges.")
)
grid0.addWidget(self.ncc_contour_cb, 13, 1)
# ## NCC Offset choice
self.ncc_choice_offset_cb = FCCheckBox('%s' % _("Offset"))
self.ncc_choice_offset_cb.setToolTip(
_("If used, it will add an offset to the copper features.\n"
"The copper clearing will finish to a distance\n"
"from the copper features.\n"
"The value can be between 0 and 10 FlatCAM units.")
)
grid0.addWidget(self.ncc_choice_offset_cb, 14, 0, 1, 2)
# ## NCC Offset value
self.ncc_offset_label = QtWidgets.QLabel('%s:' % _("Offset value"))
self.ncc_offset_label.setToolTip(
_("If used, it will add an offset to the copper features.\n"
"The copper clearing will finish to a distance\n"
"from the copper features.\n"
"The value can be between 0.0 and 9999.9 FlatCAM units.")
)
self.ncc_offset_spinner = FCDoubleSpinner()
self.ncc_offset_spinner.set_range(0.00, 9999.9999)
self.ncc_offset_spinner.set_precision(self.decimals)
self.ncc_offset_spinner.setWrapping(True)
self.ncc_offset_spinner.setSingleStep(0.1)
grid0.addWidget(self.ncc_offset_label, 15, 0)
grid0.addWidget(self.ncc_offset_spinner, 15, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 16, 0, 1, 2)
# Rest machining CheckBox
self.ncc_rest_cb = FCCheckBox('%s' % _("Rest Machining"))
self.ncc_rest_cb.setToolTip(
_("If checked, use 'rest machining'.\n"
"Basically it will clear copper outside PCB features,\n"
"using the biggest tool and continue with the next tools,\n"
"from bigger to smaller, to clear areas of copper that\n"
"could not be cleared by previous tool, until there is\n"
"no more copper to clear or there are no more tools.\n"
"If not checked, use the standard algorithm.")
)
grid0.addWidget(self.ncc_rest_cb, 17, 0, 1, 2)
# ## Reference
# self.reference_radio = RadioSet([{'label': _('Itself'), 'value': 'itself'},
# {"label": _("Area Selection"), "value": "area"},
# {'label': _('Reference Object'), 'value': 'box'}],
# orientation='vertical',
# stretch=None)
self.select_combo = FCComboBox()
self.select_combo.addItems(
[_("Itself"), _("Area Selection"), _("Reference Object")]
)
select_label = QtWidgets.QLabel('%s:' % _("Selection"))
select_label.setToolTip(
_("Selection of area to be processed.\n"
"- 'Itself' - the processing extent is based on the object that is processed.\n "
"- 'Area Selection' - left mouse click to start selection of the area to be processed.\n"
"- 'Reference Object' - will process the area specified by another object.")
)
grid0.addWidget(select_label, 18, 0)
grid0.addWidget(self.select_combo, 18, 1)
self.area_shape_label = QtWidgets.QLabel('%s:' % _("Shape"))
self.area_shape_label.setToolTip(
_("The kind of selection shape used for area selection.")
)
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}])
grid0.addWidget(self.area_shape_label, 19, 0)
grid0.addWidget(self.area_shape_radio, 19, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 20, 0, 1, 2)
# ## Plotting type
self.ncc_plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'},
{"label": _("Progressive"), "value": "progressive"}])
plotting_label = QtWidgets.QLabel('%s:' % _("NCC Plotting"))
plotting_label.setToolTip(
_("- 'Normal' - normal plotting, done at the end of the NCC job\n"
"- 'Progressive' - after each shape is generated it will be plotted.")
)
grid0.addWidget(plotting_label, 21, 0)
grid0.addWidget(self.ncc_plotting_radio, 21, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,313 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCEntry, RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsPaintPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Paint Area Tool Options", parent=parent)
super(ToolsPaintPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Paint Tool Options")))
self.decimals = decimals
# ------------------------------
# ## Paint area
# ------------------------------
self.paint_label = QtWidgets.QLabel(_('<b>Parameters:</b>'))
self.paint_label.setToolTip(
_("Creates tool paths to cover the\n"
"whole area of a polygon (remove\n"
"all copper). You will be asked\n"
"to click on the desired polygon.")
)
self.layout.addWidget(self.paint_label)
grid0 = QtWidgets.QGridLayout()
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.layout.addLayout(grid0)
# Tool dia
ptdlabel = QtWidgets.QLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia'))
ptdlabel.setToolTip(
_("Diameters of the tools, separated by comma.\n"
"The value of the diameter has to use the dot decimals separator.\n"
"Valid values: 0.3, 1.0")
)
grid0.addWidget(ptdlabel, 0, 0)
self.painttooldia_entry = FCEntry(border_color='#0069A9')
self.painttooldia_entry.setPlaceholderText(_("Comma separated values"))
grid0.addWidget(self.painttooldia_entry, 0, 1)
# Tool Type Radio Button
self.tool_type_label = QtWidgets.QLabel('%s:' % _('Tool Type'))
self.tool_type_label.setToolTip(
_("Default tool type:\n"
"- 'V-shape'\n"
"- Circular")
)
self.tool_type_radio = RadioSet([{'label': _('V-shape'), 'value': 'V'},
{'label': _('Circular'), 'value': 'C1'}])
self.tool_type_radio.setObjectName(_("Tool Type"))
grid0.addWidget(self.tool_type_label, 1, 0)
grid0.addWidget(self.tool_type_radio, 1, 1)
# Tip Dia
self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia'))
self.tipdialabel.setToolTip(
_("The tip diameter for V-Shape Tool"))
self.tipdia_entry = FCDoubleSpinner()
self.tipdia_entry.set_precision(self.decimals)
self.tipdia_entry.set_range(0.0000, 9999.9999)
self.tipdia_entry.setSingleStep(0.1)
self.tipdia_entry.setObjectName(_("V-Tip Dia"))
grid0.addWidget(self.tipdialabel, 2, 0)
grid0.addWidget(self.tipdia_entry, 2, 1)
# Tip Angle
self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle'))
self.tipanglelabel.setToolTip(
_("The tip angle for V-Shape Tool.\n"
"In degree."))
self.tipangle_entry = FCDoubleSpinner()
self.tipangle_entry.set_precision(self.decimals)
self.tipangle_entry.set_range(1.0000, 180.0000)
self.tipangle_entry.setSingleStep(5)
self.tipangle_entry.setObjectName(_("V-Tip Angle"))
grid0.addWidget(self.tipanglelabel, 3, 0)
grid0.addWidget(self.tipangle_entry, 3, 1)
# Cut Z entry
cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
cutzlabel.setToolTip(
_("Depth of cut into material. Negative value.\n"
"In FlatCAM units.")
)
self.cutz_entry = FCDoubleSpinner()
self.cutz_entry.set_precision(self.decimals)
self.cutz_entry.set_range(-99999.9999, 0.0000)
self.cutz_entry.setObjectName(_("Cut Z"))
self.cutz_entry.setToolTip(
_("Depth of cut into material. Negative value.\n"
"In FlatCAM units.")
)
grid0.addWidget(cutzlabel, 4, 0)
grid0.addWidget(self.cutz_entry, 4, 1)
# ### Tool Diameter ####
self.newdialabel = QtWidgets.QLabel('%s:' % _('New Dia'))
self.newdialabel.setToolTip(
_("Diameter for the new tool to add in the Tool Table.\n"
"If the tool is V-shape type then this value is automatically\n"
"calculated from the other parameters.")
)
self.newdia_entry = FCDoubleSpinner()
self.newdia_entry.set_precision(self.decimals)
self.newdia_entry.set_range(0.000, 9999.9999)
self.newdia_entry.setObjectName(_("Tool Dia"))
grid0.addWidget(self.newdialabel, 5, 0)
grid0.addWidget(self.newdia_entry, 5, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 6, 0, 1, 2)
self.paint_order_label = QtWidgets.QLabel('%s:' % _('Tool order'))
self.paint_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control."))
self.paint_order_radio = RadioSet([{'label': _('No'), 'value': 'no'},
{'label': _('Forward'), 'value': 'fwd'},
{'label': _('Reverse'), 'value': 'rev'}])
grid0.addWidget(self.paint_order_label, 7, 0)
grid0.addWidget(self.paint_order_radio, 7, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 8, 0, 1, 2)
# Overlap
ovlabel = QtWidgets.QLabel('%s:' % _('Overlap'))
ovlabel.setToolTip(
_("How much (percentage) of the tool width to overlap each tool pass.\n"
"Adjust the value starting with lower values\n"
"and increasing it if areas that should be painted are still \n"
"not painted.\n"
"Lower values = faster processing, faster execution on CNC.\n"
"Higher values = slow processing and slow execution on CNC\n"
"due of too many paths.")
)
self.paintoverlap_entry = FCDoubleSpinner(suffix='%')
self.paintoverlap_entry.set_precision(self.decimals)
self.paintoverlap_entry.setWrapping(True)
self.paintoverlap_entry.setRange(0.0000, 99.9999)
self.paintoverlap_entry.setSingleStep(0.1)
grid0.addWidget(ovlabel, 9, 0)
grid0.addWidget(self.paintoverlap_entry, 9, 1)
# Margin
marginlabel = QtWidgets.QLabel('%s:' % _('Margin'))
marginlabel.setToolTip(
_("Distance by which to avoid\n"
"the edges of the polygon to\n"
"be painted.")
)
self.paintmargin_entry = FCDoubleSpinner()
self.paintmargin_entry.set_range(-9999.9999, 9999.9999)
self.paintmargin_entry.set_precision(self.decimals)
self.paintmargin_entry.setSingleStep(0.1)
grid0.addWidget(marginlabel, 10, 0)
grid0.addWidget(self.paintmargin_entry, 10, 1)
# Method
methodlabel = QtWidgets.QLabel('%s:' % _('Method'))
methodlabel.setToolTip(
_("Algorithm for painting:\n"
"- Standard: Fixed step inwards.\n"
"- Seed-based: Outwards from seed.\n"
"- Line-based: Parallel lines.\n"
"- Laser-lines: Active only for Gerber objects.\n"
"Will create lines that follow the traces.\n"
"- Combo: In case of failure a new method will be picked from the above\n"
"in the order specified.")
)
# self.paintmethod_combo = RadioSet([
# {"label": _("Standard"), "value": "standard"},
# {"label": _("Seed-based"), "value": "seed"},
# {"label": _("Straight lines"), "value": "lines"}
# ], orientation='vertical', stretch=False)
self.paintmethod_combo = FCComboBox()
self.paintmethod_combo.addItems(
[_("Standard"), _("Seed"), _("Lines"), _("Laser_lines"), _("Combo")]
)
grid0.addWidget(methodlabel, 11, 0)
grid0.addWidget(self.paintmethod_combo, 11, 1)
# Connect lines
self.pathconnect_cb = FCCheckBox('%s' % _("Connect"))
self.pathconnect_cb.setToolTip(
_("Draw lines between resulting\n"
"segments to minimize tool lifts.")
)
grid0.addWidget(self.pathconnect_cb, 12, 0)
# Paint contour
self.contour_cb = FCCheckBox('%s' % _("Contour"))
self.contour_cb.setToolTip(
_("Cut around the perimeter of the polygon\n"
"to trim rough edges.")
)
grid0.addWidget(self.contour_cb, 12, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 13, 0, 1, 2)
self.rest_cb = FCCheckBox('%s' % _("Rest Machining"))
self.rest_cb.setObjectName(_("Rest Machining"))
self.rest_cb.setToolTip(
_("If checked, use 'rest machining'.\n"
"Basically it will clear copper outside PCB features,\n"
"using the biggest tool and continue with the next tools,\n"
"from bigger to smaller, to clear areas of copper that\n"
"could not be cleared by previous tool, until there is\n"
"no more copper to clear or there are no more tools.\n\n"
"If not checked, use the standard algorithm.")
)
grid0.addWidget(self.rest_cb, 14, 0, 1, 2)
# Polygon selection
selectlabel = QtWidgets.QLabel('%s:' % _('Selection'))
selectlabel.setToolTip(
_("Selection of area to be processed.\n"
"- 'Polygon Selection' - left mouse click to add/remove polygons to be processed.\n"
"- 'Area Selection' - left mouse click to start selection of the area to be processed.\n"
"Keeping a modifier key pressed (CTRL or SHIFT) will allow to add multiple areas.\n"
"- 'All Polygons' - the process will start after click.\n"
"- 'Reference Object' - will process the area specified by another object.")
)
# self.selectmethod_combo = RadioSet(
# [
# {"label": _("Polygon Selection"), "value": "single"},
# {"label": _("Area Selection"), "value": "area"},
# {"label": _("All Polygons"), "value": "all"},
# {"label": _("Reference Object"), "value": "ref"}
# ],
# orientation='vertical',
# stretch=None
# )
self.selectmethod_combo = FCComboBox()
self.selectmethod_combo.addItems(
[_("Polygon Selection"), _("Area Selection"), _("All Polygons"), _("Reference Object")]
)
grid0.addWidget(selectlabel, 15, 0)
grid0.addWidget(self.selectmethod_combo, 15, 1)
self.area_shape_label = QtWidgets.QLabel('%s:' % _("Shape"))
self.area_shape_label.setToolTip(
_("The kind of selection shape used for area selection.")
)
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}])
grid0.addWidget(self.area_shape_label, 18, 0)
grid0.addWidget(self.area_shape_radio, 18, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 19, 0, 1, 2)
# ## Plotting type
self.paint_plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'},
{"label": _("Progressive"), "value": "progressive"}])
plotting_label = QtWidgets.QLabel('%s:' % _("Paint Plotting"))
plotting_label.setToolTip(
_("- 'Normal' - normal plotting, done at the end of the Paint job\n"
"- 'Progressive' - after each shape is generated it will be plotted.")
)
grid0.addWidget(plotting_label, 20, 0)
grid0.addWidget(self.paint_plotting_radio, 20, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,146 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsPanelizePrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Cutout Tool Options", parent=parent)
super(ToolsPanelizePrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Panelize Tool Options")))
self.decimals = decimals
# ## Board cuttout
self.panelize_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.panelize_label.setToolTip(
_("Create an object that contains an array of (x, y) elements,\n"
"each element is a copy of the source object spaced\n"
"at a X distance, Y distance of each other.")
)
self.layout.addWidget(self.panelize_label)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
# ## Spacing Columns
self.pspacing_columns = FCDoubleSpinner()
self.pspacing_columns.set_range(0.000001, 9999.9999)
self.pspacing_columns.set_precision(self.decimals)
self.pspacing_columns.setSingleStep(0.1)
self.spacing_columns_label = QtWidgets.QLabel('%s:' % _("Spacing cols"))
self.spacing_columns_label.setToolTip(
_("Spacing between columns of the desired panel.\n"
"In current units.")
)
grid0.addWidget(self.spacing_columns_label, 0, 0)
grid0.addWidget(self.pspacing_columns, 0, 1)
# ## Spacing Rows
self.pspacing_rows = FCDoubleSpinner()
self.pspacing_rows.set_range(0.000001, 9999.9999)
self.pspacing_rows.set_precision(self.decimals)
self.pspacing_rows.setSingleStep(0.1)
self.spacing_rows_label = QtWidgets.QLabel('%s:' % _("Spacing rows"))
self.spacing_rows_label.setToolTip(
_("Spacing between rows of the desired panel.\n"
"In current units.")
)
grid0.addWidget(self.spacing_rows_label, 1, 0)
grid0.addWidget(self.pspacing_rows, 1, 1)
# ## Columns
self.pcolumns = FCSpinner()
self.pcolumns.set_range(1, 1000)
self.pcolumns.set_step(1)
self.columns_label = QtWidgets.QLabel('%s:' % _("Columns"))
self.columns_label.setToolTip(
_("Number of columns of the desired panel")
)
grid0.addWidget(self.columns_label, 2, 0)
grid0.addWidget(self.pcolumns, 2, 1)
# ## Rows
self.prows = FCSpinner()
self.prows.set_range(1, 1000)
self.prows.set_step(1)
self.rows_label = QtWidgets.QLabel('%s:' % _("Rows"))
self.rows_label.setToolTip(
_("Number of rows of the desired panel")
)
grid0.addWidget(self.rows_label, 3, 0)
grid0.addWidget(self.prows, 3, 1)
# ## Type of resulting Panel object
self.panel_type_radio = RadioSet([{'label': _('Gerber'), 'value': 'gerber'},
{'label': _('Geo'), 'value': 'geometry'}])
self.panel_type_label = QtWidgets.QLabel('%s:' % _("Panel Type"))
self.panel_type_label.setToolTip(
_("Choose the type of object for the panel object:\n"
"- Gerber\n"
"- Geometry")
)
grid0.addWidget(self.panel_type_label, 4, 0)
grid0.addWidget(self.panel_type_radio, 4, 1)
# ## Constrains
self.pconstrain_cb = FCCheckBox('%s:' % _("Constrain within"))
self.pconstrain_cb.setToolTip(
_("Area define by DX and DY within to constrain the panel.\n"
"DX and DY values are in current units.\n"
"Regardless of how many columns and rows are desired,\n"
"the final panel will have as many columns and rows as\n"
"they fit completely within selected area.")
)
grid0.addWidget(self.pconstrain_cb, 5, 0, 1, 2)
self.px_width_entry = FCDoubleSpinner()
self.px_width_entry.set_range(0.000001, 9999.9999)
self.px_width_entry.set_precision(self.decimals)
self.px_width_entry.setSingleStep(0.1)
self.x_width_lbl = QtWidgets.QLabel('%s:' % _("Width (DX)"))
self.x_width_lbl.setToolTip(
_("The width (DX) within which the panel must fit.\n"
"In current units.")
)
grid0.addWidget(self.x_width_lbl, 6, 0)
grid0.addWidget(self.px_width_entry, 6, 1)
self.py_height_entry = FCDoubleSpinner()
self.py_height_entry.set_range(0.000001, 9999.9999)
self.py_height_entry.set_precision(self.decimals)
self.py_height_entry.setSingleStep(0.1)
self.y_height_lbl = QtWidgets.QLabel('%s:' % _("Height (DY)"))
self.y_height_lbl.setToolTip(
_("The height (DY)within which the panel must fit.\n"
"In current units.")
)
grid0.addWidget(self.y_height_lbl, 7, 0)
grid0.addWidget(self.py_height_entry, 7, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,99 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.preferences.tools.ToolsSubPrefGroupUI import ToolsSubPrefGroupUI
from AppGUI.preferences.tools.ToolsSolderpastePrefGroupUI import ToolsSolderpastePrefGroupUI
from AppGUI.preferences.tools.ToolsCornersPrefGroupUI import ToolsCornersPrefGroupUI
from AppGUI.preferences.tools.ToolsTransformPrefGroupUI import ToolsTransformPrefGroupUI
from AppGUI.preferences.tools.ToolsCalculatorsPrefGroupUI import ToolsCalculatorsPrefGroupUI
from AppGUI.preferences.tools.ToolsPanelizePrefGroupUI import ToolsPanelizePrefGroupUI
from AppGUI.preferences.tools.ToolsFilmPrefGroupUI import ToolsFilmPrefGroupUI
from AppGUI.preferences.tools.ToolsPaintPrefGroupUI import ToolsPaintPrefGroupUI
from AppGUI.preferences.tools.Tools2sidedPrefGroupUI import Tools2sidedPrefGroupUI
from AppGUI.preferences.tools.ToolsCutoutPrefGroupUI import ToolsCutoutPrefGroupUI
from AppGUI.preferences.tools.ToolsNCCPrefGroupUI import ToolsNCCPrefGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsPreferencesUI(QtWidgets.QWidget):
def __init__(self, decimals, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
self.setLayout(self.layout)
self.decimals = decimals
self.tools_ncc_group = ToolsNCCPrefGroupUI(decimals=self.decimals)
self.tools_ncc_group.setMinimumWidth(220)
self.tools_paint_group = ToolsPaintPrefGroupUI(decimals=self.decimals)
self.tools_paint_group.setMinimumWidth(220)
self.tools_cutout_group = ToolsCutoutPrefGroupUI(decimals=self.decimals)
self.tools_cutout_group.setMinimumWidth(220)
self.tools_2sided_group = Tools2sidedPrefGroupUI(decimals=self.decimals)
self.tools_2sided_group.setMinimumWidth(220)
self.tools_film_group = ToolsFilmPrefGroupUI(decimals=self.decimals)
self.tools_film_group.setMinimumWidth(220)
self.tools_panelize_group = ToolsPanelizePrefGroupUI(decimals=self.decimals)
self.tools_panelize_group.setMinimumWidth(220)
self.tools_calculators_group = ToolsCalculatorsPrefGroupUI(decimals=self.decimals)
self.tools_calculators_group.setMinimumWidth(220)
self.tools_transform_group = ToolsTransformPrefGroupUI(decimals=self.decimals)
self.tools_transform_group.setMinimumWidth(200)
self.tools_solderpaste_group = ToolsSolderpastePrefGroupUI(decimals=self.decimals)
self.tools_solderpaste_group.setMinimumWidth(200)
self.tools_corners_group = ToolsCornersPrefGroupUI(decimals=self.decimals)
self.tools_corners_group.setMinimumWidth(200)
self.tools_sub_group = ToolsSubPrefGroupUI(decimals=self.decimals)
self.tools_sub_group.setMinimumWidth(200)
self.vlay = QtWidgets.QVBoxLayout()
self.vlay.addWidget(self.tools_ncc_group)
self.vlay.addWidget(self.tools_cutout_group)
self.vlay1 = QtWidgets.QVBoxLayout()
self.vlay1.addWidget(self.tools_paint_group)
self.vlay1.addWidget(self.tools_panelize_group)
self.vlay2 = QtWidgets.QVBoxLayout()
self.vlay2.addWidget(self.tools_transform_group)
self.vlay2.addWidget(self.tools_2sided_group)
self.vlay2.addWidget(self.tools_sub_group)
self.vlay3 = QtWidgets.QVBoxLayout()
self.vlay3.addWidget(self.tools_film_group)
self.vlay3.addWidget(self.tools_calculators_group)
self.vlay4 = QtWidgets.QVBoxLayout()
self.vlay4.addWidget(self.tools_solderpaste_group)
self.vlay4.addWidget(self.tools_corners_group)
self.layout.addLayout(self.vlay)
self.layout.addLayout(self.vlay1)
self.layout.addLayout(self.vlay2)
self.layout.addLayout(self.vlay3)
self.layout.addLayout(self.vlay4)
self.layout.addStretch()

View File

@@ -0,0 +1,246 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCEntry, FCDoubleSpinner, FCSpinner, FCComboBox
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsSolderpastePrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(ToolsSolderpastePrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("SolderPaste Tool Options")))
self.decimals = decimals
# ## Solder Paste Dispensing
self.solderpastelabel = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.solderpastelabel.setToolTip(
_("A tool to create GCode for dispensing\n"
"solder paste onto a PCB.")
)
self.layout.addWidget(self.solderpastelabel)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
# Nozzle Tool Diameters
nozzletdlabel = QtWidgets.QLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia'))
nozzletdlabel.setToolTip(
_("Diameters of the tools, separated by comma.\n"
"The value of the diameter has to use the dot decimals separator.\n"
"Valid values: 0.3, 1.0")
)
self.nozzle_tool_dia_entry = FCEntry()
grid0.addWidget(nozzletdlabel, 0, 0)
grid0.addWidget(self.nozzle_tool_dia_entry, 0, 1)
# New Nozzle Tool Dia
self.addtool_entry_lbl = QtWidgets.QLabel('<b>%s:</b>' % _('New Nozzle Dia'))
self.addtool_entry_lbl.setToolTip(
_("Diameter for the new Nozzle tool to add in the Tool Table")
)
self.addtool_entry = FCDoubleSpinner()
self.addtool_entry.set_precision(self.decimals)
self.addtool_entry.set_range(0.0000001, 9999.9999)
self.addtool_entry.setSingleStep(0.1)
grid0.addWidget(self.addtool_entry_lbl, 1, 0)
grid0.addWidget(self.addtool_entry, 1, 1)
# Z dispense start
self.z_start_entry = FCDoubleSpinner()
self.z_start_entry.set_precision(self.decimals)
self.z_start_entry.set_range(0.0000001, 9999.9999)
self.z_start_entry.setSingleStep(0.1)
self.z_start_label = QtWidgets.QLabel('%s:' % _("Z Dispense Start"))
self.z_start_label.setToolTip(
_("The height (Z) when solder paste dispensing starts.")
)
grid0.addWidget(self.z_start_label, 2, 0)
grid0.addWidget(self.z_start_entry, 2, 1)
# Z dispense
self.z_dispense_entry = FCDoubleSpinner()
self.z_dispense_entry.set_precision(self.decimals)
self.z_dispense_entry.set_range(0.0000001, 9999.9999)
self.z_dispense_entry.setSingleStep(0.1)
self.z_dispense_label = QtWidgets.QLabel('%s:' % _("Z Dispense"))
self.z_dispense_label.setToolTip(
_("The height (Z) when doing solder paste dispensing.")
)
grid0.addWidget(self.z_dispense_label, 3, 0)
grid0.addWidget(self.z_dispense_entry, 3, 1)
# Z dispense stop
self.z_stop_entry = FCDoubleSpinner()
self.z_stop_entry.set_precision(self.decimals)
self.z_stop_entry.set_range(0.0000001, 9999.9999)
self.z_stop_entry.setSingleStep(0.1)
self.z_stop_label = QtWidgets.QLabel('%s:' % _("Z Dispense Stop"))
self.z_stop_label.setToolTip(
_("The height (Z) when solder paste dispensing stops.")
)
grid0.addWidget(self.z_stop_label, 4, 0)
grid0.addWidget(self.z_stop_entry, 4, 1)
# Z travel
self.z_travel_entry = FCDoubleSpinner()
self.z_travel_entry.set_precision(self.decimals)
self.z_travel_entry.set_range(0.0000001, 9999.9999)
self.z_travel_entry.setSingleStep(0.1)
self.z_travel_label = QtWidgets.QLabel('%s:' % _("Z Travel"))
self.z_travel_label.setToolTip(
_("The height (Z) for travel between pads\n"
"(without dispensing solder paste).")
)
grid0.addWidget(self.z_travel_label, 5, 0)
grid0.addWidget(self.z_travel_entry, 5, 1)
# Z toolchange location
self.z_toolchange_entry = FCDoubleSpinner()
self.z_toolchange_entry.set_precision(self.decimals)
self.z_toolchange_entry.set_range(0.0000001, 9999.9999)
self.z_toolchange_entry.setSingleStep(0.1)
self.z_toolchange_label = QtWidgets.QLabel('%s:' % _("Z Toolchange"))
self.z_toolchange_label.setToolTip(
_("The height (Z) for tool (nozzle) change.")
)
grid0.addWidget(self.z_toolchange_label, 6, 0)
grid0.addWidget(self.z_toolchange_entry, 6, 1)
# X,Y Toolchange location
self.xy_toolchange_entry = FCEntry()
self.xy_toolchange_label = QtWidgets.QLabel('%s:' % _("Toolchange X-Y"))
self.xy_toolchange_label.setToolTip(
_("The X,Y location for tool (nozzle) change.\n"
"The format is (x, y) where x and y are real numbers.")
)
grid0.addWidget(self.xy_toolchange_label, 7, 0)
grid0.addWidget(self.xy_toolchange_entry, 7, 1)
# Feedrate X-Y
self.frxy_entry = FCDoubleSpinner()
self.frxy_entry.set_precision(self.decimals)
self.frxy_entry.set_range(0.0000001, 99999.9999)
self.frxy_entry.setSingleStep(0.1)
self.frxy_label = QtWidgets.QLabel('%s:' % _("Feedrate X-Y"))
self.frxy_label.setToolTip(
_("Feedrate (speed) while moving on the X-Y plane.")
)
grid0.addWidget(self.frxy_label, 8, 0)
grid0.addWidget(self.frxy_entry, 8, 1)
# Feedrate Z
self.frz_entry = FCDoubleSpinner()
self.frz_entry.set_precision(self.decimals)
self.frz_entry.set_range(0.0000001, 99999.9999)
self.frz_entry.setSingleStep(0.1)
self.frz_label = QtWidgets.QLabel('%s:' % _("Feedrate Z"))
self.frz_label.setToolTip(
_("Feedrate (speed) while moving vertically\n"
"(on Z plane).")
)
grid0.addWidget(self.frz_label, 9, 0)
grid0.addWidget(self.frz_entry, 9, 1)
# Feedrate Z Dispense
self.frz_dispense_entry = FCDoubleSpinner()
self.frz_dispense_entry.set_precision(self.decimals)
self.frz_dispense_entry.set_range(0.0000001, 99999.9999)
self.frz_dispense_entry.setSingleStep(0.1)
self.frz_dispense_label = QtWidgets.QLabel('%s:' % _("Feedrate Z Dispense"))
self.frz_dispense_label.setToolTip(
_("Feedrate (speed) while moving up vertically\n"
"to Dispense position (on Z plane).")
)
grid0.addWidget(self.frz_dispense_label, 10, 0)
grid0.addWidget(self.frz_dispense_entry, 10, 1)
# Spindle Speed Forward
self.speedfwd_entry = FCSpinner()
self.speedfwd_entry.set_range(0, 99999)
self.speedfwd_entry.set_step(1000)
self.speedfwd_label = QtWidgets.QLabel('%s:' % _("Spindle Speed FWD"))
self.speedfwd_label.setToolTip(
_("The dispenser speed while pushing solder paste\n"
"through the dispenser nozzle.")
)
grid0.addWidget(self.speedfwd_label, 11, 0)
grid0.addWidget(self.speedfwd_entry, 11, 1)
# Dwell Forward
self.dwellfwd_entry = FCDoubleSpinner()
self.dwellfwd_entry.set_precision(self.decimals)
self.dwellfwd_entry.set_range(0.0000001, 9999.9999)
self.dwellfwd_entry.setSingleStep(0.1)
self.dwellfwd_label = QtWidgets.QLabel('%s:' % _("Dwell FWD"))
self.dwellfwd_label.setToolTip(
_("Pause after solder dispensing.")
)
grid0.addWidget(self.dwellfwd_label, 12, 0)
grid0.addWidget(self.dwellfwd_entry, 12, 1)
# Spindle Speed Reverse
self.speedrev_entry = FCSpinner()
self.speedrev_entry.set_range(0, 999999)
self.speedrev_entry.set_step(1000)
self.speedrev_label = QtWidgets.QLabel('%s:' % _("Spindle Speed REV"))
self.speedrev_label.setToolTip(
_("The dispenser speed while retracting solder paste\n"
"through the dispenser nozzle.")
)
grid0.addWidget(self.speedrev_label, 13, 0)
grid0.addWidget(self.speedrev_entry, 13, 1)
# Dwell Reverse
self.dwellrev_entry = FCDoubleSpinner()
self.dwellrev_entry.set_precision(self.decimals)
self.dwellrev_entry.set_range(0.0000001, 9999.9999)
self.dwellrev_entry.setSingleStep(0.1)
self.dwellrev_label = QtWidgets.QLabel('%s:' % _("Dwell REV"))
self.dwellrev_label.setToolTip(
_("Pause after solder paste dispenser retracted,\n"
"to allow pressure equilibrium.")
)
grid0.addWidget(self.dwellrev_label, 14, 0)
grid0.addWidget(self.dwellrev_entry, 14, 1)
# Preprocessors
pp_label = QtWidgets.QLabel('%s:' % _('Preprocessor'))
pp_label.setToolTip(
_("Files that control the GCode generation.")
)
self.pp_combo = FCComboBox()
grid0.addWidget(pp_label, 15, 0)
grid0.addWidget(self.pp_combo, 15, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,42 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCCheckBox
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsSubPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(ToolsSubPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Substractor Tool Options")))
self.decimals = decimals
# ## Subtractor Tool Parameters
self.sublabel = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.sublabel.setToolTip(
_("A tool to substract one Gerber or Geometry object\n"
"from another of the same type.")
)
self.layout.addWidget(self.sublabel)
self.close_paths_cb = FCCheckBox(_("Close paths"))
self.close_paths_cb.setToolTip(_("Checking this will close the paths cut by the Geometry substractor object."))
self.layout.addWidget(self.close_paths_cb)
self.layout.addStretch()

View File

@@ -0,0 +1,249 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCEntry
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class ToolsTransformPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
super(ToolsTransformPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Transform Tool Options")))
self.decimals = decimals
# ## Transformations
self.transform_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.transform_label.setToolTip(
_("Various transformations that can be applied\n"
"on a FlatCAM object.")
)
self.layout.addWidget(self.transform_label)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
# ## Rotate Angle
rotate_title_lbl = QtWidgets.QLabel('<b>%s</b>' % _("Rotate"))
grid0.addWidget(rotate_title_lbl, 0, 0, 1, 2)
self.rotate_entry = FCDoubleSpinner()
self.rotate_entry.set_range(-360.0, 360.0)
self.rotate_entry.set_precision(self.decimals)
self.rotate_entry.setSingleStep(15)
self.rotate_label = QtWidgets.QLabel('%s:' % _("Angle"))
self.rotate_label.setToolTip(
_("Angle for Rotation action, in degrees.\n"
"Float number between -360 and 359.\n"
"Positive numbers for CW motion.\n"
"Negative numbers for CCW motion.")
)
grid0.addWidget(self.rotate_label, 1, 0)
grid0.addWidget(self.rotate_entry, 1, 1)
# ## Skew/Shear Angle on X axis
skew_title_lbl = QtWidgets.QLabel('<b>%s</b>' % _("Skew"))
grid0.addWidget(skew_title_lbl, 2, 0, 1, 2)
self.skewx_entry = FCDoubleSpinner()
self.skewx_entry.set_range(-360.0, 360.0)
self.skewx_entry.set_precision(self.decimals)
self.skewx_entry.setSingleStep(0.1)
self.skewx_label = QtWidgets.QLabel('%s:' % _("X angle"))
self.skewx_label.setToolTip(
_("Angle for Skew action, in degrees.\n"
"Float number between -360 and 359.")
)
grid0.addWidget(self.skewx_label, 3, 0)
grid0.addWidget(self.skewx_entry, 3, 1)
# ## Skew/Shear Angle on Y axis
self.skewy_entry = FCDoubleSpinner()
self.skewy_entry.set_range(-360.0, 360.0)
self.skewy_entry.set_precision(self.decimals)
self.skewy_entry.setSingleStep(0.1)
self.skewy_label = QtWidgets.QLabel('%s:' % _("Y angle"))
self.skewy_label.setToolTip(
_("Angle for Skew action, in degrees.\n"
"Float number between -360 and 359.")
)
grid0.addWidget(self.skewy_label, 4, 0)
grid0.addWidget(self.skewy_entry, 4, 1)
# ## Scale
scale_title_lbl = QtWidgets.QLabel('<b>%s</b>' % _("Scale"))
grid0.addWidget(scale_title_lbl, 5, 0, 1, 2)
self.scalex_entry = FCDoubleSpinner()
self.scalex_entry.set_range(0, 9999.9999)
self.scalex_entry.set_precision(self.decimals)
self.scalex_entry.setSingleStep(0.1)
self.scalex_label = QtWidgets.QLabel('%s:' % _("X factor"))
self.scalex_label.setToolTip(
_("Factor for scaling on X axis.")
)
grid0.addWidget(self.scalex_label, 6, 0)
grid0.addWidget(self.scalex_entry, 6, 1)
# ## Scale factor on X axis
self.scaley_entry = FCDoubleSpinner()
self.scaley_entry.set_range(0, 9999.9999)
self.scaley_entry.set_precision(self.decimals)
self.scaley_entry.setSingleStep(0.1)
self.scaley_label = QtWidgets.QLabel('%s:' % _("Y factor"))
self.scaley_label.setToolTip(
_("Factor for scaling on Y axis.")
)
grid0.addWidget(self.scaley_label, 7, 0)
grid0.addWidget(self.scaley_entry, 7, 1)
# ## Link Scale factors
self.link_cb = FCCheckBox(_("Link"))
self.link_cb.setToolTip(
_("Scale the selected object(s)\n"
"using the Scale_X factor for both axis.")
)
grid0.addWidget(self.link_cb, 8, 0)
# ## Scale Reference
self.reference_cb = FCCheckBox('%s' % _("Scale Reference"))
self.reference_cb.setToolTip(
_("Scale the selected object(s)\n"
"using the origin reference when checked,\n"
"and the center of the biggest bounding box\n"
"of the selected objects when unchecked.")
)
grid0.addWidget(self.reference_cb, 8, 1)
# ## Offset
offset_title_lbl = QtWidgets.QLabel('<b>%s</b>' % _("Offset"))
grid0.addWidget(offset_title_lbl, 9, 0, 1, 2)
self.offx_entry = FCDoubleSpinner()
self.offx_entry.set_range(-9999.9999, 9999.9999)
self.offx_entry.set_precision(self.decimals)
self.offx_entry.setSingleStep(0.1)
self.offx_label = QtWidgets.QLabel('%s:' % _("X val"))
self.offx_label.setToolTip(
_("Distance to offset on X axis. In current units.")
)
grid0.addWidget(self.offx_label, 10, 0)
grid0.addWidget(self.offx_entry, 10, 1)
# ## Offset distance on Y axis
self.offy_entry = FCDoubleSpinner()
self.offy_entry.set_range(-9999.9999, 9999.9999)
self.offy_entry.set_precision(self.decimals)
self.offy_entry.setSingleStep(0.1)
self.offy_label = QtWidgets.QLabel('%s:' % _("Y val"))
self.offy_label.setToolTip(
_("Distance to offset on Y axis. In current units.")
)
grid0.addWidget(self.offy_label, 11, 0)
grid0.addWidget(self.offy_entry, 11, 1)
# ## Mirror
mirror_title_lbl = QtWidgets.QLabel('<b>%s</b>' % _("Mirror"))
grid0.addWidget(mirror_title_lbl, 12, 0, 1, 2)
# ## Mirror (Flip) Reference Point
self.mirror_reference_cb = FCCheckBox('%s' % _("Mirror Reference"))
self.mirror_reference_cb.setToolTip(
_("Flip the selected object(s)\n"
"around the point in Point Entry Field.\n"
"\n"
"The point coordinates can be captured by\n"
"left click on canvas together with pressing\n"
"SHIFT key. \n"
"Then click Add button to insert coordinates.\n"
"Or enter the coords in format (x, y) in the\n"
"Point Entry field and click Flip on X(Y)"))
grid0.addWidget(self.mirror_reference_cb, 13, 0, 1, 2)
self.flip_ref_label = QtWidgets.QLabel('%s' % _("Mirror Reference point"))
self.flip_ref_label.setToolTip(
_("Coordinates in format (x, y) used as reference for mirroring.\n"
"The 'x' in (x, y) will be used when using Flip on X and\n"
"the 'y' in (x, y) will be used when using Flip on Y and")
)
self.flip_ref_entry = FCEntry()
grid0.addWidget(self.flip_ref_label, 14, 0, 1, 2)
grid0.addWidget(self.flip_ref_entry, 15, 0, 1, 2)
# ## Buffer
buffer_title_lbl = QtWidgets.QLabel('<b>%s</b>' % _("Buffer"))
grid0.addWidget(buffer_title_lbl, 16, 0, 1, 2)
self.buffer_label = QtWidgets.QLabel('%s:' % _("Distance"))
self.buffer_label.setToolTip(
_("A positive value will create the effect of dilation,\n"
"while a negative value will create the effect of erosion.\n"
"Each geometry element of the object will be increased\n"
"or decreased with the 'distance'.")
)
self.buffer_entry = FCDoubleSpinner()
self.buffer_entry.set_precision(self.decimals)
self.buffer_entry.setSingleStep(0.1)
self.buffer_entry.setWrapping(True)
self.buffer_entry.set_range(-9999.9999, 9999.9999)
grid0.addWidget(self.buffer_label, 17, 0)
grid0.addWidget(self.buffer_entry, 17, 1)
self.buffer_factor_label = QtWidgets.QLabel('%s:' % _("Value"))
self.buffer_factor_label.setToolTip(
_("A positive value will create the effect of dilation,\n"
"while a negative value will create the effect of erosion.\n"
"Each geometry element of the object will be increased\n"
"or decreased to fit the 'Value'. Value is a percentage\n"
"of the initial dimension.")
)
self.buffer_factor_entry = FCDoubleSpinner(suffix='%')
self.buffer_factor_entry.set_range(-100.0000, 1000.0000)
self.buffer_factor_entry.set_precision(self.decimals)
self.buffer_factor_entry.setWrapping(True)
self.buffer_factor_entry.setSingleStep(1)
grid0.addWidget(self.buffer_factor_label, 18, 0)
grid0.addWidget(self.buffer_factor_entry, 18, 1)
self.buffer_rounded_cb = FCCheckBox()
self.buffer_rounded_cb.setText('%s' % _("Rounded"))
self.buffer_rounded_cb.setToolTip(
_("If checked then the buffer will surround the buffered shape,\n"
"every corner will be rounded.\n"
"If not checked then the buffer will follow the exact geometry\n"
"of the buffered shape.")
)
grid0.addWidget(self.buffer_rounded_cb, 19, 0, 1, 2)
self.layout.addStretch()

View File