- replaced the testing if instance of FlatCAMObj with testing the obj.kind attribute
- removed the import of the whole FlatCAMApp file only for the usage of GracefulException - remove the import of FlatCAMApp and used alternate ways - optimized the imports in some files - moved the Bookmarksmanager and ToolDB classes into their own files - solved some bugs that were not so visible in the Editors and HPGL parser - split the FlatCAMObj file into multiple files located in the flatcamObjects folder and renamed the contained classes with names more suggestive - updated the Google Translation for the German language
This commit is contained in:
@@ -382,7 +382,7 @@ class AlignObjects(FlatCAMTool):
|
||||
def check_points(self):
|
||||
if len(self.clicked_points) == 1:
|
||||
self.app.inform.emit('%s: %s. %s' % (
|
||||
_("First Point"), _("Click on the DESTINATION point."), _(" Or right click to cancel.")))
|
||||
_("First Point"), _("Click on the DESTINATION point."), _("Or right click to cancel.")))
|
||||
self.target_obj = self.aligner_obj
|
||||
self.reset_color()
|
||||
self.set_color()
|
||||
@@ -397,14 +397,14 @@ class AlignObjects(FlatCAMTool):
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit('%s: %s. %s' % (
|
||||
_("Second Point"), _("Click on the START point."), _(" Or right click to cancel.")))
|
||||
_("Second Point"), _("Click on the START point."), _("Or right click to cancel.")))
|
||||
self.target_obj = self.aligned_obj
|
||||
self.reset_color()
|
||||
self.set_color()
|
||||
|
||||
if len(self.clicked_points) == 3:
|
||||
self.app.inform.emit('%s: %s. %s' % (
|
||||
_("Second Point"), _("Click on the DESTINATION point."), _(" Or right click to cancel.")))
|
||||
_("Second Point"), _("Click on the DESTINATION point."), _("Or right click to cancel.")))
|
||||
self.target_obj = self.aligner_obj
|
||||
self.reset_color()
|
||||
self.set_color()
|
||||
|
||||
@@ -191,7 +191,7 @@ class DblSidedTool(FlatCAMTool):
|
||||
# Add a reference
|
||||
self.add_point_button = QtWidgets.QPushButton(_("Add"))
|
||||
self.add_point_button.setToolTip(
|
||||
_("Add the coordinates in format <b>(x, y)</b> through which the mirroring axis \n "
|
||||
_("Add the coordinates in format <b>(x, y)</b> through which the mirroring axis\n "
|
||||
"selected in 'MIRROR AXIS' pass.\n"
|
||||
"The (x, y) coordinates are captured by pressing SHIFT key\n"
|
||||
"and left mouse button click on canvas or you can enter the coordinates manually.")
|
||||
|
||||
@@ -2263,7 +2263,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||
# ##########################################################################################
|
||||
def gen_clear_area(geo_obj, app_obj):
|
||||
assert geo_obj.kind == 'geometry', \
|
||||
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
|
||||
"Initializer expected a GeometryObject, got %s" % type(geo_obj)
|
||||
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
if not run_threaded:
|
||||
@@ -2551,7 +2551,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||
# ###########################################################################################
|
||||
def gen_clear_area_rest(geo_obj, app_obj):
|
||||
assert geo_obj.kind == 'geometry', \
|
||||
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
|
||||
"Initializer expected a GeometryObject, got %s" % type(geo_obj)
|
||||
|
||||
log.debug("NCC Tool. Rest machining copper clearing task started.")
|
||||
app_obj.inform.emit('_(NCC Tool. Rest machining copper clearing task started.')
|
||||
@@ -3045,7 +3045,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||
# ##########################################################################################
|
||||
def gen_clear_area(geo_obj, app_obj):
|
||||
assert geo_obj.kind == 'geometry', \
|
||||
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
|
||||
"Initializer expected a GeometryObject, got %s" % type(geo_obj)
|
||||
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
if not run_threaded:
|
||||
@@ -3446,7 +3446,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||
# ###########################################################################################
|
||||
def gen_clear_area_rest(geo_obj, app_obj):
|
||||
assert geo_obj.kind == 'geometry', \
|
||||
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
|
||||
"Initializer expected a GeometryObject, got %s" % type(geo_obj)
|
||||
|
||||
log.debug("NCC Tool. Rest machining copper clearing task started.")
|
||||
app_obj.inform.emit('_(NCC Tool. Rest machining copper clearing task started.')
|
||||
|
||||
@@ -604,8 +604,8 @@ class ToolPunchGerber(FlatCAMTool):
|
||||
if grb_obj.apertures[apid]['type'] == 'C' and self.circular_cb.get_value():
|
||||
if punch_size >= float(grb_obj.apertures[apid]['size']):
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_(" Could not generate punched hole Gerber because the punch hole size"
|
||||
"is bigger than some of the apertures in the Gerber object."))
|
||||
_("Could not generate punched hole Gerber because the punch hole size"
|
||||
" is bigger than some of the apertures in the Gerber object."))
|
||||
return 'fail'
|
||||
else:
|
||||
for elem in grb_obj.apertures[apid]['geometry']:
|
||||
@@ -617,7 +617,7 @@ class ToolPunchGerber(FlatCAMTool):
|
||||
punch_size >= float(grb_obj.apertures[apid]['height']):
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Could not generate punched hole Gerber because the punch hole size"
|
||||
"is bigger than some of the apertures in the Gerber object."))
|
||||
" is bigger than some of the apertures in the Gerber object."))
|
||||
return 'fail'
|
||||
elif round(float(grb_obj.apertures[apid]['width']), self.decimals) == \
|
||||
round(float(grb_obj.apertures[apid]['height']), self.decimals) and \
|
||||
|
||||
@@ -1335,7 +1335,7 @@ class SolderPaste(FlatCAMTool):
|
||||
# RUNNING ON SEPARATE THREAD!
|
||||
def job_init(job_obj):
|
||||
assert job_obj.kind == 'cncjob', \
|
||||
"Initializer expected a FlatCAMCNCjob, got %s" % type(job_obj)
|
||||
"Initializer expected a CNCJobObject, got %s" % type(job_obj)
|
||||
|
||||
# this turn on the FlatCAMCNCJob plot for multiple tools
|
||||
job_obj.multitool = True
|
||||
@@ -1365,7 +1365,7 @@ class SolderPaste(FlatCAMTool):
|
||||
res = job_obj.generate_gcode_from_solderpaste_geo(**tooluid_value)
|
||||
|
||||
if res == 'fail':
|
||||
log.debug("FlatCAMGeometry.mtool_gen_cncjob() --> generate_from_geometry2() failed")
|
||||
log.debug("GeometryObject.mtool_gen_cncjob() --> generate_from_geometry2() failed")
|
||||
return 'fail'
|
||||
else:
|
||||
tool_cnc_dict['gcode'] = res
|
||||
|
||||
Reference in New Issue
Block a user