Merged jpcgt/flatcam into master
This commit is contained in:
commit
d4310a979c
|
@ -28,6 +28,8 @@ from numpy.linalg import solve
|
||||||
|
|
||||||
from rtree import index as rtindex
|
from rtree import index as rtindex
|
||||||
|
|
||||||
|
from GUIElements import FCEntry
|
||||||
|
|
||||||
|
|
||||||
class BufferSelectionTool(FlatCAMTool):
|
class BufferSelectionTool(FlatCAMTool):
|
||||||
"""
|
"""
|
||||||
|
@ -717,19 +719,23 @@ class FlatCAMDraw(QtCore.QObject):
|
||||||
self.delete_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/deleteshape32.png'), "Delete Shape '-'")
|
self.delete_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/deleteshape32.png'), "Delete Shape '-'")
|
||||||
|
|
||||||
### Snap Toolbar ###
|
### Snap Toolbar ###
|
||||||
|
|
||||||
self.snap_toolbar = QtGui.QToolBar("Grid Toolbar")
|
self.snap_toolbar = QtGui.QToolBar("Grid Toolbar")
|
||||||
self.grid_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share/grid32.png'), 'Snap to grid')
|
self.grid_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share/grid32.png'), 'Snap to grid')
|
||||||
self.grid_gap_x_entry = QtGui.QLineEdit()
|
self.grid_gap_x_entry = FCEntry()
|
||||||
|
|
||||||
self.grid_gap_x_entry.setMaximumWidth(70)
|
self.grid_gap_x_entry.setMaximumWidth(70)
|
||||||
self.grid_gap_x_entry.setToolTip("Grid X distance")
|
self.grid_gap_x_entry.setToolTip("Grid X distance")
|
||||||
self.snap_toolbar.addWidget(self.grid_gap_x_entry)
|
self.snap_toolbar.addWidget(self.grid_gap_x_entry)
|
||||||
self.grid_gap_y_entry = QtGui.QLineEdit()
|
self.grid_gap_y_entry = FCEntry()
|
||||||
self.grid_gap_y_entry.setMaximumWidth(70)
|
self.grid_gap_y_entry.setMaximumWidth(70)
|
||||||
self.grid_gap_y_entry.setToolTip("Grid Y distante")
|
self.grid_gap_y_entry.setToolTip("Grid Y distante")
|
||||||
self.snap_toolbar.addWidget(self.grid_gap_y_entry)
|
self.snap_toolbar.addWidget(self.grid_gap_y_entry)
|
||||||
|
|
||||||
|
|
||||||
self.corner_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share/corner32.png'), 'Snap to corner')
|
self.corner_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share/corner32.png'), 'Snap to corner')
|
||||||
self.snap_max_dist_entry = QtGui.QLineEdit()
|
self.snap_max_dist_entry = FCEntry()
|
||||||
|
|
||||||
self.snap_max_dist_entry.setMaximumWidth(70)
|
self.snap_max_dist_entry.setMaximumWidth(70)
|
||||||
self.snap_max_dist_entry.setToolTip("Max. magnet distance")
|
self.snap_max_dist_entry.setToolTip("Max. magnet distance")
|
||||||
self.snap_toolbar.addWidget(self.snap_max_dist_entry)
|
self.snap_toolbar.addWidget(self.snap_max_dist_entry)
|
||||||
|
|
|
@ -77,6 +77,18 @@ class LengthEntry(QtGui.QLineEdit):
|
||||||
'MM': {'IN': 25.4,
|
'MM': {'IN': 25.4,
|
||||||
'MM': 1.0}
|
'MM': 1.0}
|
||||||
}
|
}
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
|
def mousePressEvent(self, e, Parent=None):
|
||||||
|
super(LengthEntry, self).mousePressEvent(e) # required to deselect on 2e click
|
||||||
|
if self.readyToEdit:
|
||||||
|
self.selectAll()
|
||||||
|
self.readyToEdit = False
|
||||||
|
|
||||||
|
def focusOutEvent(self, e):
|
||||||
|
super(LengthEntry, self).focusOutEvent(e) # required to remove cursor on focusOut
|
||||||
|
self.deselect()
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
def returnPressed(self, *args, **kwargs):
|
def returnPressed(self, *args, **kwargs):
|
||||||
val = self.get_value()
|
val = self.get_value()
|
||||||
|
@ -111,6 +123,18 @@ class LengthEntry(QtGui.QLineEdit):
|
||||||
class FloatEntry(QtGui.QLineEdit):
|
class FloatEntry(QtGui.QLineEdit):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(FloatEntry, self).__init__(parent)
|
super(FloatEntry, self).__init__(parent)
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
|
def mousePressEvent(self, e, Parent=None):
|
||||||
|
super(FloatEntry, self).mousePressEvent(e) # required to deselect on 2e click
|
||||||
|
if self.readyToEdit:
|
||||||
|
self.selectAll()
|
||||||
|
self.readyToEdit = False
|
||||||
|
|
||||||
|
def focusOutEvent(self, e):
|
||||||
|
super(FloatEntry, self).focusOutEvent(e) # required to remove cursor on focusOut
|
||||||
|
self.deselect()
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
def returnPressed(self, *args, **kwargs):
|
def returnPressed(self, *args, **kwargs):
|
||||||
val = self.get_value()
|
val = self.get_value()
|
||||||
|
@ -139,6 +163,18 @@ class IntEntry(QtGui.QLineEdit):
|
||||||
super(IntEntry, self).__init__(parent)
|
super(IntEntry, self).__init__(parent)
|
||||||
self.allow_empty = allow_empty
|
self.allow_empty = allow_empty
|
||||||
self.empty_val = empty_val
|
self.empty_val = empty_val
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
|
def mousePressEvent(self, e, Parent=None):
|
||||||
|
super(IntEntry, self).mousePressEvent(e) # required to deselect on 2e click
|
||||||
|
if self.readyToEdit:
|
||||||
|
self.selectAll()
|
||||||
|
self.readyToEdit = False
|
||||||
|
|
||||||
|
def focusOutEvent(self, e):
|
||||||
|
super(IntEntry, self).focusOutEvent(e) # required to remove cursor on focusOut
|
||||||
|
self.deselect()
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
def get_value(self):
|
def get_value(self):
|
||||||
|
|
||||||
|
@ -160,6 +196,18 @@ class IntEntry(QtGui.QLineEdit):
|
||||||
class FCEntry(QtGui.QLineEdit):
|
class FCEntry(QtGui.QLineEdit):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(FCEntry, self).__init__(parent)
|
super(FCEntry, self).__init__(parent)
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
|
def mousePressEvent(self, e, Parent=None):
|
||||||
|
super(FCEntry, self).mousePressEvent(e) # required to deselect on 2e click
|
||||||
|
if self.readyToEdit:
|
||||||
|
self.selectAll()
|
||||||
|
self.readyToEdit = False
|
||||||
|
|
||||||
|
def focusOutEvent(self, e):
|
||||||
|
super(FCEntry, self).focusOutEvent(e) # required to remove cursor on focusOut
|
||||||
|
self.deselect()
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
def get_value(self):
|
def get_value(self):
|
||||||
return str(self.text())
|
return str(self.text())
|
||||||
|
@ -171,6 +219,18 @@ class FCEntry(QtGui.QLineEdit):
|
||||||
class EvalEntry(QtGui.QLineEdit):
|
class EvalEntry(QtGui.QLineEdit):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(EvalEntry, self).__init__(parent)
|
super(EvalEntry, self).__init__(parent)
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
|
def mousePressEvent(self, e, Parent=None):
|
||||||
|
super(EvalEntry, self).mousePressEvent(e) # required to deselect on 2e click
|
||||||
|
if self.readyToEdit:
|
||||||
|
self.selectAll()
|
||||||
|
self.readyToEdit = False
|
||||||
|
|
||||||
|
def focusOutEvent(self, e):
|
||||||
|
super(EvalEntry, self).focusOutEvent(e) # required to remove cursor on focusOut
|
||||||
|
self.deselect()
|
||||||
|
self.readyToEdit = True
|
||||||
|
|
||||||
def returnPressed(self, *args, **kwargs):
|
def returnPressed(self, *args, **kwargs):
|
||||||
val = self.get_value()
|
val = self.get_value()
|
||||||
|
|
|
@ -22,12 +22,20 @@
|
||||||
import os, site, sys
|
import os, site, sys
|
||||||
from cx_Freeze import setup, Executable
|
from cx_Freeze import setup, Executable
|
||||||
|
|
||||||
|
# this is done to solve the tkinter not being found (Python3)
|
||||||
|
# still the DLL's need to be copied to the lib folder but the script can't do it
|
||||||
|
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
|
||||||
|
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
|
||||||
|
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
|
||||||
|
|
||||||
## Get the site-package folder, not everybody will install
|
## Get the site-package folder, not everybody will install
|
||||||
## Python into C:\PythonXX
|
## Python into C:\PythonXX
|
||||||
site_dir = site.getsitepackages()[1]
|
site_dir = site.getsitepackages()[1]
|
||||||
|
|
||||||
include_files = []
|
include_files = []
|
||||||
include_files.append((os.path.join(site_dir, "shapely"), "shapely"))
|
include_files.append((os.path.join(site_dir, "shapely"), "shapely"))
|
||||||
|
include_files.append((os.path.join(site_dir, "svg"), "svg"))
|
||||||
|
include_files.append((os.path.join(site_dir, "svg/path"), "svg"))
|
||||||
include_files.append((os.path.join(site_dir, "matplotlib"), "matplotlib"))
|
include_files.append((os.path.join(site_dir, "matplotlib"), "matplotlib"))
|
||||||
include_files.append(("share", "share"))
|
include_files.append(("share", "share"))
|
||||||
include_files.append((os.path.join(site_dir, "rtree"), "rtree"))
|
include_files.append((os.path.join(site_dir, "rtree"), "rtree"))
|
||||||
|
@ -41,9 +49,7 @@ if sys.platform == "win32":
|
||||||
base = "Win32GUI"
|
base = "Win32GUI"
|
||||||
|
|
||||||
buildOptions = dict(
|
buildOptions = dict(
|
||||||
compressed=False,
|
|
||||||
include_files=include_files,
|
include_files=include_files,
|
||||||
icon='share/flatcam_icon48.ico',
|
|
||||||
# excludes=['PyQt4', 'tk', 'tcl']
|
# excludes=['PyQt4', 'tk', 'tcl']
|
||||||
excludes=['scipy.lib.lapack.flapack.pyd',
|
excludes=['scipy.lib.lapack.flapack.pyd',
|
||||||
'scipy.lib.blas.fblas.pyd',
|
'scipy.lib.blas.fblas.pyd',
|
||||||
|
@ -60,5 +66,5 @@ setup(
|
||||||
version="8.5",
|
version="8.5",
|
||||||
description="FlatCAM: 2D Computer Aided PCB Manufacturing",
|
description="FlatCAM: 2D Computer Aided PCB Manufacturing",
|
||||||
options=dict(build_exe=buildOptions),
|
options=dict(build_exe=buildOptions),
|
||||||
executables=[Executable("FlatCAM.py", base=base)]
|
executables=[Executable("FlatCAM.py", icon='share/flatcam_icon48.ico', base=base)]
|
||||||
)
|
)
|
|
@ -1,8 +1,7 @@
|
||||||
from ObjectCollection import *
|
from tclCommands.TclCommand import *
|
||||||
import TclCommand
|
|
||||||
|
|
||||||
|
|
||||||
class TclCommandFollow(TclCommand.TclCommandSignaled):
|
class TclCommandFollow(TclCommandSignaled):
|
||||||
"""
|
"""
|
||||||
Tcl shell command to follow a Gerber file
|
Tcl shell command to follow a Gerber file
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue