ソースを参照

- NCC Tool - upgraded the UI and added the functionality that now adding a new tool is done by first searching the Tools DB for a suitable tool and if fails then it adds an default tool
- NCC Tool - on start will attempt to search in the Tools DB for the default tools and if found will load them from the DB
- fixes in NCC, Paint and Isolation Tool due of recent changes

Marius Stanciu 5 年 前
コミット
fc539fa55b
4 ファイル変更373 行追加332 行削除
  1. 3 1
      CHANGELOG.md
  2. 6 5
      appTools/ToolIsolation.py
  3. 358 321
      appTools/ToolNCC.py
  4. 6 5
      appTools/ToolPaint.py

+ 3 - 1
CHANGELOG.md

@@ -11,7 +11,9 @@ CHANGELOG for FlatCAM beta
 
 - Paint Tool - upgraded the UI and added the functionality that now adding a new tool is done by first searching the Tools DB for a suitable tool and if fails then it adds an default tool
 - Paint Tool - on start will attempt to search in the Tools DB for the default tools and if found will load them from the DB
-
+- NCC Tool - upgraded the UI and added the functionality that now adding a new tool is done by first searching the Tools DB for a suitable tool and if fails then it adds an default tool
+- NCC Tool - on start will attempt to search in the Tools DB for the default tools and if found will load them from the DB
+- fixes in NCC, Paint and Isolation Tool due of recent changes
 
 27.08.2020
 

+ 6 - 5
appTools/ToolIsolation.py

@@ -195,6 +195,7 @@ class ToolIsolation(AppTool, Gerber):
         self.ui.deltool_btn.clicked.connect(self.on_tool_delete)
 
         self.ui.find_optimal_button.clicked.connect(self.on_find_optimal_tooldia)
+        # Custom Signal
         self.optimal_found_sig.connect(lambda val: self.ui.new_tooldia_entry.set_value(float(val)))
 
         self.ui.reference_combo_type.currentIndexChanged.connect(self.on_reference_combo_changed)
@@ -783,7 +784,7 @@ class ToolIsolation(AppTool, Gerber):
                 self.app.inform.emit('[WARNING_NOTCL] %s' %
                                      _("Please enter a tool diameter with non-zero value, in Float format."))
                 return
-            self.on_tool_default_add(dia=float(val))
+            self.on_tool_add(custom_dia=float(val))
         else:
             self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Adding Tool cancelled"))
 
@@ -1030,7 +1031,7 @@ class ToolIsolation(AppTool, Gerber):
             self.app.log.error("Could not load tools DB file.")
             self.app.inform.emit('[ERROR] %s' % _("Could not load Tools DB file."))
             self.blockSignals(False)
-            self.on_tool_default_add()
+            self.on_tool_default_add(dia=tool_dia)
             return
 
         try:
@@ -1041,7 +1042,7 @@ class ToolIsolation(AppTool, Gerber):
             self.app.log.error(str(e))
             self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
             self.blockSignals(False)
-            self.on_tool_default_add()
+            self.on_tool_default_add(dia=tool_dia)
             return
 
         tool_found = 0
@@ -1092,7 +1093,7 @@ class ToolIsolation(AppTool, Gerber):
         # test we found a suitable tool in Tools Database or if multiple ones
         if tool_found == 0:
             self.app.inform.emit('[WARNING_NOTCL] %s' % _("Tool not in Tools Database. Adding a default tool."))
-            self.on_tool_default_add()
+            self.on_tool_default_add(dia=tool_dia)
             self.blockSignals(False)
             return
 
@@ -1197,7 +1198,7 @@ class ToolIsolation(AppTool, Gerber):
         self.update_ui()
 
         if muted is None:
-            self.app.inform.emit('[success] %s' % _("New tool added to Tool Table."))
+            self.app.inform.emit('[success] %s' % _("Default tool added to Tool Table."))
 
     def on_tool_edit(self, item):
         self.blockSignals(True)

ファイルの差分が大きいため隠しています
+ 358 - 321
appTools/ToolNCC.py


+ 6 - 5
appTools/ToolPaint.py

@@ -394,7 +394,7 @@ class ToolPaint(AppTool, Gerber):
                 self.app.inform.emit('[WARNING_NOTCL] %s' %
                                      _("Please enter a tool diameter with non-zero value, in Float format."))
                 return
-            self.on_tool_add(dia=float(val))
+            self.on_tool_add(custom_dia=float(val))
         else:
             self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Adding Tool cancelled"))
 
@@ -702,7 +702,7 @@ class ToolPaint(AppTool, Gerber):
             self.app.log.error("Could not load tools DB file.")
             self.app.inform.emit('[ERROR] %s' % _("Could not load Tools DB file."))
             self.blockSignals(False)
-            self.on_tool_default_add()
+            self.on_tool_default_add(dia=tool_dia)
             return
 
         try:
@@ -713,7 +713,7 @@ class ToolPaint(AppTool, Gerber):
             self.app.log.error(str(e))
             self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
             self.blockSignals(False)
-            self.on_tool_default_add()
+            self.on_tool_default_add(dia=tool_dia)
             return
 
         tool_found = 0
@@ -764,7 +764,8 @@ class ToolPaint(AppTool, Gerber):
         # test we found a suitable tool in Tools Database or if multiple ones
         if tool_found == 0:
             self.app.inform.emit('[WARNING_NOTCL] %s' % _("Tool not in Tools Database. Adding a default tool."))
-            self.on_tool_default_add()
+            self.on_tool_default_add(dia=tool_dia)
+
             self.blockSignals(False)
             return
 
@@ -868,7 +869,7 @@ class ToolPaint(AppTool, Gerber):
         self.update_ui()
 
         if muted is None:
-            self.app.inform.emit('[success] %s' % _("New tool added to Tool Table."))
+            self.app.inform.emit('[success] %s' % _("Default tool added to Tool Table."))
 
     def on_tool_edit(self, item):
         self.blockSignals(True)

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません