- removed the enforced ActivityView width

- various string changes; updated the strings
- brought up-to-date the Romanian translation strings
- updated the source file when creating Excellon objects in various places in the app
This commit is contained in:
Marius Stanciu
2020-11-15 15:05:58 +02:00
committed by Marius
parent 07df345f12
commit bb279cbebe
52 changed files with 12434 additions and 11263 deletions

View File

@@ -45,7 +45,7 @@ class ToolCalibration(AppTool):
# #############################################################################
# ######################### Tool GUI ##########################################
# #############################################################################
self.ui = CalibUI(layout=self.layout, app=self.app)
self.ui = CalibrationUI(layout=self.layout, app=self.app)
self.toolName = self.ui.toolName
self.mr = None
@@ -601,7 +601,7 @@ class ToolCalibration(AppTool):
except Exception as e:
log.debug("ToolCalibration.on_cal_button_click() --> %s" % str(e))
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
return 'fail'
return
obj_name = self.cal_object.options["name"] + "_calibrated"
@@ -679,11 +679,6 @@ class ToolCalibration(AppTool):
def initialize_excellon(obj_init, app_obj):
obj_init.tools = deepcopy(obj.tools)
# drills are offset, so they need to be deep copied
obj_init.drills = deepcopy(obj.drills)
# slots are offset, so they need to be deep copied
obj_init.slots = deepcopy(obj.slots)
obj_init.scale(xfactor=scalex, yfactor=scaley, point=(origin_x, origin_y))
obj_init.skew(angle_x=skewx, angle_y=skewy, point=(origin_x, origin_y))
@@ -730,7 +725,7 @@ class ToolCalibration(AppTool):
self.ui.adj_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
class CalibUI:
class CalibrationUI:
toolName = _("Calibration Tool")

View File

