remove unnecessary imports. normalize debug log levels
This commit is contained in:
@@ -56,7 +56,9 @@ __createdDate__ = "2017"
|
||||
__scriptVersion__ = "2g testing"
|
||||
__lastModified__ = "2019-06-13 15:37 CST"
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule()
|
||||
else:
|
||||
@@ -738,7 +740,7 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
if not FreeCAD.ActiveDocument.getObject('xAxCyl'):
|
||||
xAx = 'xAxCyl'
|
||||
yAx = 'yAxCyl'
|
||||
zAx = 'zAxCyl'
|
||||
# zAx = 'zAxCyl'
|
||||
FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", "visualAxis")
|
||||
if FreeCAD.GuiUp:
|
||||
FreeCADGui.ActiveDocument.getObject('visualAxis').Visibility = False
|
||||
@@ -772,20 +774,20 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
cylGui.Visibility = False
|
||||
vaGrp.addObject(cyl)
|
||||
|
||||
if False:
|
||||
FreeCAD.ActiveDocument.addObject("Part::Cylinder", zAx)
|
||||
cyl = FreeCAD.ActiveDocument.getObject(zAx)
|
||||
cyl.Label = zAx
|
||||
cyl.Radius = self.yRotRad
|
||||
cyl.Height = 0.01
|
||||
# cyl.Placement = FreeCAD.Placement(FreeCAD.Vector(0,0,0),FreeCAD.Rotation(FreeCAD.Vector(1,0,0),90))
|
||||
cyl.purgeTouched()
|
||||
if FreeCAD.GuiUp:
|
||||
cylGui = FreeCADGui.ActiveDocument.getObject(zAx)
|
||||
cylGui.ShapeColor = (0.000, 0.000, 0.498)
|
||||
cylGui.Transparency = 85
|
||||
cylGui.Visibility = False
|
||||
vaGrp.addObject(cyl)
|
||||
# if False:
|
||||
# FreeCAD.ActiveDocument.addObject("Part::Cylinder", zAx)
|
||||
# cyl = FreeCAD.ActiveDocument.getObject(zAx)
|
||||
# cyl.Label = zAx
|
||||
# cyl.Radius = self.yRotRad
|
||||
# cyl.Height = 0.01
|
||||
# # cyl.Placement = FreeCAD.Placement(FreeCAD.Vector(0,0,0),FreeCAD.Rotation(FreeCAD.Vector(1,0,0),90))
|
||||
# cyl.purgeTouched()
|
||||
# if FreeCAD.GuiUp:
|
||||
# cylGui = FreeCADGui.ActiveDocument.getObject(zAx)
|
||||
# cylGui.ShapeColor = (0.000, 0.000, 0.498)
|
||||
# cylGui.Transparency = 85
|
||||
# cylGui.Visibility = False
|
||||
# vaGrp.addObject(cyl)
|
||||
|
||||
def useTempJobClones(self, cloneName):
|
||||
'''useTempJobClones(cloneName)
|
||||
|
||||
@@ -29,8 +29,6 @@ import Part
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import string
|
||||
import sys
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
@@ -44,8 +42,9 @@ __doc__ = "Base class an implementation for operations on circular holes."
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
LOGLEVEL = False
|
||||
|
||||
if False:
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -34,7 +34,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Implementation of circular hole specific base geometry page controller."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
@@ -146,7 +148,7 @@ class TaskPanelHoleGeometryPage(PathOpGui.TaskPanelBaseGeometryPage):
|
||||
'''checkeChanged() ... callback when checked status of a base feature changed'''
|
||||
PathLog.track()
|
||||
disabled = []
|
||||
for i in xrange(0, self.form.baseList.rowCount()):
|
||||
for i in range(0, self.form.baseList.rowCount()):
|
||||
item = self.form.baseList.item(i, 0)
|
||||
if item.checkState() != QtCore.Qt.Checked:
|
||||
disabled.append(item.data(self.DataFeatureName))
|
||||
|
||||
@@ -32,7 +32,9 @@ import math
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -28,7 +28,6 @@ import PathScripts.PathDeburr as PathDeburr
|
||||
import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
import PathScripts.PathSelection as PathSelection
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
|
||||
@@ -37,7 +36,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Deburr operation page controller and command implementation."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -31,7 +31,6 @@ from PySide import QtCore
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
from PySide import QtGui
|
||||
|
||||
"""Axis remapping Dressup object and FreeCAD command. This dressup remaps one axis of motion to another.
|
||||
For example, you can re-map the Y axis to A to control a 4th axis rotary."""
|
||||
|
||||
@@ -39,7 +39,9 @@ from PySide import QtCore
|
||||
|
||||
LOG_MODULE = PathLog.thisModule()
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, LOG_MODULE)
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, LOG_MODULE)
|
||||
else:
|
||||
|
||||
@@ -34,7 +34,6 @@ import PathScripts.PathUtils as PathUtils
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
from PySide import QtGui
|
||||
|
||||
# Qt translation handling
|
||||
def translate(context, text, disambig=None):
|
||||
|
||||
@@ -31,8 +31,6 @@ import PathScripts.PathUtil as PathUtil
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import copy
|
||||
import math
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from PathScripts.PathDressupTagPreferences import HoldingTagPreferences
|
||||
from PathScripts.PathUtils import waiting_effects
|
||||
@@ -40,7 +38,9 @@ from PySide import QtCore
|
||||
|
||||
"""Holding Tags Dressup object and FreeCAD command"""
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule()
|
||||
else:
|
||||
@@ -552,7 +552,7 @@ class PathData:
|
||||
wire = Part.Wire(bottom)
|
||||
if wire.isClosed():
|
||||
return wire
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
#if sys.version_info.major < 3:
|
||||
# traceback.print_exc(e)
|
||||
#else:
|
||||
|
||||
@@ -38,7 +38,6 @@ from PySide import QtCore
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
from PySide import QtGui
|
||||
|
||||
# Qt translation handling
|
||||
def translate(text, context="Path_DressupLeadInOut", disambig=None):
|
||||
|
||||
@@ -34,7 +34,6 @@ from PySide import QtCore
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
from PySide import QtGui
|
||||
|
||||
|
||||
# Qt translation handling
|
||||
|
||||
@@ -21,12 +21,8 @@
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
# import Draft
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
# import Path
|
||||
# import PathScripts
|
||||
# import PathScripts.PathDressupTag as PathDressupTag
|
||||
import PathScripts.PathGeom as PathGeom
|
||||
import PathScripts.PathGetPoint as PathGetPoint
|
||||
import PathScripts.PathDressupHoldingTags as PathDressupTag
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
# import ArchPanel
|
||||
import FreeCAD
|
||||
import Path
|
||||
import PathScripts.PathCircularHoleBase as PathCircularHoleBase
|
||||
@@ -32,7 +31,6 @@ import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
|
||||
# from PathScripts.PathUtils import waiting_effects
|
||||
from PySide import QtCore
|
||||
|
||||
__title__ = "Path Drilling Operation"
|
||||
@@ -40,7 +38,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Path Drilling operation."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -30,14 +30,16 @@ import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide import QtCore
|
||||
|
||||
__title__ = "Path Drilling Operation UI."
|
||||
__author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "UI and Command for Path Drilling Operation."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -35,7 +35,9 @@ from PySide import QtCore
|
||||
|
||||
__doc__ = "Class and implementation of Path Engrave operation"
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -23,20 +23,19 @@
|
||||
# ***************************************************************************
|
||||
|
||||
import DraftGeomUtils
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Path
|
||||
import PathScripts.PathGeom as PathGeom
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import copy
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
__doc__ = "Base class for all ops in the engrave family."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -27,7 +27,6 @@ import FreeCADGui
|
||||
import PathScripts.PathEngrave as PathEngrave
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
import PathScripts.PathSelection as PathSelection
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
@@ -37,7 +36,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Engrave operation page controller and command implementation."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -82,10 +82,6 @@ class _ViewProviderFixture:
|
||||
def getIcon(self): # optional
|
||||
return ":/icons/Path-Datums.svg"
|
||||
|
||||
# def attach(self): #optional
|
||||
# # this is executed on object creation and object load from file
|
||||
# pass
|
||||
|
||||
def onChanged(self, vobj, prop): # optional
|
||||
mode = 2
|
||||
vobj.setEditorMode('LineWidth', mode)
|
||||
|
||||
@@ -38,7 +38,9 @@ __doc__ = "Functions to extract and convert between Path.Command and Part.Edge a
|
||||
|
||||
Tolerance = 0.000001
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
@@ -405,7 +407,7 @@ def arcToHelix(edge, z0, z1):
|
||||
|
||||
|
||||
p1 = edge.valueAt(edge.FirstParameter)
|
||||
p2 = edge.valueAt(edge.LastParameter)
|
||||
# p2 = edge.valueAt(edge.LastParameter)
|
||||
|
||||
cmd = cmdsForEdge(edge)[0]
|
||||
params = cmd.Parameters
|
||||
@@ -459,7 +461,7 @@ def splitEdgeAt(edge, pt):
|
||||
p1 = edge.valueAt(edge.FirstParameter)
|
||||
p2 = pt
|
||||
p3 = edge.valueAt(edge.LastParameter)
|
||||
edges = []
|
||||
# edges = []
|
||||
|
||||
if type(edge.Curve) == Part.Line or type(edge.Curve) == Part.LineSegment:
|
||||
# it's a line
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
# ***************************************************************************
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import PathScripts.PathGeom as PathGeom
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PySide
|
||||
@@ -37,7 +36,9 @@ __doc__ = "A collection of helper and utility functions for the Path GUI."
|
||||
def translate(context, text, disambig=None):
|
||||
return PySide.QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
import PathScripts
|
||||
import PathScripts.PathLog as PathLog
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -29,11 +29,13 @@ import PathScripts.PathHelix as PathHelix
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide import QtCore
|
||||
|
||||
__doc__ = "Helix operation page controller and command implementation."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -31,7 +31,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "ViewProvider who's main and only task is to assign an icon."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -37,7 +37,9 @@ import json
|
||||
from PathScripts.PathPostProcessor import PostProcessor
|
||||
from PySide import QtCore
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -38,7 +38,9 @@ from PySide import QtCore, QtGui
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import PathScripts.PathJob as PathJob
|
||||
import PathScripts.PathLog as PathLog
|
||||
@@ -39,7 +38,9 @@ from collections import Counter
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -52,8 +52,9 @@ from pivy import coin
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
LOGLEVEL = False
|
||||
|
||||
if False:
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -38,7 +38,9 @@ __url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Class and implementation of Mill Facing operation."
|
||||
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -26,7 +26,6 @@ import FreeCAD
|
||||
import Path
|
||||
import PathScripts.PathGeom as PathGeom
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathSetupSheet as PathSetupSheet
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
|
||||
@@ -38,7 +37,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Base class and properties implementation for all Path operations."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule()
|
||||
else:
|
||||
|
||||
@@ -43,7 +43,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Base classes and framework for Path operation's UI"
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Path
|
||||
import PathScripts.PathGeom as PathGeom
|
||||
import PathScripts.PathLog as PathLog
|
||||
import math
|
||||
@@ -36,7 +35,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Collection of functions used by various Path operations. The functions are specific to Path and the algorithms employed by Path's operations."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -24,18 +24,18 @@
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
# import PathScripts.PathGeom as PathGeom
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
import PathScripts.PathPocketBase as PathPocketBase
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
# import sys
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
__doc__ = "Class and implementation of the Pocket operation."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -33,7 +33,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Base class and implementation for Path pocket operations."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -24,13 +24,10 @@
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
import PathScripts.PathPocket as PathPocket
|
||||
import PathScripts.PathSelection as PathSelection
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide import QtCore #, QtGui
|
||||
|
||||
__title__ = "Path Pocket Base Operation UI"
|
||||
__author__ = "sliptonic (Brad Collette)"
|
||||
@@ -73,9 +70,9 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
if not (FeatureOutline & self.pocketFeatures()):
|
||||
form.useOutline.hide()
|
||||
|
||||
if True:
|
||||
# currently doesn't have an effect or is experimental
|
||||
form.minTravel.hide()
|
||||
# if True:
|
||||
# # currently doesn't have an effect or is experimental
|
||||
# form.minTravel.hide()
|
||||
|
||||
return form
|
||||
|
||||
|
||||
@@ -52,15 +52,15 @@ __created__ = "2017"
|
||||
__scriptVersion__ = "2g testing"
|
||||
__lastModified__ = "2019-06-12 23:29 CST"
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
|
||||
# Qt translation handling
|
||||
|
||||
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
@@ -469,20 +469,20 @@ class ObjectPocket(PathPocketBase.ObjectPocket):
|
||||
# Eif
|
||||
# Efor
|
||||
# Efor
|
||||
if False:
|
||||
if False:
|
||||
(Tags, Grps) = self.sortTuplesByIndex(allTuples, 2) # return (TagList, GroupList)
|
||||
subList = []
|
||||
for o in range(0, len(Tags)):
|
||||
subList = []
|
||||
for (base, sub, tag, angle, axis, stock) in Grps[o]:
|
||||
subList.append(sub)
|
||||
pair = base, subList, angle, axis, stock
|
||||
baseSubsTuples.append(pair)
|
||||
if False:
|
||||
for (bs, sb, tg, agl, ax, stk) in allTuples:
|
||||
pair = bs, [sb], agl, ax, stk
|
||||
baseSubsTuples.append(pair)
|
||||
# if False:
|
||||
# if False:
|
||||
# (Tags, Grps) = self.sortTuplesByIndex(allTuples, 2) # return (TagList, GroupList)
|
||||
# subList = []
|
||||
# for o in range(0, len(Tags)):
|
||||
# subList = []
|
||||
# for (base, sub, tag, angle, axis, stock) in Grps[o]:
|
||||
# subList.append(sub)
|
||||
# pair = base, subList, angle, axis, stock
|
||||
# baseSubsTuples.append(pair)
|
||||
# if False:
|
||||
# for (bs, sb, tg, agl, ax, stk) in allTuples:
|
||||
# pair = bs, [sb], agl, ax, stk
|
||||
# baseSubsTuples.append(pair)
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
for o in baseSubsTuples:
|
||||
|
||||
@@ -28,11 +28,9 @@ import Part
|
||||
import PathScripts.PathGeom as PathGeom
|
||||
import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
import PathScripts.PathPocketShape as PathPocketShape
|
||||
import PathScripts.PathPocketBaseGui as PathPocketBaseGui
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
from pivy import coin
|
||||
@@ -45,7 +43,9 @@ __doc__ = "Pocket Shape operation page controller and command implementation."
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
@@ -54,7 +54,6 @@ else:
|
||||
class _Extension(object):
|
||||
ColourEnabled = (1.0, .5, 1.0)
|
||||
ColourDisabled = (1.0, 1.0, .5)
|
||||
#ColourDisabled = (.5, .5, .5)
|
||||
TransparencySelected = 0.0
|
||||
TransparencyDeselected = 0.7
|
||||
|
||||
|
||||
@@ -22,10 +22,8 @@
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
import FreeCAD
|
||||
import PathScripts.PathAreaOp as PathAreaOp
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
@@ -34,7 +32,9 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Base class and implementation for Path profile operations."
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -24,11 +24,8 @@
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
import PathScripts.PathProfileFaces as PathProfileFaces
|
||||
import PathScripts.PathSelection as PathSelection
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import ArchPanel
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Path
|
||||
# import PathScripts.PathAreaOp as PathAreaOp
|
||||
import PathScripts.PathProfileBase as PathProfileBase
|
||||
import PathScripts.PathLog as PathLog
|
||||
|
||||
@@ -37,7 +36,9 @@ from PySide import QtCore
|
||||
|
||||
FreeCAD.setLogLevel('Path.Area', 0)
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Path
|
||||
# import PathScripts.PathAreaOp as PathAreaOp
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
import PathScripts.PathProfileBase as PathProfileBase
|
||||
@@ -36,7 +35,9 @@ from PySide import QtCore
|
||||
|
||||
"""Path Profile from Edges Object and Command"""
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -32,14 +32,12 @@ import ArchPanel
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Path
|
||||
# import PathScripts.PathAreaOp as PathAreaOp
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathOp as PathOp
|
||||
import PathScripts.PathProfileBase as PathProfileBase
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import numpy
|
||||
|
||||
# from PathScripts.PathUtils import depth_params
|
||||
from PySide import QtCore
|
||||
|
||||
__title__ = "Path Profile Faces Operation"
|
||||
@@ -51,7 +49,9 @@ __created__ = "2014"
|
||||
__scriptVersion__ = "2h testing"
|
||||
__lastModified__ = "2019-06-18 22:36 CST"
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
@@ -325,8 +325,8 @@ class ObjectProfile(PathProfileBase.ObjectProfile):
|
||||
obj.AttemptInverseAngle = True
|
||||
obj.B_AxisErrorOverride = False
|
||||
|
||||
def checkDepths(self, obj, shape):
|
||||
return (strDept, finDep)
|
||||
# def checkDepths(self, obj, shape):
|
||||
# return (strDept, finDep)
|
||||
|
||||
|
||||
def SetupProperties():
|
||||
|
||||
@@ -29,7 +29,9 @@ import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathUtils as PathUtils
|
||||
import math
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
|
||||
|
||||
@@ -23,13 +23,11 @@
|
||||
# ***************************************************************************
|
||||
|
||||
import FreeCAD
|
||||
import Path
|
||||
import PathScripts.PathGeom as PathGeom
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathSetupSheetOpPrototype as PathSetupSheetOpPrototype
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
import PySide
|
||||
import traceback
|
||||
|
||||
__title__ = "Setup Sheet for a Job."
|
||||
__author__ = "sliptonic (Brad Collette)"
|
||||
@@ -38,7 +36,9 @@ __doc__ = "A container for all default values and job specific configuration val
|
||||
|
||||
_RegisteredOps = {}
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule()
|
||||
else:
|
||||
|
||||
@@ -28,7 +28,7 @@ import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathIconViewProvider as PathIconViewProvider
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathSetupSheet as PathSetupSheet
|
||||
import PathScripts.PathSetupSheetOpPrototype as PathSetupSheetOpPrototype
|
||||
# import PathScripts.PathSetupSheetOpPrototype as PathSetupSheetOpPrototype
|
||||
import PathScripts.PathSetupSheetOpPrototypeGui as PathSetupSheetOpPrototypeGui
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
|
||||
@@ -43,7 +43,9 @@ __doc__ = "Task panel editor for a SetupSheet"
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
@@ -57,12 +59,7 @@ class ViewProvider:
|
||||
PathLog.track(name)
|
||||
vobj.Proxy = self
|
||||
self.icon = name
|
||||
mode = 2
|
||||
#vobj.setEditorMode('BoundingBox', mode)
|
||||
#vobj.setEditorMode('DisplayMode', mode)
|
||||
#vobj.setEditorMode('Selectable', mode)
|
||||
#vobj.setEditorMode('ShapeColor', mode)
|
||||
#vobj.setEditorMode('Transparency', mode)
|
||||
# mode = 2
|
||||
|
||||
def attach(self, vobj):
|
||||
PathLog.track()
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
import FreeCAD
|
||||
import Path
|
||||
import PathScripts.PathLog as PathLog
|
||||
|
||||
__title__ = "Setup Sheet for a Job."
|
||||
@@ -32,7 +30,9 @@ __url__ = "http://www.freecadweb.org"
|
||||
__doc__ = "Prototype objects to allow extraction of setup sheet values and editing."
|
||||
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -23,13 +23,8 @@
|
||||
# ***************************************************************************
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathIconViewProvider as PathIconViewProvider
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathSetupSheet as PathSetupSheet
|
||||
import PathScripts.PathSetupSheetOpPrototype as PathSetupSheetOpPrototype
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
|
||||
@@ -42,7 +37,9 @@ __doc__ = "Task panel editor for a SetupSheet"
|
||||
def translate(context, text, disambig=None):
|
||||
return QtCore.QCoreApplication.translate(context, text, disambig)
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -31,7 +31,9 @@ import math
|
||||
from PySide import QtCore
|
||||
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import Path
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide import QtCore
|
||||
|
||||
# Qt translation handling
|
||||
def translate(context, text, disambig=None):
|
||||
@@ -47,7 +47,6 @@ class Stop:
|
||||
|
||||
def onChanged(self, obj, prop):
|
||||
pass
|
||||
# FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
def execute(self, obj):
|
||||
if obj.Stop == 'Optional':
|
||||
@@ -64,7 +63,6 @@ class Stop:
|
||||
class _ViewProviderStop:
|
||||
|
||||
def __init__(self, vobj): # mandatory
|
||||
# obj.addProperty("App::PropertyFloat","SomePropertyName","PropertyGroup","Description of this property")
|
||||
vobj.Proxy = self
|
||||
mode = 2
|
||||
vobj.setEditorMode('LineWidth', mode)
|
||||
|
||||
@@ -77,7 +77,9 @@ __created__ = "2016"
|
||||
__scriptVersion__ = "3t Usable"
|
||||
__lastModified__ = "2019-05-10 10:37 CST"
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -27,7 +27,6 @@ import FreeCADGui
|
||||
import PathScripts.PathSurface as PathSurface
|
||||
import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathOpGui as PathOpGui
|
||||
# import PathScripts.PathPocketBaseGui as PathPocketBaseGui
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
@@ -46,8 +45,6 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
|
||||
def getFields(self, obj):
|
||||
'''getFields(obj) ... transfers values from UI to obj's proprties'''
|
||||
# if obj.StartVertex != self.form.startVertex.value():
|
||||
# obj.StartVertex = self.form.startVertex.value()
|
||||
PathGui.updateInputField(obj, 'DepthOffset', self.form.depthOffset)
|
||||
PathGui.updateInputField(obj, 'SampleInterval', self.form.sampleInterval)
|
||||
|
||||
@@ -73,7 +70,6 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
|
||||
def setFields(self, obj):
|
||||
'''setFields(obj) ... transfers obj's property values to UI'''
|
||||
# self.form.startVertex.setValue(obj.StartVertex)
|
||||
self.selectInComboBox(obj.Algorithm, self.form.algorithmSelect)
|
||||
self.selectInComboBox(obj.BoundBox, self.form.boundBoxSelect)
|
||||
self.selectInComboBox(obj.DropCutterDir, self.form.dropCutterDirSelect)
|
||||
@@ -94,7 +90,6 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage):
|
||||
def getSignalsForUpdate(self, obj):
|
||||
'''getSignalsForUpdate(obj) ... return list of signals for updating obj'''
|
||||
signals = []
|
||||
# signals.append(self.form.startVertex.editingFinished)
|
||||
signals.append(self.form.toolController.currentIndexChanged)
|
||||
signals.append(self.form.algorithmSelect.currentIndexChanged)
|
||||
signals.append(self.form.boundBoxSelect.currentIndexChanged)
|
||||
|
||||
@@ -24,15 +24,14 @@
|
||||
''' Tool Controller defines tool, spindle speed and feed rates for Path Operations '''
|
||||
|
||||
import FreeCAD
|
||||
import Part
|
||||
import Path
|
||||
import PathScripts
|
||||
import PathScripts.PathLog as PathLog
|
||||
import PathScripts.PathUtil as PathUtil
|
||||
|
||||
from PySide import QtCore
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import Part
|
||||
import Path
|
||||
import PathScripts
|
||||
import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathLog as PathLog
|
||||
|
||||
@@ -25,11 +25,10 @@
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import Path
|
||||
import PathScripts.PathGui as PathGui
|
||||
import PathScripts.PathLog as PathLog
|
||||
import math
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide import QtGui
|
||||
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
#PathLog.trackModule(PathLog.thisModule())
|
||||
|
||||
@@ -33,11 +33,11 @@ other than PathLog, then it probably doesn't belong here.
|
||||
'''
|
||||
|
||||
import six
|
||||
|
||||
import PathScripts.PathLog as PathLog
|
||||
import sys
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -38,7 +38,9 @@ from PathScripts import PathLog
|
||||
from PySide import QtCore
|
||||
from PySide import QtGui
|
||||
|
||||
if False:
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
import PathScripts
|
||||
import PathScripts.PathJobCmd as PathJobCmd
|
||||
@@ -43,7 +42,6 @@ class PathUtilsUserInput(object):
|
||||
return tc
|
||||
|
||||
def chooseToolController(self, controllers):
|
||||
# form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Path/DlgTCChooser.ui")
|
||||
form = FreeCADGui.PySideUic.loadUi(":/panels/DlgTCChooser.ui")
|
||||
mylist = [i.Label for i in controllers]
|
||||
form.uiToolController.addItems(mylist)
|
||||
@@ -72,7 +70,6 @@ class PathUtilsUserInput(object):
|
||||
if 1 == len(modelObjectSelected):
|
||||
job = modelObjectSelected[0]
|
||||
else:
|
||||
# form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Path/DlgJobChooser.ui")
|
||||
form = FreeCADGui.PySideUic.loadUi(":/panels/DlgJobChooser.ui")
|
||||
if modelObjectSelected:
|
||||
mylist = [j.Label for j in modelObjectSelected]
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
'''
|
||||
These are a common functions and classes for creating custom post processors.
|
||||
These are a common functions and classes for creating custom post processors.
|
||||
'''
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
@@ -33,26 +33,10 @@ FreeCADGui = None
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
|
||||
# class OldHighlighter(QtGui.QSyntaxHighlighter):
|
||||
# def highlightBlock(self, text):
|
||||
# myClassFormat = QtGui.QTextCharFormat()
|
||||
# myClassFormat.setFontWeight(QtGui.QFont.Bold)
|
||||
# myClassFormat.setForeground(QtCore.Qt.green)
|
||||
# # the regex pattern to be colored
|
||||
# pattern = "(G.*?|M.*?)\\s"
|
||||
# expression = QtCore.QRegExp(pattern)
|
||||
# index = text.index(expression)
|
||||
# while index >= 0:
|
||||
# length = expression.matchedLength()
|
||||
# setFormat(index, length, myClassFormat)
|
||||
# index = text.index(expression, index + length)
|
||||
|
||||
|
||||
|
||||
class GCodeHighlighter(QtGui.QSyntaxHighlighter):
|
||||
def __init__(self, parent=None):
|
||||
super(GCodeHighlighter, self).__init__(parent)
|
||||
|
||||
|
||||
keywordFormat = QtGui.QTextCharFormat()
|
||||
keywordFormat.setForeground(QtCore.Qt.cyan)
|
||||
|
||||
Reference in New Issue
Block a user