- more Qt6 port bugs fixed

- in Autolevelling Plugin modified the UI; work in progress - the frame disable is not working
This commit is contained in:
Marius Stanciu
2021-09-26 06:26:35 +03:00
committed by Marius
parent d2cb145998
commit 33f5749a7f
4 changed files with 117 additions and 80 deletions

View File

@@ -10,6 +10,9 @@ CHANGELOG for FlatCAM beta
26.09.2021 26.09.2021
- besides reporting the error into the log file now any application crash is reported also in a MessageBox after which the application will close - besides reporting the error into the log file now any application crash is reported also in a MessageBox after which the application will close
- solved a Shapely 2.0 deprecation warning
- more Qt6 port bugs fixed
- in Autolevelling Plugin modified the UI; work in progress - the frame disable is not working
25.09.2021 25.09.2021

View File

@@ -4988,7 +4988,7 @@ class RotatedToolButton(QtWidgets.QToolButton):
if self.orientation == "west": if self.orientation == "west":
painter.rotate(90) painter.rotate(90)
painter.translate(0, -1 * self.width()) painter.translate(0, -1 * self.width())
painter.drawControl(QtWidgets.QStyle.CE_PushButton, self.getSyleOptions()) painter.drawControl(QtWidgets.QStyle.ControlElement.CE_PushButton, self.getSyleOptions())
def minimumSizeHint(self): def minimumSizeHint(self):
size = super(RotatedToolButton, self).minimumSizeHint() size = super(RotatedToolButton, self).minimumSizeHint()
@@ -5016,11 +5016,11 @@ class RotatedToolButton(QtWidgets.QToolButton):
# if self.isDefault(): # if self.isDefault():
# options.features |= QtWidgets.QStyleOptionButton.DefaultButton # options.features |= QtWidgets.QStyleOptionButton.DefaultButton
if self.isDown() or (self.menu() and self.menu().isVisible()): if self.isDown() or (self.menu() and self.menu().isVisible()):
options.state |= QtWidgets.QStyle.State_Sunken options.state |= QtWidgets.QStyle.StateFlag.State_Sunken
if self.isChecked(): if self.isChecked():
options.state |= QtWidgets.QStyle.State_On options.state |= QtWidgets.QStyle.StateFlag.State_On
# if not self.isFlat() and not self.isDown(): # if not self.isFlat() and not self.isDown():
# options.state |= QtWidgets.QStyle.State_Raised # options.state |= QtWidgets.QStyle.StateFlag.State_Raised
options.text = self.text() options.text = self.text()
options.icon = self.icon() options.icon = self.icon()
@@ -5041,7 +5041,7 @@ class RotatedButton(QtWidgets.QPushButton):
if self.orientation == "west": if self.orientation == "west":
painter.rotate(90) painter.rotate(90)
painter.translate(0, -1 * self.width()) painter.translate(0, -1 * self.width())
painter.drawControl(QtWidgets.QStyle.CE_PushButton, self.getSyleOptions()) painter.drawControl(QtWidgets.QStyle.ControlElement.CE_PushButton, self.getSyleOptions())
def minimumSizeHint(self): def minimumSizeHint(self):
size = super(RotatedButton, self).minimumSizeHint() size = super(RotatedButton, self).minimumSizeHint()
@@ -5069,11 +5069,11 @@ class RotatedButton(QtWidgets.QPushButton):
if self.isDefault(): if self.isDefault():
options.features |= QtWidgets.QStyleOptionButton.ButtonFeature.DefaultButton options.features |= QtWidgets.QStyleOptionButton.ButtonFeature.DefaultButton
if self.isDown() or (self.menu() and self.menu().isVisible()): if self.isDown() or (self.menu() and self.menu().isVisible()):
options.state |= QtWidgets.QStyle.State_Sunken options.state |= QtWidgets.QStyle.StateFlag.State_Sunken
if self.isChecked(): if self.isChecked():
options.state |= QtWidgets.QStyle.State_On options.state |= QtWidgets.QStyle.StateFlag.State_On
if not self.isFlat() and not self.isDown(): if not self.isFlat() and not self.isDown():
options.state |= QtWidgets.QStyle.State_Raised options.state |= QtWidgets.QStyle.StateFlag.State_Raised
options.text = self.text() options.text = self.text()
options.icon = self.icon() options.icon = self.icon()

