- fixed Punch Gerber Tool to work in new conditions
- fixed creating positive films in Film Tool, because of recent changes
This commit is contained in:
@@ -11,7 +11,9 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
- fixed errors on project load, in ParseGerber and Extract and Punch Gerber Plugins due of refactoring the 'apertures' attribute to 'tools'
|
- fixed errors on project load, in ParseGerber and Extract and Punch Gerber Plugins due of refactoring the 'apertures' attribute to 'tools'
|
||||||
- aperture keys in the gerber 'tools' dictionary are now stored as integers instead of strings as before; need to check the application especially the Gerber Editor
|
- aperture keys in the gerber 'tools' dictionary are now stored as integers instead of strings as before; need to check the application especially the Gerber Editor
|
||||||
- fixed issues in Gerber Editor (using the '0' insteadd of 'REG' type for apertures)
|
- fixed issues in Gerber Editor (using the '0' instead of 'REG' type for apertures)
|
||||||
|
- fixed Punch Gerber Tool to work in new conditions
|
||||||
|
- fixed creating positive films in Film Tool, because of recent changes
|
||||||
|
|
||||||
2.03.2021
|
2.03.2021
|
||||||
|
|
||||||
|
|||||||
@@ -1068,8 +1068,7 @@ class Film(AppTool):
|
|||||||
def job_thread_film():
|
def job_thread_film():
|
||||||
with self.app.proc_container.new(_("Working...")):
|
with self.app.proc_container.new(_("Working...")):
|
||||||
try:
|
try:
|
||||||
make_positive_film(p_size=p_size, orientation=orientation, color=color,
|
make_positive_film(color=color, transparency_level=transparency_level,
|
||||||
transparency_level=transparency_level,
|
|
||||||
scale_factor_x=scale_factor_x, scale_factor_y=scale_factor_y)
|
scale_factor_x=scale_factor_x, scale_factor_y=scale_factor_y)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.log.error("export_positive() process -> %s" % str(e))
|
self.app.log.error("export_positive() process -> %s" % str(e))
|
||||||
@@ -1077,8 +1076,7 @@ class Film(AppTool):
|
|||||||
|
|
||||||
self.app.worker_task.emit({'fcn': job_thread_film, 'params': []})
|
self.app.worker_task.emit({'fcn': job_thread_film, 'params': []})
|
||||||
else:
|
else:
|
||||||
make_positive_film(p_size=p_size, orientation=orientation, color=color,
|
make_positive_film(color=color, transparency_level=transparency_level,
|
||||||
transparency_level=transparency_level,
|
|
||||||
scale_factor_x=scale_factor_x, scale_factor_y=scale_factor_y)
|
scale_factor_x=scale_factor_x, scale_factor_y=scale_factor_y)
|
||||||
|
|
||||||
def reset_fields(self):
|
def reset_fields(self):
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# Aperture CODE
|
# Aperture CODE
|
||||||
ap_code_item = QtWidgets.QTableWidgetItem(ap_code)
|
ap_code_item = QtWidgets.QTableWidgetItem(str(ap_code))
|
||||||
ap_code_item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
ap_code_item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||||
|
|
||||||
# Aperture TYPE
|
# Aperture TYPE
|
||||||
@@ -568,7 +568,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
# this is the punching geometry
|
# this is the punching geometry
|
||||||
exc_solid_geometry = MultiPolygon(exc_obj.solid_geometry)
|
exc_solid_geometry = MultiPolygon(exc_obj.solid_geometry)
|
||||||
@@ -639,7 +639,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# size and add there the clear geometry
|
# size and add there the clear geometry
|
||||||
for hole_size, ap_val in holes_apertures.items():
|
for hole_size, ap_val in holes_apertures.items():
|
||||||
new_apid += 1
|
new_apid += 1
|
||||||
new_apertures[str(new_apid)] = deepcopy(ap_val)
|
new_apertures[new_apid] = deepcopy(ap_val)
|
||||||
|
|
||||||
def init_func(new_obj, app_obj):
|
def init_func(new_obj, app_obj):
|
||||||
new_obj.options.update(new_options)
|
new_obj.options.update(new_options)
|
||||||
@@ -673,7 +673,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
# this is the punching geometry
|
# this is the punching geometry
|
||||||
exc_solid_geometry = MultiPolygon(exc_obj.solid_geometry)
|
exc_solid_geometry = MultiPolygon(exc_obj.solid_geometry)
|
||||||
@@ -760,7 +760,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# size and add there the clear geometry
|
# size and add there the clear geometry
|
||||||
for hole_size, ap_val in holes_apertures.items():
|
for hole_size, ap_val in holes_apertures.items():
|
||||||
new_apid += 1
|
new_apid += 1
|
||||||
new_apertures[str(new_apid)] = deepcopy(ap_val)
|
new_apertures[new_apid] = deepcopy(ap_val)
|
||||||
|
|
||||||
def init_func(new_obj, app_obj):
|
def init_func(new_obj, app_obj):
|
||||||
new_obj.options.update(new_options)
|
new_obj.options.update(new_options)
|
||||||
@@ -792,7 +792,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
punching_geo = []
|
punching_geo = []
|
||||||
for apid in grb_obj.tools:
|
for apid in grb_obj.tools:
|
||||||
@@ -893,7 +893,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# size and add there the clear geometry
|
# size and add there the clear geometry
|
||||||
for hole_size, ap_val in holes_apertures.items():
|
for hole_size, ap_val in holes_apertures.items():
|
||||||
new_apid += 1
|
new_apid += 1
|
||||||
new_apertures[str(new_apid)] = deepcopy(ap_val)
|
new_apertures[new_apid] = deepcopy(ap_val)
|
||||||
|
|
||||||
def init_func(new_obj, app_obj):
|
def init_func(new_obj, app_obj):
|
||||||
new_obj.options.update(new_options)
|
new_obj.options.update(new_options)
|
||||||
@@ -925,7 +925,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
# this is the punching geometry
|
# this is the punching geometry
|
||||||
punching_geo = []
|
punching_geo = []
|
||||||
@@ -988,7 +988,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# size and add there the clear geometry
|
# size and add there the clear geometry
|
||||||
for hole_size, ap_val in holes_apertures.items():
|
for hole_size, ap_val in holes_apertures.items():
|
||||||
new_apid += 1
|
new_apid += 1
|
||||||
new_apertures[str(new_apid)] = deepcopy(ap_val)
|
new_apertures[new_apid] = deepcopy(ap_val)
|
||||||
|
|
||||||
def init_func(new_obj, app_obj):
|
def init_func(new_obj, app_obj):
|
||||||
new_obj.options.update(new_options)
|
new_obj.options.update(new_options)
|
||||||
@@ -1032,7 +1032,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
# store here the clear geometry, the key is the new aperture size
|
# store here the clear geometry, the key is the new aperture size
|
||||||
holes_apertures = {}
|
holes_apertures = {}
|
||||||
@@ -1137,7 +1137,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# size and add there the clear geometry
|
# size and add there the clear geometry
|
||||||
for hole_size, ap_val in holes_apertures.items():
|
for hole_size, ap_val in holes_apertures.items():
|
||||||
new_apid += 1
|
new_apid += 1
|
||||||
new_apertures[str(new_apid)] = deepcopy(ap_val)
|
new_apertures[new_apid] = deepcopy(ap_val)
|
||||||
|
|
||||||
def init_func(new_obj, app_obj):
|
def init_func(new_obj, app_obj):
|
||||||
new_obj.options.update(new_options)
|
new_obj.options.update(new_options)
|
||||||
@@ -1181,7 +1181,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
# store here the clear geometry, the key is the new aperture size
|
# store here the clear geometry, the key is the new aperture size
|
||||||
holes_apertures = {}
|
holes_apertures = {}
|
||||||
@@ -1277,7 +1277,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# size and add there the clear geometry
|
# size and add there the clear geometry
|
||||||
for hole_size, ap_val in holes_apertures.items():
|
for hole_size, ap_val in holes_apertures.items():
|
||||||
new_apid += 1
|
new_apid += 1
|
||||||
new_apertures[str(new_apid)] = deepcopy(ap_val)
|
new_apertures[new_apid] = deepcopy(ap_val)
|
||||||
|
|
||||||
def init_func(new_obj, app_obj):
|
def init_func(new_obj, app_obj):
|
||||||
new_obj.options.update(new_options)
|
new_obj.options.update(new_options)
|
||||||
@@ -1316,7 +1316,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
# store here the clear geometry, the key is the new aperture size
|
# store here the clear geometry, the key is the new aperture size
|
||||||
holes_apertures = {}
|
holes_apertures = {}
|
||||||
@@ -1421,7 +1421,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# size and add there the clear geometry
|
# size and add there the clear geometry
|
||||||
for hole_size, ap_val in holes_apertures.items():
|
for hole_size, ap_val in holes_apertures.items():
|
||||||
new_apid += 1
|
new_apid += 1
|
||||||
new_apertures[str(new_apid)] = deepcopy(ap_val)
|
new_apertures[new_apid] = deepcopy(ap_val)
|
||||||
|
|
||||||
def init_func(new_obj, app_obj):
|
def init_func(new_obj, app_obj):
|
||||||
new_obj.options.update(new_options)
|
new_obj.options.update(new_options)
|
||||||
@@ -1460,7 +1460,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
# store here the clear geometry, the key is the new aperture size
|
# store here the clear geometry, the key is the new aperture size
|
||||||
holes_apertures = {}
|
holes_apertures = {}
|
||||||
@@ -1557,7 +1557,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# size and add there the clear geometry
|
# size and add there the clear geometry
|
||||||
for hole_size, ap_val in holes_apertures.items():
|
for hole_size, ap_val in holes_apertures.items():
|
||||||
new_apid += 1
|
new_apid += 1
|
||||||
new_apertures[str(new_apid)] = deepcopy(ap_val)
|
new_apertures[new_apid] = deepcopy(ap_val)
|
||||||
|
|
||||||
def init_func(new_obj, app_obj):
|
def init_func(new_obj, app_obj):
|
||||||
new_obj.options.update(new_options)
|
new_obj.options.update(new_options)
|
||||||
@@ -1580,7 +1580,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
for apid, apid_value in self.grb_obj.tools.items():
|
for apid, apid_value in self.grb_obj.tools.items():
|
||||||
if apid in sel_apid:
|
if apid in sel_apid:
|
||||||
@@ -1848,7 +1848,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
aperture = self.ui.apertures_table.item(cw_row, 0).text()
|
aperture = int(self.ui.apertures_table.item(cw_row, 0).text())
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1884,7 +1884,7 @@ class ToolPunchGerber(AppTool, Gerber):
|
|||||||
# selected codes in the apertures UI table
|
# selected codes in the apertures UI table
|
||||||
sel_apid = []
|
sel_apid = []
|
||||||
for it in self.ui.apertures_table.selectedItems():
|
for it in self.ui.apertures_table.selectedItems():
|
||||||
sel_apid.append(it.text())
|
sel_apid.append(int(it.text()))
|
||||||
|
|
||||||
self.manual_pads = []
|
self.manual_pads = []
|
||||||
for apid, apid_value in self.grb_obj.tools.items():
|
for apid, apid_value in self.grb_obj.tools.items():
|
||||||
|
|||||||
Reference in New Issue
Block a user