- application wide change: introduced the precision parameters in Edit -> Preferences who will control how many decimals to use in the app parameters

This commit is contained in:
Marius Stanciu
2019-12-05 15:18:54 +02:00
parent 19b5f732b5
commit 0d0f872244
53 changed files with 481 additions and 445 deletions

View File

@@ -30,7 +30,7 @@ class ToolCalculator(FlatCAMTool):
FlatCAMTool.__init__(self, app)
self.app = app
self.decimals = 6
self.decimals = self.app.decimals
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)

View File

@@ -38,7 +38,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
self.app = app
self.canvas = self.app.plotcanvas
self.decimals = 4
self.decimals = self.app.decimals
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)

View File

@@ -45,7 +45,7 @@ class ToolCopperThieving(FlatCAMTool):
self.app = app
self.canvas = self.app.plotcanvas
self.decimals = 4
self.decimals = self.app.decimals
self.units = self.app.defaults['units']
# ## Title

View File

@@ -46,7 +46,7 @@ class CutOut(FlatCAMTool):
self.app = app
self.canvas = app.plotcanvas
self.decimals = 4
self.decimals = self.app.decimals
# Title
title_label = QtWidgets.QLabel("%s" % self.toolName)

View File

@@ -26,7 +26,7 @@ class DblSidedTool(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
self.decimals = 4
self.decimals = self.app.decimals
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)

View File

@@ -33,6 +33,8 @@ class Distance(FlatCAMTool):
FlatCAMTool.__init__(self, app)
self.app = app
self.decimals = self.app.decimals
self.canvas = self.app.plotcanvas
self.units = self.app.defaults['units'].lower()
@@ -135,8 +137,6 @@ class Distance(FlatCAMTool):
self.mm = None
self.mr = None
self.decimals = 4
# VisPy visuals
if self.app.is_legacy is False:
self.sel_shapes = ShapeCollection(parent=self.app.plotcanvas.view.scene, layers=1)

View File

@@ -36,6 +36,7 @@ class DistanceMin(FlatCAMTool):
self.app = app
self.canvas = self.app.plotcanvas
self.units = self.app.defaults['units'].lower()
self.decimals = self.app.decimals
# ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font><br>" % self.toolName)
@@ -137,7 +138,6 @@ class DistanceMin(FlatCAMTool):
self.layout.addStretch()
self.decimals = 4
self.h_point = (0, 0)
self.measure_btn.clicked.connect(self.activate_measure_tool)

View File

@@ -38,7 +38,7 @@ class ToolFiducials(FlatCAMTool):
self.app = app
self.canvas = self.app.plotcanvas
self.decimals = 4
self.decimals = self.app.decimals
self.units = ''
# ## Title

View File

@@ -44,7 +44,7 @@ class Film(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
self.decimals = 4
self.decimals = self.app.decimals
# Title
title_label = QtWidgets.QLabel("%s" % self.toolName)

View File

@@ -26,6 +26,9 @@ class ToolImage(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
self.app = app
self.decimals = self.app.decimals
# Title
title_label = QtWidgets.QLabel("%s" % _('Image to PCB'))
title_label.setStyleSheet("""

View File

@@ -30,6 +30,8 @@ class ToolMove(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
self.app = app
self.decimals = self.app.decimals
self.layout.setContentsMargins(0, 0, 3, 0)
self.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Maximum)

View File

@@ -39,7 +39,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
def __init__(self, app):
self.app = app
self.decimals = 4
self.decimals = self.app.decimals
FlatCAMTool.__init__(self, app)
Gerber.__init__(self, steps_per_circle=self.app.defaults["gerber_circle_steps"])

View File

@@ -40,7 +40,7 @@ class ToolOptimal(FlatCAMTool):
FlatCAMTool.__init__(self, app)
self.units = self.app.defaults['units'].upper()
self.decimals = 4
self.decimals = self.app.decimals
# ############################################################################
# ############################ GUI creation ##################################

View File

@@ -44,6 +44,7 @@ class ToolPDF(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
self.app = app
self.decimals = self.app.decimals
self.step_per_circles = self.app.defaults["gerber_circle_steps"]
self.stream_re = re.compile(b'.*?FlateDecode.*?stream(.*?)endstream', re.S)

View File

@@ -42,7 +42,7 @@ class ToolPaint(FlatCAMTool, Gerber):
def __init__(self, app):
self.app = app
self.decimals = 4
self.decimals = self.app.decimals
FlatCAMTool.__init__(self, app)
Geometry.__init__(self, geo_steps_per_circle=self.app.defaults["geometry_circle_steps"])

View File

@@ -34,8 +34,9 @@ class Panelize(FlatCAMTool):
toolName = _("Panelize PCB")
def __init__(self, app):
super(Panelize, self).__init__(self)
self.app = app
self.decimals = app.decimals
FlatCAMTool.__init__(self, app)
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)

View File

@@ -34,6 +34,7 @@ class PcbWizard(FlatCAMTool):
FlatCAMTool.__init__(self, app)
self.app = app
self.decimals = self.app.decimals
# Title
title_label = QtWidgets.QLabel("%s" % _('Import 2-file Excellon'))

View File

@@ -34,7 +34,7 @@ class Properties(FlatCAMTool):
self.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
self.decimals = 4
self.decimals = self.app.decimals
# this way I can hide/show the frame
self.properties_frame = QtWidgets.QFrame()

View File

@@ -48,7 +48,7 @@ class QRCode(FlatCAMTool):
self.app = app
self.canvas = self.app.plotcanvas
self.decimals = 4
self.decimals = self.app.decimals
self.units = ''
# ## Title

View File

@@ -35,9 +35,9 @@ class RulesCheck(FlatCAMTool):
tool_finished = QtCore.pyqtSignal(list)
def __init__(self, app):
super(RulesCheck, self).__init__(self)
self.app = app
self.decimals = 4
self.decimals = app.decimals
FlatCAMTool.__init__(self, app)
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)

View File

@@ -40,7 +40,7 @@ class SolderPaste(FlatCAMTool):
FlatCAMTool.__init__(self, app)
# Number of decimals to be used for tools/nozzles in this FlatCAM Tool
self.decimals = 4
self.decimals = self.app.decimals
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)

View File

@@ -36,6 +36,7 @@ class ToolSub(FlatCAMTool):
def __init__(self, app):
self.app = app
self.decimals = self.app.decimals
FlatCAMTool.__init__(self, app)

View File

@@ -30,7 +30,7 @@ class ToolTransform(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
self.decimals = 4
self.decimals = self.app.decimals
self.transform_lay = QtWidgets.QVBoxLayout()
self.layout.addLayout(self.transform_lay)