View File

@@ -941,7 +941,8 @@ class GerberObject(FlatCAMObj, Gerber):
used_color = random_color() if self.options['multicolored'] else 'black' used_color = random_color() if self.options['multicolored'] else 'black'
used_face_color = None used_face_color = None
for g in geometry: plot_geometry = geometry.geoms if isinstance(geometry, (MultiPolygon, MultiLineString)) else geometry
for g in plot_geometry:
if isinstance(g, (Polygon, LineString)): if isinstance(g, (Polygon, LineString)):
self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible) self.add_shape(shape=g, color=used_color, face_color=used_face_color, visible=visible)

View File

@@ -14,7 +14,7 @@ from appGUI.VisPyVisuals import *
from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy
from appGUI.GUIElements import RadioSet, FCButton, FCComboBox, FCLabel, FCFileSaveDialog, FCCheckBox, FCTable, \ from appGUI.GUIElements import RadioSet, FCButton, FCComboBox, FCLabel, FCFileSaveDialog, FCCheckBox, FCTable, \
FCDoubleSpinner, FCSpinner, FCDetachableTab, FCZeroAxes, FCJog, FCSliderWithDoubleSpinner, RotatedToolButton, \ FCDoubleSpinner, FCSpinner, FCDetachableTab, FCZeroAxes, FCJog, FCSliderWithDoubleSpinner, RotatedToolButton, \
FCEntry, VerticalScrollArea, FCGridLayout FCEntry, VerticalScrollArea, FCGridLayout, FCFrame, FCComboBox2
from appEditors.AppTextEditor import AppTextEditor from appEditors.AppTextEditor import AppTextEditor
from camlib import CNCjob from camlib import CNCjob
@@ -256,7 +256,7 @@ class ToolLevelling(AppTool, CNCjob):
pass pass
loaded_obj = self.app.collection.get_by_name(self.ui.object_combo.get_value()) loaded_obj = self.app.collection.get_by_name(self.ui.object_combo.get_value())
if loaded_obj: if loaded_obj and loaded_obj.kind == 'cncjob':
name = loaded_obj.options['name'] name = loaded_obj.options['name']
else: else:
name = '' name = ''
@@ -282,6 +282,7 @@ class ToolLevelling(AppTool, CNCjob):
# Fill Form fields # Fill Form fields
self.to_form() self.to_form()
self.on_controller_change_alter_ui()
self.ui.al_probe_points_table.setRowCount(0) self.ui.al_probe_points_table.setRowCount(0)
self.ui.al_probe_points_table.resizeColumnsToContents() self.ui.al_probe_points_table.resizeColumnsToContents()
@@ -699,9 +700,11 @@ class ToolLevelling(AppTool, CNCjob):
try: try:
for sh in geometry: for sh in geometry:
if custom_color is None: if custom_color is None:
k = self.add_probing_shape(shape=sh, color=edge_color, face_color=random_color(), visible=True) k = self.add_probing_shape(shape=sh, color=edge_color, face_color=random_color(),
visible=True)
else: else:
k = self.add_probing_shape(shape=sh, color=custom_color, face_color=custom_color, visible=True) k = self.add_probing_shape(shape=sh, color=custom_color, face_color=custom_color,
visible=True)
except TypeError: except TypeError:
if custom_color is None: if custom_color is None:
self.add_probing_shape( self.add_probing_shape(
@@ -1024,6 +1027,18 @@ class ToolLevelling(AppTool, CNCjob):
self.ui.al_rows_entry.setMinimum(1) self.ui.al_rows_entry.setMinimum(1)
def on_controller_change(self): def on_controller_change(self):
self.on_controller_change_alter_ui()
# if the is empty then there is a chance that we've added probe points but the GRBL controller was selected
# therefore no Probing GCode was genrated (it is different for GRBL on how it gets it's Probing GCode
target_obj = self.app.collection.get_by_name(self.ui.object_combo.get_value())
if (not self.probing_gcode_text or self.probing_gcode_text == '') and target_obj is not None:
# generate Probing GCode
al_method = self.ui.al_method_radio.get_value()
storage = self.al_voronoi_geo_storage if al_method == 'v' else self.al_bilinear_geo_storage
self.probing_gcode_text = self.probing_gcode(storage=storage)
def on_controller_change_alter_ui(self):
if self.ui.al_controller_combo.get_value() == 'GRBL': if self.ui.al_controller_combo.get_value() == 'GRBL':
self.ui.h_gcode_button.hide() self.ui.h_gcode_button.hide()
self.ui.view_h_gcode_button.hide() self.ui.view_h_gcode_button.hide()
@@ -1038,14 +1053,6 @@ class ToolLevelling(AppTool, CNCjob):
self.ui.import_heights_button.show() self.ui.import_heights_button.show()
self.ui.grbl_frame.hide() self.ui.grbl_frame.hide()
# if the is empty then there is a chance that we've added probe points but the GRBL controller was selected
# therefore no Probing GCode was genrated (it is different for GRBL on how it gets it's Probing GCode
if not self.probing_gcode_text or self.probing_gcode_text == '':
# generate Probing GCode
al_method = self.ui.al_method_radio.get_value()
storage = self.al_voronoi_geo_storage if al_method == 'v' else self.al_bilinear_geo_storage
self.probing_gcode_text = self.probing_gcode(storage=storage)
@staticmethod @staticmethod
def on_grbl_list_serial_ports(): def on_grbl_list_serial_ports():
""" """
@@ -1766,9 +1773,9 @@ class LevelUI:
self.level.setCheckable(True) self.level.setCheckable(True)
self.title_box.addWidget(self.level) self.title_box.addWidget(self.level)
self.obj_combo_label = FCLabel('<b>%s</b>:' % _("CNCjob")) self.obj_combo_label = FCLabel('<span style="color:darkorange;"><b>%s</b></span>' % _("Source Object"))
self.obj_combo_label.setToolTip( self.obj_combo_label.setToolTip(
_("Source object.") _("CNCJob source object to be levelled.")
) )
self.tools_box.addWidget(self.obj_combo_label) self.tools_box.addWidget(self.obj_combo_label)
@@ -1784,10 +1791,10 @@ class LevelUI:
self.tools_box.addWidget(self.object_combo) self.tools_box.addWidget(self.object_combo)
separator_line = QtWidgets.QFrame() # separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
self.tools_box.addWidget(separator_line) # self.tools_box.addWidget(separator_line)
# Autolevelling # Autolevelling
self.al_frame = QtWidgets.QFrame() self.al_frame = QtWidgets.QFrame()
@@ -1815,12 +1822,22 @@ class LevelUI:
grid0.addLayout(hor_lay, 0, 0, 1, 2) grid0.addLayout(hor_lay, 0, 0, 1, 2)
# #############################################################################################################
# Tool Table Frame
# #############################################################################################################
tt_frame = FCFrame()
self.tools_box.addWidget(tt_frame)
# Grid Layout
tool_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 0])
tt_frame.setLayout(tool_grid)
self.al_probe_points_table = FCTable() self.al_probe_points_table = FCTable()
self.al_probe_points_table.setColumnCount(3) self.al_probe_points_table.setColumnCount(3)
self.al_probe_points_table.setColumnWidth(0, 20) self.al_probe_points_table.setColumnWidth(0, 20)
self.al_probe_points_table.setHorizontalHeaderLabels(['#', _('X-Y Coordinates'), _('Height')]) self.al_probe_points_table.setHorizontalHeaderLabels(['#', _('X-Y Coordinates'), _('Height')])
grid0.addWidget(self.al_probe_points_table, 1, 0, 1, 2) tool_grid.addWidget(self.al_probe_points_table, 0, 0, 1, 2)
self.plot_probing_pts_cb = FCCheckBox(_("Plot probing points")) self.plot_probing_pts_cb = FCCheckBox(_("Plot probing points"))
self.plot_probing_pts_cb.setToolTip( self.plot_probing_pts_cb.setToolTip(
@@ -1828,24 +1845,25 @@ class LevelUI:
"If a Voronoi method is used then\n" "If a Voronoi method is used then\n"
"the Voronoi areas are also plotted.") "the Voronoi areas are also plotted.")
) )
grid0.addWidget(self.plot_probing_pts_cb, 3, 0, 1, 2) tool_grid.addWidget(self.plot_probing_pts_cb, 2, 0, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 5, 0, 1, 2)
# ############################################################################################################# # #############################################################################################################
# ############### Probe GCode Generation ###################################################################### # ############### Probe GCode Generation ######################################################################
# ############################################################################################################# # #############################################################################################################
self.probe_gc_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.probe_gc_label = FCLabel('<b>%s</b>:' % _("Parameters"))
self.probe_gc_label.setToolTip( self.probe_gc_label.setToolTip(
_("Will create a GCode which will be sent to the controller,\n" _("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" "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.") "that is to modify the original GCode to level the cutting height.")
) )
grid0.addWidget(self.probe_gc_label, 7, 0, 1, 2) self.tools_box.addWidget(self.probe_gc_label)
tp_frame = FCFrame()
self.tools_box.addWidget(tp_frame)
# Grid Layout
param_grid = FCGridLayout(v_spacing=5, h_spacing=3)
tp_frame.setLayout(param_grid)
# Travel Z Probe # Travel Z Probe
self.ptravelz_label = FCLabel('%s:' % _("Probe Z travel")) self.ptravelz_label = FCLabel('%s:' % _("Probe Z travel"))
@@ -1856,8 +1874,8 @@ class LevelUI:
self.ptravelz_entry.set_precision(self.decimals) self.ptravelz_entry.set_precision(self.decimals)
self.ptravelz_entry.set_range(0.0000, 10000.0000) self.ptravelz_entry.set_range(0.0000, 10000.0000)
grid0.addWidget(self.ptravelz_label, 9, 0) param_grid.addWidget(self.ptravelz_label, 0, 0)
grid0.addWidget(self.ptravelz_entry, 9, 1) param_grid.addWidget(self.ptravelz_entry, 0, 1)
# Probe depth # Probe depth
self.pdepth_label = FCLabel('%s:' % _("Probe Z depth")) self.pdepth_label = FCLabel('%s:' % _("Probe Z depth"))
@@ -1869,8 +1887,8 @@ class LevelUI:
self.pdepth_entry.set_precision(self.decimals) self.pdepth_entry.set_precision(self.decimals)
self.pdepth_entry.set_range(-910000.0000, 0.0000) self.pdepth_entry.set_range(-910000.0000, 0.0000)
grid0.addWidget(self.pdepth_label, 11, 0) param_grid.addWidget(self.pdepth_label, 2, 0)
grid0.addWidget(self.pdepth_entry, 11, 1) param_grid.addWidget(self.pdepth_entry, 2, 1)
# Probe feedrate # Probe feedrate
self.feedrate_probe_label = FCLabel('%s:' % _("Probe Feedrate")) self.feedrate_probe_label = FCLabel('%s:' % _("Probe Feedrate"))
@@ -1881,13 +1899,13 @@ class LevelUI:
self.feedrate_probe_entry.set_precision(self.decimals) self.feedrate_probe_entry.set_precision(self.decimals)
self.feedrate_probe_entry.set_range(0, 910000.0000) self.feedrate_probe_entry.set_range(0, 910000.0000)
grid0.addWidget(self.feedrate_probe_label, 13, 0) param_grid.addWidget(self.feedrate_probe_label, 4, 0)
grid0.addWidget(self.feedrate_probe_entry, 13, 1) param_grid.addWidget(self.feedrate_probe_entry, 4, 1)
separator_line = QtWidgets.QFrame() separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 15, 0, 1, 2) param_grid.addWidget(separator_line, 6, 0, 1, 2)
# AUTOLEVELL MODE # AUTOLEVELL MODE
al_mode_lbl = FCLabel('<b>%s</b>:' % _("Mode")) al_mode_lbl = FCLabel('<b>%s</b>:' % _("Mode"))
@@ -1900,8 +1918,8 @@ class LevelUI:
{'label': _('Manual'), 'value': 'manual'}, {'label': _('Manual'), 'value': 'manual'},
{'label': _('Grid'), 'value': 'grid'} {'label': _('Grid'), 'value': 'grid'}
]) ])
grid0.addWidget(al_mode_lbl, 16, 0) param_grid.addWidget(al_mode_lbl, 8, 0)
grid0.addWidget(self.al_mode_radio, 16, 1) param_grid.addWidget(self.al_mode_radio, 8, 1)
# AUTOLEVELL METHOD # AUTOLEVELL METHOD
self.al_method_lbl = FCLabel('%s:' % _("Method")) self.al_method_lbl = FCLabel('%s:' % _("Method"))
@@ -1918,8 +1936,8 @@ class LevelUI:
self.al_method_radio.setDisabled(True) self.al_method_radio.setDisabled(True)
self.al_method_radio.set_value('v') self.al_method_radio.set_value('v')
grid0.addWidget(self.al_method_lbl, 17, 0) param_grid.addWidget(self.al_method_lbl, 10, 0)
grid0.addWidget(self.al_method_radio, 17, 1) param_grid.addWidget(self.al_method_radio, 10, 1)
# ## Columns # ## Columns
self.al_columns_entry = FCSpinner() self.al_columns_entry = FCSpinner()
@@ -1929,8 +1947,8 @@ class LevelUI:
self.al_columns_label.setToolTip( self.al_columns_label.setToolTip(
_("The number of grid columns.") _("The number of grid columns.")
) )
grid0.addWidget(self.al_columns_label, 19, 0) param_grid.addWidget(self.al_columns_label, 12, 0)
grid0.addWidget(self.al_columns_entry, 19, 1) param_grid.addWidget(self.al_columns_entry, 12, 1)
# ## Rows # ## Rows
self.al_rows_entry = FCSpinner() self.al_rows_entry = FCSpinner()
@@ -1940,34 +1958,38 @@ class LevelUI:
self.al_rows_label.setToolTip( self.al_rows_label.setToolTip(
_("The number of grid rows.") _("The number of grid rows.")
) )
grid0.addWidget(self.al_rows_label, 21, 0) param_grid.addWidget(self.al_rows_label, 14, 0)
grid0.addWidget(self.al_rows_entry, 21, 1) param_grid.addWidget(self.al_rows_entry, 14, 1)
self.al_add_button = FCButton(_("Add Probe Points")) self.al_add_button = FCButton(_("Add Probe Points"))
grid0.addWidget(self.al_add_button, 23, 0, 1, 2) self.tools_box.addWidget(self.al_add_button)
separator_line = QtWidgets.QFrame() # #############################################################################################################
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # Controller Frame
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # #############################################################################################################
grid0.addWidget(separator_line, 25, 0, 1, 2) self.al_controller_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _("Controller"))
self.al_controller_label = FCLabel('<b>%s</b>:' % _("Controller"))
self.al_controller_label.setToolTip( self.al_controller_label.setToolTip(
_("The kind of controller for which to generate\n" _("The kind of controller for which to generate\n"
"height map gcode.") "height map gcode.")
) )
self.tools_box.addWidget(self.al_controller_label)
self.c_frame = FCFrame()
self.tools_box.addWidget( self.c_frame)
ctrl_grid = FCGridLayout(v_spacing=5, h_spacing=3)
self.c_frame.setLayout(ctrl_grid)
self.al_controller_combo = FCComboBox() self.al_controller_combo = FCComboBox()
self.al_controller_combo.addItems(["MACH3", "MACH4", "LinuxCNC", "GRBL"]) self.al_controller_combo.addItems(["MACH3", "MACH4", "LinuxCNC", "GRBL"])
grid0.addWidget(self.al_controller_label, 27, 0) ctrl_grid.addWidget(self.al_controller_combo, 0, 0, 1, 2)
grid0.addWidget(self.al_controller_combo, 27, 1)
# ############################################################################################################# # #############################################################################################################
# ########################## GRBL frame ####################################################################### # ########################## GRBL frame #######################################################################
# ############################################################################################################# # #############################################################################################################
self.grbl_frame = QtWidgets.QFrame() self.grbl_frame = QtWidgets.QFrame()
self.grbl_frame.setContentsMargins(0, 0, 0, 0) self.grbl_frame.setContentsMargins(0, 0, 0, 0)
grid0.addWidget(self.grbl_frame, 29, 0, 1, 2) ctrl_grid.addWidget(self.grbl_frame, 2, 0, 1, 2)
self.grbl_box = QtWidgets.QVBoxLayout() self.grbl_box = QtWidgets.QVBoxLayout()
self.grbl_box.setContentsMargins(0, 0, 0, 0) self.grbl_box.setContentsMargins(0, 0, 0, 0)
@@ -2023,8 +2045,11 @@ class LevelUI:
# ############################################################################################################# # #############################################################################################################
# GRBL CONNECT # GRBL CONNECT
# ############################################################################################################# # #############################################################################################################
self.connect_frame = FCFrame()
self.gr_conn_tab_layout.addWidget(self.connect_frame)
grbl_conn_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) grbl_conn_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0])
self.gr_conn_tab_layout.addLayout(grbl_conn_grid) self.connect_frame.setLayout(grbl_conn_grid)
# COM list # COM list
self.com_list_label = FCLabel('%s:' % _("COM list")) self.com_list_label = FCLabel('%s:' % _("COM list"))
@@ -2101,11 +2126,15 @@ class LevelUI:
# ############################################################################################################# # #############################################################################################################
# GRBL CONTROL # GRBL CONTROL
# ############################################################################################################# # #############################################################################################################
self.ctrl_grbl_frame = FCFrame()
self.gr_ctrl_tab_layout.addWidget(self.ctrl_grbl_frame)
grbl_ctrl_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) grbl_ctrl_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0])
self.gr_ctrl_tab_layout.addLayout(grbl_ctrl_grid) self.ctrl_grbl_frame.setLayout(grbl_ctrl_grid)
self.ctrl_grbl_frame2 = FCFrame()
self.gr_ctrl_tab_layout.addWidget(self.ctrl_grbl_frame2)
grbl_ctrl2_grid = FCGridLayout(v_spacing=5, h_spacing=3) grbl_ctrl2_grid = FCGridLayout(v_spacing=5, h_spacing=3)
self.gr_ctrl_tab_layout.addLayout(grbl_ctrl2_grid) self.ctrl_grbl_frame2.setLayout(grbl_ctrl2_grid)
self.gr_ctrl_tab_layout.addStretch(1) self.gr_ctrl_tab_layout.addStretch(1)
@@ -2149,7 +2178,8 @@ class LevelUI:
grbl_ctrl_grid.addWidget(self.zero_axs_wdg, 2, 2) grbl_ctrl_grid.addWidget(self.zero_axs_wdg, 2, 2)
self.pause_resume_button = RotatedToolButton() self.pause_resume_button = RotatedToolButton()
self.pause_resume_button.setSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.pause_resume_button.setSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum,
QtWidgets.QSizePolicy.Policy.Expanding)
self.pause_resume_button.setText(_("Pause/Resume")) self.pause_resume_button.setText(_("Pause/Resume"))
self.pause_resume_button.setCheckable(True) self.pause_resume_button.setCheckable(True)
self.pause_resume_button.setStyleSheet(""" self.pause_resume_button.setStyleSheet("""
@@ -2202,10 +2232,11 @@ class LevelUI:
# ############################################################################################################# # #############################################################################################################
# GRBL SENDER # GRBL SENDER
# ############################################################################################################# # #############################################################################################################
grbl_send_grid = FCGridLayout(v_spacing=5, h_spacing=3) self.sender_frame = FCFrame()
grbl_send_grid.setColumnStretch(0, 1) self.gr_send_tab_layout.addWidget(self.sender_frame)
grbl_send_grid.setColumnStretch(1, 0)
self.gr_send_tab_layout.addLayout(grbl_send_grid) grbl_send_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[1, 0])
self.sender_frame.setLayout(grbl_send_grid)
# Send CUSTOM COMMAND # Send CUSTOM COMMAND
self.grbl_command_label = FCLabel('%s:' % _("Send Command")) self.grbl_command_label = FCLabel('%s:' % _("Send Command"))
@@ -2279,19 +2310,21 @@ class LevelUI:
self.h_gcode_button.setToolTip( self.h_gcode_button.setToolTip(
_("Will save the probing GCode.") _("Will save the probing GCode.")
) )
self.h_gcode_button.setSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding) self.h_gcode_button.setSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding,
QtWidgets.QSizePolicy.Policy.MinimumExpanding)
height_lay.addWidget(self.h_gcode_button) height_lay.addWidget(self.h_gcode_button)
self.view_h_gcode_button = QtWidgets.QToolButton() self.view_h_gcode_button = QtWidgets.QToolButton()
self.view_h_gcode_button.setIcon(QtGui.QIcon(self.app.resource_location + '/edit_file32.png')) self.view_h_gcode_button.setIcon(QtGui.QIcon(self.app.resource_location + '/edit_file32.png'))
# self.view_h_gcode_button.setSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Ignored) # self.view_h_gcode_button.setSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored,
# QtWidgets.QSizePolicy.Policy.Ignored)
self.view_h_gcode_button.setToolTip( self.view_h_gcode_button.setToolTip(
_("View/Edit the probing GCode.") _("View/Edit the probing GCode.")
) )
# height_lay.addStretch() # height_lay.addStretch()
height_lay.addWidget(self.view_h_gcode_button) height_lay.addWidget(self.view_h_gcode_button)
grid0.addLayout(height_lay, 31, 0, 1, 2) self.tools_box.addLayout(height_lay)
self.import_heights_button = FCButton(_("Import Height Map")) self.import_heights_button = FCButton(_("Import Height Map"))
self.import_heights_button.setToolTip( self.import_heights_button.setToolTip(
@@ -2300,15 +2333,15 @@ class LevelUI:
"over the original GCode therefore\n" "over the original GCode therefore\n"
"doing autolevelling.") "doing autolevelling.")
) )
grid0.addWidget(self.import_heights_button, 33, 0, 1, 2) self.tools_box.addWidget(self.import_heights_button)
self.h_gcode_button.hide() # self.h_gcode_button.hide()
self.import_heights_button.hide() # self.import_heights_button.hide()
separator_line = QtWidgets.QFrame() # separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 35, 0, 1, 2) # grid0.addWidget(separator_line, 35, 0, 1, 2)
self.tools_box.addStretch(1) self.tools_box.addStretch(1)