- added the ability to add exclusion areas from the Excellon object too. Now there is a different in color to differentiate from which type of object the exclusion areas were added but they all serve the same purpose

This commit is contained in:
Marius Stanciu
2020-05-07 01:38:08 +03:00
committed by Marius
parent 4ece23c456
commit eea80aafc3
5 changed files with 141 additions and 12 deletions

View File

@@ -275,11 +275,18 @@ class ExclusionAreas:
}
self.exclusion_areas_storage.append(new_el)
if self.obj_type == 'excellon':
color = "#FF7400"
face_color = "#FF7400BF"
else:
color = "#098a8f"
face_color = "#098a8fBF"
# add a temporary shape on canvas
FlatCAMTool.draw_tool_selection_shape(
self, old_coords=(x0, y0), coords=(x1, y1),
color="#FF7400",
face_color="#FF7400BF",
color=color,
face_color=face_color,
shapes_storage=self.exclusion_shapes)
self.first_click = False
@@ -328,10 +335,18 @@ class ExclusionAreas:
"overz": self.over_z
}
self.exclusion_areas_storage.append(new_el)
if self.obj_type == 'excellon':
color = "#FF7400"
face_color = "#FF7400BF"
else:
color = "#098a8f"
face_color = "#098a8fBF"
FlatCAMTool.draw_selection_shape_polygon(
self, points=self.points,
color="#FF7400",
face_color="#FF7400BF",
color=color,
face_color=face_color,
shapes_storage=self.exclusion_shapes)
self.app.inform.emit(
_("Zone added. Click to start adding next zone or right click to finish."))
@@ -456,20 +471,28 @@ class ExclusionAreas:
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
if self.obj_type == 'excellon':
color = "#FF7400"
face_color = "#FF7400BF"
else:
color = "#098a8f"
face_color = "#098a8fBF"
# draw the utility geometry
if shape_type == "square":
if self.first_click:
self.app.delete_selection_shape()
self.app.draw_moving_selection_shape(old_coords=(self.cursor_pos[0], self.cursor_pos[1]),
color="#FF7400",
face_color="#FF7400BF",
color=color,
face_color=face_color,
coords=(curr_pos[0], curr_pos[1]))
else:
FlatCAMTool.delete_moving_selection_shape(self)
FlatCAMTool.draw_moving_selection_shape_poly(
self, points=self.points,
color="#FF7400",
face_color="#FF7400BF",
color=color,
face_color=face_color,
data=(curr_pos[0], curr_pos[1]))
def on_clear_area_click(self):