@@ -389,10 +389,13 @@ class ToolCorners(AppTool):
Point((x, y))
)
tools = {1: {}}
tools[1]["tooldia"] = tooldia
tools[1]['drills'] = drill_list
tools[1]['solid_geometry'] = []
tools = {
1: {
"tooldia": tooldia,
"drills": drill_list,
"solid_geometry": []
}
}
def obj_init(obj_inst, app_inst):
obj_inst.options.update({

View File

@@ -1413,7 +1413,7 @@ class CutOut(AppTool):
filename=None,
use_thread=False)
with self.app.proc_container.new(_("Working ...")):
with self.app.proc_container.new('%s...' % _("Working")):
try:
ret = self.app.app_obj.new_object("excellon", outname, obj_init)
except Exception as e:

View File

@@ -5,6 +5,7 @@ from appTool import AppTool
from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCButton, FCComboBox, NumericalEvalTupleEntry, FCLabel
from numpy import Inf
from copy import deepcopy
from shapely.geometry import Point
from shapely import affinity
@@ -202,7 +203,7 @@ class DblSidedTool(AppTool):
tools[1]['solid_geometry'] += [point, point_mirror]
def obj_init(obj_inst, app_inst):
obj_inst.tools = tools
obj_inst.tools = deepcopy(tools)
obj_inst.create_geometry()
obj_inst.source_file = app_inst.f_handlers.export_excellon(obj_name=obj_inst.options['name'],
local_use=obj_inst,

View File

@@ -582,13 +582,13 @@ class ToolExtract(AppTool):
return
def obj_init(obj_inst, app_inst):
obj_inst.tools = tools
obj_inst.tools = deepcopy(tools)
obj_inst.create_geometry()
obj_inst.source_file = app_inst.f_handlers.export_excellon(obj_name=outname, local_use=obj_inst,
filename=None,
use_thread=False)
with self.app.proc_container.new(_("Working ...")):
with self.app.proc_container.new('%s...' % _("Working")):
try:
self.app.app_obj.new_object("excellon", outname, obj_init)
except Exception as e:
@@ -699,7 +699,7 @@ class ToolExtract(AppTool):
except (AttributeError, TypeError):
pass
with self.app.proc_container.new(_("Working ...")):
with self.app.proc_container.new('%s...' % _("Working")):
try:
self.app.app_obj.new_object("gerber", outname, obj_init)
except Exception as e:
@@ -774,7 +774,7 @@ class ToolExtract(AppTool):
except (AttributeError, TypeError):
pass
with self.app.proc_container.new(_("Working ...")):
with self.app.proc_container.new('%s...' % _("Working")):
try:
self.app.app_obj.new_object("gerber", outname, obj_init)
except Exception as e:

View File

@@ -2327,7 +2327,7 @@ class ToolMilling(AppTool, Excellon):
# To be run in separate thread
def job_thread(a_obj):
with self.app.proc_container.new(_("Generating CNC Code")):
with self.app.proc_container.new('%s...' % _("Generating")):
a_obj.app_obj.new_object("cncjob", job_name, job_init)
# Create promise for the new name.

View File

@@ -160,7 +160,7 @@ class ToolMove(AppTool):
if obj.options['plot'] and obj.visible is True]
def job_move(app_obj):
with self.app.proc_container.new(_("Moving ...")):
with self.app.proc_container.new('%s...' % _("Moving")):
if not obj_list:
app_obj.app.inform.emit('[ERROR_NOTCL] %s %s' % (_("Failed."),

View File

@@ -142,7 +142,7 @@ class ToolOptimal(AppTool):
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Only Gerber objects can be evaluated."))
return
proc = self.app.proc_container.new(_("Working ..."))
proc = self.app.proc_container.new('%s...' % _("Working"))
def job_thread(app_obj):
app_obj.inform.emit(_("Optimal Tool. Started to search for the minimum distance between copper features."))

View File

@@ -61,7 +61,7 @@ class ToolPDF(AppTool):
# when empty we start the layer rendering
self.parsing_promises = []
self.parser = PdfParser(units=self.app.defaults['units'] ,
self.parser = PdfParser(units=self.app.defaults['units'],
resolution=self.app.defaults["gerber_circle_steps"],
abort=self.app.abort_flag)
@@ -126,7 +126,7 @@ class ToolPDF(AppTool):
# graceful abort requested by the user
raise grace
with self.app.proc_container.new(_("Parsing ...")):
with self.app.proc_container.new('%s...' % _("Parsing")):
with open(filename, "rb") as f:
pdf = f.read()
@@ -217,9 +217,11 @@ class ToolPDF(AppTool):
# keys are diameters and values are list of (x,y) coords
points = {}
def obj_init(exc_obj, app_obj):
def obj_init(new_obj, app_obj):
clear_geo = [geo_el['clear'] for geo_el in ap_dict['0']['geometry']]
new_obj.tools = {}
for geo in clear_geo:
xmin, ymin, xmax, ymax = geo.bounds
center = (((xmax - xmin) / 2) + xmin, ((ymax - ymin) / 2) + ymin)
@@ -240,26 +242,29 @@ class ToolPDF(AppTool):
name_tool += 1
tool = str(name_tool)
exc_obj.tools[tool] = {
'tooldia': dia,
'drills': [],
'solid_geometry': []
new_obj.tools[tool] = {
'tooldia': dia,
'drills': [],
'solid_geometry': []
}
# update the drill list
for dia_points in points:
if dia == dia_points:
for pt in points[dia_points]:
exc_obj.tools[tool]['drills'].append(Point(pt))
new_obj.tools[tool]['drills'].append(Point(pt))
break
ret = exc_obj.create_geometry()
ret = new_obj.create_geometry()
if ret == 'fail':
log.debug("Could not create geometry for Excellon object.")
return "fail"
for tool in exc_obj.tools:
if exc_obj.tools[tool]['solid_geometry']:
new_obj.source_file = app_obj.f_handlers.export_excellon(obj_name=outname, local_use=new_obj,
filename=None, use_thread=False)
for tool in new_obj.tools:
if new_obj.tools[tool]['solid_geometry']:
return
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' % (_("No geometry found in file"), outname))
return "fail"

View File

@@ -611,7 +611,7 @@ class Panelize(AppTool):
text='[WARNING] ', col=columns, row=rows))
def job_thread(app_obj):
with self.app.proc_container.new(_("Working ...")):
with self.app.proc_container.new('%s...' % _("Working")):
try:
panelize_worker()
app_obj.inform.emit('[success] %s' % _("Panel created successfully."))

View File

@@ -303,6 +303,7 @@ class PcbWizard(AppTool):
# How the object should be initialized
def obj_init(excellon_obj, app_obj):
# populate excellon_obj.tools dict
try:
ret = excellon_obj.parse_file(file_obj=excellon_fileobj)
if ret == "fail":
@@ -320,6 +321,7 @@ class PcbWizard(AppTool):
app_obj.inform.emit(msg)
return "fail"
# populate excellon_obj.solid_geometry list
ret = excellon_obj.create_geometry()
if ret == 'fail':
app_obj.log.debug("Could not create geometry for Excellon object.")

View File

@@ -192,7 +192,7 @@ class Properties(AppTool):
self.treeWidget.addChild(obj_name, [obj.options['name']])
def job_thread(obj_prop):
self.app.proc_container.new(_("Working ..."))
self.app.proc_container.new('%s...' % _("Working"))
length = 0.0
width = 0.0

View File

@@ -164,7 +164,7 @@ class QRCode(AppTool):
self.kr = self.app.plotcanvas.graph_event_connect('key_release', self.on_key_release)
def job_thread_qr(app_obj):
with self.app.proc_container.new('%s' % _("Working ...")) as self.proc:
with self.app.proc_container.new('%s...' % _("Working")) as self.proc:
error_code = {
'L': qrcode.constants.ERROR_CORRECT_L,

View File

@@ -667,7 +667,7 @@ class SolderPaste(AppTool):
:param use_thread: use thread, True or False
:return: a Geometry type object
"""
proc = self.app.proc_container.new(_("Working ..."))
proc = self.app.proc_container.new('%s...' % _("Working"))
obj = work_object
# Sort tools in descending order
@@ -957,7 +957,7 @@ class SolderPaste(AppTool):
if use_thread:
# To be run in separate thread
def job_thread(app_obj):
with self.app.proc_container.new('%s' % _("Working ...")):
with self.app.proc_container.new('%s...' % _("Working")):
if app_obj.app_obj.new_object("cncjob", name, job_init) != 'fail':
app_obj.inform.emit('[success] [success] %s: %s' %
(_("ToolSolderPaste CNCjob created"), name))

View File

@@ -194,7 +194,7 @@ class ToolSub(AppTool):
self.new_apertures[apid][key] = self.target_grb_obj.apertures[apid][key]
def worker_job(app_obj):
with app_obj.app.proc_container.new('%s' % _("Working ...")):
with app_obj.app.proc_container.new('%s...' % _("Working")):
# SUBTRACTOR geometry (always the same)
sub_geometry = {'solid': [], 'clear': []}
# iterate over SUBTRACTOR geometry and load it in the sub_geometry dict
@@ -350,7 +350,7 @@ class ToolSub(AppTool):
grb_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
local_use=grb_obj, use_thread=False)
with self.app.proc_container.new(_("New object ...")):
with self.app.proc_container.new('%s...' % _("Generating")):
ret = self.app.app_obj.new_object('gerber', outname, obj_init, autoselected=False)
if ret == 'fail':
self.app.inform.emit('[ERROR_NOTCL] %s' % _('Generating new object failed.'))
@@ -544,7 +544,7 @@ class ToolSub(AppTool):
app_obj.log.debug("ToolSub.new_geo_object() --> %s" % str(e))
geo_obj.multigeo = False
with self.app.proc_container.new(_("New object ...")):
with self.app.proc_container.new('%s...' % _("Generating")):
ret = self.app.app_obj.new_object('geometry', outname, obj_init, autoselected=False)
if ret == 'fail':
self.app.inform.emit('[ERROR_NOTCL] %s' % _('Generating new object failed.'))

View File

@@ -293,7 +293,7 @@ class ToolTransform(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
return
else:
with self.app.proc_container.new(_("Appying Rotate")):
with self.app.proc_container.new('%s...' % _("Rotating")):
try:
px, py = point
for sel_obj in obj_list:
@@ -318,7 +318,7 @@ class ToolTransform(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s!' % _("No object is selected."))
return
else:
with self.app.proc_container.new(_("Applying Flip")):
with self.app.proc_container.new('%s...' % _("Flipping")):
try:
px, py = point
@@ -363,7 +363,7 @@ class ToolTransform(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
return
else:
with self.app.proc_container.new(_("Applying Skew")):
with self.app.proc_container.new('%s...' % _("Skewing")):
try:
px, py = point
@@ -389,7 +389,7 @@ class ToolTransform(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
return
else:
with self.app.proc_container.new(_("Applying Scale")):
with self.app.proc_container.new('%s...' % _("Scaling")):
try:
px, py = point
@@ -416,7 +416,7 @@ class ToolTransform(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
return
else:
with self.app.proc_container.new(_("Applying Offset")):
with self.app.proc_container.new('%s...' % _("Offsetting")):
try:
for sel_obj in obj_list:
if sel_obj.kind == 'cncjob':
@@ -445,7 +445,7 @@ class ToolTransform(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
return
else:
with self.app.proc_container.new(_("Applying Buffer")):
with self.app.proc_container.new('%s...' % _("Buffering")):
try:
for sel_obj in obj_list:
if sel_obj.kind == 'cncjob':