- updated the Turkish translation (by Mehmet Kaya)

- the methods of the APP class that were the handlers for the File menu are now moved to their oen class
This commit is contained in:
Marius Stanciu
2020-10-24 19:50:34 +03:00
committed by Marius
parent 5a6fad46ac
commit 9491bdc4fc
43 changed files with 13029 additions and 13222 deletions

View File

@@ -671,8 +671,8 @@ class ToolCalibration(AppTool):
obj_init.skew(angle_x=skewx, angle_y=skewy, point=(origin_x, origin_y))
try:
obj_init.source_file = self.export_gerber(obj_name=obj_name, filename=None, local_use=obj_init,
use_thread=False)
obj_init.source_file = self.app.f_handlers.export_gerber(obj_name=obj_name, filename=None,
local_use=obj_init, use_thread=False)
except (AttributeError, TypeError):
pass
@@ -689,8 +689,8 @@ class ToolCalibration(AppTool):
obj_init.create_geometry()
obj_init.source_file = self.app.export_excellon(obj_name=obj_name, local_use=obj, filename=None,
use_thread=False)
obj_init.source_file = self.app.export.export_excellon(obj_name=obj_name, local_use=obj, filename=None,
use_thread=False)
obj = self.cal_object
obj_name = obj_name

View File

@@ -282,10 +282,9 @@ class ToolCopperThieving(AppTool):
self.app.proc_container.update_view_text(' %s' % _("Append source file"))
# update the source file with the new geometry:
self.grb_object.source_file = self.app.export_gerber(obj_name=self.grb_object.options['name'],
filename=None,
local_use=self.grb_object,
use_thread=False)
self.grb_object.source_file = self.app.f_handlers.export_gerber(obj_name=self.grb_object.options['name'],
filename=None, local_use=self.grb_object,
use_thread=False)
self.app.proc_container.update_view_text(' %s' % '')
self.on_exit()
self.app.inform.emit('[success] %s' % _("Copper Thieving Tool done."))
@@ -876,10 +875,9 @@ class ToolCopperThieving(AppTool):
app_obj.app.proc_container.update_view_text(' %s' % _("Append source file"))
# update the source file with the new geometry:
app_obj.grb_object.source_file = app_obj.app.export_gerber(obj_name=app_obj.grb_object.options['name'],
filename=None,
local_use=app_obj.grb_object,
use_thread=False)
app_obj.grb_object.source_file = app_obj.f_handlers.export_gerber(
obj_name=app_obj.grb_object.options['name'], filename=None, local_use=app_obj.grb_object,
use_thread=False)
app_obj.app.proc_container.update_view_text(' %s' % '')
app_obj.on_exit()
app_obj.app.inform.emit('[success] %s' % _("Copper Thieving Tool done."))
@@ -1021,10 +1019,8 @@ class ToolCopperThieving(AppTool):
app_obj.proc_container.update_view_text(' %s' % _("Append source file"))
# update the source file with the new geometry:
grb_obj.source_file = app_obj.export_gerber(obj_name=name,
filename=None,
local_use=grb_obj,
use_thread=False)
grb_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=name, filename=None, local_use=grb_obj,
use_thread=False)
app_obj.proc_container.update_view_text(' %s' % '')
# Object name

View File

@@ -133,9 +133,10 @@ class ToolCorners(AppTool):
self.add_corners_geo(points, g_obj=self.grb_object)
self.grb_object.source_file = self.app.export_gerber(obj_name=self.grb_object.options['name'],
filename=None,
local_use=self.grb_object, use_thread=False)
self.grb_object.source_file = self.app.f_handlers.export_gerber(obj_name=self.grb_object.options['name'],
filename=None,
local_use=self.grb_object,
use_thread=False)
self.on_exit()
def add_corners_geo(self, points_storage, g_obj):

View File

