- in Tool Fiducials added a new fiducial type: chess pattern

- work in Calibrate Excellon Tool
This commit is contained in:
Marius Stanciu
2019-11-23 17:19:56 +02:00
committed by Marius
parent 9fd98b4573
commit f44e24695d
4 changed files with 127 additions and 36 deletions

View File

@@ -821,11 +821,22 @@ class ToolCalibrateExcellon(FlatCAMTool):
except TypeError:
bot_right_dy = bot_right_y
# ------------------------------------------------------------------------------- #
# --------------------------- FACTORS CALCULUS ---------------------------------- #
# ------------------------------------------------------------------------------- #
if top_left_dy != float('%.*f' % (self.decimals, 0.0)):
# we have scale on Y
scale_y = (top_left_dy + top_left_y - origin_y) / (top_left_y - origin_y)
self.scaley_entry.set_value(scale_y)
if top_left_dx != float('%.*f' % (self.decimals, 0.0)):
# we have skew on X
dx = top_left_dx
dy = top_left_y - origin_y
skew_angle_x = math.degrees(math.atan(dx / dy))
self.skewx_entrx.set_value(skew_angle_x)
if bot_right_dx != float('%.*f' % (self.decimals, 0.0)):
# we have scale on X
scale_x = (bot_right_dx + bot_right_x - origin_x) / (bot_right_x - origin_x)
@@ -833,11 +844,11 @@ class ToolCalibrateExcellon(FlatCAMTool):
if bot_right_dy != float('%.*f' % (self.decimals, 0.0)):
# we have skew on Y
dy = bot_right_dy + origin_y
dx = bot_right_x - origin_x
dy = bot_right_dy + origin_y
skew_angle_y = math.degrees(math.atan(dy / dx))
self.skewx_entry.set_value(skew_angle_y)
self.skewy_entry.set_value(skew_angle_y)
def disconnect_cal_events(self):
self.app.mr = self.canvas.graph_event_connect('mouse_release', self.app.on_mouse_click_release_over_plot)