Skip to content

Commit

Permalink
Display plots as they load (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangalio committed Oct 20, 2019
1 parent 48555bd commit 35f1f58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def __init__(self, state):
w, h = 1600, 2500
root.setMinimumSize(1000, h)
window.resize(w, h)
self.window.show()

def exec_(self):
self.window.show()
self.app.exec_()

def setup_widgets(self, layout):
Expand Down Expand Up @@ -148,7 +148,7 @@ def __init__(self):
self.ui.exec_() # Run program

def refresh_graphs(self):
self.plotter.draw(self.etterna_xml, self.replays_dir)
self.plotter.draw(self.etterna_xml, self.replays_dir, self.ui.app)

def try_choose_replays(self):
path = self.ui.choose_replays()
Expand Down
12 changes: 11 additions & 1 deletion plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, infobar):

self.plots = [a,b,c,d,e,f,g_,h,i,j,k,l,m]

def draw(self, xml_path, replays_path):
def draw(self, xml_path, replays_path, qapp):
print("Opening xml..")
try: # First try UTF-8
xmltree = etree.parse(xml_path, etree.XMLParser(encoding='UTF-8'))
Expand All @@ -96,33 +96,43 @@ def draw(self, xml_path, replays_path):
next(p).draw(g.gen_textbox_text_2(xml))
next(p).draw(g.gen_textbox_text_3(xml))
next(p).draw(g.gen_textbox_text(xml))
qapp.processEvents()

next(p).draw(g.gen_textbox_text_5(xml, replays))
next(p).draw(g.gen_textbox_text_4(xml, replays))
qapp.processEvents()

print("Generating wifescore plot..")
next(p).draw_with_given_args(g.gen_wifescore(xml))
qapp.processEvents()

print("Generating manip plot..")
data = g.gen_manip(xml, replays) if replays else "[please load replay data]"
next(p).draw_with_given_args(data)
qapp.processEvents()

print("Generating accuracy plot..")
next(p).draw_with_given_args(g.gen_accuracy(xml))
qapp.processEvents()

print("Generating session bubble plot..")
next(p).draw_with_given_args(g.gen_session_rating_improvement(xml))
qapp.processEvents()

print("Generating plays per hour of day..")
next(p).draw_with_given_args(g.gen_plays_by_hour(xml))
qapp.processEvents()

print("Generating plays for each week..")
next(p).draw_with_given_args(g.gen_plays_per_week(xml))
qapp.processEvents()

print("Generating session skillsets..")
next(p).draw_with_given_args(g.gen_session_skillsets(xml))
qapp.processEvents()

print("Generating skillset development..")
next(p).draw_with_given_args(g.gen_skillset_development(xml))
qapp.processEvents()

print("Done")

0 comments on commit 35f1f58

Please sign in to comment.