- editing a multi geometry will no longer pop-up a Tcl window

- solved issue #292 where a new geometry renamed with many underscores failed to store the name in a saved project
- the name for the saved projects are updated to the current time and not to the time of the app startup
- some PEP8 changes related to comments starting with only one '#' symbol
This commit is contained in:
Marius Stanciu 2019-05-30 21:05:12 +03:00
parent ad7222a768
commit 8ee516ec14
55 changed files with 695 additions and 684 deletions

View File

@ -26,7 +26,7 @@ import gc
from xml.dom.minidom import parseString as parse_xml_string
# ##################################### ##
# # Imports part of FlatCAM ##
# # Imports part of FlatCAM # ##
# ##################################### ##
from ObjectCollection import *
from FlatCAMObj import *
@ -59,7 +59,7 @@ if '_' not in builtins.__dict__:
_ = gettext.gettext
# ##################################### ##
# # App ##
# # App # ##
# ##################################### ##
@ -84,7 +84,7 @@ class App(QtCore.QObject):
elif opt == '--shellfile':
cmd_line_shellfile = arg
# Logging ##
# Logging # ##
log = logging.getLogger('base')
log.setLevel(logging.DEBUG)
# log.setLevel(logging.WARNING)
@ -94,8 +94,8 @@ class App(QtCore.QObject):
log.addHandler(handler)
# Version
version = 8.917
version_date = "2019/05/22"
version = 8.918
version_date = "2019/06/11"
beta = True
# current date now
@ -121,7 +121,7 @@ class App(QtCore.QObject):
save_in_progress = False
# ############### ##
# # Signals ##
# # Signals # ##
# ############### ##
# Inform the user
@ -192,7 +192,7 @@ class App(QtCore.QObject):
self.main_thread = QtWidgets.QApplication.instance().thread()
# ################ ##
# ## OS-specific ###
# # ## OS-specific # ##
# ################ ##
# Folder for user settings.
@ -210,7 +210,7 @@ class App(QtCore.QObject):
self.os = 'unix'
# ############################ ##
# ## Setup folders and files ###
# # ## Setup folders and files # ##
# ############################ ##
if not os.path.exists(self.data_path):
@ -273,7 +273,7 @@ class App(QtCore.QObject):
self.mouse = [0, 0]
# ################# ##
# # Initialize GUI ##
# # Initialize GUI # ##
# ################# ##
# FlatCAM colors used in plotting
@ -881,7 +881,7 @@ class App(QtCore.QObject):
})
# ############################ ##
# ## Load defaults from file ###
# # ## Load defaults from file # ##
# ############################ ##
if user_defaults:
@ -903,7 +903,7 @@ class App(QtCore.QObject):
# ################################ ##
# ## CREATE UNIQUE SERIAL NUMBER ###
# # ## CREATE UNIQUE SERIAL NUMBER # ##
# ################################ ##
chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
@ -1171,14 +1171,14 @@ class App(QtCore.QObject):
self.tools_form = None
self.on_options_combo_change(0) # Will show the initial form
# ## Define OBJECT COLLECTION ###
# # ## Define OBJECT COLLECTION # ##
self.collection = ObjectCollection(self)
self.ui.project_tab_layout.addWidget(self.collection.view)
# ##
# # ##
self.log.debug("Finished creating Object Collection.")
# ## Initialize the color box's color in Preferences -> Global -> Color
# # ## Initialize the color box's color in Preferences -> Global -> Color
# Init Plot Colors
self.ui.general_defaults_form.general_gui_group.pf_color_entry.set_value(self.defaults['global_plot_fill'])
self.ui.general_defaults_form.general_gui_group.pf_color_button.setStyleSheet(
@ -1270,7 +1270,7 @@ class App(QtCore.QObject):
end_plot_time = time.time()
self.log.debug("Finished Canvas initialization in %s seconds." % (str(end_plot_time - start_plot_time)))
# ## EDITOR section
# # ## EDITOR section
self.geo_editor = FlatCAMGeoEditor(self, disabled=True)
self.exc_editor = FlatCAMExcEditor(self)
self.grb_editor = FlatCAMGrbEditor(self)
@ -1289,8 +1289,8 @@ class App(QtCore.QObject):
self.workers = WorkerStack(workers_number=2)
self.worker_task.connect(self.workers.add_task)
# ## Signal handling ###
# ## Custom signals
# # ## Signal handling # ##
# # ## Custom signals
self.inform.connect(self.info)
self.app_quit.connect(self.quit_application)
self.message.connect(self.message_dialog)
@ -1303,8 +1303,8 @@ class App(QtCore.QObject):
self.file_opened.connect(lambda kind, filename: self.register_folder(filename))
self.file_saved.connect(lambda kind, filename: self.register_save_folder(filename))
# ## Standard signals
# ## Menu
# # ## Standard signals
# # ## Menu
self.ui.menufilenewproject.triggered.connect(self.on_file_new_click)
self.ui.menufilenewgeo.triggered.connect(self.new_geometry_object)
self.ui.menufilenewgrb.triggered.connect(self.new_gerber_object)
@ -1446,7 +1446,7 @@ class App(QtCore.QObject):
self.ui.pref_open_button.clicked.connect(self.on_preferences_open_folder)
# ############################ ##
# ## GUI PREFERENCES SIGNALS ###
# # ## GUI PREFERENCES SIGNALS # ##
# ############################ ##
self.ui.general_options_form.general_app_group.units_radio.group_toggle_fn = self.on_toggle_units
self.ui.general_defaults_form.general_app_group.language_apply_btn.clicked.connect(
@ -1456,7 +1456,7 @@ class App(QtCore.QObject):
lambda: self.on_toggle_units(no_pref=False))
# ############################ ##
# ## GUI PREFERENCES SIGNALS ###
# # ## GUI PREFERENCES SIGNALS # ##
# ############################ ##
# Setting plot colors signals
@ -1560,7 +1560,7 @@ class App(QtCore.QObject):
self.ui.splitter.setSizes([0, 1])
# ################# ##
# ## Other setups ###
# # ## Other setups # ##
# ################# ##
# Sets up FlatCAMObj, FCProcess and FCProcessContainer.
self.setup_obj_classes()
@ -1569,10 +1569,10 @@ class App(QtCore.QObject):
self.setup_component_editor()
# ########## ##
# ## Shell ###
# # ## Shell # ##
# ########## ##
# ##
# # ##
# Auto-complete KEYWORDS
self.tcl_commands_list = ['add_circle', 'add_poly', 'add_polygon', 'add_polyline', 'add_rectangle',
'aligndrill', 'clear',
@ -1810,7 +1810,7 @@ class App(QtCore.QObject):
self.ui.shell_dock.hide()
# ###################### ##
# ## Tools and Plugins ###
# # ## Tools and Plugins # ##
# ###################### ##
self.dblsidedtool = None
@ -1833,7 +1833,7 @@ class App(QtCore.QObject):
# always install tools only after the shell is initialized because the self.inform.emit() depends on shell
self.install_tools()
# ## System Font Parsing ###
# # ## System Font Parsing # ##
# self.f_parse = ParseFont(self)
# self.parse_system_fonts()
@ -1936,8 +1936,8 @@ class App(QtCore.QObject):
self.isHovering = False
self.notHovering = True
# ## Save defaults to factory_defaults.FlatConfig file ###
# ## It's done only once after install #############
# # ## Save defaults to factory_defaults.FlatConfig file # ##
# # ## It's done only once after install ########### ##
factory_file = open(self.data_path + '/factory_defaults.FlatConfig')
fac_def_from_file = factory_file.read()
factory_defaults = json.loads(fac_def_from_file)
@ -2754,6 +2754,10 @@ class App(QtCore.QObject):
defaults_file_content = None
self.date = str(datetime.today()).rpartition('.')[0]
self.date = ''.join(c for c in self.date if c not in ':-')
self.date = self.date.replace(' ', '_')
filter = "Config File (*.FlatConfig);;All Files (*.*)"
try:
filename, _f = QtWidgets.QFileDialog.getSaveFileName(
@ -2894,7 +2898,7 @@ class App(QtCore.QObject):
t0 = time.time() # Debug
## Create object
# ## Create object
classdict = {
"gerber": FlatCAMGerber,
"excellon": FlatCAMExcellon,
@ -4469,7 +4473,7 @@ class App(QtCore.QObject):
cursor.endEditBlock()
def on_tool_add_keypress(self):
## Current application units in Upper Case
# ## Current application units in Upper Case
self.units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
notebook_widget_name = self.ui.notebook.currentWidget().objectName()
@ -5218,7 +5222,7 @@ class App(QtCore.QObject):
self.ui.grid_gap_y_entry.setText(self.sender().text())
def on_grid_add(self):
## Current application units in lower Case
# ## Current application units in lower Case
units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
grid_add_popup = FCInputDialog(title=_("New Grid ..."),
@ -5245,7 +5249,7 @@ class App(QtCore.QObject):
_("[WARNING_NOTCL] Adding New Grid cancelled ..."))
def on_grid_delete(self):
## Current application units in lower Case
# ## Current application units in lower Case
units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
grid_del_popup = FCInputDialog(title="Delete Grid ...",
@ -6114,10 +6118,13 @@ class App(QtCore.QObject):
self.file_saved.emit("SVG", filename)
def on_file_exportpng(self):
self.report_usage("on_file_exportpng")
App.log.debug("on_file_exportpng()")
self.date = str(datetime.today()).rpartition('.')[0]
self.date = ''.join(c for c in self.date if c not in ':-')
self.date = self.date.replace(' ', '_')
image = _screenshot()
data = np.asarray(image)
if not data.ndim == 3 and data.shape[-1] in (3, 4):
@ -6426,7 +6433,7 @@ class App(QtCore.QObject):
'params': [filename, type_of_obj]})
# ################################################################################################################ ##
# ## The following section has the functions that are displayed and call the Editor tab CNCJob Tab #################
# # ## The following section has the functions that are displayed and call the Editor tab CNCJob Tab ############### ##
# ################################################################################################################ ##
def init_code_editor(self, name):
@ -6634,6 +6641,10 @@ class App(QtCore.QObject):
self.report_usage("on_file_saveprojectas")
self.date = str(datetime.today()).rpartition('.')[0]
self.date = ''.join(c for c in self.date if c not in ':-')
self.date = self.date.replace(' ', '_')
filter_ = "FlatCAM Project (*.FlatPrj);; All Files (*.*)"
try:
filename, _f = QtWidgets.QFileDialog.getSaveFileName(
@ -7481,7 +7492,7 @@ class App(QtCore.QObject):
# Object name
name = outname or filename.split('/')[-1].split('\\')[-1]
# ## Object creation ###
# # ## Object creation # ##
ret = self.new_object("gerber", name, obj_init, autoselected=False)
if ret == 'fail':
self.inform.emit(_('[ERROR_NOTCL] Open Gerber failed. Probable not a Gerber file.'))
@ -7696,7 +7707,7 @@ class App(QtCore.QObject):
self.file_opened.emit("project", filename)
# Clear the current project
# # NOT THREAD SAFE ##
# # NOT THREAD SAFE # ##
if run_from_arg is True:
pass
else:
@ -8375,7 +8386,7 @@ The normal flow when working in FlatCAM is the following:</span></p>
self.save_in_progress = True
with self.proc_container.new(_("Saving FlatCAM Project")) as proc:
## Capture the latest changes
# Capture the latest changes
# Current object
try:
self.collection.get_active().read_form()

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
class LoudDict(dict):

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
import copy
import inspect # TODO: For debugging only.
@ -36,7 +36,7 @@ class ValidationError(Exception):
self.errors = errors
# ##################################### ##
# # FlatCAMObj ##
# # FlatCAMObj # ##
# ##################################### ##
@ -2932,18 +2932,18 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
"""
pts = []
## Iterable: descend into each item.
# Iterable: descend into each item.
try:
for subo in o:
pts += FlatCAMGeometry.get_pts(subo)
## Non-iterable
# Non-iterable
except TypeError:
if o is not None:
if type(o) == MultiPolygon:
for poly in o:
pts += FlatCAMGeometry.get_pts(poly)
## Descend into .exerior and .interiors
# ## Descend into .exerior and .interiors
elif type(o) == Polygon:
pts += FlatCAMGeometry.get_pts(o.exterior)
for i in o.interiors:
@ -2951,7 +2951,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
elif type(o) == MultiLineString:
for line in o:
pts += FlatCAMGeometry.get_pts(line)
## Has .coords: list them.
# ## Has .coords: list them.
else:
pts += list(o.coords)
else:
@ -3033,6 +3033,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
# engine of FlatCAM. Most likely are generated by some of tools and are special cases of geometries.
self. special_group = None
self.old_pp_state = ''
self.old_toolchangeg_state = ''
# Attributes to be included in serialization
# Always append to it because it carries contents
# from predecessors.

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé #
# Date: 5/26/2017 #
# MIT Licence #
############################################################
# ########################################################## ##
from importlib.machinery import SourceFileLoader
import os

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
from flatcamGUI.FlatCAMGUI import FlatCAMActivityView
from PyQt5 import QtCore

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets, QtWidgets
from PyQt5.QtCore import Qt

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
import os
import sys

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
from PyQt5 import QtCore

View File

@ -1,14 +1,14 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
############################################################
# ########################################################## ##
# File modified by: Dennis Hayrullin #
############################################################
# ########################################################## ##
# from PyQt5.QtCore import QModelIndex
from FlatCAMObj import *
@ -261,7 +261,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
font.setFamily("Seagoe UI")
self.view.setFont(font)
## GUI Events
# ## GUI Events
self.view.selectionModel().selectionChanged.connect(self.on_list_selection_change)
self.view.activated.connect(self.on_item_activated)
# self.view.keyPressed.connect(self.on_key)
@ -399,11 +399,11 @@ class ObjectCollection(QtCore.QAbstractItemModel):
if index.isValid():
obj = index.internalPointer().obj
if obj:
old_name = str(obj.options['name'])
old_name = obj.options['name']
new_name = str(data)
if old_name != new_name and new_name != '':
# rename the object
obj.options["name"] = str(data)
obj.options["name"] = deepcopy(data)
# update the SHELL auto-completer model data
try:
@ -411,11 +411,12 @@ class ObjectCollection(QtCore.QAbstractItemModel):
self.app.myKeywords.append(new_name)
self.app.shell._edit.set_model_data(self.app.myKeywords)
self.app.ui.code_editor.set_model_data(self.app.myKeywords)
except:
except Exception as e:
log.debug(
"setData() --> Could not remove the old object name from auto-completer model list")
"setData() --> Could not remove the old object name from auto-completer model list. %s" %
str(e))
obj.build_ui()
# obj.build_ui()
self.app.inform.emit(_("Object renamed from <b>{old}</b> to <b>{new}</b>").format(old=old_name,
new=new_name))
@ -452,7 +453,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
# Prevent same name
while name in self.get_names():
## Create a new name
# ## Create a new name
# Ends with number?
FlatCAMApp.App.log.debug("new_object(): Object name (%s) exists, changing." % name)
match = re.search(r'(.*[^\d])?(\d+)$', name)

View File

@ -9,6 +9,13 @@ CAD program, and create G-Code for Isolation routing.
=================================================
30.05.2019
- editing a multi geometry will no longer pop-up a Tcl window
- solved issue #292 where a new geometry renamed with many underscores failed to store the name in a saved project
- the name for the saved projects are updated to the current time and not to the time of the app startup
- some PEP8 changes related to comments starting with only one '#' symbol
24.05.2019
- added a toggle Grid button to the canvas context menu in the Grids submenu

175
camlib.py
View File

@ -1,12 +1,11 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
#import traceback
from io import StringIO
@ -58,6 +57,12 @@ if platform.architecture()[0] == '64bit':
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2
import gettext
import FlatCAMTranslation as fcTranslate
fcTranslate.apply_language('strings')
import builtins
log = logging.getLogger('base2')
log.setLevel(logging.DEBUG)
@ -66,11 +71,6 @@ handler = logging.StreamHandler()
handler.setFormatter(formatter)
log.addHandler(handler)
import gettext
import FlatCAMTranslation as fcTranslate
fcTranslate.apply_language('strings')
import builtins
if '_' not in builtins.__dict__:
_ = gettext.gettext
@ -132,21 +132,20 @@ class Geometry(object):
:param radius: Radius of the circle.
:return: None
"""
# TODO: Decide what solid_geometry is supposed to be and how we append to it.
if self.solid_geometry is None:
self.solid_geometry = []
if type(self.solid_geometry) is list:
self.solid_geometry.append(Point(origin).buffer(radius, int(int(self.geo_steps_per_circle) / 4)))
self.solid_geometry.append(Point(origin).buffer(
radius, int(int(self.geo_steps_per_circle) / 4)))
return
try:
self.solid_geometry = self.solid_geometry.union(Point(origin).buffer(radius,
int(int(self.geo_steps_per_circle) / 4)))
except:
#print "Failed to run union on polygons."
log.error("Failed to run union on polygons.")
self.solid_geometry = self.solid_geometry.union(Point(origin).buffer(
radius, int(int(self.geo_steps_per_circle) / 4)))
except Exception as e:
log.error("Failed to run union on polygons. %s" % str(e))
return
def add_polygon(self, points):
@ -165,9 +164,8 @@ class Geometry(object):
try:
self.solid_geometry = self.solid_geometry.union(Polygon(points))
except:
#print "Failed to run union on polygons."
log.error("Failed to run union on polygons.")
except Exception as e:
log.error("Failed to run union on polygons. %s" % str(e))
return
def add_polyline(self, points):
@ -186,13 +184,11 @@ class Geometry(object):
try:
self.solid_geometry = self.solid_geometry.union(LineString(points))
except:
#print "Failed to run union on polygons."
log.error("Failed to run union on polylines.")
except Exception as e:
log.error("Failed to run union on polylines. %s" % str(e))
return
def is_empty(self):
if isinstance(self.solid_geometry, BaseGeometry):
return self.solid_geometry.is_empty
@ -336,7 +332,8 @@ class Geometry(object):
poly, which can can be iterable, contain iterable of, or
be itself an implementer of .contains().
:param poly: See description
:param point: See description
:param geoset: a polygon or list of polygons where to find if the param point is contained
:return: Polygon containing point or None.
"""
@ -366,12 +363,12 @@ class Geometry(object):
if geometry is None:
geometry = self.solid_geometry
## If iterable, expand recursively.
# ## If iterable, expand recursively.
try:
for geo in geometry:
interiors.extend(self.get_interiors(geometry=geo))
## Not iterable, get the interiors if polygon.
# ## Not iterable, get the interiors if polygon.
except TypeError:
if type(geometry) == Polygon:
interiors.extend(geometry.interiors)
@ -393,12 +390,12 @@ class Geometry(object):
if geometry is None:
geometry = self.solid_geometry
## If iterable, expand recursively.
# ## If iterable, expand recursively.
try:
for geo in geometry:
exteriors.extend(self.get_exteriors(geometry=geo))
## Not iterable, get the exterior if polygon.
# ## Not iterable, get the exterior if polygon.
except TypeError:
if type(geometry) == Polygon:
exteriors.append(geometry.exterior)
@ -423,7 +420,7 @@ class Geometry(object):
if reset:
self.flat_geometry = []
## If iterable, expand recursively.
# ## If iterable, expand recursively.
try:
for geo in geometry:
if geo is not None:
@ -431,7 +428,7 @@ class Geometry(object):
reset=False,
pathonly=pathonly)
## Not iterable, do the actual indexing and add.
# ## Not iterable, do the actual indexing and add.
except TypeError:
if pathonly and type(geometry) == Polygon:
self.flat_geometry.append(geometry.exterior)
@ -480,18 +477,18 @@ class Geometry(object):
# if reset:
# self.flat_geometry = []
#
# ## If iterable, expand recursively.
# # ## If iterable, expand recursively.
# try:
# for geo in geometry:
# self.flatten_to_paths(geometry=geo, reset=False)
#
# ## Not iterable, do the actual indexing and add.
# # ## Not iterable, do the actual indexing and add.
# except TypeError:
# if type(geometry) == Polygon:
# g = geometry.exterior
# self.flat_geometry.append(g)
#
# ## Add first and last points of the path to the index.
# # ## Add first and last points of the path to the index.
# self.flat_geometry_rtree.insert(len(self.flat_geometry) - 1, g.coords[0])
# self.flat_geometry_rtree.insert(len(self.flat_geometry) - 1, g.coords[-1])
#
@ -694,7 +691,6 @@ class Geometry(object):
else:
scale_factor = 1 / dpi
geos = []
unscaled_geos = []
@ -807,7 +803,7 @@ class Geometry(object):
assert type(polygon) == Polygon or type(polygon) == MultiPolygon, \
"Expected a Polygon or MultiPolygon, got %s" % type(polygon)
## The toolpaths
# ## The toolpaths
# Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@ -893,7 +889,7 @@ class Geometry(object):
# Current buffer radius
radius = tooldia / 2 * (1 - overlap)
## The toolpaths
# ## The toolpaths
# Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@ -973,7 +969,7 @@ class Geometry(object):
# log.debug("camlib.clear_polygon3()")
## The toolpaths
# ## The toolpaths
# Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@ -1071,7 +1067,7 @@ class Geometry(object):
# Assuming geolist is a flat list of flat elements
## Index first and last points in paths
# ## Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@ -1085,7 +1081,7 @@ class Geometry(object):
# storage.insert(LineString(shape))
# #storage.insert(shape)
## Iterate over geometry paths getting the nearest each time.
# ## Iterate over geometry paths getting the nearest each time.
#optimized_paths = []
optimized_paths = FlatCAMRTreeStorage()
optimized_paths.get_points = get_pts
@ -1159,7 +1155,7 @@ class Geometry(object):
log.debug("path_connect()")
## Index first and last points in paths
# ## Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
#
@ -1180,11 +1176,7 @@ class Geometry(object):
try:
while True:
path_count += 1
#print "geo is", geo
_, left = storage.nearest(geo.coords[0])
#print "left is", left
# If left touches geo, remove left from original
# storage and append to geo.
@ -1210,7 +1202,6 @@ class Geometry(object):
continue
_, right = storage.nearest(geo.coords[-1])
#print "right is", right
# If right touches geo, remove left from original
# storage and append to geo.
@ -1243,7 +1234,7 @@ class Geometry(object):
if type(right) == LinearRing:
optimized_geometry.insert(right)
else:
# Cannot exteng geo any further. Put it away.
# Cannot extend geo any further. Put it away.
optimized_geometry.insert(geo)
# Continue with right.
@ -1288,7 +1279,7 @@ class Geometry(object):
def to_dict(self):
"""
Returns a respresentation of the object as a dictionary.
Returns a representation of the object as a dictionary.
Attributes to include are listed in ``self.ser_attrs``.
:return: A dictionary-encoded copy of the object.
@ -1485,7 +1476,7 @@ class ApertureMacro:
<Comment>: 0 <Text>
"""
## Regular expressions
# ## Regular expressions
am1_re = re.compile(r'^%AM([^\*]+)\*(.+)?(%)?$')
am2_re = re.compile(r'(.*)%$')
amcomm_re = re.compile(r'^0(.*)')
@ -1496,8 +1487,8 @@ class ApertureMacro:
self.name = name
self.raw = ""
## These below are recomputed for every aperture
## definition, in other words, are temporary variables.
# ## These below are recomputed for every aperture
# ## definition, in other words, are temporary variables.
self.primitives = []
self.locvars = {}
self.geometry = None
@ -1582,7 +1573,7 @@ class ApertureMacro:
# variables are defined in an aperture definition.
match = ApertureMacro.amprim_re.search(part)
if match:
## Replace all variables
# ## Replace all variables
for v in self.locvars:
# replaced the following line with the next to fix Mentor custom apertures not parsed OK
# part = re.sub(r'\$' + str(v) + r'(?![0-9a-zA-Z])', str(self.locvars[v]), part)
@ -1594,7 +1585,7 @@ class ApertureMacro:
# Change x with *
part = re.sub(r'[xX]', "*", part)
## Store
# ## Store
elements = part.split(",")
self.primitives.append([eval(x) for x in elements])
continue
@ -1754,8 +1745,8 @@ class ApertureMacro:
i = 1 # Number of rings created so far
## If the ring does not have an interior it means that it is
## a disk. Then stop.
# ## If the ring does not have an interior it means that it is
# ## a disk. Then stop.
while len(ring.interiors) > 0 and i < nrings:
r -= thickness + gap
if r <= 0:
@ -1764,7 +1755,7 @@ class ApertureMacro:
result = cascaded_union([result, ring])
i += 1
## Crosshair
# ## Crosshair
hor = LineString([(x - cross_len, y), (x + cross_len, y)]).buffer(cross_th/2.0, cap_style=2)
ver = LineString([(x, y-cross_len), (x, y + cross_len)]).buffer(cross_th/2.0, cap_style=2)
result = cascaded_union([result, hor, ver])
@ -1802,7 +1793,7 @@ class ApertureMacro:
:rtype: shapely.geometry.polygon
"""
## Primitive makers
# ## Primitive makers
makers = {
"1": ApertureMacro.make_circle,
"2": ApertureMacro.make_vectorline,
@ -1815,19 +1806,19 @@ class ApertureMacro:
"7": ApertureMacro.make_thermal
}
## Store modifiers as local variables
# ## Store modifiers as local variables
modifiers = modifiers or []
modifiers = [float(m) for m in modifiers]
self.locvars = {}
for i in range(0, len(modifiers)):
self.locvars[str(i + 1)] = modifiers[i]
## Parse
# ## Parse
self.primitives = [] # Cleanup
self.geometry = Polygon()
self.parse_content()
## Make the geometry
# ## Make the geometry
for primitive in self.primitives:
# Make the primitive
prim_geo = makers[str(int(primitive[0]))](primitive[1:])
@ -1898,9 +1889,7 @@ class Gerber (Geometry):
:rtype: Gerber
"""
# How to discretize a circle.
# if steps_per_circle is None:
# steps_per_circle = int(Gerber.defaults['steps_per_circle'])
# How to approximate a circle with lines.
self.steps_per_circle = int(self.app.defaults["gerber_circle_steps"])
# Initialize parent
@ -1917,7 +1906,7 @@ class Gerber (Geometry):
"""Zeros in Gerber numbers. If 'L' then remove leading zeros, if 'T' remove trailing zeros. Used during parsing.
"""
## Gerber elements ##
# ## Gerber elements # ##
'''
apertures = {
'id':{
@ -2304,7 +2293,7 @@ class Gerber (Geometry):
continue
# ############################################################# ##
# Number format ##################
# Number format ############################################### ##
# Example: %FSLAX24Y24*%
# ############################################################# ##
# TODO: This is ignoring most of the format. Implement the rest.
@ -3084,7 +3073,7 @@ class Gerber (Geometry):
else:
log.warning("Invalid arc in line %d." % line_num)
## EOF
# ## EOF
match = self.eof_re.search(gline)
if match:
continue
@ -3100,7 +3089,7 @@ class Gerber (Geometry):
pass
else:
# EOF, create shapely LineString if something still in path
## --- Buffered ---
# ## --- Buffered ---
geo_dict = dict()
# this treats the case when we are storing geometry as paths
@ -3392,7 +3381,7 @@ class Gerber (Geometry):
self.app.inform.emit(_("[success] Gerber Scale done."))
## solid_geometry ???
# ## solid_geometry ???
# It's a cascaded union of objects.
# self.solid_geometry = affinity.scale(self.solid_geometry, factor,
# factor, origin=(0, 0))
@ -3435,7 +3424,7 @@ class Gerber (Geometry):
else:
return affinity.translate(obj, xoff=dx, yoff=dy)
## Solid geometry
# ## Solid geometry
self.solid_geometry = offset_geom(self.solid_geometry)
self.follow_geometry = offset_geom(self.follow_geometry)
@ -3677,7 +3666,7 @@ class Excellon(Geometry):
self.num_tools = [] # List for keeping the tools sorted
self.index_per_tool = {} # Dictionary to store the indexed points for each tool
## IN|MM -> Units are inherited from Geometry
# ## IN|MM -> Units are inherited from Geometry
#self.units = units
# Trailing "T" or leading "L" (default)
@ -3946,7 +3935,7 @@ class Excellon(Geometry):
log.warning("Found end of the header: %s" % eline)
continue
## Alternative units format M71/M72
# ## Alternative units format M71/M72
# Supposed to be just in the body (yes, the body)
# but some put it in the header (PADS for example).
# Will detect anywhere. Occurrence will change the
@ -3969,7 +3958,7 @@ class Excellon(Geometry):
#### Body ## ##
if not in_header:
## Tool change ##
# ## Tool change # ##
match = self.toolsel_re.search(eline)
if match:
current_tool = str(int(match.group(1)))
@ -4009,7 +3998,7 @@ class Excellon(Geometry):
continue
## Allegro Type Tool change ##
# ## Allegro Type Tool change # ##
if allegro_warning is True:
match = self.absinc_re.search(eline)
match1 = self.stop_re.search(eline)
@ -4019,7 +4008,7 @@ class Excellon(Geometry):
log.debug(" Tool change for Allegro type of Excellon: %s" % current_tool)
continue
## Slots parsing for drilled slots (contain G85)
# ## Slots parsing for drilled slots (contain G85)
# a Excellon drilled slot line may look like this:
# X01125Y0022244G85Y0027756
match = self.slots_re.search(eline)
@ -4032,7 +4021,7 @@ class Excellon(Geometry):
start_coords_match = match.group(1)
stop_coords_match = match.group(2)
# Slot coordinates without period ##
# Slot coordinates without period # ##
# get the coordinates for slot start and for slot stop into variables
start_coords_noperiod = self.coordsnoperiod_re.search(start_coords_match)
stop_coords_noperiod = self.coordsnoperiod_re.search(stop_coords_match)
@ -4101,7 +4090,7 @@ class Excellon(Geometry):
)
continue
# Slot coordinates with period: Use literally. ##
# Slot coordinates with period: Use literally. # ##
# get the coordinates for slot start and for slot stop into variables
start_coords_period = self.coordsperiod_re.search(start_coords_match)
stop_coords_period = self.coordsperiod_re.search(stop_coords_match)
@ -4170,7 +4159,7 @@ class Excellon(Geometry):
)
continue
## Coordinates without period ##
# ## Coordinates without period # ##
match = self.coordsnoperiod_re.search(eline)
if match:
matchr = self.repeat_re.search(eline)
@ -4201,7 +4190,7 @@ class Excellon(Geometry):
log.error("Missing coordinates")
continue
## Excellon Routing parse
# ## Excellon Routing parse
if len(re.findall("G00", eline)) > 0:
self.match_routing_start = 'G00'
@ -4251,7 +4240,7 @@ class Excellon(Geometry):
# log.debug("{:15} {:8} {:8}".format(eline, x, y))
continue
## Coordinates with period: Use literally. ##
# ## Coordinates with period: Use literally. # ##
match = self.coordsperiod_re.search(eline)
if match:
matchr = self.repeat_re.search(eline)
@ -4282,7 +4271,7 @@ class Excellon(Geometry):
log.error("Missing coordinates")
continue
## Excellon Routing parse
# ## Excellon Routing parse
if len(re.findall("G00", eline)) > 0:
self.match_routing_start = 'G00'
@ -4336,7 +4325,7 @@ class Excellon(Geometry):
#### Header ## ##
if in_header:
## Tool definitions ##
# ## Tool definitions # ##
match = self.toolset_re.search(eline)
if match:
@ -4354,7 +4343,7 @@ class Excellon(Geometry):
log.debug(" Tool definition: %s %s" % (name, spec))
continue
## Units and number format ##
# ## Units and number format # ##
match = self.units_re.match(eline)
if match:
self.units_found = match.group(1)
@ -4412,7 +4401,7 @@ class Excellon(Geometry):
log.warning("Type of zeros found: %s" % self.zeros)
continue
## Units and number format outside header##
# ## Units and number format outside header# ##
match = self.units_re.match(eline)
if match:
self.units_found = match.group(1)
@ -4489,7 +4478,7 @@ class Excellon(Geometry):
# You must show all zeros to the right of the number and can omit
# all zeros to the left of the number. The CNC-7 will count the number
# of digits you typed and automatically fill in the missing zeros.
## flatCAM expects 6digits
# ## flatCAM expects 6digits
# flatCAM expects the number of digits entered into the defaults
if self.units.lower() == "in": # Inches is 00.0000
@ -5588,7 +5577,7 @@ class CNCjob(Geometry):
else:
temp_solid_geometry = geometry
## Flatten the geometry. Only linear elements (no polygons) remain.
# ## Flatten the geometry. Only linear elements (no polygons) remain.
flat_geometry = self.flatten(temp_solid_geometry, pathonly=True)
log.debug("%d paths" % len(flat_geometry))
@ -5665,7 +5654,7 @@ class CNCjob(Geometry):
"This is dangerous, skipping %s file") % self.options['name'])
return 'fail'
## Index first and last points in paths
# ## Index first and last points in paths
# What points to index.
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@ -5719,7 +5708,7 @@ class CNCjob(Geometry):
if self.dwell is True:
self.gcode += self.doformat(p.dwell_code) # Dwell time
## Iterate over geometry paths getting the nearest each time.
# ## Iterate over geometry paths getting the nearest each time.
log.debug("Starting G-Code...")
path_count = 0
current_pt = (0, 0)
@ -5855,7 +5844,7 @@ class CNCjob(Geometry):
else:
temp_solid_geometry = geometry.solid_geometry
## Flatten the geometry. Only linear elements (no polygons) remain.
# ## Flatten the geometry. Only linear elements (no polygons) remain.
flat_geometry = self.flatten(temp_solid_geometry, pathonly=True)
log.debug("%d paths" % len(flat_geometry))
@ -5928,7 +5917,7 @@ class CNCjob(Geometry):
"This is dangerous, skipping %s file") % self.options['name'])
return 'fail'
## Index first and last points in paths
# ## Index first and last points in paths
# What points to index.
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@ -6041,7 +6030,7 @@ class CNCjob(Geometry):
log.debug("Generate_from_solderpaste_geometry()")
## Index first and last points in paths
# ## Index first and last points in paths
# What points to index.
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@ -6077,7 +6066,7 @@ class CNCjob(Geometry):
else self.app.defaults['tools_solderpaste_pp']
p = self.app.postprocessors[self.pp_solderpaste_name]
## Flatten the geometry. Only linear elements (no polygons) remain.
# ## Flatten the geometry. Only linear elements (no polygons) remain.
flat_geometry = self.flatten(kwargs['solid_geometry'], pathonly=True)
log.debug("%d paths" % len(flat_geometry))
@ -6096,7 +6085,7 @@ class CNCjob(Geometry):
self.gcode += self.doformat(p.spindle_off_code)
self.gcode += self.doformat(p.toolchange_code)
## Iterate over geometry paths getting the nearest each time.
# ## Iterate over geometry paths getting the nearest each time.
log.debug("Starting SolderPaste G-Code...")
path_count = 0
current_pt = (0, 0)
@ -6355,12 +6344,12 @@ class CNCjob(Geometry):
gobj = self.codes_split(line)
## Units
# ## Units
if 'G' in gobj and (gobj['G'] == 20.0 or gobj['G'] == 21.0):
self.units = {20.0: "IN", 21.0: "MM"}[gobj['G']]
continue
## Changing height
# ## Changing height
if 'Z' in gobj:
if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name:
pass
@ -7699,7 +7688,7 @@ class FlatCAMRTree(object):
# Python RTree Index
self.rti = rtindex.Index()
## Track object-point relationship
# ## Track object-point relationship
# Each is list of points in object.
self.obj2points = []

View File

@ -726,11 +726,11 @@ class FlatCAMExcEditor(QtCore.QObject):
self.app = app
self.canvas = self.app.plotcanvas
## Current application units in Upper Case
# ## Current application units in Upper Case
self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
self.exc_edit_widget = QtWidgets.QWidget()
## Box for custom widgets
# ## Box for custom widgets
# This gets populated in offspring implementations.
layout = QtWidgets.QVBoxLayout()
self.exc_edit_widget.setLayout(layout)
@ -744,22 +744,22 @@ class FlatCAMExcEditor(QtCore.QObject):
self.tools_box.setContentsMargins(0, 0, 0, 0)
self.drills_frame.setLayout(self.tools_box)
## Page Title box (spacing between children)
# ## Page Title box (spacing between children)
self.title_box = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(self.title_box)
## Page Title icon
# ## Page Title icon
pixmap = QtGui.QPixmap('share/flatcam_icon32.png')
self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0)
## Title label
# ## Title label
self.title_label = QtWidgets.QLabel("<font size=5><b>%s</b></font>" % _('Excellon Editor'))
self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.title_label, stretch=1)
## Object name
# ## Object name
self.name_box = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(self.name_box)
name_label = QtWidgets.QLabel(_("Name:"))
@ -1001,7 +1001,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.array_frame.hide()
self.tools_box.addStretch()
## Toolbar events and properties
# ## Toolbar events and properties
self.tools_exc = {
"drill_select": {"button": self.app.ui.select_drill_btn,
"constructor": FCDrillSelect},
@ -1090,7 +1090,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.shapes.enabled = False
self.tool_shape.enabled = False
## List of selected shapes.
# ## List of selected shapes.
self.selected = []
self.move_timer = QtCore.QTimer()
@ -1160,7 +1160,7 @@ class FlatCAMExcEditor(QtCore.QObject):
@staticmethod
def make_storage():
## Shape storage.
# ## Shape storage.
storage = FlatCAMRTreeStorage()
storage.get_points = DrawToolShape.get_pts
@ -1739,7 +1739,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.drills_frame.hide()
def connect_canvas_event_handlers(self):
## Canvas events
# ## Canvas events
# first connect to new, then disconnect the old handlers
# don't ask why but if there is nothing connected I've seen issues
@ -2553,13 +2553,13 @@ class FlatCAMExcEditor(QtCore.QObject):
for geo in geometry:
plot_elements += self.plot_shape(geometry=geo, color=color, linewidth=linewidth)
## Non-iterable
# ## Non-iterable
except TypeError:
## DrawToolShape
# ## DrawToolShape
if isinstance(geometry, DrawToolShape):
plot_elements += self.plot_shape(geometry=geometry.geo, color=color, linewidth=linewidth)
## Polygon: Descend into exterior and each interior.
# ## Polygon: Descend into exterior and each interior.
if type(geometry) == Polygon:
plot_elements += self.plot_shape(geometry=geometry.exterior, color=color, linewidth=linewidth)
plot_elements += self.plot_shape(geometry=geometry.interiors, color=color, linewidth=linewidth)

View File

@ -629,7 +629,7 @@ class TransformEditorTool(FlatCAMTool):
self.transform_lay = QtWidgets.QVBoxLayout()
self.layout.addLayout(self.transform_lay)
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % (_('Editor %s') % self.toolName))
title_label.setStyleSheet("""
QLabel
@ -2918,7 +2918,7 @@ class FCTransform(FCShapeTool):
# ##################### ##
# ## Main Application ###
# # ## Main Application # ##
# ##################### ##
class FlatCAMGeoEditor(QtCore.QObject):
@ -2935,7 +2935,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
self.app = app
self.canvas = app.plotcanvas
## Toolbar events and properties
# ## Toolbar events and properties
self.tools = {
"select": {"button": self.app.ui.geo_select_btn,
"constructor": FCSelect},
@ -2965,7 +2965,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
"constructor": FCCopy}
}
# ## Data
# # ## Data
self.active_tool = None
self.storage = FlatCAMGeoEditor.make_storage()
@ -3413,7 +3413,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
if multigeo_tool:
self.multigeo_tool = multigeo_tool
geo_to_edit = fcgeometry.flatten(geometry=fcgeometry.tools[self.multigeo_tool]['solid_geometry'])
self.app.inform.emit(_("[WARNING] Editing MultiGeo Geometry, tool: {tool} with diameter: {dia}").
self.app.inform.emit(_("[WARNING_NOTCL] Editing MultiGeo Geometry, tool: {tool} with diameter: {dia}").
format(tool=self.multigeo_tool, dia=fcgeometry.tools[self.multigeo_tool]['tooldia']))
else:
geo_to_edit = fcgeometry.flatten()
@ -3569,7 +3569,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
if self.active_tool is None:
return
# ## Snap coordinates
# # ## Snap coordinates
if self.app.grid_status():
x, y = self.snap(x, y)
self.app.app_cursor.enabled = True
@ -3597,14 +3597,14 @@ class FlatCAMGeoEditor(QtCore.QObject):
if event.button == 1 and event.is_dragging == 1 and isinstance(self.active_tool, FCEraser):
pass
else:
# ## Utility geometry (animated)
# # ## Utility geometry (animated)
geo = self.active_tool.utility_geometry(data=(x, y))
if isinstance(geo, DrawToolShape) and geo.geo is not None:
# Remove any previous utility shape
self.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo)
# ## Selection area on canvas section ###
# # ## Selection area on canvas section # ##
dx = pos[0] - self.pos[0]
if event.is_dragging == 1 and event.button == 1:
self.app.delete_selection_shape()
@ -3938,9 +3938,9 @@ class FlatCAMGeoEditor(QtCore.QObject):
snap_x, snap_y = (x, y)
snap_distance = Inf
# ## Object (corner?) snap
# ## No need for the objects, just the coordinates
# ## in the index.
# # ## Object (corner?) snap
# # ## No need for the objects, just the coordinates
# # ## in the index.
if self.options["corner_snap"]:
try:
nearest_pt, shape = self.storage.nearest((x, y))
@ -3952,7 +3952,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
except (StopIteration, AssertionError):
pass
# ## Grid snap
# # ## Grid snap
if self.options["grid_snap"]:
if self.options["global_gridx"] != 0:
snap_x_ = round(x / self.options["global_gridx"]) * self.options['global_gridx']

View File

@ -52,7 +52,7 @@ class DrawToolShape(object):
"""
pts = []
## Iterable: descend into each item.
# ## Iterable: descend into each item.
try:
for sub_o in o:
pts += DrawToolShape.get_pts(sub_o)
@ -64,7 +64,7 @@ class DrawToolShape(object):
if isinstance(o, DrawToolShape):
pts += DrawToolShape.get_pts(o.geo)
## Descend into .exerior and .interiors
# ## Descend into .exerior and .interiors
elif type(o) == Polygon:
pts += DrawToolShape.get_pts(o.exterior)
for i in o.interiors:
@ -72,7 +72,7 @@ class DrawToolShape(object):
elif type(o) == MultiLineString:
for line in o:
pts += DrawToolShape.get_pts(line)
## Has .coords: list them.
# ## Has .coords: list them.
else:
if DrawToolShape.tolerance is not None:
pts += list(o.simplify(DrawToolShape.tolerance).coords)
@ -2390,7 +2390,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
hlay_ad.addWidget(self.addaperture_btn)
hlay_ad.addWidget(self.delaperture_btn)
# ## BUFFER TOOL ###
# # ## BUFFER TOOL # ##
self.buffer_tool_frame = QtWidgets.QFrame()
self.buffer_tool_frame.setContentsMargins(0, 0, 0, 0)
@ -2434,7 +2434,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.buffer_button = QtWidgets.QPushButton(_("Buffer"))
hlay_buf.addWidget(self.buffer_button)
# ## SCALE TOOL ###
# # ## SCALE TOOL # ##
self.scale_tool_frame = QtWidgets.QFrame()
self.scale_tool_frame.setContentsMargins(0, 0, 0, 0)
@ -2633,7 +2633,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
"constructor": FCApertureMove},
}
# ## Data
# # ## Data
self.active_tool = None
self.storage_dict = {}
@ -4079,7 +4079,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
if self.active_tool is None:
return
# ## Snap coordinates
# # ## Snap coordinates
if self.app.grid_status():
x, y = self.app.geo_editor.snap(x, y)
self.app.app_cursor.enabled = True
@ -4104,7 +4104,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy))
# ## Utility geometry (animated)
# # ## Utility geometry (animated)
geo = self.active_tool.utility_geometry(data=(x, y))
if isinstance(geo, DrawToolShape) and geo.geo is not None:
@ -4112,7 +4112,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo)
# ## Selection area on canvas section ###
# # ## Selection area on canvas section # ##
if event.is_dragging == 1 and event.button == 1:
# I make an exception for FCRegion and FCTrack because clicking and dragging while making regions can
# create strange issues like missing a point in a track/region

View File

@ -1,15 +1,15 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
############################################################
# ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 #
############################################################
# ########################################################## ##
from PyQt5.QtCore import QSettings
from flatcamGUI.GUIElements import *
@ -517,7 +517,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.exc_editor_menu.setDisabled(True)
# ############################# ##
# ## Project Tab Context menu ###
# # ## Project Tab Context menu # ##
# ############################# ##
self.menuproject = QtWidgets.QMenu()
@ -536,7 +536,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.menuprojectproperties = self.menuproject.addAction(QtGui.QIcon('share/properties32.png'), _('Properties'))
# ############# ##
# ## Splitter ###
# # ## Splitter # ##
# ############# ##
# IMPORTANT #
@ -732,7 +732,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.grb_edit_toolbar.addSeparator()
self.aperture_move_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move"))
# ## Snap Toolbar ###
# # ## Snap Toolbar # ##
# Snap GRID toolbar is always active to facilitate usage of measurements done on GRID
# self.addToolBar(self.snap_toolbar)
@ -1575,7 +1575,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# ########################################################### ##
# ## HERE WE BUILD THE CONTEXT MENU FOR RMB CLICK ON CANVAS ###
# # ## HERE WE BUILD THE CONTEXT MENU FOR RMB CLICK ON CANVAS # ##
# ########################################################### ##
self.popMenu = FCMenu()
@ -2813,7 +2813,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Add Track
if key == QtCore.Qt.Key_T or key == 'T':
self.app.grb_editor.launched_from_shortcuts = True
## Current application units in Upper Case
# ## Current application units in Upper Case
self.app.grb_editor.select_tool('track')
return
@ -2990,7 +2990,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Add Tool
if key == QtCore.Qt.Key_T or key == 'T':
self.app.exc_editor.launched_from_shortcuts = True
## Current application units in Upper Case
# ## Current application units in Upper Case
self.units = self.general_defaults_form.general_app_group.units_radio.get_value().upper()
tool_add_popup = FCInputDialog(title=_("New Tool ..."),
text=_('Enter a Tool Diameter:'),
@ -3996,7 +3996,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str("Gerber General"))
## Plot options
# ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.layout.addWidget(self.plot_options_label)
@ -4045,7 +4045,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Gerber Options")))
## Isolation Routing
# ## Isolation Routing
self.isolation_routing_label = QtWidgets.QLabel(_("<b>Isolation Routing:</b>"))
self.isolation_routing_label.setToolTip(
_("Create a Geometry object with\n"
@ -4104,7 +4104,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
)
grid0.addWidget(self.combine_passes_cb, 4, 0)
## Clear non-copper regions
# ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("<b>Clear non-copper:</b>"))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
@ -4135,7 +4135,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
)
grid1.addWidget(self.noncopper_rounded_cb, 1, 0, 1, 2)
## Bounding box
# ## Bounding box
self.boundingbox_label = QtWidgets.QLabel(_('<b>Bounding Box:</b>'))
self.layout.addWidget(self.boundingbox_label)
@ -4170,7 +4170,7 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Gerber Adv. Options")))
## Advanced Gerber Parameters
# ## Advanced Gerber Parameters
self.adv_param_label = QtWidgets.QLabel(_("<b>Advanced Param.:</b>"))
self.adv_param_label.setToolTip(
_("A list of Gerber advanced parameters.\n"
@ -4619,7 +4619,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Excellon Options")))
## Create CNC Job
# ## Create CNC Job
self.cncjob_label = QtWidgets.QLabel(_('<b>Create CNC Job</b>'))
self.cncjob_label.setToolTip(
_("Parameters used to create a CNC Job object\n"
@ -4794,7 +4794,7 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Excellon Adv. Options")))
#################### ##
## ADVANCED OPTIONS ##
# ## ADVANCED OPTIONS # ##
#################### ##
self.cncjob_label = QtWidgets.QLabel(_('<b>Advanced Options:</b>'))
@ -5035,7 +5035,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry General")))
## Plot options
# ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.layout.addWidget(self.plot_options_label)
@ -5086,7 +5086,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry Options")))
# ------------------------------
## Create CNC Job
# ## Create CNC Job
# ------------------------------
self.cncjob_label = QtWidgets.QLabel(_('<b>Create CNC Job:</b>'))
self.cncjob_label.setToolTip(
@ -5245,7 +5245,7 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry Adv. Options")))
# ------------------------------
## Advanced Options
# ## Advanced Options
# ------------------------------
self.cncjob_label = QtWidgets.QLabel(_('<b>Advanced Options:</b>'))
self.cncjob_label.setToolTip(
@ -5407,7 +5407,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job General")))
## Plot options
# ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.layout.addWidget(self.plot_options_label)
@ -5493,7 +5493,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job Options")))
## Export G-Code
# ## Export G-Code
self.export_gcode_label = QtWidgets.QLabel(_("<b>Export G-Code:</b>"))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
@ -5534,7 +5534,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job Adv. Options")))
## Export G-Code
# ## Export G-Code
self.export_gcode_label = QtWidgets.QLabel(_("<b>Export G-Code:</b>"))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
@ -5617,7 +5617,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("NCC Tool Options")))
## Clear non-copper regions
# ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
@ -5718,7 +5718,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Cutout Tool Options")))
## Board cuttout
# ## Board cuttout
self.board_cutout_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n"
@ -5797,7 +5797,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("2Sided Tool Options")))
## Board cuttout
# ## Board cuttout
self.dblsided_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.dblsided_label.setToolTip(
_("A tool to help in creating a double sided\n"
@ -5808,7 +5808,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
## Drill diameter for alignment holes
# ## Drill diameter for alignment holes
self.drill_dia_entry = LengthEntry()
self.dd_label = QtWidgets.QLabel(_("Drill diam.:"))
self.dd_label.setToolTip(
@ -5818,7 +5818,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.dd_label, 0, 0)
grid0.addWidget(self.drill_dia_entry, 0, 1)
## Axis
# ## Axis
self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
{'label': 'Y', 'value': 'Y'}])
self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:"))
@ -5831,7 +5831,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.mirax_label, 2, 0)
grid0.addWidget(self.mirror_axis_radio, 2, 1)
## Axis Location
# ## Axis Location
self.axis_location_radio = RadioSet([{'label': 'Point', 'value': 'point'},
{'label': 'Box', 'value': 'box'}])
self.axloc_label = QtWidgets.QLabel(_("Axis Ref:"))
@ -5855,7 +5855,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Paint Tool Options")))
# ------------------------------
## Paint area
# ## Paint area
# ------------------------------
self.paint_label = QtWidgets.QLabel(_('<b>Parameters:</b>'))
self.paint_label.setToolTip(
@ -5959,7 +5959,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Film Tool Options")))
## Board cuttout
# ## Board cuttout
self.film_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.film_label.setToolTip(
_("Create a PCB film from a Gerber or Geometry\n"
@ -6020,7 +6020,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Panelize Tool Options")))
## Board cuttout
# ## Board cuttout
self.panelize_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.panelize_label.setToolTip(
_("Create an object that contains an array of (x, y) elements,\n"
@ -6032,7 +6032,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
## Spacing Columns
# ## Spacing Columns
self.pspacing_columns = FCEntry()
self.spacing_columns_label = QtWidgets.QLabel(_("Spacing cols:"))
self.spacing_columns_label.setToolTip(
@ -6042,7 +6042,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.spacing_columns_label, 0, 0)
grid0.addWidget(self.pspacing_columns, 0, 1)
## Spacing Rows
# ## Spacing Rows
self.pspacing_rows = FCEntry()
self.spacing_rows_label = QtWidgets.QLabel(_("Spacing rows:"))
self.spacing_rows_label.setToolTip(
@ -6052,7 +6052,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.spacing_rows_label, 1, 0)
grid0.addWidget(self.pspacing_rows, 1, 1)
## Columns
# ## Columns
self.pcolumns = FCEntry()
self.columns_label = QtWidgets.QLabel(_("Columns:"))
self.columns_label.setToolTip(
@ -6061,7 +6061,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.columns_label, 2, 0)
grid0.addWidget(self.pcolumns, 2, 1)
## Rows
# ## Rows
self.prows = FCEntry()
self.rows_label = QtWidgets.QLabel(_("Rows:"))
self.rows_label.setToolTip(
@ -6070,7 +6070,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.rows_label, 3, 0)
grid0.addWidget(self.prows, 3, 1)
## Type of resulting Panel object
# ## Type of resulting Panel object
self.panel_type_radio = RadioSet([{'label': 'Gerber', 'value': 'gerber'},
{'label': 'Geo', 'value': 'geometry'}])
self.panel_type_label = QtWidgets.QLabel(_("Panel Type:"))
@ -6083,7 +6083,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.panel_type_label, 4, 0)
grid0.addWidget(self.panel_type_radio, 4, 1)
## Constrains
# ## Constrains
self.pconstrain_cb = FCCheckBox(_("Constrain within:"))
self.pconstrain_cb.setToolTip(
_("Area define by DX and DY within to constrain the panel.\n"
@ -6122,7 +6122,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Calculators Tool Options")))
## V-shape Calculator Tool
# ## V-shape Calculator Tool
self.vshape_tool_label = QtWidgets.QLabel(_("<b>V-Shape Tool Calculator:</b>"))
self.vshape_tool_label.setToolTip(
_("Calculate the tool diameter for a given V-shape tool,\n"
@ -6134,7 +6134,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
## Tip Diameter
# ## Tip Diameter
self.tip_dia_entry = FCEntry()
self.tip_dia_label = QtWidgets.QLabel(_("Tip Diameter:"))
self.tip_dia_label.setToolTip(
@ -6144,7 +6144,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.tip_dia_label, 0, 0)
grid0.addWidget(self.tip_dia_entry, 0, 1)
## Tip angle
# ## Tip angle
self.tip_angle_entry = FCEntry()
self.tip_angle_label = QtWidgets.QLabel(_("Tip angle:"))
self.tip_angle_label.setToolTip(
@ -6154,7 +6154,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.tip_angle_label, 1, 0)
grid0.addWidget(self.tip_angle_entry, 1, 1)
## Depth-of-cut Cut Z
# ## Depth-of-cut Cut Z
self.cut_z_entry = FCEntry()
self.cut_z_label = QtWidgets.QLabel(_("Cut Z:"))
self.cut_z_label.setToolTip(
@ -6164,7 +6164,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.cut_z_label, 2, 0)
grid0.addWidget(self.cut_z_entry, 2, 1)
## Electroplating Calculator Tool
# ## Electroplating Calculator Tool
self.plate_title_label = QtWidgets.QLabel(_("<b>ElectroPlating Calculator:</b>"))
self.plate_title_label.setToolTip(
_("This calculator is useful for those who plate the via/pad/drill holes,\n"
@ -6175,7 +6175,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid1)
## PCB Length
# ## PCB Length
self.pcblength_entry = FCEntry()
self.pcblengthlabel = QtWidgets.QLabel(_("Board Length:"))
@ -6183,7 +6183,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.pcblengthlabel, 0, 0)
grid1.addWidget(self.pcblength_entry, 0, 1)
## PCB Width
# ## PCB Width
self.pcbwidth_entry = FCEntry()
self.pcbwidthlabel = QtWidgets.QLabel(_("Board Width:"))
@ -6191,7 +6191,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.pcbwidthlabel, 1, 0)
grid1.addWidget(self.pcbwidth_entry, 1, 1)
## Current Density
# ## Current Density
self.cdensity_label = QtWidgets.QLabel(_("Current Density:"))
self.cdensity_entry = FCEntry()
@ -6200,7 +6200,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.cdensity_label, 2, 0)
grid1.addWidget(self.cdensity_entry, 2, 1)
## PCB Copper Growth
# ## PCB Copper Growth
self.growth_label = QtWidgets.QLabel(_("Copper Growth:"))
self.growth_entry = FCEntry()
@ -6219,7 +6219,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Transform Tool Options")))
## Transformations
# ## Transformations
self.transform_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.transform_label.setToolTip(
_("Various transformations that can be applied\n"
@ -6230,7 +6230,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
## Rotate Angle
# ## Rotate Angle
self.rotate_entry = FCEntry()
self.rotate_label = QtWidgets.QLabel(_("Rotate Angle:"))
self.rotate_label.setToolTip(
@ -6239,7 +6239,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.rotate_label, 0, 0)
grid0.addWidget(self.rotate_entry, 0, 1)
## Skew/Shear Angle on X axis
# ## Skew/Shear Angle on X axis
self.skewx_entry = FCEntry()
self.skewx_label = QtWidgets.QLabel(_("Skew_X angle:"))
self.skewx_label.setToolTip(
@ -6248,7 +6248,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.skewx_label, 1, 0)
grid0.addWidget(self.skewx_entry, 1, 1)
## Skew/Shear Angle on Y axis
# ## Skew/Shear Angle on Y axis
self.skewy_entry = FCEntry()
self.skewy_label = QtWidgets.QLabel(_("Skew_Y angle:"))
self.skewy_label.setToolTip(
@ -6257,7 +6257,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.skewy_label, 2, 0)
grid0.addWidget(self.skewy_entry, 2, 1)
## Scale factor on X axis
# ## Scale factor on X axis
self.scalex_entry = FCEntry()
self.scalex_label = QtWidgets.QLabel(_("Scale_X factor:"))
self.scalex_label.setToolTip(
@ -6266,7 +6266,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.scalex_label, 3, 0)
grid0.addWidget(self.scalex_entry, 3, 1)
## Scale factor on X axis
# ## Scale factor on X axis
self.scaley_entry = FCEntry()
self.scaley_label = QtWidgets.QLabel(_("Scale_Y factor:"))
self.scaley_label.setToolTip(
@ -6275,7 +6275,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.scaley_label, 4, 0)
grid0.addWidget(self.scaley_entry, 4, 1)
## Link Scale factors
# ## Link Scale factors
self.link_cb = FCCheckBox(_("Link"))
self.link_cb.setToolTip(
_("Scale the selected object(s)\n"
@ -6283,7 +6283,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
)
grid0.addWidget(self.link_cb, 5, 0)
## Scale Reference
# ## Scale Reference
self.reference_cb = FCCheckBox(_("Scale Reference"))
self.reference_cb.setToolTip(
_("Scale the selected object(s)\n"
@ -6293,7 +6293,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
)
grid0.addWidget(self.reference_cb, 5, 1)
## Offset distance on X axis
# ## Offset distance on X axis
self.offx_entry = FCEntry()
self.offx_label = QtWidgets.QLabel(_("Offset_X val:"))
self.offx_label.setToolTip(
@ -6302,7 +6302,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.offx_label, 6, 0)
grid0.addWidget(self.offx_entry, 6, 1)
## Offset distance on Y axis
# ## Offset distance on Y axis
self.offy_entry = FCEntry()
self.offy_label = QtWidgets.QLabel(_("Offset_Y val:"))
self.offy_label.setToolTip(
@ -6311,7 +6311,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.offy_label, 7, 0)
grid0.addWidget(self.offy_entry, 7, 1)
## Mirror (Flip) Reference Point
# ## Mirror (Flip) Reference Point
self.mirror_reference_cb = FCCheckBox(_("Mirror Reference"))
self.mirror_reference_cb.setToolTip(
_("Flip the selected object(s)\n"
@ -6346,7 +6346,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("SolderPaste Tool Options")))
## Solder Paste Dispensing
# ## Solder Paste Dispensing
self.solderpastelabel = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.solderpastelabel.setToolTip(
_("A tool to create GCode for dispensing\n"

View File

@ -1,15 +1,15 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
############################################################
# ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 #
############################################################
# ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot

View File

@ -1,15 +1,15 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
############################################################
# ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 #
############################################################
# ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt
@ -36,22 +36,22 @@ class ObjectUI(QtWidgets.QWidget):
layout = QtWidgets.QVBoxLayout()
self.setLayout(layout)
## Page Title box (spacing between children)
# ## Page Title box (spacing between children)
self.title_box = QtWidgets.QHBoxLayout()
layout.addLayout(self.title_box)
## Page Title icon
# ## Page Title icon
pixmap = QtGui.QPixmap(icon_file)
self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0)
## Title label
# ## Title label
self.title_label = QtWidgets.QLabel("<font size=5><b>%s</b></font>" % title)
self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.title_label, stretch=1)
## App Level label
# ## App Level label
self.level = QtWidgets.QLabel("")
self.level.setToolTip(
_(
@ -66,13 +66,13 @@ class ObjectUI(QtWidgets.QWidget):
self.level.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.level)
## Box box for custom widgets
# ## Box box for custom widgets
# This gets populated in offspring implementations.
self.custom_box = QtWidgets.QVBoxLayout()
layout.addLayout(self.custom_box)
######################### ##
## Common to all objects ##
# ## Common to all objects # ##
######################### ##
#### Scale ## ##
@ -176,7 +176,7 @@ class GerberObjectUI(ObjectUI):
self.plot_cb.setFixedWidth(59)
grid0.addWidget(self.plot_cb, 0, 3)
## Object name
# ## Object name
self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("<b>Name:</b>"))
@ -380,7 +380,7 @@ class GerberObjectUI(ObjectUI):
grid2 = QtWidgets.QGridLayout()
self.custom_box.addLayout(grid2)
## Clear non-copper regions
# ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("<b>Clear N-copper:</b>"))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
@ -396,7 +396,7 @@ class GerberObjectUI(ObjectUI):
)
grid2.addWidget(self.generate_ncc_button, 0, 1)
## Board cutout
# ## Board cutout
self.board_cutout_label = QtWidgets.QLabel(_("<b>Board cutout:</b>"))
self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n"
@ -412,7 +412,7 @@ class GerberObjectUI(ObjectUI):
)
grid2.addWidget(self.generate_cutout_button, 1, 1)
## Non-copper regions
# ## Non-copper regions
self.noncopper_label = QtWidgets.QLabel(_("<b>Non-copper regions:</b>"))
self.noncopper_label.setToolTip(
_("Create polygons covering the\n"
@ -450,7 +450,7 @@ class GerberObjectUI(ObjectUI):
self.generate_noncopper_button = QtWidgets.QPushButton(_('Generate Geo'))
grid4.addWidget(self.generate_noncopper_button, 1, 1)
## Bounding box
# ## Bounding box
self.boundingbox_label = QtWidgets.QLabel(_('<b>Bounding Box:</b>'))
self.boundingbox_label.setToolTip(
_("Create a geometry surrounding the Gerber object.\n"
@ -511,7 +511,7 @@ class ExcellonObjectUI(ObjectUI):
hlay_plot.addStretch()
hlay_plot.addWidget(self.solid_cb)
## Object name
# ## Object name
self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("<b>Name:</b>"))
@ -833,7 +833,7 @@ class GeometryObjectUI(ObjectUI):
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.custom_box.addWidget(self.plot_options_label)
## Object name
# ## Object name
self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("<b>Name:</b>"))
@ -1346,7 +1346,7 @@ class CNCObjectUI(ObjectUI):
self.offset_label.hide()
self.offset_button.hide()
## Plot options
# ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.custom_box.addWidget(self.plot_options_label)
@ -1366,7 +1366,7 @@ class CNCObjectUI(ObjectUI):
{"label": "Cut", "value": "cut"}
], stretch=False)
## Object name
# ## Object name
self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("<b>Name:</b>"))
@ -1463,7 +1463,7 @@ class CNCObjectUI(ObjectUI):
self.custom_box.addWidget(self.updateplot_button)
################ ##
## Export G-Code
# ## Export G-Code
################ ##
self.export_gcode_label = QtWidgets.QLabel(_("<b>Export CNC Code:</b>"))
self.export_gcode_label.setToolTip(

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://caram.cl/software/flatcam #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
from PyQt5 import QtCore

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence #
############################################################
# ########################################################## ##
import numpy as np
from PyQt5.QtGui import QPalette

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence #
############################################################
# ########################################################## ##
from vispy.visuals import markers, LineVisual, InfiniteLineVisual
from vispy.visuals.axis import Ticker, _get_ticks_talbot

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence #
############################################################
# ########################################################## ##
from OpenGL import GLU

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence #
############################################################
# ########################################################## ##
from vispy.visuals import CompoundVisual, LineVisual, MeshVisual, TextVisual, MarkersVisual
from vispy.scene.visuals import VisualNode, generate_docstring, visuals

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from shapely.geometry import LineString
import logging

View File

@ -2,12 +2,12 @@
# Vasilis Vlachoudis
# Date: 20-Oct-2015
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File modified: Marius Adrian Stanciu #
# Date: 3/10/2019 #
############################################################
# ########################################################## ##
import math
import sys

View File

@ -1,15 +1,15 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
#########################################################################
# ####################################################################### ##
# ## Borrowed code from 'https://github.com/gddc/ttfquery/blob/master/ # ##
# ## and made it work with Python 3 ########### ##
#########################################################################
# ####################################################################### ##
import re, os, sys, glob
import itertools

View File

@ -1,4 +1,4 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
@ -17,7 +17,7 @@
# * All transformations #
# #
# Reference: www.w3.org/TR/SVG/Overview.html #
############################################################
# ########################################################## ##
# import xml.etree.ElementTree as ET
from svg.path import Line, Arc, CubicBezier, QuadraticBezier, parse_path

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMObj import *
@ -31,7 +31,7 @@ class ToolCalculator(FlatCAMTool):
self.app = app
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@ -43,13 +43,13 @@ class ToolCalculator(FlatCAMTool):
self.layout.addWidget(title_label)
#################### ##
## Units Calculator ##
# ## Units Calculator # ##
#################### ##
self.unists_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.unists_spacer_label)
## Title of the Units Calculator
# ## Title of the Units Calculator
units_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.unitsName)
self.layout.addWidget(units_label)
@ -77,17 +77,17 @@ class ToolCalculator(FlatCAMTool):
########################## ##
## V-shape Tool Calculator ##
# ## V-shape Tool Calculator # ##
########################## ##
self.v_shape_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.v_shape_spacer_label)
## Title of the V-shape Tools Calculator
# ## Title of the V-shape Tools Calculator
v_shape_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.v_shapeName)
self.layout.addWidget(v_shape_title_label)
## Form Layout
# ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout)
@ -127,7 +127,7 @@ class ToolCalculator(FlatCAMTool):
form_layout.addRow(self.cutDepth_label, self.cutDepth_entry)
form_layout.addRow(self.effectiveToolDia_label, self.effectiveToolDia_entry)
## Buttons
# ## Buttons
self.calculate_vshape_button = QtWidgets.QPushButton(_("Calculate"))
# self.calculate_button.setFixedWidth(70)
self.calculate_vshape_button.setToolTip(
@ -140,13 +140,13 @@ class ToolCalculator(FlatCAMTool):
################################## ##
## ElectroPlating Tool Calculator ##
# ## ElectroPlating Tool Calculator # ##
################################## ##
self.plate_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.plate_spacer_label)
## Title of the ElectroPlating Tools Calculator
# ## Title of the ElectroPlating Tools Calculator
plate_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.eplateName)
plate_title_label.setToolTip(
_("This calculator is useful for those who plate the via/pad/drill holes,\n"
@ -154,7 +154,7 @@ class ToolCalculator(FlatCAMTool):
)
self.layout.addWidget(plate_title_label)
## Plate Form Layout
# ## Plate Form Layout
plate_form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(plate_form_layout)
@ -210,7 +210,7 @@ class ToolCalculator(FlatCAMTool):
plate_form_layout.addRow(self.cvaluelabel, self.cvalue_entry)
plate_form_layout.addRow(self.timelabel, self.time_entry)
## Buttons
# ## Buttons
self.calculate_plate_button = QtWidgets.QPushButton(_("Calculate"))
# self.calculate_button.setFixedWidth(70)
self.calculate_plate_button.setToolTip(
@ -223,7 +223,7 @@ class ToolCalculator(FlatCAMTool):
self.layout.addStretch()
## Signals
# ## Signals
self.cutDepth_entry.textChanged.connect(self.on_calculate_tool_dia)
self.cutDepth_entry.editingFinished.connect(self.on_calculate_tool_dia)
self.tipDia_entry.editingFinished.connect(self.on_calculate_tool_dia)
@ -264,7 +264,7 @@ class ToolCalculator(FlatCAMTool):
def set_tool_ui(self):
self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
## Initialize form
# ## Initialize form
self.mm_entry.set_value('0')
self.inch_entry.set_value('0')

View File

@ -20,7 +20,7 @@ class DblSidedTool(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@ -34,11 +34,11 @@ class DblSidedTool(FlatCAMTool):
self.empty_lb = QtWidgets.QLabel("")
self.layout.addWidget(self.empty_lb)
## Grid Layout
# ## Grid Layout
grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay)
## Gerber Object to mirror
# ## Gerber Object to mirror
self.gerber_object_combo = QtWidgets.QComboBox()
self.gerber_object_combo.setModel(self.app.collection)
self.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
@ -62,7 +62,7 @@ class DblSidedTool(FlatCAMTool):
grid_lay.addWidget(self.gerber_object_combo, 1, 0)
grid_lay.addWidget(self.mirror_gerber_button, 1, 1)
## Excellon Object to mirror
# ## Excellon Object to mirror
self.exc_object_combo = QtWidgets.QComboBox()
self.exc_object_combo.setModel(self.app.collection)
self.exc_object_combo.setRootModelIndex(self.app.collection.index(1, 0, QtCore.QModelIndex()))
@ -86,7 +86,7 @@ class DblSidedTool(FlatCAMTool):
grid_lay.addWidget(self.exc_object_combo, 3, 0)
grid_lay.addWidget(self.mirror_exc_button, 3, 1)
## Geometry Object to mirror
# ## Geometry Object to mirror
self.geo_object_combo = QtWidgets.QComboBox()
self.geo_object_combo.setModel(self.app.collection)
self.geo_object_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex()))
@ -110,11 +110,11 @@ class DblSidedTool(FlatCAMTool):
grid_lay.addWidget(self.geo_object_combo, 5, 0)
grid_lay.addWidget(self.mirror_geo_button, 5, 1)
## Grid Layout
# ## Grid Layout
grid_lay1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay1)
## Axis
# ## Axis
self.mirror_axis = RadioSet([{'label': 'X', 'value': 'X'},
{'label': 'Y', 'value': 'Y'}])
self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:"))
@ -127,7 +127,7 @@ class DblSidedTool(FlatCAMTool):
grid_lay1.addWidget(self.mirax_label, 7, 0)
grid_lay1.addWidget(self.mirror_axis, 7, 1)
## Axis Location
# ## Axis Location
self.axis_location = RadioSet([{'label': 'Point', 'value': 'point'},
{'label': 'Box', 'value': 'box'}])
self.axloc_label = QtWidgets.QLabel(_("Axis Ref:"))
@ -143,11 +143,11 @@ class DblSidedTool(FlatCAMTool):
self.empty_lb2 = QtWidgets.QLabel("")
grid_lay1.addWidget(self.empty_lb2, 9, 0)
## Grid Layout
# ## Grid Layout
grid_lay2 = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay2)
## Point/Box
# ## Point/Box
self.point_box_container = QtWidgets.QVBoxLayout()
self.pb_label = QtWidgets.QLabel("<b>%s</b>" % _('Point/Box Reference:'))
self.pb_label.setToolTip(
@ -189,7 +189,7 @@ class DblSidedTool(FlatCAMTool):
self.box_combo_type.hide()
## Alignment holes
# ## Alignment holes
self.ah_label = QtWidgets.QLabel("<b>%s</b>" % _('Alignment Drill Coordinates:'))
self.ah_label.setToolTip(
_( "Alignment holes (x1, y1), (x2, y2), ... "
@ -220,7 +220,7 @@ class DblSidedTool(FlatCAMTool):
grid_lay3.addWidget(self.alignment_holes, 0, 0)
grid_lay3.addWidget(self.add_drill_point_button, 0, 1)
## Drill diameter for alignment holes
# ## Drill diameter for alignment holes
self.dt_label = QtWidgets.QLabel("<b>%s</b>:" % _('Alignment Drill Diameter'))
self.dt_label.setToolTip(
_("Diameter of the drill for the "
@ -243,7 +243,7 @@ class DblSidedTool(FlatCAMTool):
hlay2 = QtWidgets.QHBoxLayout()
self.layout.addLayout(hlay2)
## Buttons
# ## Buttons
self.create_alignment_hole_button = QtWidgets.QPushButton(_("Create Excellon Object"))
self.create_alignment_hole_button.setToolTip(
_("Creates an Excellon Object containing the\n"
@ -261,7 +261,7 @@ class DblSidedTool(FlatCAMTool):
self.layout.addStretch()
## Signals
# ## Signals
self.create_alignment_hole_button.clicked.connect(self.on_create_alignment_holes)
self.mirror_gerber_button.clicked.connect(self.on_mirror_gerber)
self.mirror_exc_button.clicked.connect(self.on_mirror_exc)

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
@ -165,7 +165,7 @@ class Film(FlatCAMTool):
self.layout.addStretch()
## Signals
# ## Signals
self.film_object_button.clicked.connect(self.on_film_creation)
self.tf_type_obj_combo.currentIndexChanged.connect(self.on_type_obj_index_changed)
self.tf_type_box_combo.currentIndexChanged.connect(self.on_type_box_index_changed)

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
@ -144,7 +144,7 @@ class ToolImage(FlatCAMTool):
self.layout.addStretch()
## Signals
# ## Signals
self.import_button.clicked.connect(self.on_file_importimage)
def run(self, toggle=True):
@ -173,7 +173,7 @@ class ToolImage(FlatCAMTool):
FlatCAMTool.install(self, icon, separator, **kwargs)
def set_tool_ui(self):
## Initialize form
# ## Initialize form
self.dpi_entry.set_value(96)
self.image_type.set_value('black')
self.mask_bw_entry.set_value(250)

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMObj import *
@ -32,11 +32,11 @@ class Measurement(FlatCAMTool):
self.canvas = self.app.plotcanvas
self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
## Title
# ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font><br>" % self.toolName)
self.layout.addWidget(title_label)
## Form Layout
# ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout)

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMObj import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Modified by: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from copy import copy,deepcopy
@ -38,7 +38,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.tools_box.setContentsMargins(0, 0, 0, 0)
self.tools_frame.setLayout(self.tools_box)
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@ -49,11 +49,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
""")
self.tools_box.addWidget(title_label)
## Form Layout
# ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.tools_box.addLayout(form_layout)
## Object
# ## Object
self.object_combo = QtWidgets.QComboBox()
self.object_combo.setModel(self.app.collection)
self.object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 4/23/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from shapely.geometry import Point, Polygon, LineString

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Modified: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from copy import copy,deepcopy
@ -29,7 +29,7 @@ class ToolPaint(FlatCAMTool, Gerber):
FlatCAMTool.__init__(self, app)
Geometry.__init__(self, geo_steps_per_circle=self.app.defaults["geometry_circle_steps"])
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@ -47,11 +47,11 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tools_box.setContentsMargins(0, 0, 0, 0)
self.tools_frame.setLayout(self.tools_box)
## Form Layout
# ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.tools_box.addLayout(form_layout)
## Object
# ## Object
self.object_combo = QtWidgets.QComboBox()
self.object_combo.setModel(self.app.collection)
self.object_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex()))
@ -305,7 +305,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tool_type_item_options = ["C1", "C2", "C3", "C4", "B", "V"]
## Signals
# ## Signals
self.addtool_btn.clicked.connect(self.on_tool_add)
self.addtool_entry.returnPressed.connect(self.on_tool_add)
# self.copytool_btn.clicked.connect(lambda: self.on_tool_copy())
@ -365,7 +365,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tools_frame.show()
self.reset_fields()
## Init the GUI interface
# ## Init the GUI interface
self.paintmargin_entry.set_value(self.default_data["paintmargin"])
self.paintmethod_combo.set_value(self.default_data["paintmethod"])
self.selectmethod_combo.set_value(self.default_data["selectmethod"])
@ -1035,13 +1035,13 @@ class ToolPaint(FlatCAMTool, Gerber):
if reset:
self.flat_geometry = []
## If iterable, expand recursively.
# ## If iterable, expand recursively.
try:
for geo in geometry:
if geo is not None:
recurse(geometry=geo, reset=False)
## Not iterable, do the actual indexing and add.
# ## Not iterable, do the actual indexing and add.
except TypeError:
self.flat_geometry.append(geometry)

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from copy import copy, deepcopy
@ -28,7 +28,7 @@ class Panelize(FlatCAMTool):
super(Panelize, self).__init__(self)
self.app = app
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 4/15/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
@ -152,7 +152,7 @@ class PcbWizard(FlatCAMTool):
self.modified_excellon_file = ''
## Signals
# ## Signals
self.excellon_brn.clicked.connect(self.on_load_excellon_click)
self.inf_btn.clicked.connect(self.on_load_inf_click)
self.import_button.clicked.connect(lambda: self.on_import_excellon(
@ -207,7 +207,7 @@ class PcbWizard(FlatCAMTool):
self.exc_file_content = None
self.tools_from_inf = {}
## Initialize form
# ## Initialize form
self.int_entry.set_value(self.integral)
self.frac_entry.set_value(self.fractional)
self.zeros_radio.set_value(self.zeros)

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt
@ -37,7 +37,7 @@ class Properties(FlatCAMTool):
self.properties_box.setContentsMargins(0, 0, 0, 0)
self.properties_frame.setLayout(self.properties_box)
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
############################################################
# ########################################################## ##
# from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import Qt

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMCommon import LoudDict
@ -39,7 +39,7 @@ class SolderPaste(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@ -50,11 +50,11 @@ class SolderPaste(FlatCAMTool):
""")
self.layout.addWidget(title_label)
## Form Layout
# ## Form Layout
obj_form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(obj_form_layout)
## Gerber Object to be used for solderpaste dispensing
# ## Gerber Object to be used for solderpaste dispensing
self.obj_combo = FCComboBox(callback=self.on_rmb_combo)
self.obj_combo.setModel(self.app.collection)
self.obj_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
@ -135,7 +135,7 @@ class SolderPaste(FlatCAMTool):
self.layout.addSpacing(10)
## Buttons
# ## Buttons
grid0_1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0_1)
@ -157,7 +157,7 @@ class SolderPaste(FlatCAMTool):
self.gcode_box.setContentsMargins(0, 0, 0, 0)
self.gcode_frame.setLayout(self.gcode_box)
## Form Layout
# ## Form Layout
self.gcode_form_layout = QtWidgets.QFormLayout()
self.gcode_box.addLayout(self.gcode_form_layout)
@ -283,7 +283,7 @@ class SolderPaste(FlatCAMTool):
self.pp_combo.setStyleSheet('background-color: rgb(255,255,255)')
self.gcode_form_layout.addRow(pp_label, self.pp_combo)
## Buttons
# ## Buttons
grid1 = QtWidgets.QGridLayout()
self.gcode_box.addLayout(grid1)
@ -301,7 +301,7 @@ class SolderPaste(FlatCAMTool):
self.generation_frame.setLayout(self.generation_box)
## Buttons
# ## Buttons
grid2 = QtWidgets.QGridLayout()
self.generation_box.addLayout(grid2)
@ -313,11 +313,11 @@ class SolderPaste(FlatCAMTool):
grid2.addWidget(step2_lbl, 0, 0)
grid2.addWidget(self.soldergeo_btn, 0, 2)
## Form Layout
# ## Form Layout
geo_form_layout = QtWidgets.QFormLayout()
self.generation_box.addLayout(geo_form_layout)
## Geometry Object to be used for solderpaste dispensing
# ## Geometry Object to be used for solderpaste dispensing
self.geo_obj_combo = FCComboBox(callback=self.on_rmb_combo)
self.geo_obj_combo.setModel(self.app.collection)
self.geo_obj_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex()))
@ -346,11 +346,11 @@ class SolderPaste(FlatCAMTool):
grid3.addWidget(step3_lbl, 0, 0)
grid3.addWidget(self.solder_gcode_btn, 0, 2)
## Form Layout
# ## Form Layout
cnc_form_layout = QtWidgets.QFormLayout()
self.generation_box.addLayout(cnc_form_layout)
## Gerber Object to be used for solderpaste dispensing
# ## Gerber Object to be used for solderpaste dispensing
self.cnc_obj_combo = FCComboBox(callback=self.on_rmb_combo)
self.cnc_obj_combo.setModel(self.app.collection)
self.cnc_obj_combo.setRootModelIndex(self.app.collection.index(3, 0, QtCore.QModelIndex()))
@ -412,7 +412,7 @@ class SolderPaste(FlatCAMTool):
# action to be added in the combobox context menu
self.combo_context_del_action = QtWidgets.QAction(QtGui.QIcon('share/trash16.png'), _("Delete Object"))
## Signals
# ## Signals
self.combo_context_del_action.triggered.connect(self.on_delete_object)
self.addtool_btn.clicked.connect(self.on_tool_add)
self.addtool_entry.returnPressed.connect(self.on_tool_add)
@ -995,7 +995,7 @@ class SolderPaste(FlatCAMTool):
if reset:
self.flat_geometry = []
## If iterable, expand recursively.
# ## If iterable, expand recursively.
try:
for geo in geometry:
if geo is not None:
@ -1003,7 +1003,7 @@ class SolderPaste(FlatCAMTool):
reset=False,
pathonly=pathonly)
## Not iterable, do the actual indexing and add.
# ## Not iterable, do the actual indexing and add.
except TypeError:
if pathonly and type(geometry) == Polygon:
self.flat_geometry.append(geometry.exterior)
@ -1380,7 +1380,7 @@ class SolderPaste(FlatCAMTool):
gcode += obj.cnc_tools[tool]['gcode']
lines = StringIO(gcode)
## Write
# ## Write
if filename is not None:
try:
with open(filename, 'w') as f:

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 4/24/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMObj import *
@ -32,7 +32,7 @@ class ToolTransform(FlatCAMTool):
self.transform_lay = QtWidgets.QVBoxLayout()
self.layout.addLayout(self.transform_lay)
## Title
# ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@ -56,11 +56,11 @@ class ToolTransform(FlatCAMTool):
self.empty_label4.setFixedWidth(70)
self.transform_lay.addWidget(self.empty_label)
## Rotate Title
# ## Rotate Title
rotate_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.rotateName)
self.transform_lay.addWidget(rotate_title_label)
## Layout
# ## Layout
form_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form_layout)
form_child = QtWidgets.QHBoxLayout()
@ -94,11 +94,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label1)
## Skew Title
# ## Skew Title
skew_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.skewName)
self.transform_lay.addWidget(skew_title_label)
## Form Layout
# ## Form Layout
form1_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form1_layout)
form1_child_1 = QtWidgets.QHBoxLayout()
@ -151,11 +151,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label2)
## Scale Title
# ## Scale Title
scale_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.scaleName)
self.transform_lay.addWidget(scale_title_label)
## Form Layout
# ## Form Layout
form2_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form2_layout)
form2_child_1 = QtWidgets.QHBoxLayout()
@ -225,11 +225,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label3)
## Offset Title
# ## Offset Title
offset_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.offsetName)
self.transform_lay.addWidget(offset_title_label)
## Form Layout
# ## Form Layout
form3_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form3_layout)
form3_child_1 = QtWidgets.QHBoxLayout()
@ -280,11 +280,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label4)
## Flip Title
# ## Flip Title
flip_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.flipName)
self.transform_lay.addWidget(flip_title_label)
## Form Layout
# ## Form Layout
form4_layout = QtWidgets.QFormLayout()
form4_child_hlay = QtWidgets.QHBoxLayout()
self.transform_lay.addLayout(form4_child_hlay)
@ -355,7 +355,7 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addStretch()
## Signals
# ## Signals
self.rotate_button.clicked.connect(self.on_rotate)
self.skewx_button.clicked.connect(self.on_skewx)
self.skewy_button.clicked.connect(self.on_skewy)
@ -401,7 +401,7 @@ class ToolTransform(FlatCAMTool):
FlatCAMTool.install(self, icon, separator, shortcut='ALT+R', **kwargs)
def set_tool_ui(self):
## Initialize form
# ## Initialize form
if self.app.defaults["tools_transform_rotate"]:
self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"])
else:

View File

@ -1,4 +1,4 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
@ -11,12 +11,12 @@
# This is not an aid to install FlatCAM from source on #
# Windows platforms. It is only useful when FlatCAM is up #
# and running and ready to be packaged. #
############################################################
# ########################################################## ##
############################################################
# ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 #
############################################################
# ########################################################## ##
# Files not needed: Qt, tk.dll, tcl.dll, tk/, tcl/, vtk/,

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé #
# Date: 5/26/2017 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé #
# Date: 5/26/2017 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé #
# Date: 5/26/2017 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################
# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
############################################################
# ########################################################## ##
from FlatCAMPostProc import *