@@ -875,8 +875,9 @@ class CutOut(AppTool):
exc_obj.tools = tools
exc_obj.create_geometry()
exc_obj.source_file = app_o.export_excellon(obj_name=exc_obj.options['name'], local_use=exc_obj,
filename=None, use_thread=False)
exc_obj.source_file = app_o.f_handlers.export_excellon(obj_name=exc_obj.options['name'],
local_use=exc_obj,filename=None,
use_thread=False)
# calculate the bounds
xmin, ymin, xmax, ymax = CutOut.recursive_bounds(exc_obj.solid_geometry)
exc_obj.options['xmin'] = xmin
@@ -1244,8 +1245,10 @@ class CutOut(AppTool):
exc_obj.tools = tools
exc_obj.create_geometry()
exc_obj.source_file = app_o.export_excellon(obj_name=exc_obj.options['name'], local_use=exc_obj,
filename=None, use_thread=False)
exc_obj.source_file = app_o.f_handlers.export_excellon(obj_name=exc_obj.options['name'],
local_use=exc_obj,
filename=None,
use_thread=False)
# calculate the bounds
e_xmin, e_ymin, e_xmax, e_ymax = CutOut.recursive_bounds(exc_obj.solid_geometry)
exc_obj.options['xmin'] = e_xmin
@@ -1600,9 +1603,10 @@ class CutOut(AppTool):
exc_obj.tools = tools
exc_obj.create_geometry()
exc_obj.source_file = app_o.export_excellon(obj_name=exc_obj.options['name'],
local_use=exc_obj,
filename=None, use_thread=False)
exc_obj.source_file = app_o.f_handlers.export_excellon(obj_name=exc_obj.options['name'],
local_use=exc_obj,
filename=None,
use_thread=False)
# calculate the bounds
xmin, ymin, xmax, ymax = CutOut.recursive_bounds(exc_obj.solid_geometry)
exc_obj.options['xmin'] = xmin

View File

@@ -205,8 +205,10 @@ class DblSidedTool(AppTool):
def obj_init(obj_inst, app_inst):
obj_inst.tools = tools
obj_inst.create_geometry()
obj_inst.source_file = app_inst.export_excellon(obj_name=obj_inst.options['name'], local_use=obj_inst,
filename=None, use_thread=False)
obj_inst.source_file = app_inst.f_handlers.export_excellon(obj_name=obj_inst.options['name'],
local_use=obj_inst,
filename=None,
use_thread=False)
self.app.app_obj.new_object("excellon", "Alignment Drills", obj_init)
self.drill_values = ''

View File

@@ -233,8 +233,8 @@ class ToolEtchCompensation(AppTool):
new_obj.apertures = deepcopy(new_apertures)
new_obj.solid_geometry = deepcopy(new_solid_geometry)
new_obj.source_file = self.app.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
new_obj.source_file = self.app.f_handlers.export_gerber(obj_name=outname, filename=None, local_use=new_obj,
use_thread=False)
self.app.app_obj.new_object('gerber', outname, init_func)

View File

@@ -373,8 +373,9 @@ class ToolExtractDrills(AppTool):
obj_inst.tools = tools
obj_inst.drills = drills
obj_inst.create_geometry()
obj_inst.source_file = self.app.export_excellon(obj_name=outname, local_use=obj_inst, filename=None,
use_thread=False)
obj_inst.source_file = app_inst.f_handlers.export_excellon(obj_name=outname, local_use=obj_inst,
filename=None,
use_thread=False)
self.app.app_obj.new_object("excellon", outname, obj_init)

View File

