Reduced logging.
This commit is contained in:
parent
d6c588e57b
commit
068dc2d72d
|
@ -47,11 +47,10 @@ except AttributeError:
|
||||||
def translate(context, text, disambig=None):
|
def translate(context, text, disambig=None):
|
||||||
return QtGui.QApplication.translate(context, text, disambig)
|
return QtGui.QApplication.translate(context, text, disambig)
|
||||||
|
|
||||||
debugDressup = True
|
debugDressup = False
|
||||||
debugComponents = ['P0', 'P1', 'P2', 'P3']
|
|
||||||
|
|
||||||
def debugPrint(comp, msg):
|
def debugPrint(msg):
|
||||||
if debugDressup and comp in debugComponents:
|
if debugDressup:
|
||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
def debugEdge(edge, prefix, comp = None):
|
def debugEdge(edge, prefix, comp = None):
|
||||||
|
@ -108,7 +107,7 @@ class Tag:
|
||||||
return str((self.x, self.y, self.width, self.height, self.angle, self.enabled))
|
return str((self.x, self.y, self.width, self.height, self.angle, self.enabled))
|
||||||
|
|
||||||
def __init__(self, x, y, width, height, angle, enabled=True, z=None):
|
def __init__(self, x, y, width, height, angle, enabled=True, z=None):
|
||||||
print("Tag(%.2f, %.2f, %.2f, %.2f, %.2f, %d, %s)" % (x, y, width, height, angle/math.pi, enabled, z))
|
debugPrint("Tag(%.2f, %.2f, %.2f, %.2f, %.2f, %d, %s)" % (x, y, width, height, angle/math.pi, enabled, z))
|
||||||
self.x = x
|
self.x = x
|
||||||
self.y = y
|
self.y = y
|
||||||
self.z = z
|
self.z = z
|
||||||
|
@ -357,7 +356,7 @@ class MapWireToTag:
|
||||||
|
|
||||||
class PathData:
|
class PathData:
|
||||||
def __init__(self, obj):
|
def __init__(self, obj):
|
||||||
print("PathData(%s)" % obj.Base.Name)
|
debugPrint("PathData(%s)" % obj.Base.Name)
|
||||||
self.obj = obj
|
self.obj = obj
|
||||||
self.wire = PathGeom.wireForPath(obj.Base.Path)
|
self.wire = PathGeom.wireForPath(obj.Base.Path)
|
||||||
self.edges = self.wire.Edges
|
self.edges = self.wire.Edges
|
||||||
|
@ -420,7 +419,7 @@ class PathData:
|
||||||
startIndex = 0
|
startIndex = 0
|
||||||
for i in range(0, len(self.base.Edges)):
|
for i in range(0, len(self.base.Edges)):
|
||||||
edge = self.base.Edges[i]
|
edge = self.base.Edges[i]
|
||||||
print(' %d: %.2f' % (i, edge.Length))
|
debugPrint(' %d: %.2f' % (i, edge.Length))
|
||||||
if edge.Length == longestEdge.Length:
|
if edge.Length == longestEdge.Length:
|
||||||
startIndex = i
|
startIndex = i
|
||||||
break
|
break
|
||||||
|
@ -435,10 +434,10 @@ class PathData:
|
||||||
|
|
||||||
minLength = min(2. * W, longestEdge.Length)
|
minLength = min(2. * W, longestEdge.Length)
|
||||||
|
|
||||||
print("length=%.2f shortestEdge=%.2f(%.2f) longestEdge=%.2f(%.2f) minLength=%.2f" % (self.base.Length, shortestEdge.Length, shortestEdge.Length/self.base.Length, longestEdge.Length, longestEdge.Length / self.base.Length, minLength))
|
debugPrint("length=%.2f shortestEdge=%.2f(%.2f) longestEdge=%.2f(%.2f) minLength=%.2f" % (self.base.Length, shortestEdge.Length, shortestEdge.Length/self.base.Length, longestEdge.Length, longestEdge.Length / self.base.Length, minLength))
|
||||||
print(" start: index=%-2d count=%d (length=%.2f, distance=%.2f)" % (startIndex, startCount, startEdge.Length, tagDistance))
|
debugPrint(" start: index=%-2d count=%d (length=%.2f, distance=%.2f)" % (startIndex, startCount, startEdge.Length, tagDistance))
|
||||||
print(" -> lastTagLength=%.2f)" % lastTagLength)
|
debugPrint(" -> lastTagLength=%.2f)" % lastTagLength)
|
||||||
print(" -> currentLength=%.2f)" % currentLength)
|
debugPrint(" -> currentLength=%.2f)" % currentLength)
|
||||||
|
|
||||||
edgeDict = { startIndex: startCount }
|
edgeDict = { startIndex: startCount }
|
||||||
|
|
||||||
|
@ -453,7 +452,7 @@ class PathData:
|
||||||
|
|
||||||
for (i, count) in edgeDict.iteritems():
|
for (i, count) in edgeDict.iteritems():
|
||||||
edge = self.base.Edges[i]
|
edge = self.base.Edges[i]
|
||||||
print(" %d: %d" % (i, count))
|
debugPrint(" %d: %d" % (i, count))
|
||||||
#debugMarker(edge.Vertexes[0].Point, 'base', (1.0, 0.0, 0.0), 0.2)
|
#debugMarker(edge.Vertexes[0].Point, 'base', (1.0, 0.0, 0.0), 0.2)
|
||||||
#debugMarker(edge.Vertexes[1].Point, 'base', (0.0, 1.0, 0.0), 0.2)
|
#debugMarker(edge.Vertexes[1].Point, 'base', (0.0, 1.0, 0.0), 0.2)
|
||||||
distance = (edge.LastParameter - edge.FirstParameter) / count
|
distance = (edge.LastParameter - edge.FirstParameter) / count
|
||||||
|
@ -471,10 +470,10 @@ class PathData:
|
||||||
tagCount += 1
|
tagCount += 1
|
||||||
lastTagLength += tagDistance
|
lastTagLength += tagDistance
|
||||||
if tagCount > 0:
|
if tagCount > 0:
|
||||||
print(" index=%d -> count=%d" % (index, tagCount))
|
debugPrint(" index=%d -> count=%d" % (index, tagCount))
|
||||||
edgeDict[index] = tagCount
|
edgeDict[index] = tagCount
|
||||||
else:
|
else:
|
||||||
print(" skipping=%-2d (%.2f)" % (index, edge.Length))
|
debugPrint(" skipping=%-2d (%.2f)" % (index, edge.Length))
|
||||||
|
|
||||||
return (currentLength, lastTagLength)
|
return (currentLength, lastTagLength)
|
||||||
|
|
||||||
|
@ -606,7 +605,7 @@ class ObjectDressup:
|
||||||
tags = [Tag.FromString(tag) for tag in obj.Tags]
|
tags = [Tag.FromString(tag) for tag in obj.Tags]
|
||||||
else:
|
else:
|
||||||
print("execute - default tags")
|
print("execute - default tags")
|
||||||
tags = self.generateTags(obj, 2.)
|
tags = self.generateTags(obj, 4.)
|
||||||
|
|
||||||
if not tags:
|
if not tags:
|
||||||
print("execute - no tags")
|
print("execute - no tags")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user