Fixes graph updates

This commit is contained in:
LSaldyt
2017-11-03 12:56:44 -07:00
parent af72289ee5
commit 25841db648
4 changed files with 7 additions and 10 deletions

1
.gitignore vendored
View File

@ -28,3 +28,4 @@ pip-log.txt
.*.swp .*.swp
output output
copycat.log

View File

@ -54,3 +54,6 @@ class Control(GridFrame):
def get_vars(self): def get_vars(self):
return self.entry.a.get(), self.entry.b.get(), self.entry.c.get() return self.entry.a.get(), self.entry.b.get(), self.entry.c.get()
def reset(self):
self.go = False

View File

@ -57,16 +57,6 @@ class MainApplication(GridFrame):
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)))
get_descriptors = lambda s : ', '.join('({}={})'.format(d.descriptionType.name, d.descriptor.name) for d in 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))) self.objectList.update(objects, formatter=lambda s : '{}: {}'.format(s, get_descriptors(s)))
'''
if len(objects) > 0:
print('Descriptions:')
for obj in objects:
print(obj)
for description in obj.descriptions:
print(' {}:'.format(description))
print(' {}'.format(description.descriptionType.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)
@ -84,6 +74,8 @@ class GUI(object):
def add_answers(self, answers): def add_answers(self, answers):
def modifier(status): def modifier(status):
print('Here')
print(answers)
with plt.style.context(('dark_background')): with plt.style.context(('dark_background')):
plot_imbedded(answers, status) plot_imbedded(answers, status)
self.app.graph2.status.modifier = modifier self.app.graph2.status.modifier = modifier

View File

@ -27,3 +27,4 @@ class Primary(GridFrame):
def reset_with_strings(self, initial, modified, target): def reset_with_strings(self, initial, modified, target):
self.canvas.reset_with_strings(initial, modified, target) self.canvas.reset_with_strings(initial, modified, target)
self.control.reset()