- fixed bug in Gerber parser that allowed loading as Gerber of a file that is not a Gerber

- fixed a bug in extension detection for Gerber files that allowed in the filtered list files that extension *.gb*
- added a processEvents method in the Gerber parser parse_lines() method
This commit is contained in:
Marius Stanciu
2020-04-05 21:11:48 +03:00
committed by Marius
parent 836122ca24
commit fdd5344581
4 changed files with 10 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
from PyQt5 import QtWidgets
from camlib import Geometry, arc, arc_angle, ApertureMacro
import FlatCAMApp
@@ -1416,6 +1416,8 @@ class Gerber(Geometry):
# ######### Line did not match any pattern. Warn user. ##########
# ################################################################
log.warning("Line ignored (%d): %s" % (line_num, gline))
# provide the app with a way to process the GUI events when in a blocking loop
QtWidgets.QApplication.processEvents()
try:
path_length = len(path)
@@ -1475,7 +1477,7 @@ class Gerber(Geometry):
sol_geo_length = 1
try:
if buff_length == 0 and sol_geo_length == 0:
if buff_length == 0 and sol_geo_length in [0, 1]:
log.error("Object is not Gerber file or empty. Aborting Object creation.")
return 'fail'
except TypeError as e: