- in Distance Minimum Plugin - upgraded the UI
This commit is contained in:
@@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- in Distance Plugin - implemented a new feature: multi segment distance measurement
|
- in Distance Plugin - implemented a new feature: multi segment distance measurement
|
||||||
- in Distance Plugin - the Dx, Dy, Angle and Distance values are updated real time (for non multi segment measurement)
|
- in Distance Plugin - the Dx, Dy, Angle and Distance values are updated real time (for non multi segment measurement)
|
||||||
- in Distance Plugin - Distance value is now updated real time regardless of the Multi Point setting
|
- in Distance Plugin - Distance value is now updated real time regardless of the Multi Point setting
|
||||||
|
- in Distance Minimum Plugin - upgraded the UI
|
||||||
|
|
||||||
12.10.2021
|
12.10.2021
|
||||||
|
|
||||||
|
|||||||
@@ -735,6 +735,7 @@ class DistanceUI:
|
|||||||
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||||
# param_grid.addWidget(separator_line, 6, 0, 1, 2)
|
# param_grid.addWidget(separator_line, 6, 0, 1, 2)
|
||||||
|
|
||||||
|
# Start Point
|
||||||
self.start_label = FCLabel("%s:" % _('Start point'))
|
self.start_label = FCLabel("%s:" % _('Start point'))
|
||||||
self.start_label.setToolTip(_("This is measuring Start point coordinates."))
|
self.start_label.setToolTip(_("This is measuring Start point coordinates."))
|
||||||
|
|
||||||
@@ -747,6 +748,7 @@ class DistanceUI:
|
|||||||
coords_grid.addWidget(self.start_entry, 0, 1)
|
coords_grid.addWidget(self.start_entry, 0, 1)
|
||||||
coords_grid.addWidget(FCLabel("%s" % self.units), 0, 2)
|
coords_grid.addWidget(FCLabel("%s" % self.units), 0, 2)
|
||||||
|
|
||||||
|
# End Point
|
||||||
self.stop_label = FCLabel("%s:" % _('End point'))
|
self.stop_label = FCLabel("%s:" % _('End point'))
|
||||||
self.stop_label.setToolTip(_("This is the measuring Stop point coordinates."))
|
self.stop_label.setToolTip(_("This is the measuring Stop point coordinates."))
|
||||||
|
|
||||||
|
|||||||
@@ -252,67 +252,62 @@ class DistMinUI:
|
|||||||
title_label = FCLabel("<font size=4><b>%s</b></font><br>" % self.pluginName)
|
title_label = FCLabel("<font size=4><b>%s</b></font><br>" % self.pluginName)
|
||||||
self.layout.addWidget(title_label)
|
self.layout.addWidget(title_label)
|
||||||
|
|
||||||
# ## Grid Layout
|
|
||||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
|
||||||
self.layout.addLayout(grid0)
|
|
||||||
|
|
||||||
# Units
|
|
||||||
self.units_label = FCLabel('%s:' % _("Units"))
|
|
||||||
self.units_label.setToolTip(_("Those are the units in which the distance is measured."))
|
|
||||||
self.units_value = FCLabel("%s" % str({'mm': _("METRIC (mm)"), 'in': _("INCH (in)")}[self.units]))
|
|
||||||
self.units_value.setDisabled(True)
|
|
||||||
|
|
||||||
grid0.addWidget(self.units_label, 0, 0)
|
|
||||||
grid0.addWidget(self.units_value, 0, 1)
|
|
||||||
|
|
||||||
grid0.addWidget(FCLabel(""), 2, 0, 1, 2)
|
|
||||||
|
|
||||||
# #############################################################################################################
|
# #############################################################################################################
|
||||||
# Coordinates
|
# Coordinates Frame
|
||||||
# #############################################################################################################
|
# #############################################################################################################
|
||||||
coords_label = FCLabel('<span style="color:green;"><b>%s</b></span>' % _('Coordinates'))
|
self.coords_label = FCLabel('<span style="color:green;"><b>%s</b></span>' % _('Coordinates'))
|
||||||
grid0.addWidget(coords_label, 4, 0, 1, 2)
|
self.layout.addWidget(self.coords_label)
|
||||||
|
|
||||||
separator_line = QtWidgets.QFrame()
|
coords_frame = FCFrame()
|
||||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
self.layout.addWidget(coords_frame)
|
||||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
|
||||||
grid0.addWidget(separator_line, 6, 0, 1, 2)
|
|
||||||
|
|
||||||
# Start
|
coords_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||||
|
coords_frame.setLayout(coords_grid)
|
||||||
|
|
||||||
|
# separator_line = QtWidgets.QFrame()
|
||||||
|
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||||
|
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||||
|
# grid0.addWidget(separator_line, 6, 0, 1, 2)
|
||||||
|
|
||||||
|
# Start Point
|
||||||
self.start_label = FCLabel("%s:" % _('Start point'))
|
self.start_label = FCLabel("%s:" % _('Start point'))
|
||||||
self.start_label.setToolTip(_("This is first object point coordinates.\n"
|
self.start_label.setToolTip(_("This is measuring Start point coordinates."))
|
||||||
"This is the start point for measuring distance."))
|
|
||||||
|
|
||||||
|
|
||||||
self.start_entry = FCEntry()
|
self.start_entry = FCEntry()
|
||||||
self.start_entry.setReadOnly(True)
|
self.start_entry.setReadOnly(True)
|
||||||
self.start_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
self.start_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||||
self.start_entry.setToolTip(_("This is first object point coordinates.\n"
|
self.start_entry.setToolTip(_("This is measuring Start point coordinates."))
|
||||||
"This is the start point for measuring distance."))
|
|
||||||
|
|
||||||
grid0.addWidget(self.start_label, 8, 0)
|
coords_grid.addWidget(self.start_label, 0, 0)
|
||||||
grid0.addWidget(self.start_entry, 8, 1)
|
coords_grid.addWidget(self.start_entry, 0, 1)
|
||||||
|
coords_grid.addWidget(FCLabel("%s" % self.units), 0, 2)
|
||||||
|
|
||||||
# Stop
|
# End Point
|
||||||
self.stop_label = FCLabel("%s:" % _('End point'))
|
self.stop_label = FCLabel("%s:" % _('End point'))
|
||||||
self.stop_label.setToolTip(_("This is second object point coordinates.\n"
|
self.stop_label.setToolTip(_("This is the measuring Stop point coordinates."))
|
||||||
"This is the end point for measuring distance."))
|
|
||||||
|
|
||||||
self.stop_entry = FCEntry()
|
self.stop_entry = FCEntry()
|
||||||
self.stop_entry.setReadOnly(True)
|
self.stop_entry.setReadOnly(True)
|
||||||
self.stop_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
self.stop_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||||
self.stop_entry.setToolTip(_("This is second object point coordinates.\n"
|
self.stop_entry.setToolTip(_("This is the measuring Stop point coordinates."))
|
||||||
"This is the end point for measuring distance."))
|
|
||||||
|
|
||||||
grid0.addWidget(self.stop_label, 10, 0)
|
coords_grid.addWidget(self.stop_label, 2, 0)
|
||||||
grid0.addWidget(self.stop_entry, 10, 1)
|
coords_grid.addWidget(self.stop_entry, 2, 1)
|
||||||
|
coords_grid.addWidget(FCLabel("%s" % self.units), 2, 2)
|
||||||
|
|
||||||
separator_line = QtWidgets.QFrame()
|
# #############################################################################################################
|
||||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
# Coordinates Frame
|
||||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
# #############################################################################################################
|
||||||
grid0.addWidget(separator_line, 12, 0, 1, 2)
|
self.res_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('Results'))
|
||||||
|
self.layout.addWidget(self.res_label)
|
||||||
|
|
||||||
# DX
|
res_frame = FCFrame()
|
||||||
|
self.layout.addWidget(res_frame)
|
||||||
|
|
||||||
|
res_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||||
|
res_frame.setLayout(res_grid)
|
||||||
|
|
||||||
|
# DX distance
|
||||||
self.distance_x_label = FCLabel('%s:' % _("Dx"))
|
self.distance_x_label = FCLabel('%s:' % _("Dx"))
|
||||||
self.distance_x_label.setToolTip(_("This is the distance measured over the X axis."))
|
self.distance_x_label.setToolTip(_("This is the distance measured over the X axis."))
|
||||||
|
|
||||||
@@ -321,10 +316,11 @@ class DistMinUI:
|
|||||||
self.distance_x_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
self.distance_x_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||||
self.distance_x_entry.setToolTip(_("This is the distance measured over the X axis."))
|
self.distance_x_entry.setToolTip(_("This is the distance measured over the X axis."))
|
||||||
|
|
||||||
grid0.addWidget(self.distance_x_label, 14, 0)
|
res_grid.addWidget(self.distance_x_label, 0, 0)
|
||||||
grid0.addWidget(self.distance_x_entry, 14, 1)
|
res_grid.addWidget(self.distance_x_entry, 0, 1)
|
||||||
|
res_grid.addWidget(FCLabel("%s" % self.units), 0, 2)
|
||||||
|
|
||||||
# DY
|
# DY distance
|
||||||
self.distance_y_label = FCLabel('%s:' % _("Dy"))
|
self.distance_y_label = FCLabel('%s:' % _("Dy"))
|
||||||
self.distance_y_label.setToolTip(_("This is the distance measured over the Y axis."))
|
self.distance_y_label.setToolTip(_("This is the distance measured over the Y axis."))
|
||||||
|
|
||||||
@@ -333,8 +329,9 @@ class DistMinUI:
|
|||||||
self.distance_y_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
self.distance_y_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||||
self.distance_y_entry.setToolTip(_("This is the distance measured over the Y axis."))
|
self.distance_y_entry.setToolTip(_("This is the distance measured over the Y axis."))
|
||||||
|
|
||||||
grid0.addWidget(self.distance_y_label, 16, 0)
|
res_grid.addWidget(self.distance_y_label, 2, 0)
|
||||||
grid0.addWidget(self.distance_y_entry, 16, 1)
|
res_grid.addWidget(self.distance_y_entry, 2, 1)
|
||||||
|
res_grid.addWidget(FCLabel("%s" % self.units), 2, 2)
|
||||||
|
|
||||||
# Angle
|
# Angle
|
||||||
self.angle_label = FCLabel('%s:' % _("Angle"))
|
self.angle_label = FCLabel('%s:' % _("Angle"))
|
||||||
@@ -345,29 +342,28 @@ class DistMinUI:
|
|||||||
self.angle_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
self.angle_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||||
self.angle_entry.setToolTip(_("This is orientation angle of the measuring line."))
|
self.angle_entry.setToolTip(_("This is orientation angle of the measuring line."))
|
||||||
|
|
||||||
grid0.addWidget(self.angle_label, 18, 0)
|
res_grid.addWidget(self.angle_label, 4, 0)
|
||||||
grid0.addWidget(self.angle_entry, 18, 1)
|
res_grid.addWidget(self.angle_entry, 4, 1)
|
||||||
|
res_grid.addWidget(FCLabel("%s" % "°"), 4, 2)
|
||||||
|
|
||||||
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, 20, 0, 1, 2)
|
res_grid.addWidget(separator_line, 6, 0, 1, 3)
|
||||||
|
|
||||||
res_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('Results'))
|
|
||||||
grid0.addWidget(res_label, 22, 0, 1, 2)
|
|
||||||
|
|
||||||
# Total Distance
|
# Total Distance
|
||||||
self.total_distance_label = FCLabel("<b>%s:</b>" % _('DISTANCE'))
|
self.total_distance_label = FCLabel("<b>%s:</b>" % _('DISTANCE'))
|
||||||
self.total_distance_label.setToolTip(_("This is the point to point Euclidean distance."))
|
self.total_distance_label.setToolTip(_("This is the point to point Euclidian distance."))
|
||||||
|
|
||||||
self.total_distance_entry = FCEntry()
|
self.total_distance_entry = FCEntry()
|
||||||
self.total_distance_entry.setReadOnly(True)
|
self.total_distance_entry.setReadOnly(True)
|
||||||
self.total_distance_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight |
|
self.total_distance_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight |
|
||||||
QtCore.Qt.AlignmentFlag.AlignVCenter)
|
QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||||
self.total_distance_entry.setToolTip(_("This is the point to point Euclidean distance."))
|
self.total_distance_entry.setToolTip(_("This is the point to point Euclidian distance."))
|
||||||
|
|
||||||
grid0.addWidget(self.total_distance_label, 24, 0)
|
res_grid.addWidget(self.total_distance_label, 8, 0)
|
||||||
grid0.addWidget(self.total_distance_entry, 24, 1)
|
res_grid.addWidget(self.total_distance_entry, 8, 1)
|
||||||
|
res_grid.addWidget(FCLabel("%s" % self.units), 8, 2)
|
||||||
|
|
||||||
# Half Point
|
# Half Point
|
||||||
self.half_point_label = FCLabel("<b>%s:</b>" % _('Half Point'))
|
self.half_point_label = FCLabel("<b>%s:</b>" % _('Half Point'))
|
||||||
@@ -378,16 +374,19 @@ class DistMinUI:
|
|||||||
self.half_point_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
self.half_point_entry.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight | QtCore.Qt.AlignmentFlag.AlignVCenter)
|
||||||
self.half_point_entry.setToolTip(_("This is the middle point of the point to point Euclidean distance."))
|
self.half_point_entry.setToolTip(_("This is the middle point of the point to point Euclidean distance."))
|
||||||
|
|
||||||
grid0.addWidget(self.half_point_label, 26, 0)
|
res_grid.addWidget(self.half_point_label, 10, 0)
|
||||||
grid0.addWidget(self.half_point_entry, 26, 1)
|
res_grid.addWidget(self.half_point_entry, 10, 1)
|
||||||
|
res_grid.addWidget(FCLabel("%s" % self.units), 10, 2)
|
||||||
|
|
||||||
|
# Buttons
|
||||||
self.measure_btn = FCButton(_("Measure"))
|
self.measure_btn = FCButton(_("Measure"))
|
||||||
grid0.addWidget(self.measure_btn, 28, 0, 1, 2)
|
self.layout.addWidget(self.measure_btn)
|
||||||
|
|
||||||
self.jump_hp_btn = FCButton(_("Jump to Half Point"))
|
self.jump_hp_btn = FCButton(_("Jump to Half Point"))
|
||||||
self.jump_hp_btn.setDisabled(True)
|
self.jump_hp_btn.setDisabled(True)
|
||||||
|
self.layout.addWidget(self.jump_hp_btn)
|
||||||
|
|
||||||
grid0.addWidget(self.jump_hp_btn, 30, 0, 1, 2)
|
FCGridLayout.set_common_column_size([coords_grid, res_grid], 0)
|
||||||
|
|
||||||
self.layout.addStretch(1)
|
self.layout.addStretch(1)
|
||||||
# #################################### FINSIHED GUI ###########################
|
# #################################### FINSIHED GUI ###########################
|
||||||
|
|||||||
Reference in New Issue
Block a user