2020-04-29 21:53:16 +00:00
|
|
|
from PyQt5 import QtWidgets, QtGui
|
|
|
|
from PyQt5.QtCore import QSettings
|
|
|
|
|
2020-08-04 10:33:58 +00:00
|
|
|
from appGUI.GUIElements import RadioSet, FCCheckBox
|
2020-06-03 17:35:59 +00:00
|
|
|
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
2020-04-29 21:53:16 +00:00
|
|
|
|
2020-04-30 09:47:07 +00:00
|
|
|
import gettext
|
2020-06-03 17:35:59 +00:00
|
|
|
import appTranslation as fcTranslate
|
2020-04-30 09:47:07 +00:00
|
|
|
import builtins
|
|
|
|
|
|
|
|
fcTranslate.apply_language('strings')
|
|
|
|
if '_' not in builtins.__dict__:
|
|
|
|
_ = gettext.gettext
|
|
|
|
|
|
|
|
settings = QSettings("Open Source", "FlatCAM")
|
|
|
|
if settings.contains("machinist"):
|
|
|
|
machinist_setting = settings.value('machinist', type=int)
|
|
|
|
else:
|
|
|
|
machinist_setting = 0
|
|
|
|
|
2020-04-29 21:53:16 +00:00
|
|
|
|
|
|
|
class CNCJobOptPrefGroupUI(OptionsGroupUI):
|
|
|
|
def __init__(self, decimals=4, parent=None):
|
|
|
|
# OptionsGroupUI.__init__(self, "CNC Job Options Preferences", parent=None)
|
2020-04-30 09:47:07 +00:00
|
|
|
super(CNCJobOptPrefGroupUI, self).__init__(self, parent=parent)
|
2020-04-29 21:53:16 +00:00
|
|
|
|
|
|
|
self.setTitle(str(_("CNC Job Options")))
|
|
|
|
self.decimals = decimals
|
|
|
|
|
|
|
|
# ## Export G-Code
|
|
|
|
self.export_gcode_label = QtWidgets.QLabel("<b>%s:</b>" % _("Export G-Code"))
|
|
|
|
self.export_gcode_label.setToolTip(
|
|
|
|
_("Export and save G-Code to\n"
|
|
|
|
"make this object to a file.")
|
|
|
|
)
|
|
|
|
self.layout.addWidget(self.export_gcode_label)
|
|
|
|
|
|
|
|
qsettings = QSettings("Open Source", "FlatCAM")
|
|
|
|
if qsettings.contains("textbox_font_size"):
|
|
|
|
tb_fsize = qsettings.value('textbox_font_size', type=int)
|
|
|
|
else:
|
|
|
|
tb_fsize = 10
|
|
|
|
font = QtGui.QFont()
|
|
|
|
font.setPointSize(tb_fsize)
|
|
|
|
|
2020-08-04 10:33:58 +00:00
|
|
|
grid0 = QtWidgets.QGridLayout()
|
|
|
|
self.layout.addLayout(grid0)
|
|
|
|
grid0.setColumnStretch(0, 0)
|
|
|
|
grid0.setColumnStretch(1, 1)
|
2020-04-29 21:53:16 +00:00
|
|
|
|
2020-08-04 10:33:58 +00:00
|
|
|
# Plot Kind
|
|
|
|
self.cncplot_method_label = QtWidgets.QLabel('%s:' % _("Plot kind"))
|
|
|
|
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.")
|
2020-04-29 21:53:16 +00:00
|
|
|
)
|
|
|
|
|
2020-08-04 10:33:58 +00:00
|
|
|
self.cncplot_method_radio = RadioSet([
|
|
|
|
{"label": _("All"), "value": "all"},
|
|
|
|
{"label": _("Travel"), "value": "travel"},
|
|
|
|
{"label": _("Cut"), "value": "cut"}
|
|
|
|
], orientation='vertical', stretch=False)
|
|
|
|
|
|
|
|
grid0.addWidget(self.cncplot_method_label, 1, 0)
|
|
|
|
grid0.addWidget(self.cncplot_method_radio, 1, 1)
|
|
|
|
grid0.addWidget(QtWidgets.QLabel(''), 1, 2)
|
|
|
|
|
|
|
|
# Display 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-04-29 21:53:16 +00:00
|
|
|
)
|
2020-08-04 10:33:58 +00:00
|
|
|
|
|
|
|
grid0.addWidget(self.annotation_cb, 2, 0, 1, 3)
|
2020-04-29 21:53:16 +00:00
|
|
|
|
2020-04-30 09:47:07 +00:00
|
|
|
self.layout.addStretch()
|