2019-07-19 18:46:11 +00:00
|
|
|
# ##########################################################
|
2019-03-10 13:22:16 +00:00
|
|
|
# FlatCAM: 2D Post-processing for Manufacturing #
|
|
|
|
# http://flatcam.org #
|
|
|
|
# Author: Juan Pablo Caram (c) #
|
|
|
|
# Date: 2/5/2014 #
|
|
|
|
# MIT Licence #
|
2019-07-19 18:46:11 +00:00
|
|
|
# ##########################################################
|
2019-03-10 13:22:16 +00:00
|
|
|
|
2019-07-19 18:46:11 +00:00
|
|
|
# ##########################################################
|
2019-03-10 13:22:16 +00:00
|
|
|
# File Modified (major mod): Marius Adrian Stanciu #
|
|
|
|
# Date: 3/10/2019 #
|
2019-07-19 18:46:11 +00:00
|
|
|
# ##########################################################
|
2019-03-10 13:22:16 +00:00
|
|
|
|
2020-06-03 17:35:59 +00:00
|
|
|
from appGUI.GUIElements import *
|
2019-10-03 18:44:37 +00:00
|
|
|
import sys
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-03-07 23:32:18 +00:00
|
|
|
import gettext
|
2020-06-03 17:35:59 +00:00
|
|
|
import appTranslation as fcTranslate
|
2019-07-19 18:46:11 +00:00
|
|
|
import builtins
|
2019-03-07 23:32:18 +00:00
|
|
|
|
2019-03-13 23:09:06 +00:00
|
|
|
fcTranslate.apply_language('strings')
|
2019-03-10 15:12:58 +00:00
|
|
|
if '_' not in builtins.__dict__:
|
|
|
|
_ = gettext.gettext
|
2019-02-10 20:55:51 +00:00
|
|
|
|
2019-11-05 13:12:10 +00:00
|
|
|
settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
|
|
if settings.contains("machinist"):
|
|
|
|
machinist_setting = settings.value('machinist', type=int)
|
|
|
|
else:
|
|
|
|
machinist_setting = 0
|
|
|
|
|
2019-03-17 02:35:04 +00:00
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
class ObjectUI(QtWidgets.QWidget):
|
|
|
|
"""
|
|
|
|
Base class for the UI of FlatCAM objects. Deriving classes should
|
|
|
|
put UI elements in ObjectUI.custom_box (QtWidgets.QLayout).
|
|
|
|
"""
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
def __init__(self, app, icon_file='assets/resources/flatcam_icon32.png', title=_('App Object'),
|
2020-04-28 14:23:49 +00:00
|
|
|
parent=None, common=True):
|
2019-01-03 19:25:08 +00:00
|
|
|
QtWidgets.QWidget.__init__(self, parent=parent)
|
2020-04-05 22:56:38 +00:00
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.app = app
|
|
|
|
self.decimals = app.decimals
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2019-12-15 14:28:36 +00:00
|
|
|
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
|
|
if theme_settings.contains("theme"):
|
|
|
|
theme = theme_settings.value('theme', type=str)
|
|
|
|
else:
|
|
|
|
theme = 'white'
|
|
|
|
|
|
|
|
if theme == 'white':
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
else:
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
layout = QtWidgets.QVBoxLayout()
|
|
|
|
self.setLayout(layout)
|
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Page Title box (spacing between children)
|
2019-01-03 19:25:08 +00:00
|
|
|
self.title_box = QtWidgets.QHBoxLayout()
|
|
|
|
layout.addLayout(self.title_box)
|
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Page Title icon
|
2020-04-28 14:23:49 +00:00
|
|
|
pixmap = QtGui.QPixmap(icon_file.replace('assets/resources', self.resource_loc))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.icon = QtWidgets.QLabel()
|
|
|
|
self.icon.setPixmap(pixmap)
|
|
|
|
self.title_box.addWidget(self.icon, stretch=0)
|
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Title label
|
2019-03-08 22:12:38 +00:00
|
|
|
self.title_label = QtWidgets.QLabel("<font size=5><b>%s</b></font>" % title)
|
2019-01-03 19:25:08 +00:00
|
|
|
self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
|
|
self.title_box.addWidget(self.title_label, stretch=1)
|
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## App Level label
|
2019-02-21 01:04:38 +00:00
|
|
|
self.level = QtWidgets.QLabel("")
|
|
|
|
self.level.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"BASIC is suitable for a beginner. Many parameters\n"
|
|
|
|
"are hidden from the user in this mode.\n"
|
|
|
|
"ADVANCED mode will make available all parameters.\n\n"
|
|
|
|
"To change the application LEVEL, go to:\n"
|
|
|
|
"Edit -> Preferences -> General and check:\n"
|
|
|
|
"'APP. LEVEL' radio button."
|
|
|
|
)
|
2019-02-21 01:04:38 +00:00
|
|
|
)
|
|
|
|
self.level.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
|
|
|
|
self.title_box.addWidget(self.level)
|
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Box box for custom widgets
|
2019-01-03 19:25:08 +00:00
|
|
|
# This gets populated in offspring implementations.
|
|
|
|
self.custom_box = QtWidgets.QVBoxLayout()
|
|
|
|
layout.addLayout(self.custom_box)
|
|
|
|
|
2019-07-19 18:46:11 +00:00
|
|
|
# ###########################
|
|
|
|
# ## Common to all objects ##
|
|
|
|
# ###########################
|
2019-10-02 14:58:48 +00:00
|
|
|
if common is True:
|
2019-10-14 19:26:50 +00:00
|
|
|
self.common_grid = QtWidgets.QGridLayout()
|
2020-01-30 04:26:14 +00:00
|
|
|
self.common_grid.setColumnStretch(0, 1)
|
|
|
|
self.common_grid.setColumnStretch(1, 0)
|
2019-10-14 19:26:50 +00:00
|
|
|
layout.addLayout(self.common_grid)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-01-30 04:26:14 +00:00
|
|
|
# self.common_grid.addWidget(QtWidgets.QLabel(''), 1, 0, 1, 2)
|
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
|
|
|
self.common_grid.addWidget(separator_line, 1, 0, 1, 2)
|
|
|
|
|
|
|
|
self.transform_label = QtWidgets.QLabel('<b>%s</b>' % _('Transformations'))
|
|
|
|
self.transform_label.setToolTip(
|
|
|
|
_("Geometrical transformations of the current object.")
|
2019-10-02 14:58:48 +00:00
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-01-30 04:26:14 +00:00
|
|
|
self.common_grid.addWidget(self.transform_label, 2, 0, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-01-30 04:26:14 +00:00
|
|
|
# ### Scale ####
|
2020-06-02 15:29:45 +00:00
|
|
|
self.scale_entry = NumericalEvalEntry(border_color='#0069A9')
|
2020-01-30 04:26:14 +00:00
|
|
|
self.scale_entry.set_value(1.0)
|
|
|
|
self.scale_entry.setToolTip(
|
2019-10-02 14:58:48 +00:00
|
|
|
_("Factor by which to multiply\n"
|
2019-12-11 23:55:04 +00:00
|
|
|
"geometric features of this object.\n"
|
|
|
|
"Expressions are allowed. E.g: 1/25.4")
|
2019-10-02 14:58:48 +00:00
|
|
|
)
|
|
|
|
# GO Button
|
|
|
|
self.scale_button = QtWidgets.QPushButton(_('Scale'))
|
|
|
|
self.scale_button.setToolTip(
|
|
|
|
_("Perform scaling operation.")
|
|
|
|
)
|
|
|
|
self.scale_button.setMinimumWidth(70)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-01-30 04:26:14 +00:00
|
|
|
self.common_grid.addWidget(self.scale_entry, 3, 0)
|
|
|
|
self.common_grid.addWidget(self.scale_button, 3, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
# ### Offset ####
|
2020-06-02 15:29:45 +00:00
|
|
|
self.offsetvector_entry = NumericalEvalTupleEntry(border_color='#0069A9')
|
2020-01-30 04:26:14 +00:00
|
|
|
self.offsetvector_entry.setText("(0.0, 0.0)")
|
|
|
|
self.offsetvector_entry.setToolTip(
|
2019-10-02 14:58:48 +00:00
|
|
|
_("Amount by which to move the object\n"
|
2019-12-12 17:38:29 +00:00
|
|
|
"in the x and y axes in (x, y) format.\n"
|
|
|
|
"Expressions are allowed. E.g: (1/3.2, 0.5*3)")
|
2019-10-02 14:58:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
self.offset_button = QtWidgets.QPushButton(_('Offset'))
|
|
|
|
self.offset_button.setToolTip(
|
|
|
|
_("Perform the offset operation.")
|
|
|
|
)
|
|
|
|
self.offset_button.setMinimumWidth(70)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-01-30 04:26:14 +00:00
|
|
|
self.common_grid.addWidget(self.offsetvector_entry, 4, 0)
|
|
|
|
self.common_grid.addWidget(self.offset_button, 4, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.transformations_button = QtWidgets.QPushButton(_('Transformations'))
|
2020-07-14 23:23:45 +00:00
|
|
|
self.transformations_button.setIcon(QtGui.QIcon(self.app.resource_location + '/transform.png'))
|
2020-06-02 15:29:45 +00:00
|
|
|
self.transformations_button.setToolTip(
|
|
|
|
_("Geometrical transformations of the current object.")
|
|
|
|
)
|
|
|
|
self.common_grid.addWidget(self.transformations_button, 5, 0, 1, 2)
|
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
layout.addStretch()
|
2020-02-03 00:18:28 +00:00
|
|
|
|
|
|
|
def confirmation_message(self, accepted, minval, maxval):
|
|
|
|
if accepted is False:
|
2020-06-02 15:29:45 +00:00
|
|
|
self.app.inform[str, bool].emit('[WARNING_NOTCL] %s: [%.*f, %.*f]' % (_("Edited value is out of range"),
|
|
|
|
self.decimals,
|
|
|
|
minval,
|
|
|
|
self.decimals,
|
|
|
|
maxval), False)
|
2020-02-03 00:18:28 +00:00
|
|
|
else:
|
2020-06-02 15:29:45 +00:00
|
|
|
self.app.inform[str, bool].emit('[success] %s' % _("Edited value is within limits."), False)
|
2020-02-03 00:18:28 +00:00
|
|
|
|
|
|
|
def confirmation_message_int(self, accepted, minval, maxval):
|
|
|
|
if accepted is False:
|
2020-06-02 15:29:45 +00:00
|
|
|
self.app.inform[str, bool].emit('[WARNING_NOTCL] %s: [%d, %d]' %
|
|
|
|
(_("Edited value is out of range"), minval, maxval), False)
|
2020-02-03 00:18:28 +00:00
|
|
|
else:
|
2020-06-02 15:29:45 +00:00
|
|
|
self.app.inform[str, bool].emit('[success] %s' % _("Edited value is within limits."), False)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
class GerberObjectUI(ObjectUI):
|
|
|
|
"""
|
|
|
|
User interface for Gerber objects.
|
|
|
|
"""
|
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
def __init__(self, app, parent=None):
|
|
|
|
self.decimals = app.decimals
|
|
|
|
self.app = app
|
|
|
|
|
|
|
|
ObjectUI.__init__(self, title=_('Gerber Object'), parent=parent, app=self.app)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Plot options
|
|
|
|
grid0 = QtWidgets.QGridLayout()
|
|
|
|
grid0.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
|
|
self.custom_box.addLayout(grid0)
|
2019-10-14 02:54:51 +00:00
|
|
|
grid0.setColumnStretch(0, 0)
|
|
|
|
grid0.setColumnStretch(1, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-08-18 11:17:46 +00:00
|
|
|
self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
|
2019-02-25 14:28:32 +00:00
|
|
|
|
2020-02-02 22:43:38 +00:00
|
|
|
grid0.addWidget(self.plot_options_label, 0, 0)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Solid CB
|
2019-05-01 13:04:40 +00:00
|
|
|
self.solid_cb = FCCheckBox(label=_('Solid'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.solid_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Solid color polygons.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-02 22:43:38 +00:00
|
|
|
grid0.addWidget(self.solid_cb, 0, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Multicolored CB
|
2019-12-10 02:14:58 +00:00
|
|
|
self.multicolored_cb = FCCheckBox(label=_('Multi-Color'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.multicolored_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Draw polygons in different colors.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-02 22:43:38 +00:00
|
|
|
grid0.addWidget(self.multicolored_cb, 0, 2)
|
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Object name
|
2019-02-13 15:26:21 +00:00
|
|
|
self.name_hlay = QtWidgets.QHBoxLayout()
|
2020-06-02 15:29:45 +00:00
|
|
|
grid0.addLayout(self.name_hlay, 1, 0, 1, 3)
|
|
|
|
|
2019-08-18 11:17:46 +00:00
|
|
|
name_label = QtWidgets.QLabel("<b>%s:</b>" % _("Name"))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.name_entry = FCEntry()
|
|
|
|
self.name_entry.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
|
|
self.name_hlay.addWidget(name_label)
|
|
|
|
self.name_hlay.addWidget(self.name_entry)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
# Plot CB
|
|
|
|
self.plot_lbl = FCLabel('%s:' % _("Plot"))
|
|
|
|
self.plot_lbl.setToolTip(_("Plot (show) this object."))
|
|
|
|
self.plot_cb = FCCheckBox()
|
|
|
|
|
|
|
|
grid0.addWidget(self.plot_lbl, 2, 0)
|
|
|
|
grid0.addWidget(self.plot_cb, 2, 1)
|
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
# Generate 'Follow'
|
2020-06-02 15:29:45 +00:00
|
|
|
self.follow_cb = FCCheckBox('%s' % _("Follow"))
|
|
|
|
self.follow_cb.setToolTip(_("Generate a 'Follow' geometry.\n"
|
|
|
|
"This means that it will cut through\n"
|
|
|
|
"the middle of the trace."))
|
|
|
|
grid0.addWidget(self.follow_cb, 2, 2)
|
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
# Editor
|
|
|
|
self.editor_button = QtWidgets.QPushButton(_('Gerber Editor'))
|
|
|
|
self.editor_button.setIcon(QtGui.QIcon(self.app.resource_location + '/edit_file32.png'))
|
|
|
|
self.editor_button.setToolTip(
|
|
|
|
_("Edit an Gerber object.")
|
|
|
|
)
|
|
|
|
self.editor_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid0.addWidget(self.editor_button, 4, 0, 1, 3)
|
|
|
|
|
2020-10-20 15:11:12 +00:00
|
|
|
# PROPERTIES CB
|
2020-10-21 09:16:17 +00:00
|
|
|
self.properties_button = FCButton('%s' % _("PROPERTIES"), checkable=True)
|
|
|
|
self.properties_button.setIcon(QtGui.QIcon(self.app.resource_location + '/properties32.png'))
|
|
|
|
self.properties_button.setToolTip(_("Show the Properties."))
|
|
|
|
self.properties_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid0.addWidget(self.properties_button, 6, 0, 1, 3)
|
2020-10-20 15:11:12 +00:00
|
|
|
|
|
|
|
# PROPERTIES Frame
|
|
|
|
self.properties_frame = QtWidgets.QFrame()
|
|
|
|
self.properties_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
grid0.addWidget(self.properties_frame, 7, 0, 1, 3)
|
|
|
|
self.properties_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.properties_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.properties_frame.setLayout(self.properties_box)
|
|
|
|
self.properties_frame.hide()
|
|
|
|
|
|
|
|
self.treeWidget = FCTree(columns=2)
|
|
|
|
|
|
|
|
self.properties_box.addWidget(self.treeWidget)
|
|
|
|
self.properties_box.setStretch(0, 0)
|
2020-09-26 11:39:52 +00:00
|
|
|
|
2019-07-19 18:46:11 +00:00
|
|
|
# ### Gerber Apertures ####
|
2020-06-02 15:29:45 +00:00
|
|
|
self.apertures_table_label = QtWidgets.QLabel('%s:' % _('Apertures'))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.apertures_table_label.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Apertures Table for the Gerber Object.")
|
2019-02-13 15:26:21 +00:00
|
|
|
)
|
2019-02-25 14:28:32 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
grid0.addWidget(self.apertures_table_label, 8, 0)
|
2019-02-13 15:26:21 +00:00
|
|
|
|
2019-02-13 20:34:56 +00:00
|
|
|
# Aperture Table Visibility CB
|
2019-02-26 21:12:15 +00:00
|
|
|
self.aperture_table_visibility_cb = FCCheckBox()
|
2019-02-25 22:33:31 +00:00
|
|
|
self.aperture_table_visibility_cb.setToolTip(
|
2020-07-10 22:42:44 +00:00
|
|
|
_("Toggle the display of the Tools Table.")
|
2019-02-25 22:33:31 +00:00
|
|
|
)
|
2019-02-26 21:12:15 +00:00
|
|
|
# self.aperture_table_visibility_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
2020-09-26 11:39:52 +00:00
|
|
|
grid0.addWidget(self.aperture_table_visibility_cb, 8, 1)
|
2019-02-13 20:34:56 +00:00
|
|
|
|
2020-08-26 21:56:55 +00:00
|
|
|
hlay_plot = QtWidgets.QHBoxLayout()
|
2020-09-26 11:39:52 +00:00
|
|
|
grid0.addLayout(hlay_plot, 8, 2)
|
2019-02-26 21:12:15 +00:00
|
|
|
|
|
|
|
# Aperture Mark all CB
|
2019-03-10 12:34:13 +00:00
|
|
|
self.mark_all_cb = FCCheckBox(_('Mark All'))
|
2019-02-26 21:12:15 +00:00
|
|
|
self.mark_all_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("When checked it will display all the apertures.\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"When unchecked, it will delete all mark shapes\n"
|
|
|
|
"that are drawn on canvas.")
|
2019-02-26 21:12:15 +00:00
|
|
|
|
|
|
|
)
|
|
|
|
self.mark_all_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
2020-08-26 21:56:55 +00:00
|
|
|
hlay_plot.addStretch()
|
2019-02-26 21:12:15 +00:00
|
|
|
hlay_plot.addWidget(self.mark_all_cb)
|
|
|
|
|
2020-08-26 21:56:55 +00:00
|
|
|
# Apertures Table
|
2019-02-13 15:26:21 +00:00
|
|
|
self.apertures_table = FCTable()
|
2020-09-26 11:39:52 +00:00
|
|
|
grid0.addWidget(self.apertures_table, 10, 0, 1, 3)
|
2019-02-13 15:26:21 +00:00
|
|
|
|
|
|
|
self.apertures_table.setColumnCount(6)
|
2019-03-10 12:34:13 +00:00
|
|
|
self.apertures_table.setHorizontalHeaderLabels(['#', _('Code'), _('Type'), _('Size'), _('Dim'), 'M'])
|
2019-02-13 15:26:21 +00:00
|
|
|
self.apertures_table.setSortingEnabled(False)
|
|
|
|
|
|
|
|
self.apertures_table.horizontalHeaderItem(0).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Index"))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.apertures_table.horizontalHeaderItem(1).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Aperture Code"))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.apertures_table.horizontalHeaderItem(2).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Type of aperture: circular, rectangle, macros etc"))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.apertures_table.horizontalHeaderItem(4).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Aperture Size:"))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.apertures_table.horizontalHeaderItem(4).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Aperture Dimensions:\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
" - (width, height) for R, O type.\n"
|
|
|
|
" - (dia, nVertices) for P type"))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.apertures_table.horizontalHeaderItem(5).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Mark the aperture instances on canvas."))
|
2019-02-25 14:28:32 +00:00
|
|
|
# self.apertures_table.setColumnHidden(5, True)
|
|
|
|
|
2019-02-13 20:34:56 +00:00
|
|
|
# start with apertures table hidden
|
|
|
|
self.apertures_table.setVisible(False)
|
2019-02-25 22:33:31 +00:00
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
# Buffer Geometry
|
2019-09-09 11:32:30 +00:00
|
|
|
self.create_buffer_button = QtWidgets.QPushButton(_('Buffer Solid Geometry'))
|
|
|
|
self.create_buffer_button.setToolTip(
|
|
|
|
_("This button is shown only when the Gerber file\n"
|
|
|
|
"is loaded without buffering.\n"
|
|
|
|
"Clicking this will create the buffered geometry\n"
|
|
|
|
"required for isolation.")
|
|
|
|
)
|
2020-09-26 11:39:52 +00:00
|
|
|
grid0.addWidget(self.create_buffer_button, 12, 0, 1, 3)
|
2019-02-13 15:26:21 +00:00
|
|
|
|
2020-10-20 15:11:12 +00:00
|
|
|
separator_line1 = QtWidgets.QFrame()
|
|
|
|
separator_line1.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line1.setFrameShadow(QtWidgets.QFrame.Sunken)
|
|
|
|
grid0.addWidget(separator_line1, 13, 0, 1, 3)
|
|
|
|
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tool_lbl = QtWidgets.QLabel('<b>%s</b>' % _("TOOLS"))
|
2020-08-26 21:56:55 +00:00
|
|
|
grid0.addWidget(self.tool_lbl, 14, 0, 1, 3)
|
2019-09-07 12:13:40 +00:00
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
# Isolation Tool - will create isolation paths around the copper features
|
|
|
|
self.iso_button = QtWidgets.QPushButton(_('Isolation Routing'))
|
2020-07-14 23:23:45 +00:00
|
|
|
# self.iso_button.setIcon(QtGui.QIcon(self.app.resource_location + '/iso_16.png'))
|
2020-06-02 15:29:45 +00:00
|
|
|
self.iso_button.setToolTip(
|
2020-05-25 17:05:41 +00:00
|
|
|
_("Create a Geometry object with\n"
|
2020-06-02 15:29:45 +00:00
|
|
|
"toolpaths to cut around polygons.")
|
2020-05-25 17:05:41 +00:00
|
|
|
)
|
2020-06-02 15:29:45 +00:00
|
|
|
self.iso_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
2020-08-26 21:56:55 +00:00
|
|
|
grid0.addWidget(self.iso_button, 16, 0, 1, 3)
|
2020-05-25 17:05:41 +00:00
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
# ## Clear non-copper regions
|
2019-03-10 12:34:13 +00:00
|
|
|
self.generate_ncc_button = QtWidgets.QPushButton(_('NCC Tool'))
|
2020-07-14 23:23:45 +00:00
|
|
|
self.generate_ncc_button.setIcon(QtGui.QIcon(self.app.resource_location + '/eraser26.png'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.generate_ncc_button.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Create the Geometry Object\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"for non-copper routing.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-10-21 18:42:31 +00:00
|
|
|
# self.generate_ncc_button.setStyleSheet("""
|
|
|
|
# QPushButton
|
|
|
|
# {
|
|
|
|
# font-weight: bold;
|
|
|
|
# }
|
|
|
|
# """)
|
2020-08-26 21:56:55 +00:00
|
|
|
grid0.addWidget(self.generate_ncc_button, 18, 0, 1, 3)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Board cutout
|
2019-03-10 12:34:13 +00:00
|
|
|
self.generate_cutout_button = QtWidgets.QPushButton(_('Cutout Tool'))
|
2020-07-14 23:23:45 +00:00
|
|
|
self.generate_cutout_button.setIcon(QtGui.QIcon(self.app.resource_location + '/cut32_bis.png'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.generate_cutout_button.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Generate the geometry for\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"the board cutout.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-10-21 18:42:31 +00:00
|
|
|
# self.generate_cutout_button.setStyleSheet("""
|
|
|
|
# QPushButton
|
|
|
|
# {
|
|
|
|
# font-weight: bold;
|
|
|
|
# }
|
|
|
|
# """)
|
2020-08-26 21:56:55 +00:00
|
|
|
grid0.addWidget(self.generate_cutout_button, 20, 0, 1, 3)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-11-25 14:52:37 +00:00
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-08-26 21:56:55 +00:00
|
|
|
grid0.addWidget(separator_line, 22, 0, 1, 3)
|
2019-11-25 14:52:37 +00:00
|
|
|
|
2020-10-21 18:02:10 +00:00
|
|
|
# UTILITIES BUTTON
|
|
|
|
self.util_button = FCButton('%s' % _("UTILTIES"), checkable=True)
|
|
|
|
self.util_button.setIcon(QtGui.QIcon(self.app.resource_location + '/settings18.png'))
|
|
|
|
self.util_button.setToolTip(_("Show the Utilties."))
|
|
|
|
self.util_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid0.addWidget(self.util_button, 24, 0, 1, 3)
|
|
|
|
|
|
|
|
# UTILITIES Frame
|
|
|
|
self.util_frame = QtWidgets.QFrame()
|
|
|
|
self.util_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
grid0.addWidget(self.util_frame, 25, 0, 1, 3)
|
|
|
|
self.util_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.util_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.util_frame.setLayout(self.util_box)
|
|
|
|
self.util_frame.hide()
|
|
|
|
|
|
|
|
util_grid = QtWidgets.QGridLayout()
|
|
|
|
util_grid.setColumnStretch(0, 0)
|
|
|
|
util_grid.setColumnStretch(1, 1)
|
|
|
|
self.util_box.addLayout(util_grid)
|
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Non-copper regions
|
2019-10-14 02:54:51 +00:00
|
|
|
self.noncopper_label = QtWidgets.QLabel("<b>%s</b>" % _("Non-copper regions"))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.noncopper_label.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Create polygons covering the\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"areas without copper on the PCB.\n"
|
|
|
|
"Equivalent to the inverse of this\n"
|
|
|
|
"object. Can be used to remove all\n"
|
|
|
|
"copper from a specified region.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
|
2020-10-21 18:02:10 +00:00
|
|
|
util_grid.addWidget(self.noncopper_label, 0, 0, 1, 3)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Margin
|
2019-08-19 14:24:56 +00:00
|
|
|
bmlabel = QtWidgets.QLabel('%s:' % _('Boundary Margin'))
|
2019-01-03 19:25:08 +00:00
|
|
|
bmlabel.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Specify the edge of the PCB\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"by drawing a box around all\n"
|
|
|
|
"objects with this minimum\n"
|
|
|
|
"distance.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-08-26 21:56:55 +00:00
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.noncopper_margin_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.noncopper_margin_entry.set_range(-9999.9999, 9999.9999)
|
|
|
|
self.noncopper_margin_entry.set_precision(self.decimals)
|
|
|
|
self.noncopper_margin_entry.setSingleStep(0.1)
|
|
|
|
|
2020-10-21 18:02:10 +00:00
|
|
|
util_grid.addWidget(bmlabel, 2, 0)
|
|
|
|
util_grid.addWidget(self.noncopper_margin_entry, 2, 1, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Rounded corners
|
2020-08-26 21:56:55 +00:00
|
|
|
self.noncopper_rounded_cb = FCCheckBox(label=_("Rounded"))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.noncopper_rounded_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Resulting geometry will have rounded corners.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
|
2020-08-26 21:56:55 +00:00
|
|
|
self.generate_noncopper_button = QtWidgets.QPushButton(_('Generate Geometry'))
|
|
|
|
self.generate_noncopper_button.setIcon(QtGui.QIcon(self.app.resource_location + '/geometry32.png'))
|
2020-10-21 18:02:10 +00:00
|
|
|
util_grid.addWidget(self.noncopper_rounded_cb, 4, 0)
|
|
|
|
util_grid.addWidget(self.generate_noncopper_button, 4, 1, 1, 2)
|
2019-11-25 14:52:37 +00:00
|
|
|
|
|
|
|
separator_line1 = QtWidgets.QFrame()
|
|
|
|
separator_line1.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line1.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-10-21 18:02:10 +00:00
|
|
|
util_grid.addWidget(separator_line1, 6, 0, 1, 3)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Bounding box
|
2019-10-14 02:54:51 +00:00
|
|
|
self.boundingbox_label = QtWidgets.QLabel('<b>%s</b>' % _('Bounding Box'))
|
2019-02-19 11:00:38 +00:00
|
|
|
self.boundingbox_label.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Create a geometry surrounding the Gerber object.\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"Square shape.")
|
2019-02-19 11:00:38 +00:00
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-10-21 18:02:10 +00:00
|
|
|
util_grid.addWidget(self.boundingbox_label, 8, 0, 1, 3)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-08-19 14:24:56 +00:00
|
|
|
bbmargin = QtWidgets.QLabel('%s:' % _('Boundary Margin'))
|
2019-01-03 19:25:08 +00:00
|
|
|
bbmargin.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Distance of the edges of the box\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"to the nearest polygon.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.bbmargin_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.bbmargin_entry.set_range(-9999.9999, 9999.9999)
|
|
|
|
self.bbmargin_entry.set_precision(self.decimals)
|
|
|
|
self.bbmargin_entry.setSingleStep(0.1)
|
|
|
|
|
2020-10-21 18:02:10 +00:00
|
|
|
util_grid.addWidget(bbmargin, 10, 0)
|
|
|
|
util_grid.addWidget(self.bbmargin_entry, 10, 1, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-08-26 21:56:55 +00:00
|
|
|
self.bbrounded_cb = FCCheckBox(label=_("Rounded"))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.bbrounded_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("If the bounding box is \n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"to have rounded corners\n"
|
|
|
|
"their radius is equal to\n"
|
|
|
|
"the margin.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
|
2020-08-26 21:56:55 +00:00
|
|
|
self.generate_bb_button = QtWidgets.QPushButton(_('Generate Geometry'))
|
|
|
|
self.generate_bb_button.setIcon(QtGui.QIcon(self.app.resource_location + '/geometry32.png'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.generate_bb_button.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Generate the Geometry object.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-10-21 18:02:10 +00:00
|
|
|
util_grid.addWidget(self.bbrounded_cb, 12, 0)
|
|
|
|
util_grid.addWidget(self.generate_bb_button, 12, 1, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-12-15 14:28:36 +00:00
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
class ExcellonObjectUI(ObjectUI):
|
|
|
|
"""
|
|
|
|
User interface for Excellon objects.
|
|
|
|
"""
|
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
def __init__(self, app, parent=None):
|
|
|
|
|
|
|
|
self.decimals = app.decimals
|
|
|
|
self.app = app
|
2019-12-15 14:28:36 +00:00
|
|
|
|
|
|
|
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
|
|
if theme_settings.contains("theme"):
|
|
|
|
theme = theme_settings.value('theme', type=str)
|
|
|
|
else:
|
|
|
|
theme = 'white'
|
|
|
|
|
|
|
|
if theme == 'white':
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
else:
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
|
2019-03-10 12:34:13 +00:00
|
|
|
ObjectUI.__init__(self, title=_('Excellon Object'),
|
2019-12-15 14:28:36 +00:00
|
|
|
icon_file=self.resource_loc + '/drill32.png',
|
2019-12-05 13:18:54 +00:00
|
|
|
parent=parent,
|
2020-02-03 00:18:28 +00:00
|
|
|
app=self.app)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
grid0 = QtWidgets.QGridLayout()
|
|
|
|
grid0.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
|
|
grid0.setColumnStretch(0, 0)
|
|
|
|
grid0.setColumnStretch(1, 1)
|
|
|
|
self.custom_box.addLayout(grid0)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
# Plot options
|
2019-08-18 11:17:46 +00:00
|
|
|
self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
|
2020-06-02 15:29:45 +00:00
|
|
|
|
|
|
|
# Solid CB
|
2019-03-10 12:34:13 +00:00
|
|
|
self.solid_cb = FCCheckBox(label=_('Solid'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.solid_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Solid circles.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-06-02 15:29:45 +00:00
|
|
|
|
|
|
|
# Multicolored CB
|
|
|
|
self.multicolored_cb = FCCheckBox(label=_('Multi-Color'))
|
|
|
|
self.multicolored_cb.setToolTip(
|
|
|
|
_("Draw polygons in different colors.")
|
|
|
|
)
|
2020-09-26 11:39:52 +00:00
|
|
|
|
|
|
|
grid0.addWidget(self.plot_options_label, 0, 0)
|
|
|
|
grid0.addWidget(self.solid_cb, 0, 1)
|
|
|
|
grid0.addWidget(self.multicolored_cb, 0, 2)
|
2019-02-13 15:26:21 +00:00
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Object name
|
2019-02-13 15:26:21 +00:00
|
|
|
self.name_hlay = QtWidgets.QHBoxLayout()
|
2020-06-02 15:29:45 +00:00
|
|
|
|
2019-08-18 11:17:46 +00:00
|
|
|
name_label = QtWidgets.QLabel("<b>%s:</b>" % _("Name"))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.name_entry = FCEntry()
|
|
|
|
self.name_entry.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
|
|
self.name_hlay.addWidget(name_label)
|
|
|
|
self.name_hlay.addWidget(self.name_entry)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
grid0.addLayout(self.name_hlay, 2, 0, 1, 3)
|
|
|
|
|
|
|
|
# Editor
|
|
|
|
self.editor_button = QtWidgets.QPushButton(_('Excellon Editor'))
|
|
|
|
self.editor_button.setIcon(QtGui.QIcon(self.app.resource_location + '/edit_file32.png'))
|
|
|
|
|
|
|
|
self.editor_button.setToolTip(
|
|
|
|
_("Edit an Excellon object.")
|
|
|
|
)
|
|
|
|
self.editor_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid0.addWidget(self.editor_button, 4, 0, 1, 3)
|
2019-02-12 23:22:09 +00:00
|
|
|
|
2020-10-20 15:11:12 +00:00
|
|
|
# PROPERTIES CB
|
2020-10-21 09:16:17 +00:00
|
|
|
self.properties_button = FCButton('%s' % _("PROPERTIES"), checkable=True)
|
|
|
|
self.properties_button.setIcon(QtGui.QIcon(self.app.resource_location + '/properties32.png'))
|
|
|
|
self.properties_button.setToolTip(_("Show the Properties."))
|
|
|
|
self.properties_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid0.addWidget(self.properties_button, 6, 0, 1, 3)
|
2020-10-20 15:11:12 +00:00
|
|
|
|
|
|
|
# PROPERTIES Frame
|
|
|
|
self.properties_frame = QtWidgets.QFrame()
|
|
|
|
self.properties_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
grid0.addWidget(self.properties_frame, 7, 0, 1, 3)
|
|
|
|
self.properties_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.properties_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.properties_frame.setLayout(self.properties_box)
|
|
|
|
self.properties_frame.hide()
|
|
|
|
|
|
|
|
self.treeWidget = FCTree(columns=2)
|
|
|
|
|
|
|
|
self.properties_box.addWidget(self.treeWidget)
|
|
|
|
self.properties_box.setStretch(0, 0)
|
|
|
|
|
2019-07-19 18:46:11 +00:00
|
|
|
# ### Tools Drills ####
|
2020-07-10 22:42:44 +00:00
|
|
|
self.tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Tools Table'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tools_table_label.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Tools in this Excellon object\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"when are used for drilling.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-07-10 22:42:44 +00:00
|
|
|
|
|
|
|
# Table Visibility CB
|
|
|
|
self.table_visibility_cb = FCCheckBox()
|
|
|
|
self.table_visibility_cb.setToolTip(
|
|
|
|
_("Toggle the display of the Tools Table.")
|
|
|
|
)
|
2019-02-12 23:22:09 +00:00
|
|
|
|
|
|
|
# Plot CB
|
2020-07-10 22:42:44 +00:00
|
|
|
hlay_plot = QtWidgets.QHBoxLayout()
|
2019-08-19 14:24:56 +00:00
|
|
|
self.plot_cb = FCCheckBox(_('Plot'))
|
2019-02-12 23:22:09 +00:00
|
|
|
self.plot_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Plot (show) this object.")
|
2019-02-12 23:22:09 +00:00
|
|
|
)
|
|
|
|
self.plot_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
|
|
|
hlay_plot.addStretch()
|
|
|
|
hlay_plot.addWidget(self.plot_cb)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-10-20 15:11:12 +00:00
|
|
|
grid0.addWidget(self.tools_table_label, 8, 0)
|
|
|
|
grid0.addWidget(self.table_visibility_cb, 8, 1)
|
|
|
|
grid0.addLayout(hlay_plot, 8, 2)
|
2020-07-10 22:42:44 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
# #############################################################################################################
|
|
|
|
# #############################################################################################################
|
2020-07-10 22:42:44 +00:00
|
|
|
# add a frame and inside add a vertical box layout. Inside this vbox layout I add all the Drills widgets
|
|
|
|
# this way I can hide/show the frame
|
2020-09-26 11:39:52 +00:00
|
|
|
# #############################################################################################################
|
|
|
|
# #############################################################################################################
|
|
|
|
|
2020-07-10 22:42:44 +00:00
|
|
|
self.drills_frame = QtWidgets.QFrame()
|
|
|
|
self.drills_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.custom_box.addWidget(self.drills_frame)
|
|
|
|
self.tools_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.tools_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.drills_frame.setLayout(self.tools_box)
|
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tools_table = FCTable()
|
2020-07-09 02:58:11 +00:00
|
|
|
self.tools_table.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
|
|
|
self.tools_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tools_box.addWidget(self.tools_table)
|
|
|
|
|
2019-02-12 23:22:09 +00:00
|
|
|
self.tools_table.setColumnCount(6)
|
2019-03-10 12:34:13 +00:00
|
|
|
self.tools_table.setHorizontalHeaderLabels(['#', _('Diameter'), _('Drills'), _('Slots'),
|
2020-07-21 04:20:14 +00:00
|
|
|
"C", 'P'])
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tools_table.setSortingEnabled(False)
|
|
|
|
|
2019-01-21 21:44:22 +00:00
|
|
|
self.tools_table.horizontalHeaderItem(0).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("This is the Tool Number.\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"When ToolChange is checked, on toolchange event this value\n"
|
2019-09-02 10:52:15 +00:00
|
|
|
"will be showed as a T1, T2 ... Tn in the Machine Code.\n\n"
|
|
|
|
"Here the tools are selected for G-code generation."))
|
2019-01-21 21:44:22 +00:00
|
|
|
self.tools_table.horizontalHeaderItem(1).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Tool Diameter. It's value (in current FlatCAM units) \n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"is the cut width into the material."))
|
2019-01-21 21:44:22 +00:00
|
|
|
self.tools_table.horizontalHeaderItem(2).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("The number of Drill holes. Holes that are drilled with\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"a drill bit."))
|
2019-01-21 21:44:22 +00:00
|
|
|
self.tools_table.horizontalHeaderItem(3).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("The number of Slot holes. Holes that are created by\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"milling them with an endmill bit."))
|
2020-07-21 04:20:14 +00:00
|
|
|
self.tools_table.horizontalHeaderItem(4).setToolTip(
|
|
|
|
_("Show the color of the drill holes when using multi-color."))
|
2019-02-12 23:22:09 +00:00
|
|
|
self.tools_table.horizontalHeaderItem(5).setToolTip(
|
2019-09-02 10:52:15 +00:00
|
|
|
_("Toggle display of the drills for the current tool.\n"
|
|
|
|
"This does not select the tools for G-code generation."))
|
2019-01-21 21:44:22 +00:00
|
|
|
|
2020-02-17 02:43:01 +00:00
|
|
|
# this column is not used; reserved for future usage
|
2020-07-21 03:49:49 +00:00
|
|
|
# self.tools_table.setColumnHidden(4, True)
|
2020-02-17 02:43:01 +00:00
|
|
|
|
2020-07-14 11:20:19 +00:00
|
|
|
# Excellon Tools autoload from DB
|
|
|
|
|
|
|
|
# Auto Load Tools from DB
|
|
|
|
self.autoload_db_cb = FCCheckBox('%s' % _("Auto load from DB"))
|
|
|
|
self.autoload_db_cb.setToolTip(
|
|
|
|
_("Automatic replacement of the tools from related application tools\n"
|
|
|
|
"with tools from DB that have a close diameter value.")
|
|
|
|
)
|
|
|
|
self.tools_box.addWidget(self.autoload_db_cb)
|
|
|
|
|
2020-07-09 02:58:11 +00:00
|
|
|
# #################################################################
|
|
|
|
# ########## TOOLS GRID ###########################################
|
|
|
|
# #################################################################
|
2020-01-16 13:49:51 +00:00
|
|
|
|
2020-07-09 02:58:11 +00:00
|
|
|
grid2 = QtWidgets.QGridLayout()
|
|
|
|
self.tools_box.addLayout(grid2)
|
|
|
|
grid2.setColumnStretch(0, 0)
|
|
|
|
grid2.setColumnStretch(1, 1)
|
2020-01-16 13:49:51 +00:00
|
|
|
|
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-07-09 02:58:11 +00:00
|
|
|
grid2.addWidget(separator_line, 0, 0, 1, 2)
|
2020-02-17 02:43:01 +00:00
|
|
|
|
2020-07-09 02:58:11 +00:00
|
|
|
self.tool_lbl = QtWidgets.QLabel('<b>%s</b>' % _("TOOLS"))
|
|
|
|
grid2.addWidget(self.tool_lbl, 2, 0, 1, 2)
|
2020-02-17 02:43:01 +00:00
|
|
|
|
2020-07-09 02:58:11 +00:00
|
|
|
# Drilling Tool - will create GCode for drill holes
|
|
|
|
self.drill_button = QtWidgets.QPushButton(_('Drilling Tool'))
|
2020-07-14 23:23:45 +00:00
|
|
|
self.drill_button.setIcon(QtGui.QIcon(self.app.resource_location + '/drilling_tool32.png'))
|
2020-07-09 02:58:11 +00:00
|
|
|
self.drill_button.setToolTip(
|
|
|
|
_("Generate GCode out of drill holes in an Excellon object.")
|
2020-02-17 02:43:01 +00:00
|
|
|
)
|
2020-07-09 02:58:11 +00:00
|
|
|
self.drill_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid2.addWidget(self.drill_button, 4, 0, 1, 2)
|
2020-05-09 22:05:02 +00:00
|
|
|
|
2020-07-09 02:58:11 +00:00
|
|
|
# Milling Tool - will create GCode for slot holes
|
|
|
|
self.milling_button = QtWidgets.QPushButton(_('Milling Tool'))
|
2020-07-14 23:23:45 +00:00
|
|
|
self.milling_button.setIcon(QtGui.QIcon(self.app.resource_location + '/milling_tool32.png'))
|
2020-07-09 02:58:11 +00:00
|
|
|
self.milling_button.setToolTip(
|
2020-10-21 08:40:27 +00:00
|
|
|
_("Generate a Geometry for milling drills or slots in an Excellon object.")
|
2020-05-06 22:38:08 +00:00
|
|
|
)
|
2020-10-21 18:42:31 +00:00
|
|
|
# self.milling_button.setStyleSheet("""
|
|
|
|
# QPushButton
|
|
|
|
# {
|
|
|
|
# font-weight: bold;
|
|
|
|
# }
|
|
|
|
# """)
|
2020-07-09 02:58:11 +00:00
|
|
|
grid2.addWidget(self.milling_button, 6, 0, 1, 2)
|
2020-10-21 08:40:27 +00:00
|
|
|
# TODO until the Milling Tool is finished this stays disabled
|
|
|
|
self.milling_button.setDisabled(True)
|
2020-05-06 22:38:08 +00:00
|
|
|
|
2020-01-17 01:15:13 +00:00
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-07-09 02:58:11 +00:00
|
|
|
grid2.addWidget(separator_line, 8, 0, 1, 2)
|
2020-01-17 01:15:13 +00:00
|
|
|
|
2020-10-21 18:42:31 +00:00
|
|
|
# UTILITIES BUTTON
|
|
|
|
self.util_button = FCButton('%s' % _("UTILTIES"), checkable=True)
|
|
|
|
self.util_button.setIcon(QtGui.QIcon(self.app.resource_location + '/settings18.png'))
|
|
|
|
self.util_button.setToolTip(_("Show the Utilties."))
|
|
|
|
self.util_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid2.addWidget(self.util_button, 10, 0, 1, 2)
|
|
|
|
|
|
|
|
# UTILITIES Frame
|
|
|
|
self.util_frame = QtWidgets.QFrame()
|
|
|
|
self.util_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
grid2.addWidget(self.util_frame, 12, 0, 1, 2)
|
|
|
|
self.util_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.util_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.util_frame.setLayout(self.util_box)
|
|
|
|
self.util_frame.hide()
|
|
|
|
|
|
|
|
util_grid = QtWidgets.QGridLayout()
|
|
|
|
util_grid.setColumnStretch(0, 0)
|
|
|
|
util_grid.setColumnStretch(1, 1)
|
|
|
|
self.util_box.addLayout(util_grid)
|
2020-01-17 01:15:13 +00:00
|
|
|
|
2019-07-19 18:46:11 +00:00
|
|
|
# ### Milling Holes Drills ####
|
2020-01-30 04:26:14 +00:00
|
|
|
self.mill_hole_label = QtWidgets.QLabel('<b>%s</b>' % _('Milling Geometry'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.mill_hole_label.setToolTip(
|
2019-11-04 23:01:52 +00:00
|
|
|
_("Create Geometry for milling holes.\n"
|
|
|
|
"Select from the Tools Table above the hole dias to be\n"
|
|
|
|
"milled. Use the # column to make the selection.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-10-21 18:42:31 +00:00
|
|
|
util_grid.addWidget(self.mill_hole_label, 0, 0, 1, 3)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-10-21 08:56:24 +00:00
|
|
|
self.tdlabel = QtWidgets.QLabel('%s:' % _('Milling Diameter'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tdlabel.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Diameter of the cutting tool.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-01-30 04:26:14 +00:00
|
|
|
|
2020-10-21 18:42:31 +00:00
|
|
|
util_grid.addWidget(self.tdlabel, 2, 0, 1, 3)
|
2020-01-30 04:26:14 +00:00
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tooldia_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.tooldia_entry.set_range(0.0, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tooldia_entry.setSingleStep(0.1)
|
|
|
|
|
2020-01-30 04:26:14 +00:00
|
|
|
self.generate_milling_button = QtWidgets.QPushButton(_('Mill Drills'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.generate_milling_button.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Create the Geometry Object\n"
|
2020-10-21 08:56:24 +00:00
|
|
|
"for milling drills.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2019-12-10 13:26:51 +00:00
|
|
|
self.generate_milling_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-10-21 18:42:31 +00:00
|
|
|
util_grid.addWidget(self.tooldia_entry, 4, 0, 1, 2)
|
|
|
|
util_grid.addWidget(self.generate_milling_button, 4, 2)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.slot_tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.slot_tooldia_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.slot_tooldia_entry.set_range(0.0, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.slot_tooldia_entry.setSingleStep(0.1)
|
|
|
|
|
2020-01-30 04:26:14 +00:00
|
|
|
self.generate_milling_slots_button = QtWidgets.QPushButton(_('Mill Slots'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.generate_milling_slots_button.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Create the Geometry Object\n"
|
2020-10-21 08:56:24 +00:00
|
|
|
"for milling slots.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2019-12-10 13:26:51 +00:00
|
|
|
self.generate_milling_slots_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-10-21 18:42:31 +00:00
|
|
|
util_grid.addWidget(self.slot_tooldia_entry, 6, 0, 1, 2)
|
|
|
|
util_grid.addWidget(self.generate_milling_slots_button, 6, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
def hide_drills(self, state=True):
|
|
|
|
if state is True:
|
|
|
|
self.drills_frame.hide()
|
|
|
|
else:
|
|
|
|
self.drills_frame.show()
|
|
|
|
|
|
|
|
|
|
|
|
class GeometryObjectUI(ObjectUI):
|
|
|
|
"""
|
|
|
|
User interface for Geometry objects.
|
|
|
|
"""
|
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
def __init__(self, app, parent=None):
|
|
|
|
|
|
|
|
self.decimals = app.decimals
|
|
|
|
self.app = app
|
2019-12-15 14:28:36 +00:00
|
|
|
|
|
|
|
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
|
|
if theme_settings.contains("theme"):
|
|
|
|
theme = theme_settings.value('theme', type=str)
|
|
|
|
else:
|
|
|
|
theme = 'white'
|
|
|
|
|
|
|
|
if theme == 'white':
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
else:
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
|
|
|
|
super(GeometryObjectUI, self).__init__(
|
|
|
|
title=_('Geometry Object'),
|
2020-02-03 00:18:28 +00:00
|
|
|
icon_file=self.resource_loc + '/geometry32.png', parent=parent, app=self.app
|
2019-12-15 14:28:36 +00:00
|
|
|
)
|
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
# Plot options
|
2020-06-02 15:29:45 +00:00
|
|
|
grid_header = QtWidgets.QGridLayout()
|
|
|
|
grid_header.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
|
|
self.custom_box.addLayout(grid_header)
|
|
|
|
grid_header.setColumnStretch(0, 0)
|
|
|
|
grid_header.setColumnStretch(1, 1)
|
|
|
|
|
2019-08-18 11:17:46 +00:00
|
|
|
self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
|
2020-06-02 15:29:45 +00:00
|
|
|
self.plot_options_label.setMinimumWidth(90)
|
|
|
|
|
|
|
|
grid_header.addWidget(self.plot_options_label, 0, 0)
|
|
|
|
|
|
|
|
# Multicolored CB
|
|
|
|
self.multicolored_cb = FCCheckBox(label=_('Multi-Color'))
|
|
|
|
self.multicolored_cb.setToolTip(
|
|
|
|
_("Draw polygons in different colors.")
|
|
|
|
)
|
|
|
|
self.multicolored_cb.setMinimumWidth(55)
|
|
|
|
grid_header.addWidget(self.multicolored_cb, 0, 2)
|
2019-02-13 15:26:21 +00:00
|
|
|
|
2019-05-30 18:05:12 +00:00
|
|
|
# ## Object name
|
2019-02-13 15:26:21 +00:00
|
|
|
self.name_hlay = QtWidgets.QHBoxLayout()
|
2020-09-26 11:39:52 +00:00
|
|
|
grid_header.addLayout(self.name_hlay, 2, 0, 1, 3)
|
2020-04-05 22:56:38 +00:00
|
|
|
|
2019-08-18 11:17:46 +00:00
|
|
|
name_label = QtWidgets.QLabel("<b>%s:</b>" % _("Name"))
|
2019-02-13 15:26:21 +00:00
|
|
|
self.name_entry = FCEntry()
|
|
|
|
self.name_entry.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
|
|
self.name_hlay.addWidget(name_label)
|
|
|
|
self.name_hlay.addWidget(self.name_entry)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
# Editor
|
|
|
|
self.editor_button = QtWidgets.QPushButton(_('Geometry Editor'))
|
|
|
|
self.editor_button.setIcon(QtGui.QIcon(self.app.resource_location + '/edit_file32.png'))
|
|
|
|
|
|
|
|
self.editor_button.setToolTip(
|
|
|
|
_("Edit an Geometry object.")
|
|
|
|
)
|
|
|
|
self.editor_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid_header.addWidget(self.editor_button, 4, 0, 1, 3)
|
|
|
|
|
2020-10-20 15:11:12 +00:00
|
|
|
# PROPERTIES CB
|
2020-10-21 09:16:17 +00:00
|
|
|
self.properties_button = FCButton('%s' % _("PROPERTIES"), checkable=True)
|
|
|
|
self.properties_button.setIcon(QtGui.QIcon(self.app.resource_location + '/properties32.png'))
|
|
|
|
self.properties_button.setToolTip(_("Show the Properties."))
|
|
|
|
self.properties_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
grid_header.addWidget(self.properties_button, 6, 0, 1, 3)
|
2020-10-20 15:11:12 +00:00
|
|
|
|
|
|
|
# PROPERTIES Frame
|
|
|
|
self.properties_frame = QtWidgets.QFrame()
|
|
|
|
self.properties_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
grid_header.addWidget(self.properties_frame, 7, 0, 1, 3)
|
|
|
|
self.properties_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.properties_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.properties_frame.setLayout(self.properties_box)
|
|
|
|
self.properties_frame.hide()
|
|
|
|
|
|
|
|
self.treeWidget = FCTree(columns=2)
|
|
|
|
|
|
|
|
self.properties_box.addWidget(self.treeWidget)
|
|
|
|
self.properties_box.setStretch(0, 0)
|
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
# add a frame and inside add a vertical box layout. Inside this vbox layout I add all the Tools widgets
|
|
|
|
# this way I can hide/show the frame
|
|
|
|
self.geo_tools_frame = QtWidgets.QFrame()
|
|
|
|
self.geo_tools_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.custom_box.addWidget(self.geo_tools_frame)
|
2020-04-05 22:56:38 +00:00
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
self.geo_tools_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.geo_tools_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.geo_tools_frame.setLayout(self.geo_tools_box)
|
|
|
|
|
2020-04-05 22:56:38 +00:00
|
|
|
# ************************************************************************
|
|
|
|
# ************** TABLE BOX FRAME *****************************************
|
|
|
|
# ************************************************************************
|
|
|
|
self.geo_table_frame = QtWidgets.QFrame()
|
|
|
|
self.geo_table_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.geo_tools_box.addWidget(self.geo_table_frame)
|
|
|
|
self.geo_table_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.geo_table_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.geo_table_frame.setLayout(self.geo_table_box)
|
|
|
|
|
|
|
|
grid0 = QtWidgets.QGridLayout()
|
|
|
|
self.geo_table_box.addLayout(grid0)
|
|
|
|
grid0.setColumnStretch(0, 0)
|
|
|
|
grid0.setColumnStretch(1, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-07-19 18:46:11 +00:00
|
|
|
# ### Tools ####
|
2019-08-19 14:24:56 +00:00
|
|
|
self.tools_table_label = QtWidgets.QLabel('<b>%s:</b>' % _('Tools Table'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tools_table_label.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Tools in this Geometry object used for cutting.\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"The 'Offset' entry will set an offset for the cut.\n"
|
|
|
|
"'Offset' can be inside, outside, on path (none) and custom.\n"
|
|
|
|
"'Type' entry is only informative and it allow to know the \n"
|
|
|
|
"intent of using the current tool. \n"
|
|
|
|
"It can be Rough(ing), Finish(ing) or Iso(lation).\n"
|
|
|
|
"The 'Tool type'(TT) can be circular with 1 to 4 teeths(C1..C4),\n"
|
|
|
|
"ball(B), or V-Shaped(V). \n"
|
|
|
|
"When V-shaped is selected the 'Type' entry is automatically \n"
|
|
|
|
"set to Isolation, the CutZ parameter in the UI form is\n"
|
|
|
|
"grayed out and Cut Z is automatically calculated from the newly \n"
|
|
|
|
"showed UI form entries named V-Tip Dia and V-Tip Angle.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-04-05 22:56:38 +00:00
|
|
|
grid0.addWidget(self.tools_table_label, 0, 0)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Plot CB
|
|
|
|
# self.plot_cb = QtWidgets.QCheckBox('Plot')
|
2019-03-10 12:34:13 +00:00
|
|
|
self.plot_cb = FCCheckBox(_('Plot Object'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.plot_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_("Plot (show) this object.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
self.plot_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
2020-04-05 22:56:38 +00:00
|
|
|
grid0.addWidget(self.plot_cb, 0, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-06-10 07:25:48 +00:00
|
|
|
self.geo_tools_table = FCTable(drag_drop=True)
|
2020-04-05 22:56:38 +00:00
|
|
|
grid0.addWidget(self.geo_tools_table, 1, 0, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
self.geo_tools_table.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
|
|
|
|
|
|
|
|
self.geo_tools_table.setColumnCount(7)
|
|
|
|
self.geo_tools_table.setColumnWidth(0, 20)
|
2019-03-10 12:34:13 +00:00
|
|
|
self.geo_tools_table.setHorizontalHeaderLabels(['#', _('Dia'), _('Offset'), _('Type'), _('TT'), '', 'P'])
|
2019-01-03 19:25:08 +00:00
|
|
|
self.geo_tools_table.setColumnHidden(5, True)
|
2019-02-02 21:56:08 +00:00
|
|
|
# stylesheet = "::section{Background-color:rgb(239,239,245)}"
|
|
|
|
# self.geo_tools_table.horizontalHeader().setStyleSheet(stylesheet)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
self.geo_tools_table.horizontalHeaderItem(0).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"This is the Tool Number.\n"
|
|
|
|
"When ToolChange is checked, on toolchange event this value\n"
|
|
|
|
"will be showed as a T1, T2 ... Tn")
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
self.geo_tools_table.horizontalHeaderItem(1).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"Tool Diameter. It's value (in current FlatCAM units) \n"
|
|
|
|
"is the cut width into the material."
|
|
|
|
))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.geo_tools_table.horizontalHeaderItem(2).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"The value for the Offset can be:\n"
|
|
|
|
"- Path -> There is no offset, the tool cut will be done through the geometry line.\n"
|
|
|
|
"- In(side) -> The tool cut will follow the geometry inside. It will create a 'pocket'.\n"
|
|
|
|
"- Out(side) -> The tool cut will follow the geometry line on the outside."
|
|
|
|
))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.geo_tools_table.horizontalHeaderItem(3).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"The (Operation) Type has only informative value. Usually the UI form values \n"
|
2019-09-01 21:14:28 +00:00
|
|
|
"are choose based on the operation type and this will serve as a reminder.\n"
|
2019-03-08 22:12:38 +00:00
|
|
|
"Can be 'Roughing', 'Finishing' or 'Isolation'.\n"
|
|
|
|
"For Roughing we may choose a lower Feedrate and multiDepth cut.\n"
|
|
|
|
"For Finishing we may choose a higher Feedrate, without multiDepth.\n"
|
|
|
|
"For Isolation we need a lower Feedrate as it use a milling bit with a fine tip."
|
|
|
|
))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.geo_tools_table.horizontalHeaderItem(4).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"The Tool Type (TT) can be:\n"
|
|
|
|
"- Circular with 1 ... 4 teeth -> it is informative only. Being circular the cut width in material\n"
|
|
|
|
"is exactly the tool diameter.\n"
|
|
|
|
"- Ball -> informative only and make reference to the Ball type endmill.\n"
|
2020-04-28 16:34:23 +00:00
|
|
|
"- V-Shape -> it will disable Z-Cut parameter in the UI form and enable two additional UI form\n"
|
2019-03-08 22:12:38 +00:00
|
|
|
"fields: V-Tip Dia and V-Tip Angle. Adjusting those two values will adjust the Z-Cut parameter such\n"
|
2019-07-19 18:46:11 +00:00
|
|
|
"as the cut width into material will be equal with the value in the Tool "
|
|
|
|
"Diameter column of this table.\n"
|
2019-03-08 22:12:38 +00:00
|
|
|
"Choosing the V-Shape Tool Type automatically will select the Operation Type as Isolation."
|
|
|
|
))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.geo_tools_table.horizontalHeaderItem(6).setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"Plot column. It is visible only for MultiGeo geometries, meaning geometries that holds the geometry\n"
|
|
|
|
"data into the tools. For those geometries, deleting the tool will delete the geometry data also,\n"
|
|
|
|
"so be WARNED. From the checkboxes on each row it can be enabled/disabled the plot on canvas\n"
|
|
|
|
"for the corresponding tool."
|
|
|
|
))
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Tool Offset
|
2020-04-05 22:56:38 +00:00
|
|
|
grid1 = QtWidgets.QGridLayout()
|
|
|
|
self.geo_table_box.addLayout(grid1)
|
|
|
|
grid1.setColumnStretch(0, 0)
|
|
|
|
grid1.setColumnStretch(1, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-08-19 14:24:56 +00:00
|
|
|
self.tool_offset_lbl = QtWidgets.QLabel('%s:' % _('Tool Offset'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tool_offset_lbl.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"The value to offset the cut when \n"
|
|
|
|
"the Offset type selected is 'Offset'.\n"
|
|
|
|
"The value can be positive for 'outside'\n"
|
|
|
|
"cut and negative for 'inside' cut."
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.tool_offset_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tool_offset_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.tool_offset_entry.set_range(-9999.9999, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tool_offset_entry.setSingleStep(0.1)
|
|
|
|
|
2020-04-05 22:56:38 +00:00
|
|
|
grid1.addWidget(self.tool_offset_lbl, 0, 0)
|
|
|
|
grid1.addWidget(self.tool_offset_entry, 0, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-01-17 01:42:50 +00:00
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-04-05 22:56:38 +00:00
|
|
|
grid1.addWidget(separator_line, 1, 0, 1, 2)
|
2020-01-17 01:42:50 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.tool_sel_label = QtWidgets.QLabel('<b>%s</b>' % _("Add from DB"))
|
2020-04-05 22:56:38 +00:00
|
|
|
grid1.addWidget(self.tool_sel_label, 2, 0, 1, 2)
|
2020-01-17 01:42:50 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.addtool_entry_lbl = QtWidgets.QLabel('%s:' % _('Tool Dia'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.addtool_entry_lbl.setToolTip(
|
2019-11-04 23:01:52 +00:00
|
|
|
_("Diameter for the new tool")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.addtool_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.addtool_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.addtool_entry.set_range(0.00001, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.addtool_entry.setSingleStep(0.1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-04-05 22:56:38 +00:00
|
|
|
grid1.addWidget(self.addtool_entry_lbl, 3, 0)
|
|
|
|
grid1.addWidget(self.addtool_entry, 3, 1)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
bhlay = QtWidgets.QHBoxLayout()
|
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.addtool_btn = QtWidgets.QPushButton(_('Search and Add'))
|
2020-07-15 18:11:47 +00:00
|
|
|
self.addtool_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/plus16.png'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.addtool_btn.setToolTip(
|
2019-11-04 23:01:52 +00:00
|
|
|
_("Add a new tool to the Tool Table\n"
|
2020-06-02 15:29:45 +00:00
|
|
|
"with the diameter specified above.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2019-11-04 23:01:52 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.addtool_from_db_btn = QtWidgets.QPushButton(_('Pick from DB'))
|
|
|
|
self.addtool_from_db_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/search_db32.png'))
|
2019-11-04 23:01:52 +00:00
|
|
|
self.addtool_from_db_btn.setToolTip(
|
|
|
|
_("Add a new tool to the Tool Table\n"
|
2020-10-08 12:42:16 +00:00
|
|
|
"from the Tools Database.\n"
|
|
|
|
"Tools database administration in in:\n"
|
|
|
|
"Menu: Options -> Tools Database")
|
2019-11-04 23:01:52 +00:00
|
|
|
)
|
2020-06-02 15:29:45 +00:00
|
|
|
|
|
|
|
bhlay.addWidget(self.addtool_btn)
|
|
|
|
bhlay.addWidget(self.addtool_from_db_btn)
|
|
|
|
|
|
|
|
grid1.addLayout(bhlay, 5, 0, 1, 2)
|
2020-01-17 01:42:50 +00:00
|
|
|
|
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-04-05 22:56:38 +00:00
|
|
|
grid1.addWidget(separator_line, 9, 0, 1, 2)
|
2019-11-04 23:01:52 +00:00
|
|
|
|
|
|
|
grid2 = QtWidgets.QGridLayout()
|
2020-04-05 22:56:38 +00:00
|
|
|
self.geo_table_box.addLayout(grid2)
|
2019-11-04 23:01:52 +00:00
|
|
|
|
2019-03-10 12:34:13 +00:00
|
|
|
self.deltool_btn = QtWidgets.QPushButton(_('Delete'))
|
2020-07-15 18:11:47 +00:00
|
|
|
self.deltool_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/trash16.png'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.deltool_btn.setToolTip(
|
2019-11-04 23:01:52 +00:00
|
|
|
_("Delete a selection of tools in the Tool Table\n"
|
|
|
|
"by first selecting a row in the Tool Table.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
|
2020-10-28 01:18:56 +00:00
|
|
|
grid2.addWidget(self.deltool_btn, 0, 0, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2020-01-16 13:49:51 +00:00
|
|
|
# ###########################################################
|
|
|
|
# ############# Create CNC Job ##############################
|
|
|
|
# ###########################################################
|
2020-04-05 22:56:38 +00:00
|
|
|
self.geo_param_frame = QtWidgets.QFrame()
|
|
|
|
self.geo_param_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.geo_tools_box.addWidget(self.geo_param_frame)
|
|
|
|
|
|
|
|
self.geo_param_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.geo_param_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.geo_param_frame.setLayout(self.geo_param_box)
|
|
|
|
|
2019-12-08 14:58:15 +00:00
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-04-05 22:56:38 +00:00
|
|
|
self.geo_param_box.addWidget(separator_line)
|
|
|
|
|
|
|
|
# #################################################################
|
|
|
|
# ################# GRID LAYOUT 3 ###############################
|
|
|
|
# #################################################################
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3 = QtWidgets.QGridLayout()
|
|
|
|
self.grid3.setColumnStretch(0, 0)
|
|
|
|
self.grid3.setColumnStretch(1, 1)
|
|
|
|
self.geo_param_box.addLayout(self.grid3)
|
2019-12-08 14:58:15 +00:00
|
|
|
|
2019-07-19 18:46:11 +00:00
|
|
|
# ### Tools Data ## ##
|
2019-12-08 13:12:05 +00:00
|
|
|
self.tool_data_label = QtWidgets.QLabel(
|
|
|
|
"<b>%s: <font color='#0000FF'>%s %d</font></b>" % (_('Parameters for'), _("Tool"), int(1)))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tool_data_label.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"The data used for creating GCode.\n"
|
|
|
|
"Each tool store it's own set of such data."
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.tool_data_label, 0, 0, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Tip Dia
|
2019-08-19 14:24:56 +00:00
|
|
|
self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tipdialabel.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"The tip diameter for V-Shape Tool"
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.tipdia_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tipdia_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.tipdia_entry.set_range(0.00001, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tipdia_entry.setSingleStep(0.1)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.tipdialabel, 1, 0)
|
|
|
|
self.grid3.addWidget(self.tipdia_entry, 1, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Tip Angle
|
2019-08-19 14:24:56 +00:00
|
|
|
self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.tipanglelabel.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"The tip angle for V-Shape Tool.\n"
|
|
|
|
"In degree."
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.tipangle_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tipangle_entry.set_precision(self.decimals)
|
2020-02-02 13:54:09 +00:00
|
|
|
self.tipangle_entry.set_range(1.0, 180.0)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.tipangle_entry.setSingleStep(1)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.tipanglelabel, 2, 0)
|
|
|
|
self.grid3.addWidget(self.tipangle_entry, 2, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Cut Z
|
2020-02-08 16:01:32 +00:00
|
|
|
self.cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
|
|
|
|
self.cutzlabel.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"Cutting depth (negative)\n"
|
|
|
|
"below the copper surface."
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.cutz_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.cutz_entry.set_precision(self.decimals)
|
2019-11-05 13:12:10 +00:00
|
|
|
|
|
|
|
if machinist_setting == 0:
|
2019-12-16 23:53:58 +00:00
|
|
|
self.cutz_entry.set_range(-9999.9999, 0.0000)
|
2019-11-05 13:12:10 +00:00
|
|
|
else:
|
2019-12-16 23:53:58 +00:00
|
|
|
self.cutz_entry.set_range(-9999.9999, 9999.9999)
|
2019-11-05 13:12:10 +00:00
|
|
|
|
2019-10-14 02:54:51 +00:00
|
|
|
self.cutz_entry.setSingleStep(0.1)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.cutzlabel, 3, 0)
|
|
|
|
self.grid3.addWidget(self.cutz_entry, 3, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Multi-pass
|
2019-08-19 14:24:56 +00:00
|
|
|
self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth"))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.mpass_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"Use multiple passes to limit\n"
|
|
|
|
"the cut depth in each pass. Will\n"
|
|
|
|
"cut multiple times until Cut Z is\n"
|
2019-08-19 14:24:56 +00:00
|
|
|
"reached."
|
2019-03-08 22:12:38 +00:00
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.maxdepth_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.maxdepth_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.maxdepth_entry.set_range(0, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.maxdepth_entry.setSingleStep(0.1)
|
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
self.maxdepth_entry.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"Depth of each pass (positive)."
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
self.ois_mpass_geo = OptionalInputSection(self.mpass_cb, [self.maxdepth_entry])
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.mpass_cb, 4, 0)
|
|
|
|
self.grid3.addWidget(self.maxdepth_entry, 4, 1)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
# Travel Z
|
2020-02-08 16:01:32 +00:00
|
|
|
self.travelzlabel = QtWidgets.QLabel('%s:' % _('Travel Z'))
|
|
|
|
self.travelzlabel.setToolTip(
|
2019-08-19 14:24:56 +00:00
|
|
|
_("Height of the tool when\n"
|
|
|
|
"moving without cutting.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.travelz_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.travelz_entry.set_precision(self.decimals)
|
2019-11-05 13:12:10 +00:00
|
|
|
|
|
|
|
if machinist_setting == 0:
|
2019-12-16 23:53:58 +00:00
|
|
|
self.travelz_entry.set_range(0.00001, 9999.9999)
|
2019-11-05 13:12:10 +00:00
|
|
|
else:
|
2019-12-16 23:53:58 +00:00
|
|
|
self.travelz_entry.set_range(-9999.9999, 9999.9999)
|
2019-11-05 13:12:10 +00:00
|
|
|
|
2019-10-14 02:54:51 +00:00
|
|
|
self.travelz_entry.setSingleStep(0.1)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.travelzlabel, 5, 0)
|
|
|
|
self.grid3.addWidget(self.travelz_entry, 5, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Feedrate X-Y
|
2020-02-08 16:01:32 +00:00
|
|
|
self.frlabel = QtWidgets.QLabel('%s:' % _('Feedrate X-Y'))
|
|
|
|
self.frlabel.setToolTip(
|
2019-08-19 14:24:56 +00:00
|
|
|
_("Cutting speed in the XY\n"
|
|
|
|
"plane in units per minute")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.cncfeedrate_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.cncfeedrate_entry.set_precision(self.decimals)
|
2020-02-03 12:46:39 +00:00
|
|
|
self.cncfeedrate_entry.set_range(0, 99999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.cncfeedrate_entry.setSingleStep(0.1)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.frlabel, 10, 0)
|
|
|
|
self.grid3.addWidget(self.cncfeedrate_entry, 10, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Feedrate Z (Plunge)
|
2020-02-08 16:01:32 +00:00
|
|
|
self.frzlabel = QtWidgets.QLabel('%s:' % _('Feedrate Z'))
|
|
|
|
self.frzlabel.setToolTip(
|
2019-08-19 14:24:56 +00:00
|
|
|
_("Cutting speed in the XY\n"
|
|
|
|
"plane in units per minute.\n"
|
|
|
|
"It is called also Plunge.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-08 16:01:32 +00:00
|
|
|
self.feedrate_z_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
|
|
|
self.feedrate_z_entry.set_precision(self.decimals)
|
|
|
|
self.feedrate_z_entry.set_range(0, 99999.9999)
|
|
|
|
self.feedrate_z_entry.setSingleStep(0.1)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.frzlabel, 11, 0)
|
|
|
|
self.grid3.addWidget(self.feedrate_z_entry, 11, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Feedrate rapids
|
2019-12-05 01:14:07 +00:00
|
|
|
self.fr_rapidlabel = QtWidgets.QLabel('%s:' % _('Feedrate Rapids'))
|
2019-02-18 19:19:57 +00:00
|
|
|
self.fr_rapidlabel.setToolTip(
|
2019-08-19 14:24:56 +00:00
|
|
|
_("Cutting speed in the XY plane\n"
|
2019-03-10 12:34:13 +00:00
|
|
|
"(in units per minute).\n"
|
|
|
|
"This is for the rapid move G00.\n"
|
|
|
|
"It is useful only for Marlin,\n"
|
2019-08-19 14:24:56 +00:00
|
|
|
"ignore for any other cases.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-08 18:38:51 +00:00
|
|
|
self.feedrate_rapid_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
|
|
|
self.feedrate_rapid_entry.set_precision(self.decimals)
|
|
|
|
self.feedrate_rapid_entry.set_range(0, 99999.9999)
|
|
|
|
self.feedrate_rapid_entry.setSingleStep(0.1)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.fr_rapidlabel, 12, 0)
|
|
|
|
self.grid3.addWidget(self.feedrate_rapid_entry, 12, 1)
|
2019-05-11 01:54:05 +00:00
|
|
|
# default values is to hide
|
|
|
|
self.fr_rapidlabel.hide()
|
2020-02-08 18:38:51 +00:00
|
|
|
self.feedrate_rapid_entry.hide()
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Cut over 1st point in path
|
2019-12-20 21:59:29 +00:00
|
|
|
self.extracut_cb = FCCheckBox('%s:' % _('Re-cut'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.extracut_cb.setToolTip(
|
2019-08-19 14:24:56 +00:00
|
|
|
_("In order to remove possible\n"
|
|
|
|
"copper leftovers where first cut\n"
|
|
|
|
"meet with last cut, we generate an\n"
|
|
|
|
"extended cut over the first cut section.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2019-12-10 03:28:02 +00:00
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.e_cut_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-12-10 03:28:02 +00:00
|
|
|
self.e_cut_entry.set_range(0, 99999)
|
|
|
|
self.e_cut_entry.set_precision(self.decimals)
|
|
|
|
self.e_cut_entry.setSingleStep(0.1)
|
|
|
|
self.e_cut_entry.setWrapping(True)
|
|
|
|
self.e_cut_entry.setToolTip(
|
|
|
|
_("In order to remove possible\n"
|
|
|
|
"copper leftovers where first cut\n"
|
|
|
|
"meet with last cut, we generate an\n"
|
|
|
|
"extended cut over the first cut section.")
|
|
|
|
)
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.extracut_cb, 13, 0)
|
|
|
|
self.grid3.addWidget(self.e_cut_entry, 13, 1)
|
2019-12-10 03:28:02 +00:00
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
# Spindlespeed
|
2020-02-08 16:01:32 +00:00
|
|
|
self.spindle_label = QtWidgets.QLabel('%s:' % _('Spindle speed'))
|
|
|
|
self.spindle_label.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"Speed of the spindle in RPM (optional).\n"
|
2019-12-06 21:00:43 +00:00
|
|
|
"If LASER preprocessor is used,\n"
|
2019-03-08 22:12:38 +00:00
|
|
|
"this value is the power of laser."
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.cncspindlespeed_entry = FCSpinner(callback=self.confirmation_message_int)
|
2019-12-10 21:57:00 +00:00
|
|
|
self.cncspindlespeed_entry.set_range(0, 1000000)
|
2020-02-17 12:27:45 +00:00
|
|
|
self.cncspindlespeed_entry.set_step(100)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.spindle_label, 14, 0)
|
|
|
|
self.grid3.addWidget(self.cncspindlespeed_entry, 14, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# Dwell
|
2019-08-19 14:24:56 +00:00
|
|
|
self.dwell_cb = FCCheckBox('%s:' % _('Dwell'))
|
2019-01-03 19:25:08 +00:00
|
|
|
self.dwell_cb.setToolTip(
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2019-03-08 22:12:38 +00:00
|
|
|
"Pause to allow the spindle to reach its\n"
|
|
|
|
"speed before cutting."
|
|
|
|
)
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.dwelltime_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.dwelltime_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.dwelltime_entry.set_range(0, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.dwelltime_entry.setSingleStep(0.1)
|
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
self.dwelltime_entry.setToolTip(
|
2019-08-19 14:24:56 +00:00
|
|
|
_("Number of time units for spindle to dwell.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.ois_dwell_geo = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry])
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.dwell_cb, 15, 0)
|
|
|
|
self.grid3.addWidget(self.dwelltime_entry, 15, 1)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-02-05 14:43:12 +00:00
|
|
|
# Probe depth
|
2019-08-19 14:24:56 +00:00
|
|
|
self.pdepth_label = QtWidgets.QLabel('%s:' % _("Probe Z depth"))
|
2019-02-05 14:43:12 +00:00
|
|
|
self.pdepth_label.setToolTip(
|
2019-08-19 14:24:56 +00:00
|
|
|
_("The maximum depth that the probe is allowed\n"
|
|
|
|
"to probe. Negative value, in current units.")
|
2019-02-05 14:43:12 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.pdepth_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.pdepth_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.pdepth_entry.set_range(-9999.9999, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.pdepth_entry.setSingleStep(0.1)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.pdepth_label, 17, 0)
|
|
|
|
self.grid3.addWidget(self.pdepth_entry, 17, 1)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2019-02-05 14:43:12 +00:00
|
|
|
self.pdepth_label.hide()
|
|
|
|
self.pdepth_entry.setVisible(False)
|
|
|
|
|
2019-02-05 17:40:46 +00:00
|
|
|
# Probe feedrate
|
2019-08-19 14:24:56 +00:00
|
|
|
self.feedrate_probe_label = QtWidgets.QLabel('%s:' % _("Feedrate Probe"))
|
2019-02-05 17:40:46 +00:00
|
|
|
self.feedrate_probe_label.setToolTip(
|
2019-08-19 14:24:56 +00:00
|
|
|
_("The feedrate used while the probe is probing.")
|
2019-02-05 17:40:46 +00:00
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.feedrate_probe_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.feedrate_probe_entry.set_precision(self.decimals)
|
2019-12-16 23:53:58 +00:00
|
|
|
self.feedrate_probe_entry.set_range(0.0, 9999.9999)
|
2019-10-14 02:54:51 +00:00
|
|
|
self.feedrate_probe_entry.setSingleStep(0.1)
|
|
|
|
|
2020-06-02 15:29:45 +00:00
|
|
|
self.grid3.addWidget(self.feedrate_probe_label, 18, 0)
|
|
|
|
self.grid3.addWidget(self.feedrate_probe_entry, 18, 1)
|
2019-10-14 02:54:51 +00:00
|
|
|
|
2019-02-05 17:40:46 +00:00
|
|
|
self.feedrate_probe_label.hide()
|
|
|
|
self.feedrate_probe_entry.setVisible(False)
|
|
|
|
|
2020-01-17 01:15:13 +00:00
|
|
|
# #################################################################
|
|
|
|
# ################# GRID LAYOUT 4 ###############################
|
|
|
|
# #################################################################
|
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4 = QtWidgets.QGridLayout()
|
|
|
|
self.grid4.setColumnStretch(0, 0)
|
|
|
|
self.grid4.setColumnStretch(1, 1)
|
|
|
|
self.geo_param_box.addLayout(self.grid4)
|
2020-01-17 01:15:13 +00:00
|
|
|
|
2019-12-08 14:58:15 +00:00
|
|
|
separator_line2 = QtWidgets.QFrame()
|
|
|
|
separator_line2.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(separator_line2, 0, 0, 1, 2)
|
2019-12-08 14:58:15 +00:00
|
|
|
|
|
|
|
self.apply_param_to_all = FCButton(_("Apply parameters to all tools"))
|
2020-07-15 18:11:47 +00:00
|
|
|
self.apply_param_to_all.setIcon(QtGui.QIcon(self.app.resource_location + '/param_all32.png'))
|
2019-12-08 23:56:45 +00:00
|
|
|
self.apply_param_to_all.setToolTip(
|
|
|
|
_("The parameters in the current form will be applied\n"
|
|
|
|
"on all the tools from the Tool Table.")
|
|
|
|
)
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(self.apply_param_to_all, 1, 0, 1, 2)
|
2020-01-17 01:15:13 +00:00
|
|
|
|
|
|
|
separator_line2 = QtWidgets.QFrame()
|
|
|
|
separator_line2.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(separator_line2, 2, 0, 1, 2)
|
2020-01-17 01:15:13 +00:00
|
|
|
|
|
|
|
# General Parameters
|
|
|
|
self.gen_param_label = QtWidgets.QLabel('<b>%s</b>' % _("Common Parameters"))
|
|
|
|
self.gen_param_label.setToolTip(
|
|
|
|
_("Parameters that are common for all tools.")
|
|
|
|
)
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(self.gen_param_label, 3, 0, 1, 2)
|
2020-01-17 01:15:13 +00:00
|
|
|
|
2020-02-14 03:07:11 +00:00
|
|
|
# Tool change Z
|
|
|
|
self.toolchangeg_cb = FCCheckBox('%s:' % _("Tool change Z"))
|
|
|
|
self.toolchangeg_cb.setToolTip(
|
|
|
|
_(
|
|
|
|
"Include tool-change sequence\n"
|
|
|
|
"in the Machine Code (Pause for tool change)."
|
|
|
|
)
|
|
|
|
)
|
|
|
|
self.toolchangez_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
|
|
|
self.toolchangez_entry.set_precision(self.decimals)
|
|
|
|
self.toolchangez_entry.setToolTip(
|
|
|
|
_(
|
|
|
|
"Z-axis position (height) for\n"
|
|
|
|
"tool change."
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
if machinist_setting == 0:
|
|
|
|
self.toolchangez_entry.set_range(0, 9999.9999)
|
|
|
|
else:
|
|
|
|
self.toolchangez_entry.set_range(-9999.9999, 9999.9999)
|
|
|
|
|
|
|
|
self.toolchangez_entry.setSingleStep(0.1)
|
|
|
|
self.ois_tcz_geo = OptionalInputSection(self.toolchangeg_cb, [self.toolchangez_entry])
|
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(self.toolchangeg_cb, 6, 0)
|
|
|
|
self.grid4.addWidget(self.toolchangez_entry, 6, 1)
|
2020-02-14 03:07:11 +00:00
|
|
|
|
|
|
|
# The Z value for the start move
|
|
|
|
# startzlabel = QtWidgets.QLabel('Start move Z:')
|
|
|
|
# startzlabel.setToolTip(
|
|
|
|
# "Tool height just before starting the work.\n"
|
|
|
|
# "Delete the value if you don't need this feature."
|
|
|
|
#
|
|
|
|
# )
|
2020-04-05 22:56:38 +00:00
|
|
|
# grid3.addWidget(startzlabel, 8, 0)
|
2020-02-14 03:07:11 +00:00
|
|
|
# self.gstartz_entry = FloatEntry()
|
2020-04-05 22:56:38 +00:00
|
|
|
# grid3.addWidget(self.gstartz_entry, 8, 1)
|
2020-02-14 03:07:11 +00:00
|
|
|
|
|
|
|
# The Z value for the end move
|
|
|
|
self.endz_label = QtWidgets.QLabel('%s:' % _('End move Z'))
|
|
|
|
self.endz_label.setToolTip(
|
|
|
|
_("Height of the tool after\n"
|
|
|
|
"the last move at the end of the job.")
|
|
|
|
)
|
|
|
|
self.endz_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
|
|
|
self.endz_entry.set_precision(self.decimals)
|
|
|
|
|
|
|
|
if machinist_setting == 0:
|
|
|
|
self.endz_entry.set_range(0, 9999.9999)
|
|
|
|
else:
|
|
|
|
self.endz_entry.set_range(-9999.9999, 9999.9999)
|
|
|
|
|
|
|
|
self.endz_entry.setSingleStep(0.1)
|
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(self.endz_label, 9, 0)
|
|
|
|
self.grid4.addWidget(self.endz_entry, 9, 1)
|
2020-02-14 03:07:11 +00:00
|
|
|
|
2020-02-26 02:43:54 +00:00
|
|
|
# End Move X,Y
|
|
|
|
endmove_xy_label = QtWidgets.QLabel('%s:' % _('End move X,Y'))
|
|
|
|
endmove_xy_label.setToolTip(
|
2020-02-26 03:00:23 +00:00
|
|
|
_("End move X,Y position. In format (x,y).\n"
|
2020-02-26 02:43:54 +00:00
|
|
|
"If no value is entered then there is no move\n"
|
|
|
|
"on X,Y plane at the end of the job.")
|
|
|
|
)
|
2020-06-12 21:17:17 +00:00
|
|
|
self.endxy_entry = NumericalEvalTupleEntry(border_color='#0069A9')
|
|
|
|
self.endxy_entry.setPlaceholderText(_("X,Y coordinates"))
|
2020-02-26 02:43:54 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(endmove_xy_label, 10, 0)
|
|
|
|
self.grid4.addWidget(self.endxy_entry, 10, 1)
|
2020-02-26 02:43:54 +00:00
|
|
|
|
2020-01-17 01:15:13 +00:00
|
|
|
# preprocessor selection
|
|
|
|
pp_label = QtWidgets.QLabel('%s:' % _("Preprocessor"))
|
|
|
|
pp_label.setToolTip(
|
|
|
|
_("The Preprocessor file that dictates\n"
|
|
|
|
"the Machine Code (like GCode, RML, HPGL) output.")
|
|
|
|
)
|
|
|
|
self.pp_geometry_name_cb = FCComboBox()
|
|
|
|
self.pp_geometry_name_cb.setFocusPolicy(QtCore.Qt.StrongFocus)
|
2019-12-08 14:58:15 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(pp_label, 11, 0)
|
|
|
|
self.grid4.addWidget(self.pp_geometry_name_cb, 11, 1)
|
2019-12-08 14:58:15 +00:00
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
# self.grid4.addWidget(QtWidgets.QLabel(''), 12, 0, 1, 2)
|
2020-05-02 19:53:48 +00:00
|
|
|
|
2020-05-09 22:05:02 +00:00
|
|
|
# ------------------------------------------------------------------------------------------------------------
|
|
|
|
# ------------------------- EXCLUSION AREAS ------------------------------------------------------------------
|
|
|
|
# ------------------------------------------------------------------------------------------------------------
|
|
|
|
|
2020-05-02 19:53:48 +00:00
|
|
|
# Exclusion Areas
|
2020-05-07 22:41:40 +00:00
|
|
|
self.exclusion_cb = FCCheckBox('%s' % _("Add exclusion areas"))
|
2020-05-02 19:53:48 +00:00
|
|
|
self.exclusion_cb.setToolTip(
|
|
|
|
_(
|
|
|
|
"Include exclusion areas.\n"
|
|
|
|
"In those areas the travel of the tools\n"
|
|
|
|
"is forbidden."
|
|
|
|
)
|
|
|
|
)
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(self.exclusion_cb, 12, 0, 1, 2)
|
2020-05-02 19:53:48 +00:00
|
|
|
|
|
|
|
self.exclusion_frame = QtWidgets.QFrame()
|
|
|
|
self.exclusion_frame.setContentsMargins(0, 0, 0, 0)
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(self.exclusion_frame, 14, 0, 1, 2)
|
2020-05-02 19:53:48 +00:00
|
|
|
|
|
|
|
self.exclusion_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.exclusion_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.exclusion_frame.setLayout(self.exclusion_box)
|
|
|
|
|
2020-05-09 02:18:05 +00:00
|
|
|
self.exclusion_table = FCTable()
|
|
|
|
self.exclusion_box.addWidget(self.exclusion_table)
|
|
|
|
self.exclusion_table.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
|
|
|
|
|
|
|
|
self.exclusion_table.setColumnCount(4)
|
|
|
|
self.exclusion_table.setColumnWidth(0, 20)
|
|
|
|
self.exclusion_table.setHorizontalHeaderLabels(['#', _('Object'), _('Strategy'), _('Over Z')])
|
|
|
|
|
|
|
|
self.exclusion_table.horizontalHeaderItem(0).setToolTip(_("This is the Area ID."))
|
|
|
|
self.exclusion_table.horizontalHeaderItem(1).setToolTip(
|
|
|
|
_("Type of the object where the exclusion area was added."))
|
|
|
|
self.exclusion_table.horizontalHeaderItem(2).setToolTip(
|
|
|
|
_("The strategy used for exclusion area. Go around the exclusion areas or over it."))
|
|
|
|
self.exclusion_table.horizontalHeaderItem(3).setToolTip(
|
|
|
|
_("If the strategy is to go over the area then this is the height at which the tool will go to avoid the "
|
|
|
|
"exclusion area."))
|
|
|
|
|
|
|
|
self.exclusion_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
|
|
|
|
|
|
|
grid_a1 = QtWidgets.QGridLayout()
|
|
|
|
grid_a1.setColumnStretch(0, 0)
|
|
|
|
grid_a1.setColumnStretch(1, 1)
|
|
|
|
self.exclusion_box.addLayout(grid_a1)
|
2020-05-02 19:53:48 +00:00
|
|
|
|
|
|
|
# Chose Strategy
|
|
|
|
self.strategy_label = FCLabel('%s:' % _("Strategy"))
|
|
|
|
self.strategy_label.setToolTip(_("The strategy followed when encountering an exclusion area.\n"
|
|
|
|
"Can be:\n"
|
|
|
|
"- Over -> when encountering the area, the tool will go to a set height\n"
|
|
|
|
"- Around -> will avoid the exclusion area by going around the area"))
|
|
|
|
self.strategy_radio = RadioSet([{'label': _('Over'), 'value': 'over'},
|
|
|
|
{'label': _('Around'), 'value': 'around'}])
|
|
|
|
|
2020-05-09 02:18:05 +00:00
|
|
|
grid_a1.addWidget(self.strategy_label, 1, 0)
|
|
|
|
grid_a1.addWidget(self.strategy_radio, 1, 1)
|
2020-05-02 19:53:48 +00:00
|
|
|
|
|
|
|
# Over Z
|
|
|
|
self.over_z_label = FCLabel('%s:' % _("Over Z"))
|
|
|
|
self.over_z_label.setToolTip(_("The height Z to which the tool will rise in order to avoid\n"
|
|
|
|
"an interdiction area."))
|
|
|
|
self.over_z_entry = FCDoubleSpinner()
|
|
|
|
self.over_z_entry.set_range(0.000, 9999.9999)
|
|
|
|
self.over_z_entry.set_precision(self.decimals)
|
|
|
|
|
2020-05-09 02:18:05 +00:00
|
|
|
grid_a1.addWidget(self.over_z_label, 2, 0)
|
|
|
|
grid_a1.addWidget(self.over_z_entry, 2, 1)
|
|
|
|
|
|
|
|
# Button Add Area
|
2020-05-09 22:05:02 +00:00
|
|
|
self.add_area_button = QtWidgets.QPushButton(_('Add area:'))
|
2020-05-09 02:18:05 +00:00
|
|
|
self.add_area_button.setToolTip(_("Add an Exclusion Area."))
|
|
|
|
|
|
|
|
# Area Selection shape
|
|
|
|
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
|
|
|
|
{'label': _("Polygon"), 'value': 'polygon'}])
|
|
|
|
self.area_shape_radio.setToolTip(
|
|
|
|
_("The kind of selection shape used for area selection.")
|
|
|
|
)
|
|
|
|
|
|
|
|
grid_a1.addWidget(self.add_area_button, 4, 0)
|
|
|
|
grid_a1.addWidget(self.area_shape_radio, 4, 1)
|
|
|
|
|
|
|
|
h_lay_1 = QtWidgets.QHBoxLayout()
|
|
|
|
self.exclusion_box.addLayout(h_lay_1)
|
|
|
|
|
|
|
|
# Button Delete All Areas
|
2020-05-09 22:05:02 +00:00
|
|
|
self.delete_area_button = QtWidgets.QPushButton(_('Delete All'))
|
2020-05-09 02:18:05 +00:00
|
|
|
self.delete_area_button.setToolTip(_("Delete all exclusion areas."))
|
|
|
|
|
|
|
|
# Button Delete Selected Areas
|
|
|
|
self.delete_sel_area_button = QtWidgets.QPushButton(_('Delete Selected'))
|
|
|
|
self.delete_sel_area_button.setToolTip(_("Delete all exclusion areas that are selected in the table."))
|
|
|
|
|
|
|
|
h_lay_1.addWidget(self.delete_area_button)
|
|
|
|
h_lay_1.addWidget(self.delete_sel_area_button)
|
2020-05-02 19:53:48 +00:00
|
|
|
|
2020-05-09 22:05:02 +00:00
|
|
|
self.ois_exclusion_geo = OptionalHideInputSection(self.exclusion_cb, [self.exclusion_frame])
|
2020-05-02 19:53:48 +00:00
|
|
|
# -------------------------- EXCLUSION AREAS END -------------------------------------------------------------
|
|
|
|
# ------------------------------------------------------------------------------------------------------------
|
2020-05-09 22:05:02 +00:00
|
|
|
|
2020-07-11 00:51:25 +00:00
|
|
|
# Add Polish
|
|
|
|
self.polish_cb = FCCheckBox(label=_('Add Polish'))
|
|
|
|
self.polish_cb.setToolTip(_(
|
|
|
|
"Will add a Paint section at the end of the GCode.\n"
|
|
|
|
"A metallic brush will clean the material after milling."))
|
|
|
|
self.polish_cb.setObjectName("g_polish")
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(self.polish_cb, 15, 0, 1, 2)
|
2020-07-11 00:51:25 +00:00
|
|
|
|
|
|
|
# Polish Tool Diameter
|
|
|
|
self.polish_dia_lbl = QtWidgets.QLabel('%s:' % _('Tool Dia'))
|
|
|
|
self.polish_dia_lbl.setToolTip(
|
|
|
|
_("Diameter for the polishing tool.")
|
|
|
|
)
|
|
|
|
self.polish_dia_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
|
|
|
self.polish_dia_entry.set_precision(self.decimals)
|
|
|
|
self.polish_dia_entry.set_range(0.000, 9999.9999)
|
|
|
|
self.polish_dia_entry.setObjectName("g_polish_dia")
|
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
self.grid4.addWidget(self.polish_dia_lbl, 16, 0)
|
|
|
|
self.grid4.addWidget(self.polish_dia_entry, 16, 1)
|
2020-07-11 00:51:25 +00:00
|
|
|
|
2020-10-28 01:18:56 +00:00
|
|
|
# Polish Travel Z
|
|
|
|
self.polish_travelz_lbl = QtWidgets.QLabel('%s:' % _('Travel Z'))
|
|
|
|
self.polish_travelz_lbl.setToolTip(
|
|
|
|
_("Height of the tool when\n"
|
|
|
|
"moving without cutting.")
|
|
|
|
)
|
|
|
|
self.polish_travelz_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
|
|
|
self.polish_travelz_entry.set_precision(self.decimals)
|
|
|
|
self.polish_travelz_entry.set_range(0.00000, 10000.00000)
|
|
|
|
self.polish_travelz_entry.setSingleStep(0.1)
|
|
|
|
self.polish_travelz_entry.setObjectName("g_polish_travelz")
|
|
|
|
|
|
|
|
self.grid4.addWidget(self.polish_travelz_lbl, 17, 0)
|
|
|
|
self.grid4.addWidget(self.polish_travelz_entry, 17, 1)
|
|
|
|
|
2020-07-11 00:51:25 +00:00
|
|
|
# Polish Pressure
|
|
|
|
self.polish_pressure_lbl = QtWidgets.QLabel('%s:' % _('Pressure'))
|
|
|
|
self.polish_pressure_lbl.setToolTip(
|
|
|
|
_("Negative value. The higher the absolute value\n"
|
|
|
|
"the stronger the pressure of the brush on the material.")
|
|
|
|
)
|
|
|
|
self.polish_pressure_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
|
|
|
self.polish_pressure_entry.set_precision(self.decimals)
|
|
|
|
self.polish_pressure_entry.set_range(-9999.9999, 9999.9999)
|
|
|
|
self.polish_pressure_entry.setObjectName("g_polish_pressure")
|
|
|
|
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(self.polish_pressure_lbl, 18, 0)
|
|
|
|
self.grid4.addWidget(self.polish_pressure_entry, 18, 1)
|
|
|
|
|
|
|
|
# Polish Margin
|
|
|
|
self.polish_margin_lbl = FCLabel('%s:' % _('Margin'))
|
|
|
|
self.polish_margin_lbl.setToolTip(
|
|
|
|
_("Bounding box margin.")
|
|
|
|
)
|
|
|
|
self.polish_margin_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
|
|
|
self.polish_margin_entry.set_precision(self.decimals)
|
|
|
|
self.polish_margin_entry.set_range(-9999.9999, 9999.9999)
|
|
|
|
self.polish_margin_entry.setObjectName("g_polish_margin")
|
|
|
|
|
|
|
|
self.grid4.addWidget(self.polish_margin_lbl, 20, 0)
|
|
|
|
self.grid4.addWidget(self.polish_margin_entry, 20, 1)
|
2020-07-11 00:51:25 +00:00
|
|
|
|
|
|
|
# Polish Overlap
|
|
|
|
self.polish_over_lbl = QtWidgets.QLabel('%s:' % _('Overlap'))
|
|
|
|
self.polish_over_lbl.setToolTip(
|
|
|
|
_("How much (percentage) of the tool width to overlap each tool pass.")
|
|
|
|
)
|
|
|
|
self.polish_over_entry = FCDoubleSpinner(suffix='%', callback=self.confirmation_message)
|
|
|
|
self.polish_over_entry.set_precision(self.decimals)
|
|
|
|
self.polish_over_entry.setWrapping(True)
|
|
|
|
self.polish_over_entry.set_range(0.0000, 99.9999)
|
|
|
|
self.polish_over_entry.setSingleStep(0.1)
|
|
|
|
self.polish_over_entry.setObjectName("g_polish_overlap")
|
|
|
|
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(self.polish_over_lbl, 22, 0)
|
|
|
|
self.grid4.addWidget(self.polish_over_entry, 22, 1)
|
2020-07-11 00:51:25 +00:00
|
|
|
|
|
|
|
# Polish Method
|
|
|
|
self.polish_method_lbl = QtWidgets.QLabel('%s:' % _('Method'))
|
|
|
|
self.polish_method_lbl.setToolTip(
|
|
|
|
_("Algorithm for polishing:\n"
|
|
|
|
"- Standard: Fixed step inwards.\n"
|
|
|
|
"- Seed-based: Outwards from seed.\n"
|
|
|
|
"- Line-based: Parallel lines.")
|
|
|
|
)
|
|
|
|
|
2020-10-28 21:00:18 +00:00
|
|
|
self.polish_method_combo = FCComboBox2()
|
2020-07-11 00:51:25 +00:00
|
|
|
self.polish_method_combo.addItems(
|
|
|
|
[_("Standard"), _("Seed"), _("Lines")]
|
|
|
|
)
|
|
|
|
self.polish_method_combo.setObjectName('g_polish_method')
|
|
|
|
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(self.polish_method_lbl, 24, 0)
|
|
|
|
self.grid4.addWidget(self.polish_method_combo, 24, 1)
|
2020-07-11 00:51:25 +00:00
|
|
|
|
|
|
|
self.polish_dia_lbl.hide()
|
|
|
|
self.polish_dia_entry.hide()
|
|
|
|
self.polish_pressure_lbl.hide()
|
|
|
|
self.polish_pressure_entry.hide()
|
2020-10-28 01:18:56 +00:00
|
|
|
self.polish_travelz_lbl.hide()
|
|
|
|
self.polish_travelz_entry.hide()
|
|
|
|
self.polish_margin_lbl.hide()
|
|
|
|
self.polish_margin_entry.hide()
|
2020-07-11 00:51:25 +00:00
|
|
|
self.polish_over_lbl.hide()
|
|
|
|
self.polish_over_entry.hide()
|
|
|
|
self.polish_method_lbl.hide()
|
|
|
|
self.polish_method_combo.hide()
|
|
|
|
|
|
|
|
self.ois_polish = OptionalHideInputSection(
|
|
|
|
self.polish_cb,
|
|
|
|
[
|
|
|
|
self.polish_dia_lbl,
|
|
|
|
self.polish_dia_entry,
|
|
|
|
self.polish_pressure_lbl,
|
|
|
|
self.polish_pressure_entry,
|
2020-10-28 01:18:56 +00:00
|
|
|
self.polish_travelz_lbl,
|
|
|
|
self.polish_travelz_entry,
|
|
|
|
self.polish_margin_lbl,
|
|
|
|
self.polish_margin_entry,
|
2020-07-11 00:51:25 +00:00
|
|
|
self.polish_over_lbl,
|
|
|
|
self.polish_over_entry,
|
|
|
|
self.polish_method_lbl,
|
|
|
|
self.polish_method_combo
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2020-05-09 22:05:02 +00:00
|
|
|
separator_line2 = QtWidgets.QFrame()
|
|
|
|
separator_line2.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(separator_line2, 26, 0, 1, 2)
|
2020-05-02 19:53:48 +00:00
|
|
|
|
2020-06-12 21:17:17 +00:00
|
|
|
# Button
|
|
|
|
self.generate_cnc_button = QtWidgets.QPushButton(_('Generate CNCJob object'))
|
2020-07-15 18:11:47 +00:00
|
|
|
self.generate_cnc_button.setIcon(QtGui.QIcon(self.app.resource_location + '/cnc16.png'))
|
2020-10-24 12:58:20 +00:00
|
|
|
self.generate_cnc_button.setToolTip('%s.\n%s' % (
|
|
|
|
_("Generate CNCJob object"),
|
2019-03-10 12:34:13 +00:00
|
|
|
_(
|
2020-01-16 00:33:54 +00:00
|
|
|
"Add / Select at least one tool in the tool-table.\n"
|
2020-01-30 03:55:46 +00:00
|
|
|
"Click the # header to select all, or Ctrl + LMB\n"
|
2020-06-12 21:17:17 +00:00
|
|
|
"for custom selection of tools.")))
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-12-10 02:14:58 +00:00
|
|
|
self.generate_cnc_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(self.generate_cnc_button, 28, 0, 1, 2)
|
2019-12-12 17:38:29 +00:00
|
|
|
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(QtWidgets.QLabel(''), 30, 0, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-07-19 18:46:11 +00:00
|
|
|
# ##############
|
|
|
|
# Paint area ##
|
|
|
|
# ##############
|
2019-12-12 17:38:29 +00:00
|
|
|
self.tools_label = QtWidgets.QLabel('<b>%s</b>' % _('TOOLS'))
|
|
|
|
self.tools_label.setToolTip(
|
|
|
|
_("Launch Paint Tool in Tools Tab.")
|
|
|
|
)
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(self.tools_label, 32, 0, 1, 2)
|
2019-12-12 17:38:29 +00:00
|
|
|
|
2020-10-21 19:17:23 +00:00
|
|
|
# Milling Tool - will create GCode for slot holes
|
|
|
|
self.milling_button = QtWidgets.QPushButton(_('Milling Tool'))
|
|
|
|
self.milling_button.setIcon(QtGui.QIcon(self.app.resource_location + '/milling_tool32.png'))
|
|
|
|
self.milling_button.setToolTip(
|
|
|
|
_("Generate a CNCJob by milling a Geometry.")
|
|
|
|
)
|
|
|
|
self.milling_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(self.milling_button, 34, 0, 1, 2)
|
2020-10-21 19:17:23 +00:00
|
|
|
# FIXME: until the Milling Tool is ready, this get disabled
|
|
|
|
self.milling_button.setDisabled(True)
|
|
|
|
|
2019-12-12 17:38:29 +00:00
|
|
|
# Paint Button
|
|
|
|
self.paint_tool_button = QtWidgets.QPushButton(_('Paint Tool'))
|
2020-07-15 18:11:47 +00:00
|
|
|
self.paint_tool_button.setIcon(QtGui.QIcon(self.app.resource_location + '/paint20_1.png'))
|
2019-12-12 17:38:29 +00:00
|
|
|
self.paint_tool_button.setToolTip(
|
2020-10-22 12:09:12 +00:00
|
|
|
_("Creates tool paths to cover the\n"
|
|
|
|
"whole area of a polygon.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-10-22 12:09:12 +00:00
|
|
|
|
2020-10-21 19:17:23 +00:00
|
|
|
# self.paint_tool_button.setStyleSheet("""
|
|
|
|
# QPushButton
|
|
|
|
# {
|
|
|
|
# font-weight: bold;
|
|
|
|
# }
|
|
|
|
# """)
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(self.paint_tool_button, 36, 0, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-12-12 17:38:29 +00:00
|
|
|
# NCC Tool
|
|
|
|
self.generate_ncc_button = QtWidgets.QPushButton(_('NCC Tool'))
|
2020-07-15 18:11:47 +00:00
|
|
|
self.generate_ncc_button.setIcon(QtGui.QIcon(self.app.resource_location + '/eraser26.png'))
|
2019-12-12 17:38:29 +00:00
|
|
|
self.generate_ncc_button.setToolTip(
|
|
|
|
_("Create the Geometry Object\n"
|
|
|
|
"for non-copper routing.")
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
2020-10-21 18:42:31 +00:00
|
|
|
# self.generate_ncc_button.setStyleSheet("""
|
|
|
|
# QPushButton
|
|
|
|
# {
|
|
|
|
# font-weight: bold;
|
|
|
|
# }
|
|
|
|
# """)
|
2020-10-28 01:18:56 +00:00
|
|
|
self.grid4.addWidget(self.generate_ncc_button, 38, 0, 1, 2)
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CNCObjectUI(ObjectUI):
|
|
|
|
"""
|
|
|
|
User interface for CNCJob objects.
|
|
|
|
"""
|
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
def __init__(self, app, parent=None):
|
2019-01-03 19:25:08 +00:00
|
|
|
"""
|
2020-05-18 13:39:26 +00:00
|
|
|
Creates the user interface for CNCJob objects. GUI elements should
|
2019-01-03 19:25:08 +00:00
|
|
|
be placed in ``self.custom_box`` to preserve the layout.
|
|
|
|
"""
|
2019-12-15 14:28:36 +00:00
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.decimals = app.decimals
|
|
|
|
self.app = app
|
|
|
|
|
2019-12-15 14:28:36 +00:00
|
|
|
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
|
|
if theme_settings.contains("theme"):
|
|
|
|
theme = theme_settings.value('theme', type=str)
|
|
|
|
else:
|
|
|
|
theme = 'white'
|
|
|
|
|
|
|
|
if theme == 'white':
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
else:
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
|
|
|
|
ObjectUI.__init__(
|
|
|
|
self, title=_('CNC Job Object'),
|
|
|
|
icon_file=self.resource_loc + '/cnc32.png', parent=parent,
|
2020-02-03 00:18:28 +00:00
|
|
|
app=self.app)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2019-10-14 19:26:50 +00:00
|
|
|
for i in range(0, self.common_grid.count()):
|
|
|
|
self.common_grid.itemAt(i).widget().hide()
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2020-07-10 01:39:25 +00:00
|
|
|
f_lay = QtWidgets.QGridLayout()
|
|
|
|
f_lay.setColumnStretch(0, 0)
|
|
|
|
f_lay.setColumnStretch(1, 1)
|
|
|
|
self.custom_box.addLayout(f_lay)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2020-07-10 01:39:25 +00:00
|
|
|
# Plot Options
|
|
|
|
self.cncplot_method_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
|
2019-10-01 15:24:15 +00:00
|
|
|
self.cncplot_method_label.setToolTip(
|
|
|
|
_(
|
|
|
|
"This selects the kind of geometries on the canvas to plot.\n"
|
|
|
|
"Those can be either of type 'Travel' which means the moves\n"
|
|
|
|
"above the work piece or it can be of type 'Cut',\n"
|
|
|
|
"which means the moves that cut into the material."
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
self.cncplot_method_combo = RadioSet([
|
|
|
|
{"label": _("All"), "value": "all"},
|
|
|
|
{"label": _("Travel"), "value": "travel"},
|
|
|
|
{"label": _("Cut"), "value": "cut"}
|
|
|
|
], stretch=False)
|
|
|
|
|
2020-07-10 01:39:25 +00:00
|
|
|
f_lay.addWidget(self.cncplot_method_label, 0, 0)
|
|
|
|
f_lay.addWidget(self.cncplot_method_combo, 0, 1, 1, 2)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
|
|
|
self.name_hlay = QtWidgets.QHBoxLayout()
|
2020-09-26 11:39:52 +00:00
|
|
|
f_lay.addLayout(self.name_hlay, 2, 0, 1, 3)
|
2020-07-10 01:39:25 +00:00
|
|
|
|
|
|
|
# ## Object name
|
2019-10-01 15:24:15 +00:00
|
|
|
name_label = QtWidgets.QLabel("<b>%s:</b>" % _("Name"))
|
|
|
|
self.name_entry = FCEntry()
|
|
|
|
self.name_entry.setFocusPolicy(QtCore.Qt.StrongFocus)
|
2020-07-10 01:39:25 +00:00
|
|
|
|
2019-10-01 15:24:15 +00:00
|
|
|
self.name_hlay.addWidget(name_label)
|
|
|
|
self.name_hlay.addWidget(self.name_entry)
|
|
|
|
|
2020-09-26 11:39:52 +00:00
|
|
|
# Editor
|
|
|
|
self.editor_button = FCButton(_('GCode Editor'))
|
|
|
|
self.editor_button.setIcon(QtGui.QIcon(self.app.resource_location + '/edit_file32.png'))
|
|
|
|
|
|
|
|
self.editor_button.setToolTip(
|
|
|
|
_("Edit an GCode object.")
|
|
|
|
)
|
|
|
|
self.editor_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
f_lay.addWidget(self.editor_button, 4, 0, 1, 3)
|
|
|
|
|
2020-10-20 15:11:12 +00:00
|
|
|
# PROPERTIES CB
|
2020-10-21 09:16:17 +00:00
|
|
|
self.properties_button = FCButton('%s' % _("PROPERTIES"), checkable=True)
|
|
|
|
self.properties_button.setIcon(QtGui.QIcon(self.app.resource_location + '/properties32.png'))
|
|
|
|
self.properties_button.setToolTip(_("Show the Properties."))
|
|
|
|
self.properties_button.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
f_lay.addWidget(self.properties_button, 6, 0, 1, 3)
|
2020-10-20 15:11:12 +00:00
|
|
|
|
|
|
|
# PROPERTIES Frame
|
|
|
|
self.properties_frame = QtWidgets.QFrame()
|
|
|
|
self.properties_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
f_lay.addWidget(self.properties_frame, 7, 0, 1, 3)
|
|
|
|
self.properties_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.properties_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.properties_frame.setLayout(self.properties_box)
|
|
|
|
self.properties_frame.hide()
|
|
|
|
|
|
|
|
self.treeWidget = FCTree(columns=2)
|
|
|
|
|
|
|
|
self.properties_box.addWidget(self.treeWidget)
|
|
|
|
self.properties_box.setStretch(0, 0)
|
|
|
|
|
2020-07-10 01:39:25 +00:00
|
|
|
# Annotation
|
|
|
|
self.annotation_cb = FCCheckBox(_("Display Annotation"))
|
|
|
|
self.annotation_cb.setToolTip(
|
|
|
|
_("This selects if to display text annotation on the plot.\n"
|
|
|
|
"When checked it will display numbers in order for each end\n"
|
|
|
|
"of a travel line.")
|
|
|
|
)
|
2020-10-20 15:11:12 +00:00
|
|
|
f_lay.addWidget(self.annotation_cb, 8, 0, 1, 3)
|
2020-07-10 01:39:25 +00:00
|
|
|
|
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-10-20 15:11:12 +00:00
|
|
|
f_lay.addWidget(separator_line, 10, 0, 1, 3)
|
2020-07-10 01:39:25 +00:00
|
|
|
|
|
|
|
# Travelled Distance
|
|
|
|
self.t_distance_label = QtWidgets.QLabel("<b>%s:</b>" % _("Travelled distance"))
|
2019-10-01 15:24:15 +00:00
|
|
|
self.t_distance_label.setToolTip(
|
|
|
|
_("This is the total travelled distance on X-Y plane.\n"
|
|
|
|
"In current units.")
|
|
|
|
)
|
|
|
|
self.t_distance_entry = FCEntry()
|
|
|
|
self.units_label = QtWidgets.QLabel()
|
|
|
|
|
2020-10-20 15:11:12 +00:00
|
|
|
f_lay.addWidget(self.t_distance_label, 12, 0)
|
|
|
|
f_lay.addWidget(self.t_distance_entry, 12, 1)
|
|
|
|
f_lay.addWidget(self.units_label, 12, 2)
|
2020-07-10 01:39:25 +00:00
|
|
|
|
|
|
|
# Estimated Time
|
2019-10-01 15:24:15 +00:00
|
|
|
self.t_time_label = QtWidgets.QLabel("<b>%s:</b>" % _("Estimated time"))
|
|
|
|
self.t_time_label.setToolTip(
|
|
|
|
_("This is the estimated time to do the routing/drilling,\n"
|
|
|
|
"without the time spent in ToolChange events.")
|
|
|
|
)
|
|
|
|
self.t_time_entry = FCEntry()
|
|
|
|
self.units_time_label = QtWidgets.QLabel()
|
|
|
|
|
2020-10-20 15:11:12 +00:00
|
|
|
f_lay.addWidget(self.t_time_label, 14, 0)
|
|
|
|
f_lay.addWidget(self.t_time_entry, 14, 1)
|
|
|
|
f_lay.addWidget(self.units_time_label, 14, 2)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
|
|
|
self.t_distance_label.hide()
|
|
|
|
self.t_distance_entry.setVisible(False)
|
|
|
|
self.t_time_label.hide()
|
|
|
|
self.t_time_entry.setVisible(False)
|
|
|
|
|
2020-07-10 01:39:25 +00:00
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-10-20 15:11:12 +00:00
|
|
|
f_lay.addWidget(separator_line, 16, 0, 1, 3)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
|
|
|
hlay = QtWidgets.QHBoxLayout()
|
|
|
|
self.custom_box.addLayout(hlay)
|
|
|
|
|
|
|
|
# CNC Tools Table for plot
|
|
|
|
self.cnc_tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('CNC Tools Table'))
|
|
|
|
self.cnc_tools_table_label.setToolTip(
|
|
|
|
_(
|
|
|
|
"Tools in this CNCJob object used for cutting.\n"
|
|
|
|
"The tool diameter is used for plotting on canvas.\n"
|
|
|
|
"The 'Offset' entry will set an offset for the cut.\n"
|
|
|
|
"'Offset' can be inside, outside, on path (none) and custom.\n"
|
|
|
|
"'Type' entry is only informative and it allow to know the \n"
|
|
|
|
"intent of using the current tool. \n"
|
|
|
|
"It can be Rough(ing), Finish(ing) or Iso(lation).\n"
|
|
|
|
"The 'Tool type'(TT) can be circular with 1 to 4 teeths(C1..C4),\n"
|
|
|
|
"ball(B), or V-Shaped(V)."
|
|
|
|
)
|
|
|
|
)
|
|
|
|
hlay.addWidget(self.cnc_tools_table_label)
|
|
|
|
|
|
|
|
# Plot CB
|
|
|
|
# self.plot_cb = QtWidgets.QCheckBox('Plot')
|
|
|
|
self.plot_cb = FCCheckBox(_('Plot Object'))
|
|
|
|
self.plot_cb.setToolTip(
|
|
|
|
_("Plot (show) this object.")
|
|
|
|
)
|
|
|
|
self.plot_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
|
|
|
hlay.addStretch()
|
|
|
|
hlay.addWidget(self.plot_cb)
|
|
|
|
|
|
|
|
self.cnc_tools_table = FCTable()
|
|
|
|
self.custom_box.addWidget(self.cnc_tools_table)
|
|
|
|
|
|
|
|
self.cnc_tools_table.setColumnCount(7)
|
|
|
|
self.cnc_tools_table.setColumnWidth(0, 20)
|
2019-12-10 13:26:51 +00:00
|
|
|
self.cnc_tools_table.setHorizontalHeaderLabels(['#', _('Dia'), _('Offset'), _('Type'), _('TT'), '', _('P')])
|
2019-10-01 15:24:15 +00:00
|
|
|
self.cnc_tools_table.setColumnHidden(5, True)
|
|
|
|
# stylesheet = "::section{Background-color:rgb(239,239,245)}"
|
|
|
|
# self.cnc_tools_table.horizontalHeader().setStyleSheet(stylesheet)
|
|
|
|
|
2019-12-10 13:26:51 +00:00
|
|
|
self.exc_cnc_tools_table = FCTable()
|
|
|
|
self.custom_box.addWidget(self.exc_cnc_tools_table)
|
|
|
|
|
2019-12-10 14:00:37 +00:00
|
|
|
self.exc_cnc_tools_table.setColumnCount(7)
|
2019-12-10 13:26:51 +00:00
|
|
|
self.exc_cnc_tools_table.setColumnWidth(0, 20)
|
2019-12-10 14:00:37 +00:00
|
|
|
self.exc_cnc_tools_table.setHorizontalHeaderLabels(['#', _('Dia'), _('Drills'), _('Slots'), '', _("Cut Z"),
|
|
|
|
_('P')])
|
2019-12-10 13:26:51 +00:00
|
|
|
self.exc_cnc_tools_table.setColumnHidden(4, True)
|
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
2019-10-14 19:26:50 +00:00
|
|
|
self.tooldia_entry.set_range(0, 9999.9999)
|
|
|
|
self.tooldia_entry.set_precision(self.decimals)
|
|
|
|
self.tooldia_entry.setSingleStep(0.1)
|
|
|
|
self.custom_box.addWidget(self.tooldia_entry)
|
|
|
|
|
2019-10-01 15:24:15 +00:00
|
|
|
# Update plot button
|
|
|
|
self.updateplot_button = QtWidgets.QPushButton(_('Update Plot'))
|
|
|
|
self.updateplot_button.setToolTip(
|
|
|
|
_("Update the plot.")
|
|
|
|
)
|
|
|
|
self.custom_box.addWidget(self.updateplot_button)
|
|
|
|
|
2020-07-15 00:31:39 +00:00
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
|
|
|
self.custom_box.addWidget(separator_line)
|
|
|
|
|
2020-08-02 13:27:30 +00:00
|
|
|
# CNC Code snippets
|
|
|
|
self.snippets_cb = FCCheckBox(_("Use CNC Code Snippets"))
|
|
|
|
self.snippets_cb.setToolTip(
|
|
|
|
_("When selected, it will include CNC Code snippets (append and prepend)\n"
|
|
|
|
"defined in the Preferences.")
|
|
|
|
)
|
|
|
|
self.custom_box.addWidget(self.snippets_cb)
|
|
|
|
|
2020-08-13 12:13:07 +00:00
|
|
|
# Autolevelling
|
2020-10-22 16:49:19 +00:00
|
|
|
self.sal_btn = FCButton('%s' % _("Autolevelling"), checkable=True)
|
|
|
|
# self.sal_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/properties32.png'))
|
|
|
|
self.sal_btn.setToolTip(
|
2020-08-13 12:13:07 +00:00
|
|
|
_("Enable the autolevelling feature.")
|
|
|
|
)
|
2020-10-22 16:49:19 +00:00
|
|
|
self.sal_btn.setStyleSheet("""
|
|
|
|
QPushButton
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
self.custom_box.addWidget(self.sal_btn)
|
|
|
|
|
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
|
|
|
self.custom_box.addWidget(separator_line)
|
2020-08-13 12:13:07 +00:00
|
|
|
|
|
|
|
self.al_frame = QtWidgets.QFrame()
|
|
|
|
self.al_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.custom_box.addWidget(self.al_frame)
|
|
|
|
|
|
|
|
self.al_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.al_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.al_frame.setLayout(self.al_box)
|
|
|
|
|
|
|
|
grid0 = QtWidgets.QGridLayout()
|
|
|
|
grid0.setColumnStretch(0, 0)
|
|
|
|
grid0.setColumnStretch(1, 1)
|
|
|
|
self.al_box.addLayout(grid0)
|
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
al_title = FCLabel('<b>%s</b>' % _("Probe Points Table"))
|
2020-08-13 12:13:07 +00:00
|
|
|
al_title.setToolTip(_("Generate GCode that will obtain the height map"))
|
2020-08-14 09:46:27 +00:00
|
|
|
|
|
|
|
self.show_al_table = FCCheckBox(_("Show"))
|
2020-08-16 20:05:31 +00:00
|
|
|
self.show_al_table.setToolTip(_("Toggle the display of the Probe Points table."))
|
2020-08-14 09:46:27 +00:00
|
|
|
self.show_al_table.setChecked(True)
|
|
|
|
|
|
|
|
hor_lay = QtWidgets.QHBoxLayout()
|
|
|
|
hor_lay.addWidget(al_title)
|
|
|
|
hor_lay.addStretch()
|
|
|
|
hor_lay.addWidget(self.show_al_table, alignment=QtCore.Qt.AlignRight)
|
|
|
|
|
|
|
|
grid0.addLayout(hor_lay, 0, 0, 1, 2)
|
2020-08-13 12:13:07 +00:00
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
self.al_probe_points_table = FCTable()
|
|
|
|
self.al_probe_points_table.setColumnCount(3)
|
|
|
|
self.al_probe_points_table.setColumnWidth(0, 20)
|
|
|
|
self.al_probe_points_table.setHorizontalHeaderLabels(['#', _('X-Y Coordinates'), _('Height')])
|
2020-08-13 12:13:07 +00:00
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
grid0.addWidget(self.al_probe_points_table, 1, 0, 1, 2)
|
2020-08-13 12:13:07 +00:00
|
|
|
|
2020-09-03 00:45:58 +00:00
|
|
|
self.plot_probing_pts_cb = FCCheckBox(_("Plot probing points"))
|
|
|
|
self.plot_probing_pts_cb.setToolTip(
|
|
|
|
_("Plot the probing points in the table.\n"
|
|
|
|
"If a Voronoi method is used then\n"
|
|
|
|
"the Voronoi areas are also plotted.")
|
2020-08-14 09:46:27 +00:00
|
|
|
)
|
2020-09-03 00:45:58 +00:00
|
|
|
grid0.addWidget(self.plot_probing_pts_cb, 3, 0, 1, 2)
|
2020-08-14 09:46:27 +00:00
|
|
|
|
2020-08-13 12:13:07 +00:00
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-08-14 09:46:27 +00:00
|
|
|
grid0.addWidget(separator_line, 5, 0, 1, 2)
|
2020-08-13 12:13:07 +00:00
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
# #############################################################################################################
|
|
|
|
# ############### Probe GCode Generation ######################################################################
|
|
|
|
# #############################################################################################################
|
|
|
|
|
|
|
|
self.probe_gc_label = FCLabel('<b>%s</b>:' % _("Probe GCode Generation"))
|
|
|
|
self.probe_gc_label.setToolTip(
|
|
|
|
_("Will create a GCode which will be sent to the controller,\n"
|
|
|
|
"either through a file or directly, with the intent to get the height map\n"
|
|
|
|
"that is to modify the original GCode to level the cutting height.")
|
|
|
|
)
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addWidget(self.probe_gc_label, 7, 0, 1, 2)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
# Travel Z Probe
|
|
|
|
self.ptravelz_label = QtWidgets.QLabel('%s:' % _("Probe Z travel"))
|
|
|
|
self.ptravelz_label.setToolTip(
|
|
|
|
_("The safe Z for probe travelling between probe points.")
|
|
|
|
)
|
|
|
|
self.ptravelz_entry = FCDoubleSpinner()
|
|
|
|
self.ptravelz_entry.set_precision(self.decimals)
|
|
|
|
self.ptravelz_entry.set_range(0.0000, 9999.9999)
|
|
|
|
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addWidget(self.ptravelz_label, 9, 0)
|
|
|
|
grid0.addWidget(self.ptravelz_entry, 9, 1)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
# Probe depth
|
|
|
|
self.pdepth_label = QtWidgets.QLabel('%s:' % _("Probe Z depth"))
|
|
|
|
self.pdepth_label.setToolTip(
|
|
|
|
_("The maximum depth that the probe is allowed\n"
|
|
|
|
"to probe. Negative value, in current units.")
|
|
|
|
)
|
|
|
|
self.pdepth_entry = FCDoubleSpinner()
|
|
|
|
self.pdepth_entry.set_precision(self.decimals)
|
|
|
|
self.pdepth_entry.set_range(-99999.9999, 0.0000)
|
|
|
|
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addWidget(self.pdepth_label, 11, 0)
|
|
|
|
grid0.addWidget(self.pdepth_entry, 11, 1)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
# Probe feedrate
|
2020-08-16 21:40:45 +00:00
|
|
|
self.feedrate_probe_label = QtWidgets.QLabel('%s:' % _("Probe Feedrate"))
|
2020-08-16 20:05:31 +00:00
|
|
|
self.feedrate_probe_label.setToolTip(
|
|
|
|
_("The feedrate used while the probe is probing.")
|
|
|
|
)
|
|
|
|
self.feedrate_probe_entry = FCDoubleSpinner()
|
|
|
|
self.feedrate_probe_entry.set_precision(self.decimals)
|
|
|
|
self.feedrate_probe_entry.set_range(0, 99999.9999)
|
|
|
|
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addWidget(self.feedrate_probe_label, 13, 0)
|
|
|
|
grid0.addWidget(self.feedrate_probe_entry, 13, 1)
|
|
|
|
|
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
|
|
|
grid0.addWidget(separator_line, 15, 0, 1, 2)
|
|
|
|
|
2020-09-02 21:37:10 +00:00
|
|
|
# AUTOLEVELL MODE
|
2020-08-23 23:13:13 +00:00
|
|
|
al_mode_lbl = FCLabel('<b>%s</b>:' % _("Mode"))
|
|
|
|
al_mode_lbl.setToolTip(_("Choose a mode for height map generation.\n"
|
|
|
|
"- Manual: will pick a selection of probe points by clicking on canvas\n"
|
|
|
|
"- Grid: will automatically generate a grid of probe points"))
|
|
|
|
|
|
|
|
self.al_mode_radio = RadioSet(
|
|
|
|
[
|
|
|
|
{'label': _('Manual'), 'value': 'manual'},
|
|
|
|
{'label': _('Grid'), 'value': 'grid'}
|
|
|
|
])
|
2020-09-02 21:37:10 +00:00
|
|
|
grid0.addWidget(al_mode_lbl, 16, 0)
|
|
|
|
grid0.addWidget(self.al_mode_radio, 16, 1)
|
|
|
|
|
|
|
|
# AUTOLEVELL METHOD
|
|
|
|
self.al_method_lbl = FCLabel('%s:' % _("Method"))
|
|
|
|
self.al_method_lbl.setToolTip(_("Choose a method for approximation of heights from autolevelling data.\n"
|
|
|
|
"- Voronoi: will generate a Voronoi diagram\n"
|
|
|
|
"- Bilinear: will use bilinear interpolation. Usable only for grid mode."))
|
|
|
|
|
|
|
|
self.al_method_radio = RadioSet(
|
|
|
|
[
|
|
|
|
{'label': _('Voronoi'), 'value': 'v'},
|
|
|
|
{'label': _('Bilinear'), 'value': 'b'}
|
|
|
|
])
|
|
|
|
self.al_method_lbl.setDisabled(True)
|
|
|
|
self.al_method_radio.setDisabled(True)
|
|
|
|
self.al_method_radio.set_value('v')
|
|
|
|
|
|
|
|
grid0.addWidget(self.al_method_lbl, 17, 0)
|
|
|
|
grid0.addWidget(self.al_method_radio, 17, 1)
|
2020-08-23 23:13:13 +00:00
|
|
|
|
|
|
|
# ## Columns
|
|
|
|
self.al_columns_entry = FCSpinner()
|
2020-09-03 00:45:58 +00:00
|
|
|
self.al_columns_entry.setMinimum(2)
|
2020-08-23 23:13:13 +00:00
|
|
|
|
|
|
|
self.al_columns_label = QtWidgets.QLabel('%s:' % _("Columns"))
|
|
|
|
self.al_columns_label.setToolTip(
|
|
|
|
_("The number of grid columns.")
|
|
|
|
)
|
|
|
|
grid0.addWidget(self.al_columns_label, 19, 0)
|
|
|
|
grid0.addWidget(self.al_columns_entry, 19, 1)
|
|
|
|
|
|
|
|
# ## Rows
|
|
|
|
self.al_rows_entry = FCSpinner()
|
2020-09-03 00:45:58 +00:00
|
|
|
self.al_rows_entry.setMinimum(2)
|
2020-08-23 23:13:13 +00:00
|
|
|
|
|
|
|
self.al_rows_label = QtWidgets.QLabel('%s:' % _("Rows"))
|
|
|
|
self.al_rows_label.setToolTip(
|
2020-10-24 12:58:20 +00:00
|
|
|
_("The number of grid rows.")
|
2020-08-23 23:13:13 +00:00
|
|
|
)
|
|
|
|
grid0.addWidget(self.al_rows_label, 21, 0)
|
|
|
|
grid0.addWidget(self.al_rows_entry, 21, 1)
|
|
|
|
|
|
|
|
self.al_add_button = FCButton(_("Add Probe Points"))
|
|
|
|
grid0.addWidget(self.al_add_button, 23, 0, 1, 2)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addWidget(separator_line, 25, 0, 1, 2)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
self.al_controller_label = FCLabel('<b>%s</b>:' % _("Controller"))
|
2020-08-16 21:40:45 +00:00
|
|
|
self.al_controller_label.setToolTip(
|
2020-08-13 14:32:54 +00:00
|
|
|
_("The kind of controller for which to generate\n"
|
|
|
|
"height map gcode.")
|
2020-08-13 12:13:07 +00:00
|
|
|
)
|
2020-08-13 14:32:54 +00:00
|
|
|
|
|
|
|
self.al_controller_combo = FCComboBox()
|
2020-08-16 20:05:31 +00:00
|
|
|
self.al_controller_combo.addItems(["MACH3", "MACH4", "LinuxCNC", "GRBL"])
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addWidget(self.al_controller_label, 27, 0)
|
|
|
|
grid0.addWidget(self.al_controller_combo, 27, 1)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
# #############################################################################################################
|
|
|
|
# ########################## GRBL frame #######################################################################
|
|
|
|
# #############################################################################################################
|
|
|
|
self.grbl_frame = QtWidgets.QFrame()
|
|
|
|
self.grbl_frame.setContentsMargins(0, 0, 0, 0)
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addWidget(self.grbl_frame, 29, 0, 1, 2)
|
2020-08-13 12:13:07 +00:00
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
self.grbl_box = QtWidgets.QVBoxLayout()
|
|
|
|
self.grbl_box.setContentsMargins(0, 0, 0, 0)
|
|
|
|
self.grbl_frame.setLayout(self.grbl_box)
|
|
|
|
|
2020-08-17 12:50:51 +00:00
|
|
|
# #############################################################################################################
|
|
|
|
# ########################## GRBL TOOLBAR #####################################################################
|
|
|
|
# #############################################################################################################
|
|
|
|
self.al_toolbar = FCDetachableTab(protect=True, parent=self)
|
|
|
|
self.al_toolbar.setTabsClosable(False)
|
|
|
|
self.al_toolbar.useOldIndex(True)
|
2020-08-19 14:20:05 +00:00
|
|
|
self.al_toolbar.set_detachable(val=False)
|
2020-08-17 12:50:51 +00:00
|
|
|
self.grbl_box.addWidget(self.al_toolbar)
|
|
|
|
|
|
|
|
# GRBL Connect TAB
|
|
|
|
self.gr_conn_tab = QtWidgets.QWidget()
|
|
|
|
self.gr_conn_tab.setObjectName("connect_tab")
|
|
|
|
self.gr_conn_tab_layout = QtWidgets.QVBoxLayout(self.gr_conn_tab)
|
|
|
|
self.gr_conn_tab_layout.setContentsMargins(2, 2, 2, 2)
|
|
|
|
# self.gr_conn_scroll_area = VerticalScrollArea()
|
|
|
|
# self.gr_conn_tab_layout.addWidget(self.gr_conn_scroll_area)
|
|
|
|
self.al_toolbar.addTab(self.gr_conn_tab, _("Connect"))
|
|
|
|
|
|
|
|
# GRBL Control TAB
|
|
|
|
self.gr_ctrl_tab = QtWidgets.QWidget()
|
|
|
|
self.gr_ctrl_tab.setObjectName("connect_tab")
|
|
|
|
self.gr_ctrl_tab_layout = QtWidgets.QVBoxLayout(self.gr_ctrl_tab)
|
|
|
|
self.gr_ctrl_tab_layout.setContentsMargins(2, 2, 2, 2)
|
|
|
|
|
|
|
|
# self.gr_ctrl_scroll_area = VerticalScrollArea()
|
|
|
|
# self.gr_ctrl_tab_layout.addWidget(self.gr_ctrl_scroll_area)
|
|
|
|
self.al_toolbar.addTab(self.gr_ctrl_tab, _("Control"))
|
|
|
|
|
|
|
|
# GRBL Sender TAB
|
|
|
|
self.gr_send_tab = QtWidgets.QWidget()
|
|
|
|
self.gr_send_tab.setObjectName("connect_tab")
|
|
|
|
self.gr_send_tab_layout = QtWidgets.QVBoxLayout(self.gr_send_tab)
|
|
|
|
self.gr_send_tab_layout.setContentsMargins(2, 2, 2, 2)
|
|
|
|
|
|
|
|
# self.gr_send_scroll_area = VerticalScrollArea()
|
|
|
|
# self.gr_send_tab_layout.addWidget(self.gr_send_scroll_area)
|
|
|
|
self.al_toolbar.addTab(self.gr_send_tab, _("Sender"))
|
2020-08-19 01:44:50 +00:00
|
|
|
|
|
|
|
for idx in range(self.al_toolbar.count()):
|
|
|
|
if self.al_toolbar.tabText(idx) == _("Connect"):
|
|
|
|
self.al_toolbar.tabBar.setTabTextColor(idx, QtGui.QColor('red'))
|
|
|
|
if self.al_toolbar.tabText(idx) == _("Control"):
|
|
|
|
self.al_toolbar.tabBar.setTabEnabled(idx, False)
|
|
|
|
if self.al_toolbar.tabText(idx) == _("Sender"):
|
|
|
|
self.al_toolbar.tabBar.setTabEnabled(idx, False)
|
2020-08-17 12:50:51 +00:00
|
|
|
# #############################################################################################################
|
2020-08-16 20:05:31 +00:00
|
|
|
|
2020-08-21 15:08:40 +00:00
|
|
|
# #############################################################################################################
|
2020-08-16 20:05:31 +00:00
|
|
|
# GRBL CONNECT
|
2020-08-21 15:08:40 +00:00
|
|
|
# #############################################################################################################
|
2020-08-17 12:50:51 +00:00
|
|
|
grbl_conn_grid = QtWidgets.QGridLayout()
|
|
|
|
grbl_conn_grid.setColumnStretch(0, 0)
|
|
|
|
grbl_conn_grid.setColumnStretch(1, 1)
|
|
|
|
grbl_conn_grid.setColumnStretch(2, 0)
|
|
|
|
self.gr_conn_tab_layout.addLayout(grbl_conn_grid)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
# COM list
|
|
|
|
self.com_list_label = FCLabel('%s:' % _("COM list"))
|
|
|
|
self.com_list_label.setToolTip(
|
|
|
|
_("Lists the available serial ports.")
|
|
|
|
)
|
|
|
|
|
|
|
|
self.com_list_combo = FCComboBox()
|
|
|
|
self.com_search_button = FCButton(_("Search"))
|
|
|
|
self.com_search_button.setToolTip(
|
|
|
|
_("Search for the available serial ports.")
|
|
|
|
)
|
2020-08-17 12:50:51 +00:00
|
|
|
grbl_conn_grid.addWidget(self.com_list_label, 2, 0)
|
|
|
|
grbl_conn_grid.addWidget(self.com_list_combo, 2, 1)
|
|
|
|
grbl_conn_grid.addWidget(self.com_search_button, 2, 2)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
# BAUDRATES list
|
|
|
|
self.baudrates_list_label = FCLabel('%s:' % _("Baud rates"))
|
|
|
|
self.baudrates_list_label.setToolTip(
|
|
|
|
_("Lists the available serial ports.")
|
|
|
|
)
|
|
|
|
|
|
|
|
self.baudrates_list_combo = FCComboBox()
|
|
|
|
cbmodel = QtCore.QStringListModel()
|
|
|
|
self.baudrates_list_combo.setModel(cbmodel)
|
|
|
|
self.baudrates_list_combo.addItems(
|
|
|
|
['9600', '19200', '38400', '57600', '115200', '230400', '460800', '500000', '576000', '921600', '1000000',
|
|
|
|
'1152000', '1500000', '2000000'])
|
|
|
|
self.baudrates_list_combo.setCurrentText('115200')
|
|
|
|
|
2020-08-17 12:50:51 +00:00
|
|
|
grbl_conn_grid.addWidget(self.baudrates_list_label, 4, 0)
|
|
|
|
grbl_conn_grid.addWidget(self.baudrates_list_combo, 4, 1)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
# New baudrate
|
|
|
|
self.new_bd_label = FCLabel('%s:' % _("New"))
|
|
|
|
self.new_bd_label.setToolTip(
|
|
|
|
_("New, custom baudrate.")
|
|
|
|
)
|
|
|
|
|
|
|
|
self.new_baudrate_entry = FCSpinner()
|
|
|
|
self.new_baudrate_entry.set_range(40, 9999999)
|
|
|
|
|
|
|
|
self.add_bd_button = FCButton(_("Add"))
|
|
|
|
self.add_bd_button.setToolTip(
|
|
|
|
_("Add the specified custom baudrate to the list.")
|
|
|
|
)
|
2020-08-17 12:50:51 +00:00
|
|
|
grbl_conn_grid.addWidget(self.new_bd_label, 6, 0)
|
|
|
|
grbl_conn_grid.addWidget(self.new_baudrate_entry, 6, 1)
|
|
|
|
grbl_conn_grid.addWidget(self.add_bd_button, 6, 2)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
self.del_bd_button = FCButton(_("Delete selected baudrate"))
|
2020-08-17 12:50:51 +00:00
|
|
|
grbl_conn_grid.addWidget(self.del_bd_button, 8, 0, 1, 3)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
2020-08-17 12:50:51 +00:00
|
|
|
ctrl_hlay = QtWidgets.QHBoxLayout()
|
|
|
|
self.controller_reset_button = FCButton(_("Reset"))
|
|
|
|
self.controller_reset_button.setToolTip(
|
2020-08-19 14:20:05 +00:00
|
|
|
_("Software reset of the controller.")
|
2020-08-17 12:50:51 +00:00
|
|
|
)
|
2020-08-19 14:20:05 +00:00
|
|
|
self.controller_reset_button.setDisabled(True)
|
2020-08-17 12:50:51 +00:00
|
|
|
ctrl_hlay.addWidget(self.controller_reset_button)
|
|
|
|
|
2020-08-19 01:44:50 +00:00
|
|
|
self.com_connect_button = FCButton()
|
|
|
|
self.com_connect_button.setText(_("Disconnected"))
|
2020-08-17 12:50:51 +00:00
|
|
|
self.com_connect_button.setToolTip(
|
|
|
|
_("Connect to the selected port with the selected baud rate.")
|
|
|
|
)
|
2020-08-19 01:36:46 +00:00
|
|
|
self.com_connect_button.setStyleSheet("QPushButton {background-color: red;}")
|
2020-08-17 12:50:51 +00:00
|
|
|
ctrl_hlay.addWidget(self.com_connect_button)
|
|
|
|
|
2020-08-23 23:13:13 +00:00
|
|
|
grbl_conn_grid.addWidget(FCLabel(""), 9, 0, 1, 3)
|
2020-08-21 15:08:40 +00:00
|
|
|
grbl_conn_grid.setRowStretch(9, 1)
|
2020-08-17 12:50:51 +00:00
|
|
|
grbl_conn_grid.addLayout(ctrl_hlay, 10, 0, 1, 3)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
2020-08-21 15:08:40 +00:00
|
|
|
# #############################################################################################################
|
2020-08-16 20:05:31 +00:00
|
|
|
# GRBL CONTROL
|
2020-08-21 15:08:40 +00:00
|
|
|
# #############################################################################################################
|
2020-08-17 12:50:51 +00:00
|
|
|
grbl_ctrl_grid = QtWidgets.QGridLayout()
|
|
|
|
grbl_ctrl_grid.setColumnStretch(0, 0)
|
2020-08-22 00:34:45 +00:00
|
|
|
grbl_ctrl_grid.setColumnStretch(1, 1)
|
|
|
|
grbl_ctrl_grid.setColumnStretch(2, 0)
|
2020-08-17 12:50:51 +00:00
|
|
|
self.gr_ctrl_tab_layout.addLayout(grbl_ctrl_grid)
|
2020-08-21 15:08:40 +00:00
|
|
|
|
|
|
|
grbl_ctrl2_grid = QtWidgets.QGridLayout()
|
|
|
|
grbl_ctrl2_grid.setColumnStretch(0, 0)
|
|
|
|
grbl_ctrl2_grid.setColumnStretch(1, 1)
|
|
|
|
self.gr_ctrl_tab_layout.addLayout(grbl_ctrl2_grid)
|
|
|
|
|
2020-08-17 12:50:51 +00:00
|
|
|
self.gr_ctrl_tab_layout.addStretch(1)
|
|
|
|
|
2020-08-22 00:34:45 +00:00
|
|
|
jog_title_label = FCLabel(_("Jog"))
|
|
|
|
jog_title_label.setStyleSheet("""
|
|
|
|
FCLabel
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
|
|
|
|
zero_title_label = FCLabel(_("Zero Axes"))
|
|
|
|
zero_title_label.setStyleSheet("""
|
|
|
|
FCLabel
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
""")
|
|
|
|
|
|
|
|
grbl_ctrl_grid.addWidget(jog_title_label, 0, 0)
|
|
|
|
grbl_ctrl_grid.addWidget(zero_title_label, 0, 2)
|
|
|
|
|
|
|
|
self.jog_wdg = FCJog(self.app)
|
2020-08-21 15:08:40 +00:00
|
|
|
self.jog_wdg.setStyleSheet("""
|
|
|
|
FCJog
|
|
|
|
{
|
|
|
|
border: 1px solid lightgray;
|
2020-08-22 00:34:45 +00:00
|
|
|
border-radius: 5px;
|
2020-08-21 15:08:40 +00:00
|
|
|
}
|
|
|
|
""")
|
|
|
|
|
2020-08-22 00:34:45 +00:00
|
|
|
self.zero_axs_wdg = FCZeroAxes(self.app)
|
2020-08-21 15:08:40 +00:00
|
|
|
self.zero_axs_wdg.setStyleSheet("""
|
|
|
|
FCZeroAxes
|
|
|
|
{
|
|
|
|
border: 1px solid lightgray;
|
|
|
|
border-radius: 5px
|
|
|
|
}
|
|
|
|
""")
|
2020-08-22 00:34:45 +00:00
|
|
|
grbl_ctrl_grid.addWidget(self.jog_wdg, 2, 0)
|
|
|
|
grbl_ctrl_grid.addWidget(self.zero_axs_wdg, 2, 2)
|
|
|
|
|
|
|
|
self.pause_resume_button = RotatedToolButton()
|
|
|
|
self.pause_resume_button.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
|
|
|
self.pause_resume_button.setText(_("Pause/Resume"))
|
|
|
|
self.pause_resume_button.setCheckable(True)
|
2020-08-22 00:54:07 +00:00
|
|
|
self.pause_resume_button.setStyleSheet("""
|
|
|
|
RotatedToolButton:checked
|
|
|
|
{
|
|
|
|
background-color: red;
|
|
|
|
color: white;
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
""")
|
2020-08-22 00:34:45 +00:00
|
|
|
|
|
|
|
pause_frame = QtWidgets.QFrame()
|
|
|
|
pause_frame.setContentsMargins(0, 0, 0, 0)
|
|
|
|
pause_frame.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Expanding)
|
|
|
|
pause_hlay = QtWidgets.QHBoxLayout()
|
|
|
|
pause_hlay.setContentsMargins(0, 0, 0, 0)
|
|
|
|
|
|
|
|
pause_hlay.addWidget(self.pause_resume_button)
|
|
|
|
pause_frame.setLayout(pause_hlay)
|
|
|
|
grbl_ctrl_grid.addWidget(pause_frame, 2, 1)
|
2020-08-21 15:08:40 +00:00
|
|
|
|
|
|
|
# JOG Step
|
|
|
|
self.jog_step_label = FCLabel('%s:' % _("Step"))
|
|
|
|
self.jog_step_label.setToolTip(
|
|
|
|
_("Each jog action will move the axes with this value.")
|
|
|
|
)
|
|
|
|
|
2020-08-23 12:20:12 +00:00
|
|
|
self.jog_step_entry = FCSliderWithDoubleSpinner()
|
2020-08-21 15:08:40 +00:00
|
|
|
self.jog_step_entry.set_precision(self.decimals)
|
|
|
|
self.jog_step_entry.setSingleStep(0.1)
|
2020-08-23 13:57:59 +00:00
|
|
|
self.jog_step_entry.set_range(0, 500)
|
2020-08-21 15:08:40 +00:00
|
|
|
|
|
|
|
grbl_ctrl2_grid.addWidget(self.jog_step_label, 0, 0)
|
|
|
|
grbl_ctrl2_grid.addWidget(self.jog_step_entry, 0, 1)
|
|
|
|
|
|
|
|
# JOG Feedrate
|
|
|
|
self.jog_fr_label = FCLabel('%s:' % _("Feedrate"))
|
|
|
|
self.jog_fr_label.setToolTip(
|
|
|
|
_("Feedrate when jogging.")
|
|
|
|
)
|
|
|
|
|
2020-08-23 12:20:12 +00:00
|
|
|
self.jog_fr_entry = FCSliderWithDoubleSpinner()
|
2020-08-21 15:08:40 +00:00
|
|
|
self.jog_fr_entry.set_precision(self.decimals)
|
|
|
|
self.jog_fr_entry.setSingleStep(10)
|
2020-08-23 13:57:59 +00:00
|
|
|
self.jog_fr_entry.set_range(0, 10000)
|
2020-08-21 15:08:40 +00:00
|
|
|
|
|
|
|
grbl_ctrl2_grid.addWidget(self.jog_fr_label, 1, 0)
|
|
|
|
grbl_ctrl2_grid.addWidget(self.jog_fr_entry, 1, 1)
|
2020-08-17 12:50:51 +00:00
|
|
|
|
2020-08-21 15:08:40 +00:00
|
|
|
# #############################################################################################################
|
2020-08-17 12:50:51 +00:00
|
|
|
# GRBL SENDER
|
2020-08-21 15:08:40 +00:00
|
|
|
# #############################################################################################################
|
2020-08-17 12:50:51 +00:00
|
|
|
grbl_send_grid = QtWidgets.QGridLayout()
|
2020-08-19 14:20:05 +00:00
|
|
|
grbl_send_grid.setColumnStretch(0, 1)
|
|
|
|
grbl_send_grid.setColumnStretch(1, 0)
|
2020-08-17 12:50:51 +00:00
|
|
|
self.gr_send_tab_layout.addLayout(grbl_send_grid)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
2020-08-19 14:20:05 +00:00
|
|
|
# Send CUSTOM COMMAND
|
|
|
|
self.grbl_command_label = FCLabel('%s:' % _("Send Command"))
|
2020-08-16 20:05:31 +00:00
|
|
|
self.grbl_command_label.setToolTip(
|
|
|
|
_("Send a custom command to GRBL.")
|
|
|
|
)
|
2020-08-19 14:20:05 +00:00
|
|
|
grbl_send_grid.addWidget(self.grbl_command_label, 2, 0, 1, 2)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
self.grbl_command_entry = FCEntry()
|
2020-08-21 15:08:40 +00:00
|
|
|
self.grbl_command_entry.setPlaceholderText(_("Type GRBL command ..."))
|
2020-08-16 20:05:31 +00:00
|
|
|
|
2020-08-17 12:50:51 +00:00
|
|
|
self.grbl_send_button = QtWidgets.QToolButton()
|
|
|
|
self.grbl_send_button.setText(_("Send"))
|
2020-08-16 20:05:31 +00:00
|
|
|
self.grbl_send_button.setToolTip(
|
|
|
|
_("Send a custom command to GRBL.")
|
|
|
|
)
|
2020-08-19 14:20:05 +00:00
|
|
|
grbl_send_grid.addWidget(self.grbl_command_entry, 4, 0)
|
|
|
|
grbl_send_grid.addWidget(self.grbl_send_button, 4, 1)
|
2020-08-19 00:44:16 +00:00
|
|
|
|
|
|
|
# Get Parameter
|
2020-08-19 14:20:05 +00:00
|
|
|
self.grbl_get_param_label = FCLabel('%s:' % _("Get Config parameter"))
|
2020-08-19 00:44:16 +00:00
|
|
|
self.grbl_get_param_label.setToolTip(
|
2020-08-23 23:13:13 +00:00
|
|
|
_("A GRBL configuration parameter.")
|
2020-08-19 00:44:16 +00:00
|
|
|
)
|
2020-08-19 14:20:05 +00:00
|
|
|
grbl_send_grid.addWidget(self.grbl_get_param_label, 6, 0, 1, 2)
|
2020-08-19 00:44:16 +00:00
|
|
|
|
|
|
|
self.grbl_parameter_entry = FCEntry()
|
2020-08-21 15:08:40 +00:00
|
|
|
self.grbl_parameter_entry.setPlaceholderText(_("Type GRBL parameter ..."))
|
2020-08-19 00:44:16 +00:00
|
|
|
|
|
|
|
self.grbl_get_param_button = QtWidgets.QToolButton()
|
|
|
|
self.grbl_get_param_button.setText(_("Get"))
|
|
|
|
self.grbl_get_param_button.setToolTip(
|
|
|
|
_("Get the value of a specified GRBL parameter.")
|
|
|
|
)
|
2020-08-19 14:20:05 +00:00
|
|
|
grbl_send_grid.addWidget(self.grbl_parameter_entry, 8, 0)
|
|
|
|
grbl_send_grid.addWidget(self.grbl_get_param_button, 8, 1)
|
|
|
|
|
2020-08-23 23:13:13 +00:00
|
|
|
grbl_send_grid.setRowStretch(9, 1)
|
|
|
|
|
2020-08-19 14:20:05 +00:00
|
|
|
# GET Report
|
|
|
|
self.grbl_report_button = FCButton(_("Get Report"))
|
|
|
|
self.grbl_report_button.setToolTip(
|
|
|
|
_("Print in shell the GRBL report.")
|
|
|
|
)
|
|
|
|
grbl_send_grid.addWidget(self.grbl_report_button, 10, 0, 1, 2)
|
|
|
|
|
2020-09-02 21:37:10 +00:00
|
|
|
hm_lay = QtWidgets.QHBoxLayout()
|
2020-08-19 14:20:05 +00:00
|
|
|
# GET HEIGHT MAP
|
2020-08-23 23:13:13 +00:00
|
|
|
self.grbl_get_heightmap_button = FCButton(_("Apply AutoLevelling"))
|
2020-08-19 14:20:05 +00:00
|
|
|
self.grbl_get_heightmap_button.setToolTip(
|
2020-08-23 23:13:13 +00:00
|
|
|
_("Will send the probing GCode to the GRBL controller,\n"
|
|
|
|
"wait for the Z probing data and then apply this data\n"
|
|
|
|
"over the original GCode therefore doing autolevelling.")
|
2020-08-19 14:20:05 +00:00
|
|
|
)
|
2020-09-02 21:37:10 +00:00
|
|
|
hm_lay.addWidget(self.grbl_get_heightmap_button, stretch=1)
|
|
|
|
|
|
|
|
self.grbl_save_height_map_button = QtWidgets.QToolButton()
|
|
|
|
self.grbl_save_height_map_button.setIcon(QtGui.QIcon(self.app.resource_location + '/save_as.png'))
|
|
|
|
self.grbl_save_height_map_button.setToolTip(
|
|
|
|
_("Will save the GRBL height map.")
|
|
|
|
)
|
|
|
|
hm_lay.addWidget(self.grbl_save_height_map_button, stretch=0, alignment=Qt.AlignRight)
|
|
|
|
|
|
|
|
grbl_send_grid.addLayout(hm_lay, 12, 0, 1, 2)
|
2020-08-19 00:44:16 +00:00
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
self.grbl_frame.hide()
|
|
|
|
# #############################################################################################################
|
|
|
|
|
|
|
|
height_lay = QtWidgets.QHBoxLayout()
|
2020-08-23 21:51:07 +00:00
|
|
|
self.h_gcode_button = FCButton(_("Save Probing GCode"))
|
2020-09-02 21:37:10 +00:00
|
|
|
self.h_gcode_button.setToolTip(
|
|
|
|
_("Will save the probing GCode.")
|
|
|
|
)
|
2020-08-16 20:05:31 +00:00
|
|
|
self.h_gcode_button.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
|
|
|
|
|
|
|
height_lay.addWidget(self.h_gcode_button)
|
|
|
|
self.view_h_gcode_button = QtWidgets.QToolButton()
|
2020-08-23 21:51:07 +00:00
|
|
|
self.view_h_gcode_button.setIcon(QtGui.QIcon(self.app.resource_location + '/edit_file32.png'))
|
2020-08-16 20:05:31 +00:00
|
|
|
# self.view_h_gcode_button.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
|
|
|
|
self.view_h_gcode_button.setToolTip(
|
2020-08-23 21:51:07 +00:00
|
|
|
_("View/Edit the probing GCode.")
|
2020-08-16 20:05:31 +00:00
|
|
|
)
|
|
|
|
# height_lay.addStretch()
|
|
|
|
height_lay.addWidget(self.view_h_gcode_button)
|
|
|
|
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addLayout(height_lay, 31, 0, 1, 2)
|
2020-08-13 12:13:07 +00:00
|
|
|
|
|
|
|
self.import_heights_button = FCButton(_("Import Height Map"))
|
2020-08-23 23:13:13 +00:00
|
|
|
self.import_heights_button.setToolTip(
|
|
|
|
_("Import the file that has the Z heights\n"
|
|
|
|
"obtained through probing and then apply this data\n"
|
|
|
|
"over the original GCode therefore\n"
|
|
|
|
"doing autolevelling.")
|
|
|
|
)
|
|
|
|
grid0.addWidget(self.import_heights_button, 33, 0, 1, 2)
|
2020-08-16 20:05:31 +00:00
|
|
|
|
|
|
|
self.h_gcode_button.hide()
|
|
|
|
self.import_heights_button.hide()
|
|
|
|
|
2020-08-13 12:13:07 +00:00
|
|
|
separator_line = QtWidgets.QFrame()
|
|
|
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2020-08-23 23:13:13 +00:00
|
|
|
grid0.addWidget(separator_line, 35, 0, 1, 2)
|
2020-08-13 12:13:07 +00:00
|
|
|
|
2020-08-21 15:08:40 +00:00
|
|
|
# #############################################################################################################
|
2019-10-01 15:24:15 +00:00
|
|
|
# ## Export G-Code ##
|
2020-08-21 15:08:40 +00:00
|
|
|
# #############################################################################################################
|
2019-10-01 15:24:15 +00:00
|
|
|
self.export_gcode_label = QtWidgets.QLabel("<b>%s:</b>" % _("Export CNC Code"))
|
|
|
|
self.export_gcode_label.setToolTip(
|
|
|
|
_("Export and save G-Code to\n"
|
|
|
|
"make this object to a file.")
|
|
|
|
)
|
|
|
|
self.custom_box.addWidget(self.export_gcode_label)
|
|
|
|
|
2020-08-16 21:40:45 +00:00
|
|
|
g_export_lay = QtWidgets.QHBoxLayout()
|
2020-08-18 23:26:35 +00:00
|
|
|
self.custom_box.addLayout(g_export_lay)
|
|
|
|
|
2020-08-02 13:27:30 +00:00
|
|
|
# Save Button
|
2020-08-16 21:40:45 +00:00
|
|
|
self.export_gcode_button = FCButton(_('Save CNC Code'))
|
2020-07-17 21:26:03 +00:00
|
|
|
self.export_gcode_button.setIcon(QtGui.QIcon(self.app.resource_location + '/save_as.png'))
|
2019-10-01 15:24:15 +00:00
|
|
|
self.export_gcode_button.setToolTip(
|
|
|
|
_("Opens dialog to save G-Code\n"
|
|
|
|
"file.")
|
|
|
|
)
|
2020-08-18 23:26:35 +00:00
|
|
|
self.export_gcode_button.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
2020-08-16 21:40:45 +00:00
|
|
|
g_export_lay.addWidget(self.export_gcode_button)
|
|
|
|
|
|
|
|
self.review_gcode_button = QtWidgets.QToolButton()
|
|
|
|
self.review_gcode_button.setToolTip(_("Review CNC Code."))
|
|
|
|
self.review_gcode_button.setIcon(QtGui.QIcon(self.app.resource_location + '/find32.png'))
|
|
|
|
g_export_lay.addWidget(self.review_gcode_button)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2020-08-03 20:20:41 +00:00
|
|
|
self.custom_box.addStretch()
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
self.al_probe_points_table.setRowCount(0)
|
|
|
|
self.al_probe_points_table.resizeColumnsToContents()
|
|
|
|
self.al_probe_points_table.resizeRowsToContents()
|
|
|
|
v_header = self.al_probe_points_table.verticalHeader()
|
2020-08-13 12:13:07 +00:00
|
|
|
v_header.hide()
|
2020-08-16 20:05:31 +00:00
|
|
|
self.al_probe_points_table.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
2020-08-13 12:13:07 +00:00
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
h_header = self.al_probe_points_table.horizontalHeader()
|
2020-08-13 12:13:07 +00:00
|
|
|
h_header.setMinimumSectionSize(10)
|
|
|
|
h_header.setDefaultSectionSize(70)
|
|
|
|
h_header.setSectionResizeMode(0, QtWidgets.QHeaderView.Fixed)
|
|
|
|
h_header.resizeSection(0, 20)
|
|
|
|
h_header.setSectionResizeMode(1, QtWidgets.QHeaderView.Stretch)
|
|
|
|
h_header.setSectionResizeMode(2, QtWidgets.QHeaderView.ResizeToContents)
|
|
|
|
|
2020-08-16 20:05:31 +00:00
|
|
|
self.al_probe_points_table.setMinimumHeight(self.al_probe_points_table.getHeight())
|
|
|
|
self.al_probe_points_table.setMaximumHeight(self.al_probe_points_table.getHeight())
|
2020-08-13 12:13:07 +00:00
|
|
|
|
2020-08-13 14:32:54 +00:00
|
|
|
# Set initial UI
|
2020-08-13 12:13:07 +00:00
|
|
|
self.al_frame.hide()
|
2020-09-03 00:45:58 +00:00
|
|
|
self.al_rows_entry.setDisabled(True)
|
|
|
|
self.al_rows_label.setDisabled(True)
|
|
|
|
self.al_columns_entry.setDisabled(True)
|
|
|
|
self.al_columns_label.setDisabled(True)
|
|
|
|
self.al_method_lbl.setDisabled(True)
|
|
|
|
self.al_method_radio.setDisabled(True)
|
|
|
|
self.al_method_radio.set_value('v')
|
2020-08-13 14:32:54 +00:00
|
|
|
# self.on_mode_radio(val='grid')
|
|
|
|
|
2019-10-01 15:24:15 +00:00
|
|
|
|
|
|
|
class ScriptObjectUI(ObjectUI):
|
|
|
|
"""
|
|
|
|
User interface for Script objects.
|
|
|
|
"""
|
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
def __init__(self, app, parent=None):
|
2019-10-01 15:24:15 +00:00
|
|
|
"""
|
2020-05-18 13:39:26 +00:00
|
|
|
Creates the user interface for Script objects. GUI elements should
|
2019-10-01 15:24:15 +00:00
|
|
|
be placed in ``self.custom_box`` to preserve the layout.
|
|
|
|
"""
|
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.decimals = app.decimals
|
|
|
|
self.app = app
|
|
|
|
|
2019-12-15 14:28:36 +00:00
|
|
|
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
|
|
if theme_settings.contains("theme"):
|
|
|
|
theme = theme_settings.value('theme', type=str)
|
|
|
|
else:
|
|
|
|
theme = 'white'
|
|
|
|
|
|
|
|
if theme == 'white':
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
else:
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
ObjectUI.__init__(self, title=_('Script Object'),
|
2019-12-15 14:28:36 +00:00
|
|
|
icon_file=self.resource_loc + '/script_new24.png',
|
2019-10-02 14:58:48 +00:00
|
|
|
parent=parent,
|
2019-12-05 13:18:54 +00:00
|
|
|
common=False,
|
2020-02-03 00:18:28 +00:00
|
|
|
app=self.app)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
|
|
|
# ## Object name
|
|
|
|
self.name_hlay = QtWidgets.QHBoxLayout()
|
|
|
|
self.custom_box.addLayout(self.name_hlay)
|
2019-10-02 14:58:48 +00:00
|
|
|
|
2019-10-01 15:24:15 +00:00
|
|
|
name_label = QtWidgets.QLabel("<b>%s:</b>" % _("Name"))
|
|
|
|
self.name_entry = FCEntry()
|
|
|
|
self.name_entry.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
|
|
self.name_hlay.addWidget(name_label)
|
|
|
|
self.name_hlay.addWidget(self.name_entry)
|
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
h_lay = QtWidgets.QHBoxLayout()
|
|
|
|
h_lay.setAlignment(QtCore.Qt.AlignVCenter)
|
|
|
|
self.custom_box.addLayout(h_lay)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
self.autocomplete_cb = FCCheckBox("%s" % _("Auto Completer"))
|
|
|
|
self.autocomplete_cb.setToolTip(
|
|
|
|
_("This selects if the auto completer is enabled in the Script Editor.")
|
2019-10-01 15:24:15 +00:00
|
|
|
)
|
2019-10-02 14:58:48 +00:00
|
|
|
self.autocomplete_cb.setStyleSheet(
|
|
|
|
"""
|
|
|
|
QCheckBox {font-weight: bold; color: black}
|
|
|
|
"""
|
2019-10-01 15:24:15 +00:00
|
|
|
)
|
2019-10-02 14:58:48 +00:00
|
|
|
h_lay.addWidget(self.autocomplete_cb)
|
|
|
|
h_lay.addStretch()
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
# Plot CB - this is added only for compatibility; other FlatCAM objects expect it and the mechanism is already
|
|
|
|
# established and I don't want to changed it right now
|
|
|
|
self.plot_cb = FCCheckBox()
|
2019-10-01 15:24:15 +00:00
|
|
|
self.plot_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
2019-10-02 14:58:48 +00:00
|
|
|
self.custom_box.addWidget(self.plot_cb)
|
|
|
|
self.plot_cb.hide()
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
self.custom_box.addStretch()
|
2019-10-01 15:24:15 +00:00
|
|
|
|
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
class DocumentObjectUI(ObjectUI):
|
|
|
|
"""
|
|
|
|
User interface for Notes objects.
|
|
|
|
"""
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
def __init__(self, app, parent=None):
|
2019-10-02 14:58:48 +00:00
|
|
|
"""
|
2020-05-18 13:39:26 +00:00
|
|
|
Creates the user interface for Notes objects. GUI elements should
|
2019-10-02 14:58:48 +00:00
|
|
|
be placed in ``self.custom_box`` to preserve the layout.
|
|
|
|
"""
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2020-02-03 00:18:28 +00:00
|
|
|
self.decimals = app.decimals
|
|
|
|
self.app = app
|
|
|
|
|
2019-12-15 14:28:36 +00:00
|
|
|
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
|
|
if theme_settings.contains("theme"):
|
|
|
|
theme = theme_settings.value('theme', type=str)
|
|
|
|
else:
|
|
|
|
theme = 'white'
|
|
|
|
|
|
|
|
if theme == 'white':
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
else:
|
2020-04-28 14:23:49 +00:00
|
|
|
self.resource_loc = 'assets/resources'
|
2019-12-15 14:28:36 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
ObjectUI.__init__(self, title=_('Document Object'),
|
2019-12-15 14:28:36 +00:00
|
|
|
icon_file=self.resource_loc + '/notes16_1.png',
|
2019-10-02 14:58:48 +00:00
|
|
|
parent=parent,
|
2019-12-05 13:18:54 +00:00
|
|
|
common=False,
|
2020-02-03 00:18:28 +00:00
|
|
|
app=self.app)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
# ## Object name
|
|
|
|
self.name_hlay = QtWidgets.QHBoxLayout()
|
|
|
|
self.custom_box.addLayout(self.name_hlay)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
name_label = QtWidgets.QLabel("<b>%s:</b>" % _("Name"))
|
|
|
|
self.name_entry = FCEntry()
|
|
|
|
self.name_entry.setFocusPolicy(QtCore.Qt.StrongFocus)
|
|
|
|
self.name_hlay.addWidget(name_label)
|
|
|
|
self.name_hlay.addWidget(self.name_entry)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2019-10-03 18:44:37 +00:00
|
|
|
# Plot CB - this is added only for compatibility; other FlatCAM objects expect it and the mechanism is already
|
|
|
|
# established and I don't want to changed it right now
|
|
|
|
self.plot_cb = FCCheckBox()
|
|
|
|
self.plot_cb.setLayoutDirection(QtCore.Qt.RightToLeft)
|
|
|
|
self.custom_box.addWidget(self.plot_cb)
|
|
|
|
self.plot_cb.hide()
|
|
|
|
|
2019-10-03 14:15:21 +00:00
|
|
|
h_lay = QtWidgets.QHBoxLayout()
|
|
|
|
h_lay.setAlignment(QtCore.Qt.AlignVCenter)
|
|
|
|
self.custom_box.addLayout(h_lay)
|
|
|
|
|
|
|
|
self.autocomplete_cb = FCCheckBox("%s" % _("Auto Completer"))
|
|
|
|
self.autocomplete_cb.setToolTip(
|
|
|
|
_("This selects if the auto completer is enabled in the Document Editor.")
|
|
|
|
)
|
|
|
|
self.autocomplete_cb.setStyleSheet(
|
|
|
|
"""
|
|
|
|
QCheckBox {font-weight: bold; color: black}
|
|
|
|
"""
|
|
|
|
)
|
|
|
|
h_lay.addWidget(self.autocomplete_cb)
|
|
|
|
h_lay.addStretch()
|
|
|
|
|
2019-10-03 18:44:37 +00:00
|
|
|
# ##############################################################
|
|
|
|
# ############ FORM LAYOUT #####################################
|
|
|
|
# ##############################################################
|
|
|
|
|
|
|
|
self.form_box = QtWidgets.QFormLayout()
|
|
|
|
self.custom_box.addLayout(self.form_box)
|
|
|
|
|
|
|
|
# Font
|
|
|
|
self.font_type_label = QtWidgets.QLabel('%s:' % _("Font Type"))
|
|
|
|
|
|
|
|
if sys.platform == "win32":
|
|
|
|
f_current = QtGui.QFont("Arial")
|
|
|
|
elif sys.platform == "linux":
|
|
|
|
f_current = QtGui.QFont("FreeMono")
|
|
|
|
else:
|
|
|
|
f_current = QtGui.QFont("Helvetica Neue")
|
|
|
|
|
|
|
|
self.font_name = f_current.family()
|
|
|
|
|
|
|
|
self.font_type_cb = QtWidgets.QFontComboBox(self)
|
|
|
|
self.font_type_cb.setCurrentFont(f_current)
|
|
|
|
|
|
|
|
self.form_box.addRow(self.font_type_label, self.font_type_cb)
|
|
|
|
|
|
|
|
# Font Size
|
|
|
|
self.font_size_label = QtWidgets.QLabel('%s:' % _("Font Size"))
|
|
|
|
|
|
|
|
self.font_size_cb = FCComboBox()
|
|
|
|
self.font_size_cb.setEditable(True)
|
|
|
|
self.font_size_cb.setMinimumContentsLength(3)
|
|
|
|
self.font_size_cb.setMaximumWidth(70)
|
|
|
|
|
|
|
|
font_sizes = ['6', '7', '8', '9', '10', '11', '12', '13', '14',
|
|
|
|
'15', '16', '18', '20', '22', '24', '26', '28',
|
|
|
|
'32', '36', '40', '44', '48', '54', '60', '66',
|
|
|
|
'72', '80', '88', '96']
|
|
|
|
|
|
|
|
for i in font_sizes:
|
|
|
|
self.font_size_cb.addItem(i)
|
|
|
|
|
|
|
|
size_hlay = QtWidgets.QHBoxLayout()
|
|
|
|
size_hlay.addWidget(self.font_size_cb)
|
|
|
|
size_hlay.addStretch()
|
|
|
|
|
|
|
|
self.font_bold_tb = QtWidgets.QToolButton()
|
|
|
|
self.font_bold_tb.setCheckable(True)
|
2019-12-15 14:28:36 +00:00
|
|
|
self.font_bold_tb.setIcon(QtGui.QIcon(self.resource_loc + '/bold32.png'))
|
2019-10-03 18:44:37 +00:00
|
|
|
size_hlay.addWidget(self.font_bold_tb)
|
|
|
|
|
|
|
|
self.font_italic_tb = QtWidgets.QToolButton()
|
|
|
|
self.font_italic_tb.setCheckable(True)
|
2019-12-15 14:28:36 +00:00
|
|
|
self.font_italic_tb.setIcon(QtGui.QIcon(self.resource_loc + '/italic32.png'))
|
2019-10-03 18:44:37 +00:00
|
|
|
size_hlay.addWidget(self.font_italic_tb)
|
|
|
|
self.font_under_tb = QtWidgets.QToolButton()
|
|
|
|
self.font_under_tb.setCheckable(True)
|
2019-12-15 14:28:36 +00:00
|
|
|
self.font_under_tb.setIcon(QtGui.QIcon(self.resource_loc + '/underline32.png'))
|
2019-10-03 18:44:37 +00:00
|
|
|
size_hlay.addWidget(self.font_under_tb)
|
|
|
|
|
|
|
|
self.form_box.addRow(self.font_size_label, size_hlay)
|
|
|
|
|
|
|
|
# Alignment Choices
|
|
|
|
self.alignment_label = QtWidgets.QLabel('%s:' % _("Alignment"))
|
|
|
|
|
|
|
|
al_hlay = QtWidgets.QHBoxLayout()
|
|
|
|
|
|
|
|
self.al_left_tb = QtWidgets.QToolButton()
|
|
|
|
self.al_left_tb.setToolTip(_("Align Left"))
|
2019-12-15 14:28:36 +00:00
|
|
|
self.al_left_tb.setIcon(QtGui.QIcon(self.resource_loc + '/align_left32.png'))
|
2019-10-03 18:44:37 +00:00
|
|
|
al_hlay.addWidget(self.al_left_tb)
|
|
|
|
|
|
|
|
self.al_center_tb = QtWidgets.QToolButton()
|
|
|
|
self.al_center_tb.setToolTip(_("Center"))
|
2019-12-15 14:28:36 +00:00
|
|
|
self.al_center_tb.setIcon(QtGui.QIcon(self.resource_loc + '/align_center32.png'))
|
2019-10-03 18:44:37 +00:00
|
|
|
al_hlay.addWidget(self.al_center_tb)
|
|
|
|
|
|
|
|
self.al_right_tb = QtWidgets.QToolButton()
|
|
|
|
self.al_right_tb.setToolTip(_("Align Right"))
|
2019-12-15 14:28:36 +00:00
|
|
|
self.al_right_tb.setIcon(QtGui.QIcon(self.resource_loc + '/align_right32.png'))
|
2019-10-03 18:44:37 +00:00
|
|
|
al_hlay.addWidget(self.al_right_tb)
|
|
|
|
|
|
|
|
self.al_justify_tb = QtWidgets.QToolButton()
|
|
|
|
self.al_justify_tb.setToolTip(_("Justify"))
|
2019-12-15 14:28:36 +00:00
|
|
|
self.al_justify_tb.setIcon(QtGui.QIcon(self.resource_loc + '/align_justify32.png'))
|
2019-10-03 18:44:37 +00:00
|
|
|
al_hlay.addWidget(self.al_justify_tb)
|
|
|
|
|
|
|
|
self.form_box.addRow(self.alignment_label, al_hlay)
|
|
|
|
|
|
|
|
# Font Color
|
|
|
|
self.font_color_label = QtWidgets.QLabel('%s:' % _('Font Color'))
|
|
|
|
self.font_color_label.setToolTip(
|
|
|
|
_("Set the font color for the selected text")
|
|
|
|
)
|
|
|
|
self.font_color_entry = FCEntry()
|
|
|
|
self.font_color_button = QtWidgets.QPushButton()
|
|
|
|
self.font_color_button.setFixedSize(15, 15)
|
|
|
|
|
|
|
|
self.form_box_child_1 = QtWidgets.QHBoxLayout()
|
|
|
|
self.form_box_child_1.addWidget(self.font_color_entry)
|
|
|
|
self.form_box_child_1.addWidget(self.font_color_button)
|
|
|
|
self.form_box_child_1.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
|
|
|
|
|
|
self.form_box.addRow(self.font_color_label, self.form_box_child_1)
|
|
|
|
|
|
|
|
# Selection Color
|
|
|
|
self.sel_color_label = QtWidgets.QLabel('%s:' % _('Selection Color'))
|
|
|
|
self.sel_color_label.setToolTip(
|
|
|
|
_("Set the selection color when doing text selection.")
|
|
|
|
)
|
|
|
|
self.sel_color_entry = FCEntry()
|
|
|
|
self.sel_color_button = QtWidgets.QPushButton()
|
|
|
|
self.sel_color_button.setFixedSize(15, 15)
|
|
|
|
|
|
|
|
self.form_box_child_2 = QtWidgets.QHBoxLayout()
|
|
|
|
self.form_box_child_2.addWidget(self.sel_color_entry)
|
|
|
|
self.form_box_child_2.addWidget(self.sel_color_button)
|
|
|
|
self.form_box_child_2.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
|
|
|
|
|
|
self.form_box.addRow(self.sel_color_label, self.form_box_child_2)
|
|
|
|
|
|
|
|
# Tab size
|
|
|
|
self.tab_size_label = QtWidgets.QLabel('%s:' % _('Tab Size'))
|
|
|
|
self.tab_size_label.setToolTip(
|
|
|
|
_("Set the tab size. In pixels. Default value is 80 pixels.")
|
|
|
|
)
|
2020-02-03 00:18:28 +00:00
|
|
|
self.tab_size_spinner = FCSpinner(callback=self.confirmation_message_int)
|
2019-10-03 18:44:37 +00:00
|
|
|
self.tab_size_spinner.set_range(0, 1000)
|
|
|
|
|
|
|
|
self.form_box.addRow(self.tab_size_label, self.tab_size_spinner)
|
2019-10-01 15:24:15 +00:00
|
|
|
|
2019-10-02 14:58:48 +00:00
|
|
|
self.custom_box.addStretch()
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
# end of file
|