X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/e26d95d9dbadcbfcd71e6569b277dd4b8888582d..add91cc84b82124bd196adbdbef1975abfe7638f:/src/minwii/logapp.py?ds=sidebyside diff --git a/src/minwii/logapp.py b/src/minwii/logapp.py index a97e849..1bbebd4 100755 --- a/src/minwii/logapp.py +++ b/src/minwii/logapp.py @@ -6,10 +6,11 @@ $Id$ $URL$ """ +import os +os.environ['WINWII_NO_LOG'] = '1' from Tkinter import * import tkFileDialog from glob import glob -import os from os.path import join as pjoin from os.path import basename from os.path import getsize @@ -176,9 +177,6 @@ class Identification(Frame) : self.patientName = StringVar() self.createWidgets() - #def setFileName(self, name) : - # self.fileName.set(name) - def refresh(self, lfa) : filename = basename(lfa.logfile.name) self.fileName.set(filename) @@ -225,19 +223,42 @@ class ResultsFrame(Frame) : def layResults(self, lfa) : results = lfa.analyse() if results : - for i, kv in enumerate(results) : - k, v = kv + for i, kvt in enumerate(results) : + k, v, timeBased = kvt kl = Label(self, text='%s :' % k) kl.grid(row=i, column=0, sticky=E) - - vl = Label(self, text=v) - vl.grid(row=i, column=1, sticky=W) + + if not timeBased : + vl = Label(self, text=v) + vl.grid(row=i, column=1, sticky=W) + else : + maxv = max(v) + if maxv : + cw, ch = 200, 100 + c = Canvas(self, background='#fff', width=cw, height=ch) + rectW = int(float(cw) / len(v)) + unitRectH = float(ch) / maxv + for j, fv in enumerate(v) : + if not fv : continue + x0 = j * rectW + y0 = ch - int(unitRectH * fv) + x1 = (j + 1) * rectW + y1 = ch + c.create_rectangle(x0, y0, x1, y1, fill="#9085ba") + c.grid(row=i, column=1, sticky=W) + + else : + vl = Label(self, text='—') + vl.grid(row=i, column=1, sticky=W) else : msg = Label(self, text="Pas de données exploitables.") msg.grid() +def main() : + app = Application() + app.master.title("Analyseur des sessions MINWii") + app.mainloop() -app = Application() -app.master.title("Analyseur des sessions MINWii") -app.mainloop() +if __name__ == '__main__' : + main() \ No newline at end of file