- some fixes in the app_Main class

- removed the "follow" functionality from the Isolation Tool
- created a new application Tool named Follow Tool
- added the "follow" functionality in the Follow Tool and added the new feature of allowing to perform "follow" on an area selection
This commit is contained in:
Marius Stanciu
2020-11-12 16:22:50 +02:00
parent 23c4589a5e
commit 1a131eb71e
17 changed files with 814 additions and 195 deletions

View File

@@ -7,7 +7,6 @@
# Modified by Marius Stanciu (2020) #
# ###########################################################
from PyQt5 import QtCore
from appObjects.ObjectCollection import *
from appObjects.FlatCAMCNCJob import CNCJobObject
from appObjects.FlatCAMDocument import DocumentObject
@@ -56,7 +55,8 @@ class AppObject(QtCore.QObject):
self.object_plotted.connect(self.on_object_plotted)
self.plots_updated.connect(self.app.on_plots_updated)
def new_object(self, kind, name, initialize, plot=True, autoselected=True, callback=None, callback_params=None):
def new_object(self, kind, name, initialize: object, plot=True, autoselected=True, callback=None,
callback_params=None):
"""
Creates a new specialized FlatCAMObj and attaches it to the application,
this is, updates the GUI accordingly, any other records and plots it.
@@ -74,7 +74,7 @@ class AppObject(QtCore.QObject):
:param initialize: Function to run after creation of the object but before it is attached to the
application.
The function is called with 2 parameters: the new object and the App instance.
:type initialize: function
:type initialize: object
:param plot: If to plot the resulting object
:param autoselected: if the resulting object is autoselected in the Project tab and therefore in the
self.collection

View File

@@ -2302,7 +2302,8 @@ class GeometryObject(FlatCAMObj, Geometry):
'tooldia': tooldia_val
})
if "optimization_type" not in tools_dict[tooluid_key]['data']:
tools_dict[tooluid_key]['data']["optimization_type"] = self.app.defaults["geometry_optimization_type"]
tools_dict[tooluid_key]['data']["optimization_type"] = \
self.app.defaults["geometry_optimization_type"]
# find the tool_dia associated with the tooluid_key
# search in the self.tools for the sel_tool_dia and when found see what tooluid has
@@ -2574,7 +2575,7 @@ class GeometryObject(FlatCAMObj, Geometry):
def job_thread(app_obj):
with self.app.proc_container.new(_("Generating CNC Code")):
app_obj.app_obj.new_object("cncjob", outname, job_init, plot=plot)
app_obj.inform.emit('[success] %s: %s' % (_("CNCjob created")), outname)
app_obj.inform.emit('[success] %s: %s' % (_("CNCjob created"), outname))
# Create a promise with the name
self.app.collection.promise(outname)

View File

@@ -156,6 +156,7 @@ class GerberObject(FlatCAMObj, Gerber):
self.ui.iso_button.clicked.connect(self.app.isolation_tool.run)
self.ui.generate_ncc_button.clicked.connect(self.app.ncclear_tool.run)
self.ui.generate_cutout_button.clicked.connect(self.app.cutout_tool.run)
self.ui.generate_follow_button.clicked.connect(self.app.follow_tool.run)
# Utilties
self.ui.generate_bb_button.clicked.connect(self.on_generatebb_button_click)