@@ -229,9 +229,9 @@ class ToolFiducials(AppTool):
self.ui.sec_points_coords_entry.set_value('(%.*f, %.*f)' % (self.decimals, x1, self.decimals, y0))
self.add_fiducials_geo(self.click_points, g_obj=self.grb_object, fid_type=fid_type)
self.grb_object.source_file = self.app.export_gerber(obj_name=self.grb_object.options['name'],
filename=None,
local_use=self.grb_object, use_thread=False)
self.grb_object.source_file = self.app.f_handlers.export_gerber(obj_name=self.grb_object.options['name'],
filename=None,
local_use=self.grb_object, use_thread=False)
self.on_exit()
else:
self.app.inform.emit(_("Click to add first Fiducial. Bottom Left..."))
@@ -467,8 +467,10 @@ class ToolFiducials(AppTool):
self.sm_obj_set.add(self.sm_object.options['name'])
self.add_fiducials_geo(self.click_points, g_obj=self.sm_object, fid_size=sm_opening_dia, fid_type='circular')
self.sm_object.source_file = self.app.export_gerber(obj_name=self.sm_object.options['name'], filename=None,
local_use=self.sm_object, use_thread=False)
self.sm_object.source_file = self.app.f_handlers.export_gerber(obj_name=self.sm_object.options['name'],
filename=None,
local_use=self.sm_object,
use_thread=False)
self.on_exit()
def on_mouse_release(self, event):
@@ -508,18 +510,18 @@ class ToolFiducials(AppTool):
self.ui.sec_points_coords_entry.set_value(self.click_points[2])
self.app.inform.emit('[success] %s' % _("Done. All fiducials have been added."))
self.add_fiducials_geo(self.click_points, g_obj=self.grb_object, fid_type=fid_type)
self.grb_object.source_file = self.app.export_gerber(obj_name=self.grb_object.options['name'],
filename=None,
local_use=self.grb_object, use_thread=False)
self.grb_object.source_file = self.app.f_handlers.export_gerber(
obj_name=self.grb_object.options['name'], filename=None, local_use=self.grb_object,
use_thread=False)
self.on_exit()
else:
if len(self.click_points) == 2:
self.ui.top_right_coords_entry.set_value(self.click_points[1])
self.app.inform.emit('[success] %s' % _("Done. All fiducials have been added."))
self.add_fiducials_geo(self.click_points, g_obj=self.grb_object, fid_type=fid_type)
self.grb_object.source_file = self.app.export_gerber(obj_name=self.grb_object.options['name'],
filename=None,
local_use=self.grb_object, use_thread=False)
self.grb_object.source_file = self.app.f_handlers.export_gerber(
obj_name=self.grb_object.options['name'], filename=None,
local_use=self.grb_object, use_thread=False)
self.on_exit()
def on_mouse_move(self, event):

View File

@@ -157,8 +157,8 @@ class ToolInvertGerber(AppTool):
new_obj.apertures = deepcopy(new_apertures)
new_obj.solid_geometry = deepcopy(new_solid_geometry)
new_obj.source_file = self.app.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
new_obj.source_file = self.app.f_handlers.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
self.app.app_obj.new_object('gerber', outname, init_func)

View File

