- renamed classes to have shorter names and grouped

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

View File

@@ -0,0 +1,246 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCEntry, FloatEntry, FCDoubleSpinner, FCCheckBox, RadioSet, FCLabel
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class GeometryAdvOptPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Geometry Advanced Options Preferences", parent=parent)
super(GeometryAdvOptPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Geometry Adv. Options")))
self.decimals = decimals
# ------------------------------
# ## Advanced Options
# ------------------------------
self.geo_label = QtWidgets.QLabel('<b>%s:</b>' % _('Advanced Options'))
self.geo_label.setToolTip(
_("A list of Geometry advanced parameters.\n"
"Those parameters are available only for\n"
"Advanced App. Level.")
)
self.layout.addWidget(self.geo_label)
grid1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid1)
# Toolchange X,Y
toolchange_xy_label = QtWidgets.QLabel('%s:' % _('Toolchange X-Y'))
toolchange_xy_label.setToolTip(
_("Toolchange X,Y position.")
)
grid1.addWidget(toolchange_xy_label, 1, 0)
self.toolchangexy_entry = FCEntry()
grid1.addWidget(self.toolchangexy_entry, 1, 1)
# Start move Z
startzlabel = QtWidgets.QLabel('%s:' % _('Start Z'))
startzlabel.setToolTip(
_("Height of the tool just after starting the work.\n"
"Delete the value if you don't need this feature.")
)
grid1.addWidget(startzlabel, 2, 0)
self.gstartz_entry = FloatEntry()
grid1.addWidget(self.gstartz_entry, 2, 1)
# Feedrate rapids
fr_rapid_label = QtWidgets.QLabel('%s:' % _('Feedrate Rapids'))
fr_rapid_label.setToolTip(
_("Cutting speed in the XY plane\n"
"(in units per minute).\n"
"This is for the rapid move G00.\n"
"It is useful only for Marlin,\n"
"ignore for any other cases.")
)
self.feedrate_rapid_entry = FCDoubleSpinner()
self.feedrate_rapid_entry.set_range(0, 99999.9999)
self.feedrate_rapid_entry.set_precision(self.decimals)
self.feedrate_rapid_entry.setSingleStep(0.1)
self.feedrate_rapid_entry.setWrapping(True)
grid1.addWidget(fr_rapid_label, 4, 0)
grid1.addWidget(self.feedrate_rapid_entry, 4, 1)
# End move extra cut
self.extracut_cb = FCCheckBox('%s' % _('Re-cut'))
self.extracut_cb.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.")
)
self.e_cut_entry = FCDoubleSpinner()
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.")
)
grid1.addWidget(self.extracut_cb, 5, 0)
grid1.addWidget(self.e_cut_entry, 5, 1)
# 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_range(-99999, 0.0000)
self.pdepth_entry.set_precision(self.decimals)
self.pdepth_entry.setSingleStep(0.1)
self.pdepth_entry.setWrapping(True)
grid1.addWidget(self.pdepth_label, 6, 0)
grid1.addWidget(self.pdepth_entry, 6, 1)
# Probe feedrate
self.feedrate_probe_label = QtWidgets.QLabel('%s:' % _("Feedrate Probe"))
self.feedrate_probe_label.setToolTip(
_("The feedrate used while the probe is probing.")
)
self.feedrate_probe_entry = FCDoubleSpinner()
self.feedrate_probe_entry.set_range(0, 99999.9999)
self.feedrate_probe_entry.set_precision(self.decimals)
self.feedrate_probe_entry.setSingleStep(0.1)
self.feedrate_probe_entry.setWrapping(True)
grid1.addWidget(self.feedrate_probe_label, 7, 0)
grid1.addWidget(self.feedrate_probe_entry, 7, 1)
# Spindle direction
spindle_dir_label = QtWidgets.QLabel('%s:' % _('Spindle direction'))
spindle_dir_label.setToolTip(
_("This sets the direction that the spindle is rotating.\n"
"It can be either:\n"
"- CW = clockwise or\n"
"- CCW = counter clockwise")
)
self.spindledir_radio = RadioSet([{'label': _('CW'), 'value': 'CW'},
{'label': _('CCW'), 'value': 'CCW'}])
grid1.addWidget(spindle_dir_label, 8, 0)
grid1.addWidget(self.spindledir_radio, 8, 1)
# Fast Move from Z Toolchange
self.fplunge_cb = FCCheckBox('%s' % _('Fast Plunge'))
self.fplunge_cb.setToolTip(
_("By checking this, the vertical move from\n"
"Z_Toolchange to Z_move is done with G0,\n"
"meaning the fastest speed available.\n"
"WARNING: the move is done at Toolchange X,Y coords.")
)
grid1.addWidget(self.fplunge_cb, 9, 0, 1, 2)
# Size of trace segment on X axis
segx_label = QtWidgets.QLabel('%s:' % _("Segment X size"))
segx_label.setToolTip(
_("The size of the trace segment on the X axis.\n"
"Useful for auto-leveling.\n"
"A value of 0 means no segmentation on the X axis.")
)
self.segx_entry = FCDoubleSpinner()
self.segx_entry.set_range(0, 99999)
self.segx_entry.set_precision(self.decimals)
self.segx_entry.setSingleStep(0.1)
self.segx_entry.setWrapping(True)
grid1.addWidget(segx_label, 10, 0)
grid1.addWidget(self.segx_entry, 10, 1)
# Size of trace segment on Y axis
segy_label = QtWidgets.QLabel('%s:' % _("Segment Y size"))
segy_label.setToolTip(
_("The size of the trace segment on the Y axis.\n"
"Useful for auto-leveling.\n"
"A value of 0 means no segmentation on the Y axis.")
)
self.segy_entry = FCDoubleSpinner()
self.segy_entry.set_range(0, 99999)
self.segy_entry.set_precision(self.decimals)
self.segy_entry.setSingleStep(0.1)
self.segy_entry.setWrapping(True)
grid1.addWidget(segy_label, 11, 0)
grid1.addWidget(self.segy_entry, 11, 1)
# -----------------------------
# --- Area Exclusion ----------
# -----------------------------
self.adv_label = QtWidgets.QLabel('<b>%s:</b>' % _('Area Exclusion'))
self.adv_label.setToolTip(
_("Area exclusion parameters.\n"
"Those parameters are available only for\n"
"Advanced App. Level.")
)
grid1.addWidget(self.adv_label, 12, 0, 1, 2)
# Exclusion Area CB
self.exclusion_cb = FCCheckBox('%s:' % _("Exclusion areas"))
self.exclusion_cb.setToolTip(
_(
"Include exclusion areas.\n"
"In those areas the travel of the tools\n"
"is forbidden."
)
)
grid1.addWidget(self.exclusion_cb, 13, 0, 1, 2)
# Area Selection shape
self.area_shape_label = QtWidgets.QLabel('%s:' % _("Shape"))
self.area_shape_label.setToolTip(
_("The kind of selection shape used for area selection.")
)
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}])
grid1.addWidget(self.area_shape_label, 14, 0)
grid1.addWidget(self.area_shape_radio, 14, 1)
# 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'}])
grid1.addWidget(self.strategy_label, 15, 0)
grid1.addWidget(self.strategy_radio, 15, 1)
# 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)
grid1.addWidget(self.over_z_label, 18, 0)
grid1.addWidget(self.over_z_entry, 18, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,67 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCSpinner, RadioSet
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class GeometryEditorPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent)
super(GeometryEditorPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Geometry Editor")))
self.decimals = decimals
# Advanced Geometry Parameters
self.param_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.param_label.setToolTip(
_("A list of Geometry Editor parameters.")
)
self.layout.addWidget(self.param_label)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
# Selection Limit
self.sel_limit_label = QtWidgets.QLabel('%s:' % _("Selection limit"))
self.sel_limit_label.setToolTip(
_("Set the number of selected geometry\n"
"items above which the utility geometry\n"
"becomes just a selection rectangle.\n"
"Increases the performance when moving a\n"
"large number of geometric elements.")
)
self.sel_limit_entry = FCSpinner()
self.sel_limit_entry.set_range(0, 9999)
grid0.addWidget(self.sel_limit_label, 0, 0)
grid0.addWidget(self.sel_limit_entry, 0, 1)
# Milling Type
milling_type_label = QtWidgets.QLabel('%s:' % _('Milling Type'))
milling_type_label.setToolTip(
_("Milling type:\n"
"- climb / best for precision milling and to reduce tool usage\n"
"- conventional / useful when there is no backlash compensation")
)
self.milling_type_radio = RadioSet([{'label': _('Climb'), 'value': 'cl'},
{'label': _('Conventional'), 'value': 'cv'}])
grid0.addWidget(milling_type_label, 1, 0)
grid0.addWidget(self.milling_type_radio, 1, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,123 @@
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import QSettings
from AppGUI.GUIElements import FCCheckBox, FCSpinner, FCEntry
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class GeometryGenPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Geometry General Preferences", parent=parent)
super(GeometryGenPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Geometry General")))
self.decimals = decimals
# ## Plot options
self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
self.layout.addWidget(self.plot_options_label)
# Plot CB
self.plot_cb = FCCheckBox(label=_('Plot'))
self.plot_cb.setToolTip(
_("Plot (show) this object.")
)
self.layout.addWidget(self.plot_cb)
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
# Number of circle steps for circular aperture linear approximation
self.circle_steps_label = QtWidgets.QLabel('%s:' % _("Circle Steps"))
self.circle_steps_label.setToolTip(
_("The number of circle steps for <b>Geometry</b> \n"
"circle and arc shapes linear approximation.")
)
self.circle_steps_entry = FCSpinner()
self.circle_steps_entry.set_range(0, 999)
grid0.addWidget(self.circle_steps_label, 1, 0)
grid0.addWidget(self.circle_steps_entry, 1, 1)
# Tools
self.tools_label = QtWidgets.QLabel("<b>%s:</b>" % _("Tools"))
grid0.addWidget(self.tools_label, 2, 0, 1, 2)
# Tooldia
tdlabel = QtWidgets.QLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia'))
tdlabel.setToolTip(
_("Diameters of the tools, separated by comma.\n"
"The value of the diameter has to use the dot decimals separator.\n"
"Valid values: 0.3, 1.0")
)
self.cnctooldia_entry = FCEntry()
grid0.addWidget(tdlabel, 3, 0)
grid0.addWidget(self.cnctooldia_entry, 3, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid0.addWidget(separator_line, 9, 0, 1, 2)
# Geometry Object Color
self.gerber_color_label = QtWidgets.QLabel('<b>%s</b>' % _('Geometry Object Color'))
grid0.addWidget(self.gerber_color_label, 10, 0, 1, 2)
# Plot Line Color
self.line_color_label = QtWidgets.QLabel('%s:' % _('Outline'))
self.line_color_label.setToolTip(
_("Set the line color for plotted objects.")
)
self.line_color_entry = FCEntry()
self.line_color_button = QtWidgets.QPushButton()
self.line_color_button.setFixedSize(15, 15)
self.form_box_child_2 = QtWidgets.QHBoxLayout()
self.form_box_child_2.addWidget(self.line_color_entry)
self.form_box_child_2.addWidget(self.line_color_button)
self.form_box_child_2.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
grid0.addWidget(self.line_color_label, 11, 0)
grid0.addLayout(self.form_box_child_2, 11, 1)
self.layout.addStretch()
# Setting plot colors signals
self.line_color_entry.editingFinished.connect(self.on_line_color_entry)
self.line_color_button.clicked.connect(self.on_line_color_button)
def on_line_color_entry(self):
self.app.defaults['geometry_plot_line'] = self.line_color_entry.get_value()[:7] + 'FF'
self.line_color_button.setStyleSheet("background-color:%s" % str(self.app.defaults['geometry_plot_line'])[:7])
def on_line_color_button(self):
current_color = QtGui.QColor(self.app.defaults['geometry_plot_line'][:7])
# print(current_color)
c_dialog = QtWidgets.QColorDialog()
plot_line_color = c_dialog.getColor(initial=current_color)
if plot_line_color.isValid() is False:
return
self.line_color_button.setStyleSheet("background-color:%s" % str(plot_line_color.name()))
new_val_line = str(plot_line_color.name()) + str(self.app.defaults['geometry_plot_line'][7:9])
self.line_color_entry.set_value(new_val_line)

View File

@@ -0,0 +1,265 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt, QSettings
from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCEntry, FCSpinner, FCComboBox
from AppGUI.preferences import machinist_setting
from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class GeometryOptPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Geometry Options Preferences", parent=parent)
super(GeometryOptPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Geometry Options")))
self.decimals = decimals
# ------------------------------
# ## Create CNC Job
# ------------------------------
self.cncjob_label = QtWidgets.QLabel('<b>%s:</b>' % _('Create CNC Job'))
self.cncjob_label.setToolTip(
_("Create a CNC Job object\n"
"tracing the contours of this\n"
"Geometry object.")
)
self.layout.addWidget(self.cncjob_label)
grid1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid1)
grid1.setColumnStretch(0, 0)
grid1.setColumnStretch(1, 1)
# Cut Z
cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
cutzlabel.setToolTip(
_("Cutting depth (negative)\n"
"below the copper surface.")
)
self.cutz_entry = FCDoubleSpinner()
if machinist_setting == 0:
self.cutz_entry.set_range(-9999.9999, 0.0000)
else:
self.cutz_entry.set_range(-9999.9999, 9999.9999)
self.cutz_entry.set_precision(self.decimals)
self.cutz_entry.setSingleStep(0.1)
self.cutz_entry.setWrapping(True)
grid1.addWidget(cutzlabel, 0, 0)
grid1.addWidget(self.cutz_entry, 0, 1)
# Multidepth CheckBox
self.multidepth_cb = FCCheckBox(label=_('Multi-Depth'))
self.multidepth_cb.setToolTip(
_(
"Use multiple passes to limit\n"
"the cut depth in each pass. Will\n"
"cut multiple times until Cut Z is\n"
"reached."
)
)
grid1.addWidget(self.multidepth_cb, 1, 0)
# Depth/pass
dplabel = QtWidgets.QLabel('%s:' % _('Depth/Pass'))
dplabel.setToolTip(
_("The depth to cut on each pass,\n"
"when multidepth is enabled.\n"
"It has positive value although\n"
"it is a fraction from the depth\n"
"which has negative value.")
)
self.depthperpass_entry = FCDoubleSpinner()
self.depthperpass_entry.set_range(0, 99999)
self.depthperpass_entry.set_precision(self.decimals)
self.depthperpass_entry.setSingleStep(0.1)
self.depthperpass_entry.setWrapping(True)
grid1.addWidget(dplabel, 2, 0)
grid1.addWidget(self.depthperpass_entry, 2, 1)
self.ois_multidepth = OptionalInputSection(self.multidepth_cb, [self.depthperpass_entry])
# Travel Z
travelzlabel = QtWidgets.QLabel('%s:' % _('Travel Z'))
travelzlabel.setToolTip(
_("Height of the tool when\n"
"moving without cutting.")
)
self.travelz_entry = FCDoubleSpinner()
if machinist_setting == 0:
self.travelz_entry.set_range(0.0001, 9999.9999)
else:
self.travelz_entry.set_range(-9999.9999, 9999.9999)
self.travelz_entry.set_precision(self.decimals)
self.travelz_entry.setSingleStep(0.1)
self.travelz_entry.setWrapping(True)
grid1.addWidget(travelzlabel, 3, 0)
grid1.addWidget(self.travelz_entry, 3, 1)
# Tool change:
self.toolchange_cb = FCCheckBox('%s' % _("Tool change"))
self.toolchange_cb.setToolTip(
_(
"Include tool-change sequence\n"
"in the Machine Code (Pause for tool change)."
)
)
grid1.addWidget(self.toolchange_cb, 4, 0, 1, 2)
# Toolchange Z
toolchangezlabel = QtWidgets.QLabel('%s:' % _('Toolchange Z'))
toolchangezlabel.setToolTip(
_(
"Z-axis position (height) for\n"
"tool change."
)
)
self.toolchangez_entry = FCDoubleSpinner()
if machinist_setting == 0:
self.toolchangez_entry.set_range(0.000, 9999.9999)
else:
self.toolchangez_entry.set_range(-9999.9999, 9999.9999)
self.toolchangez_entry.set_precision(self.decimals)
self.toolchangez_entry.setSingleStep(0.1)
self.toolchangez_entry.setWrapping(True)
grid1.addWidget(toolchangezlabel, 5, 0)
grid1.addWidget(self.toolchangez_entry, 5, 1)
# End move Z
endz_label = QtWidgets.QLabel('%s:' % _('End move Z'))
endz_label.setToolTip(
_("Height of the tool after\n"
"the last move at the end of the job.")
)
self.endz_entry = FCDoubleSpinner()
if machinist_setting == 0:
self.endz_entry.set_range(0.000, 9999.9999)
else:
self.endz_entry.set_range(-9999.9999, 9999.9999)
self.endz_entry.set_precision(self.decimals)
self.endz_entry.setSingleStep(0.1)
self.endz_entry.setWrapping(True)
grid1.addWidget(endz_label, 6, 0)
grid1.addWidget(self.endz_entry, 6, 1)
# End Move X,Y
endmove_xy_label = QtWidgets.QLabel('%s:' % _('End move X,Y'))
endmove_xy_label.setToolTip(
_("End move X,Y position. In format (x,y).\n"
"If no value is entered then there is no move\n"
"on X,Y plane at the end of the job.")
)
self.endxy_entry = FCEntry()
grid1.addWidget(endmove_xy_label, 7, 0)
grid1.addWidget(self.endxy_entry, 7, 1)
# Feedrate X-Y
frlabel = QtWidgets.QLabel('%s:' % _('Feedrate X-Y'))
frlabel.setToolTip(
_("Cutting speed in the XY\n"
"plane in units per minute")
)
self.cncfeedrate_entry = FCDoubleSpinner()
self.cncfeedrate_entry.set_range(0, 99999.9999)
self.cncfeedrate_entry.set_precision(self.decimals)
self.cncfeedrate_entry.setSingleStep(0.1)
self.cncfeedrate_entry.setWrapping(True)
grid1.addWidget(frlabel, 8, 0)
grid1.addWidget(self.cncfeedrate_entry, 8, 1)
# Feedrate Z (Plunge)
frz_label = QtWidgets.QLabel('%s:' % _('Feedrate Z'))
frz_label.setToolTip(
_("Cutting speed in the XY\n"
"plane in units per minute.\n"
"It is called also Plunge.")
)
self.feedrate_z_entry = FCDoubleSpinner()
self.feedrate_z_entry.set_range(0, 99999.9999)
self.feedrate_z_entry.set_precision(self.decimals)
self.feedrate_z_entry.setSingleStep(0.1)
self.feedrate_z_entry.setWrapping(True)
grid1.addWidget(frz_label, 9, 0)
grid1.addWidget(self.feedrate_z_entry, 9, 1)
# Spindle Speed
spdlabel = QtWidgets.QLabel('%s:' % _('Spindle speed'))
spdlabel.setToolTip(
_(
"Speed of the spindle in RPM (optional).\n"
"If LASER preprocessor is used,\n"
"this value is the power of laser."
)
)
self.cncspindlespeed_entry = FCSpinner()
self.cncspindlespeed_entry.set_range(0, 1000000)
self.cncspindlespeed_entry.set_step(100)
grid1.addWidget(spdlabel, 10, 0)
grid1.addWidget(self.cncspindlespeed_entry, 10, 1)
# Dwell
self.dwell_cb = FCCheckBox(label='%s' % _('Enable Dwell'))
self.dwell_cb.setToolTip(
_("Pause to allow the spindle to reach its\n"
"speed before cutting.")
)
dwelltime = QtWidgets.QLabel('%s:' % _('Duration'))
dwelltime.setToolTip(
_("Number of time units for spindle to dwell.")
)
self.dwelltime_entry = FCDoubleSpinner()
self.dwelltime_entry.set_range(0, 99999)
self.dwelltime_entry.set_precision(self.decimals)
self.dwelltime_entry.setSingleStep(0.1)
self.dwelltime_entry.setWrapping(True)
grid1.addWidget(self.dwell_cb, 11, 0)
grid1.addWidget(dwelltime, 12, 0)
grid1.addWidget(self.dwelltime_entry, 12, 1)
self.ois_dwell = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry])
# 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(Qt.StrongFocus)
grid1.addWidget(pp_label, 13, 0)
grid1.addWidget(self.pp_geometry_name_cb, 13, 1)
self.layout.addStretch()

View File

@@ -0,0 +1,46 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from AppGUI.preferences.geometry.GeometryEditorPrefGroupUI import GeometryEditorPrefGroupUI
from AppGUI.preferences.geometry.GeometryAdvOptPrefGroupUI import GeometryAdvOptPrefGroupUI
from AppGUI.preferences.geometry.GeometryOptPrefGroupUI import GeometryOptPrefGroupUI
from AppGUI.preferences.geometry.GeometryGenPrefGroupUI import GeometryGenPrefGroupUI
import gettext
import AppTranslation as fcTranslate
import builtins
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("machinist"):
machinist_setting = settings.value('machinist', type=int)
else:
machinist_setting = 0
class GeometryPreferencesUI(QtWidgets.QWidget):
def __init__(self, decimals, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)
self.layout = QtWidgets.QHBoxLayout()
self.setLayout(self.layout)
self.decimals = decimals
self.geometry_gen_group = GeometryGenPrefGroupUI(decimals=self.decimals)
self.geometry_gen_group.setMinimumWidth(220)
self.geometry_opt_group = GeometryOptPrefGroupUI(decimals=self.decimals)
self.geometry_opt_group.setMinimumWidth(300)
self.geometry_adv_opt_group = GeometryAdvOptPrefGroupUI(decimals=self.decimals)
self.geometry_adv_opt_group.setMinimumWidth(270)
self.geometry_editor_group = GeometryEditorPrefGroupUI(decimals=self.decimals)
self.geometry_editor_group.setMinimumWidth(250)
self.layout.addWidget(self.geometry_gen_group)
self.layout.addWidget(self.geometry_opt_group)
self.layout.addWidget(self.geometry_adv_opt_group)
self.layout.addWidget(self.geometry_editor_group)
self.layout.addStretch()

View File