- added an automatic name on each save operation based on the object name and/or the current date

- added more information's for the statistics
This commit is contained in:
Marius Stanciu
2019-02-03 23:08:09 +02:00
committed by Marius S
parent 5e55f0d499
commit e1888b1647
15 changed files with 192 additions and 35 deletions

View File

@@ -214,6 +214,8 @@ class ToolCalculator(FlatCAMTool):
def run(self):
self.app.report_usage("ToolCalculators()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.app.ui.notebook.setTabText(2, "Calc. Tool")

View File

@@ -190,6 +190,8 @@ class ToolCutOut(FlatCAMTool):
self.obj_combo.setCurrentIndex(0)
def run(self):
self.app.report_usage("ToolCutOut()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.app.ui.notebook.setTabText(2, "Cutout Tool")

View File

@@ -253,6 +253,8 @@ class DblSidedTool(FlatCAMTool):
FlatCAMTool.install(self, icon, separator, shortcut='ALT+D', **kwargs)
def run(self):
self.app.report_usage("Tool2Sided()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.app.ui.notebook.setTabText(2, "2-Sided Tool")

View File

@@ -145,6 +145,8 @@ class Film(FlatCAMTool):
self.tf_box_combo.setCurrentIndex(0)
def run(self):
self.app.report_usage("ToolFilm()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.app.ui.notebook.setTabText(2, "Film Tool")
@@ -190,29 +192,33 @@ class Film(FlatCAMTool):
if self.film_type.get_value() == "pos":
try:
filename, _ = QtWidgets.QFileDialog.getSaveFileName(caption="Export SVG positive",
directory=self.app.get_last_save_folder(), filter="*.svg")
filename, _ = QtWidgets.QFileDialog.getSaveFileName(
caption="Export SVG positive",
directory=self.app.get_last_save_folder() + '/' + name,
filter="*.svg")
except TypeError:
filename, _ = QtWidgets.QFileDialog.getSaveFileName(caption="Export SVG positive")
filename = str(filename)
if str(filename) == "":
self.app.inform.emit("Export SVG positive cancelled.")
self.app.inform.emit("[WARNING_NOTCL]Export SVG positive cancelled.")
return
else:
self.app.export_svg_black(name, boxname, filename)
else:
try:
filename, _ = QtWidgets.QFileDialog.getSaveFileName(caption="Export SVG negative",
directory=self.app.get_last_save_folder(), filter="*.svg")
filename, _ = QtWidgets.QFileDialog.getSaveFileName(
caption="Export SVG negative",
directory=self.app.get_last_save_folder() + '/' + name,
filter="*.svg")
except TypeError:
filename, _ = QtWidgets.QFileDialog.getSaveFileName(caption="Export SVG negative")
filename = str(filename)
if str(filename) == "":
self.app.inform.emit("Export SVG negative cancelled.")
self.app.inform.emit("[WARNING_NOTCL]Export SVG negative cancelled.")
return
else:
self.app.export_svg_negative(name, boxname, filename, border)

View File

@@ -125,6 +125,8 @@ class ToolImage(FlatCAMTool):
self.import_button.clicked.connect(self.on_file_importimage)
def run(self):
self.app.report_usage("ToolImage()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.app.ui.notebook.setTabText(2, "Image Tool")

View File

@@ -152,6 +152,8 @@ class Measurement(FlatCAMTool):
self.measure_btn.clicked.connect(self.toggle)
def run(self):
self.app.report_usage("ToolMeasurement()")
if self.app.tool_tab_locked is True:
return
self.toggle()

View File

@@ -34,6 +34,8 @@ class ToolMove(FlatCAMTool):
FlatCAMTool.install(self, icon, separator, shortcut='M', **kwargs)
def run(self):
self.app.report_usage("ToolMove()")
if self.app.tool_tab_locked is True:
return
self.toggle()

View File

@@ -236,6 +236,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
FlatCAMTool.install(self, icon, separator, shortcut='ALT+N', **kwargs)
def run(self):
self.app.report_usage("ToolNonCopperClear()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.build_ui()

View File

@@ -293,6 +293,8 @@ class ToolPaint(FlatCAMTool, Gerber):
FlatCAMTool.install(self, icon, separator, shortcut='ALT+P', **kwargs)
def run(self):
self.app.report_usage("ToolPaint()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.app.ui.notebook.setTabText(2, "Paint Tool")

View File

@@ -176,6 +176,8 @@ class Panelize(FlatCAMTool):
self.constrain_flag = False
def run(self):
self.app.report_usage("ToolPanelize()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.app.ui.notebook.setTabText(2, "Panel. Tool")

View File

@@ -42,6 +42,7 @@ class Properties(FlatCAMTool):
self.vlay.setStretch(0,0)
def run(self):
self.app.report_usage("ToolProperties()")
if self.app.tool_tab_locked is True:
return

View File

@@ -356,6 +356,8 @@ class ToolTransform(FlatCAMTool):
self.offy_entry.returnPressed.connect(self.on_offy)
def run(self):
self.app.report_usage("ToolTransform()")
FlatCAMTool.run(self)
self.set_tool_ui()
self.app.ui.notebook.setTabText(2, "Transform Tool")