Improves descriptor log
This commit is contained in:
@ -55,7 +55,9 @@ class MainApplication(GridFrame):
|
|||||||
self.slipList.update(slipnodes, key=lambda s:s.activation,
|
self.slipList.update(slipnodes, key=lambda s:s.activation,
|
||||||
formatter=lambda s : '{}: {}'.format(s.name, round(s.activation, 2)))
|
formatter=lambda s : '{}: {}'.format(s.name, round(s.activation, 2)))
|
||||||
self.codeletList.update(codelets, key=lambda c:c.urgency, formatter= lambda s : '{}: {}'.format(s.name, round(s.urgency, 2)))
|
self.codeletList.update(codelets, key=lambda c:c.urgency, formatter= lambda s : '{}: {}'.format(s.name, round(s.urgency, 2)))
|
||||||
self.objectList.update(objects, formatter=lambda s : '{}'.format(', '.join(map(str, s.descriptions))))
|
get_descriptors = lambda s : ', '.join('({}={})'.format(d.descriptionType.name, d.descriptor.name) for d in s.descriptions)
|
||||||
|
self.objectList.update(objects, formatter=lambda s : '{}: {}'.format(s, get_descriptors(s)))
|
||||||
|
'''
|
||||||
if len(objects) > 0:
|
if len(objects) > 0:
|
||||||
print('Descriptions:')
|
print('Descriptions:')
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
@ -64,6 +66,7 @@ class MainApplication(GridFrame):
|
|||||||
print(' {}:'.format(description))
|
print(' {}:'.format(description))
|
||||||
print(' {}'.format(description.descriptionType.name))
|
print(' {}'.format(description.descriptionType.name))
|
||||||
print(' {}'.format(description.descriptor.name))
|
print(' {}'.format(description.descriptor.name))
|
||||||
|
'''
|
||||||
|
|
||||||
def reset_with_strings(self, initial, modified, target):
|
def reset_with_strings(self, initial, modified, target):
|
||||||
self.primary.reset_with_strings(initial, modified, target)
|
self.primary.reset_with_strings(initial, modified, target)
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import tkinter.ttk as ttk
|
|||||||
|
|
||||||
from .gridframe import GridFrame
|
from .gridframe import GridFrame
|
||||||
|
|
||||||
font1Size = 16
|
font1Size = 32
|
||||||
font1 = ('Helvetica', font1Size)
|
font1 = ('Helvetica', font1Size)
|
||||||
|
|
||||||
class WorkspaceCanvas(GridFrame):
|
class WorkspaceCanvas(GridFrame):
|
||||||
@ -11,6 +11,8 @@ class WorkspaceCanvas(GridFrame):
|
|||||||
def __init__(self, parent, *args, **kwargs):
|
def __init__(self, parent, *args, **kwargs):
|
||||||
GridFrame.__init__(self, parent, *args, **kwargs)
|
GridFrame.__init__(self, parent, *args, **kwargs)
|
||||||
|
|
||||||
|
self.chars = []
|
||||||
|
|
||||||
self.initial = ''
|
self.initial = ''
|
||||||
self.modified = ''
|
self.modified = ''
|
||||||
self.target = ''
|
self.target = ''
|
||||||
@ -20,6 +22,7 @@ class WorkspaceCanvas(GridFrame):
|
|||||||
|
|
||||||
self.canvas = tk.Canvas(self, background='black')
|
self.canvas = tk.Canvas(self, background='black')
|
||||||
self.add(self.canvas, 0, 0)
|
self.add(self.canvas, 0, 0)
|
||||||
|
|
||||||
GridFrame.configure(self)
|
GridFrame.configure(self)
|
||||||
|
|
||||||
def update(self, copycat):
|
def update(self, copycat):
|
||||||
@ -29,6 +32,7 @@ class WorkspaceCanvas(GridFrame):
|
|||||||
|
|
||||||
if self.changed:
|
if self.changed:
|
||||||
self.canvas.delete('all')
|
self.canvas.delete('all')
|
||||||
|
del self.chars[:]
|
||||||
self.add_text()
|
self.add_text()
|
||||||
|
|
||||||
def add_text(self):
|
def add_text(self):
|
||||||
@ -40,6 +44,7 @@ class WorkspaceCanvas(GridFrame):
|
|||||||
if sequence is None:
|
if sequence is None:
|
||||||
sequence = ''
|
sequence = ''
|
||||||
for char in sequence:
|
for char in sequence:
|
||||||
|
self.chars.append((char, (x, y)))
|
||||||
self.canvas.create_text(x, y, text=char, anchor=tk.NW, font=font1, fill='white')
|
self.canvas.create_text(x, y, text=char, anchor=tk.NW, font=font1, fill='white')
|
||||||
x += font1Size
|
x += font1Size
|
||||||
return x, y
|
return x, y
|
||||||
|
|||||||
Reference in New Issue
Block a user