From: benoit.pin Date: Thu, 3 Feb 2011 13:36:41 +0000 (+0000) Subject: Affichage du HID dans l'application d'analyse des logs. X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/commitdiff_plain/9df37cf5c91975214a341a58e703c5b8f826ab45?ds=sidebyside;hp=2004235944e6643e6aae81581d3c8e86ee4fc54d Affichage du HID dans l'application d'analyse des logs. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@335 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/minwii/logapp.py b/src/minwii/logapp.py index 1bbebd4..eb59267 100755 --- a/src/minwii/logapp.py +++ b/src/minwii/logapp.py @@ -174,12 +174,14 @@ class Identification(Frame) : def __init__(self, master=None) : Frame.__init__(self, master) self.fileName = StringVar() + self.hid = StringVar() self.patientName = StringVar() self.createWidgets() def refresh(self, lfa) : filename = basename(lfa.logfile.name) self.fileName.set(filename) + self.hid.set(lfa.getHID()) metadata = lfa.getMetadata() self.patientName.set(metadata.get('PatientName', '')) self.commentsText.delete(1.0, END) @@ -192,20 +194,26 @@ class Identification(Frame) : fileNameLbl = Label(self, textvariable=self.fileName) fileNameLbl.grid(row=0, column=1, sticky=W) + hidLbl = Label(self, text='HID :') + hidLbl.grid(row=1, column=0, sticky=E) + + hidNameLbl = Label(self, textvariable=self.hid) + hidNameLbl.grid(row=1, column=1, sticky=W) + nameLbl = Label(self, text='Patient :') - nameLbl.grid(row=1, column=0, sticky=E) + nameLbl.grid(row=2, column=0, sticky=E) self.nameEntry = Entry(self, width=40, textvariable=self.patientName) - self.nameEntry.grid(row=1, column=1, sticky=W) + self.nameEntry.grid(row=2, column=1, sticky=W) commentsLbl = Label(self, text='Commentaires :') - commentsLbl.grid(row=2, column=0, sticky=E) + commentsLbl.grid(row=3, column=0, sticky=E) self.commentsText = Text(self, width=40, height=4, undo=True, wrap=WORD) - self.commentsText.grid(row=2, column=1, sticky=W) + self.commentsText.grid(row=3, column=1, sticky=W) self.saveBtn = Button(self, text='Enregistrer', command=self.saveMetadata) - self.saveBtn.grid(row=3, column=1, sticky=E) + self.saveBtn.grid(row=4, column=1, sticky=E) def saveMetadata(self): app = self.master.master diff --git a/src/minwii/logfilereader.py b/src/minwii/logfilereader.py index a5a2d35..57cdc60 100755 --- a/src/minwii/logfilereader.py +++ b/src/minwii/logfilereader.py @@ -99,6 +99,16 @@ class LogFileReader(object) : mode = l.split(':', 1)[1].strip() return mode + @inplaceread + def getHID(self) : + "retourne l'interface homme-machine utilisée" + for l in self : + if l.startswith('APP HID :') : + break + + mode = l.split(':', 1)[1].strip() + return mode + @inplaceread def getFirstEventTicks(self) : "retourne le timecode du premier événement (entier)"