@@ -192,10 +192,10 @@ class ToolMove(AppTool):
for sel_obj in obj_list:
out_name = sel_obj.options["name"]
if sel_obj.kind == 'gerber':
sel_obj.source_file = self.app.export_gerber(
sel_obj.source_file = self.app.f_handlers.export_gerber(
obj_name=out_name, filename=None, local_use=sel_obj, use_thread=False)
elif sel_obj.kind == 'excellon':
sel_obj.source_file = self.app.export_excellon(
sel_obj.source_file = self.app.f_handlers.export_excellon(
obj_name=out_name, filename=None, local_use=sel_obj, use_thread=False)
except Exception as err:
log.debug('[ERROR_NOTCL] %s --> %s' % ('ToolMove.on_left_click()', str(err)))

View File

@@ -360,8 +360,8 @@ class Panelize(AppTool):
obj_fin.zeros = panel_source_obj.zeros
obj_fin.units = panel_source_obj.units
app_obj.inform.emit('%s' % _("Generating panel ... Adding the source code."))
obj_fin.source_file = self.app.export_excellon(obj_name=self.outname, filename=None,
local_use=obj_fin, use_thread=False)
obj_fin.source_file = self.app.export.export_excellon(obj_name=self.outname, filename=None,
local_use=obj_fin, use_thread=False)
app_obj.proc_container.update_view_text('')
def job_init_geometry(obj_fin, app_obj):
@@ -583,11 +583,11 @@ class Panelize(AppTool):
app_obj.inform.emit('%s' % _("Generating panel ... Adding the source code."))
if panel_type == 'gerber':
obj_fin.source_file = self.app.export_gerber(obj_name=self.outname, filename=None,
local_use=obj_fin, use_thread=False)
obj_fin.source_file = self.app.f_handlers.export_gerber(obj_name=self.outname, filename=None,
local_use=obj_fin, use_thread=False)
if panel_type == 'geometry':
obj_fin.source_file = self.app.export_dxf(obj_name=self.outname, filename=None,
local_use=obj_fin, use_thread=False)
obj_fin.source_file = self.app.f_handlers.export_dxf(obj_name=self.outname, filename=None,
local_use=obj_fin, use_thread=False)
# obj_fin.solid_geometry = unary_union(obj_fin.solid_geometry)
# app_obj.log.debug("Finished creating a unary_union for the panel.")

View File

@@ -267,8 +267,8 @@ class ToolPunchGerber(AppTool):
new_obj.apertures = deepcopy(new_apertures)
new_obj.solid_geometry = deepcopy(punched_solid_geometry)
new_obj.source_file = self.app.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
new_obj.source_file = self.app.f_handlers.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
self.app.app_obj.new_object('gerber', outname, init_func)
elif punch_method == 'fixed':
@@ -390,8 +390,8 @@ class ToolPunchGerber(AppTool):
new_obj.apertures = deepcopy(new_apertures)
new_obj.solid_geometry = deepcopy(punched_solid_geometry)
new_obj.source_file = self.app.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
new_obj.source_file = self.app.f_handlers.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
self.app.app_obj.new_object('gerber', outname, init_func)
elif punch_method == 'ring':
@@ -532,8 +532,8 @@ class ToolPunchGerber(AppTool):
new_obj.apertures = deepcopy(new_apertures)
new_obj.solid_geometry = deepcopy(punched_solid_geometry)
new_obj.source_file = self.app.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
new_obj.source_file = self.app.f_handlers.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
self.app.app_obj.new_object('gerber', outname, init_func)
@@ -671,8 +671,8 @@ class ToolPunchGerber(AppTool):
new_obj.apertures = deepcopy(new_apertures)
new_obj.solid_geometry = deepcopy(punched_solid_geometry)
new_obj.source_file = self.app.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
new_obj.source_file = self.app.f_handlers.export_gerber(obj_name=outname, filename=None,
local_use=new_obj, use_thread=False)
self.app.app_obj.new_object('gerber', outname, init_func)

View File

@@ -314,8 +314,9 @@ class QRCode(AppTool):
self.grb_object.apertures[new_apid]['geometry'].append(deepcopy(geo_elem))
# update the source file with the new geometry:
self.grb_object.source_file = self.app.export_gerber(obj_name=self.grb_object.options['name'], filename=None,
local_use=self.grb_object, use_thread=False)
self.grb_object.source_file = self.app.f_handlers.export_gerber(obj_name=self.grb_object.options['name'],
filename=None,
local_use=self.grb_object, use_thread=False)
self.replot(obj=self.grb_object)
self.app.inform.emit('[success] %s' % _("QRCode Tool done."))

View File

@@ -320,8 +320,8 @@ class ToolSub(AppTool):
grb_obj.solid_geometry = deepcopy(poly_buff)
grb_obj.follow_geometry = deepcopy(follow_buff)
grb_obj.source_file = self.app.export_gerber(obj_name=outname, filename=None,
local_use=grb_obj, use_thread=False)
grb_obj.source_file = self.app.f_handlers.export_gerber(obj_name=outname, filename=None,
local_use=grb_obj, use_thread=False)
with self.app.proc_container.new(_("Generating new object ...")):
ret = self.app.app_obj.new_object('gerber', outname, obj_init, autoselected=False)

View File

@@ -457,14 +457,14 @@ class ToolTransform(AppTool):
self.app.inform.emit(_("CNCJob objects can't be buffered."))
elif sel_obj.kind.lower() == 'gerber':
sel_obj.buffer(value, join, factor)
sel_obj.source_file = self.app.export_gerber(obj_name=sel_obj.options['name'],
filename=None, local_use=sel_obj,
use_thread=False)
sel_obj.source_file = self.app.f_handlers.export_gerber(obj_name=sel_obj.options['name'],
filename=None, local_use=sel_obj,
use_thread=False)
elif sel_obj.kind.lower() == 'excellon':
sel_obj.buffer(value, join, factor)
sel_obj.source_file = self.app.export_excellon(obj_name=sel_obj.options['name'],
filename=None, local_use=sel_obj,
use_thread=False)
sel_obj.source_file = self.app.f_handlers.export_excellon(obj_name=sel_obj.options['name'],
filename=None, local_use=sel_obj,
use_thread=False)
elif sel_obj.kind.lower() == 'geometry':
sel_obj.buffer(value, join, factor)