From: <jb...@us...> - 2010-04-14 11:11:48
|
Revision: 564 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=564&view=rev Author: jblance Date: 2010-04-14 11:11:42 +0000 (Wed, 14 Apr 2010) Log Message: ----------- Fixes to heartrate graphing after changes to profile and config variables Modified Paths: -------------- pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/heartrategraph.py pytrainer/trunk/pytrainer/lib/heartrate.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-14 10:59:25 UTC (rev 563) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-04-14 11:11:42 UTC (rev 564) @@ -141,7 +141,7 @@ def createGraphs(self,RecordGraph,DayGraph,WeekGraph, MonthGraph,YearGraph,HeartRateGraph): self.drawarearecord = RecordGraph(self.record_graph_vbox, self.window1, self.record_combovalue, self.record_combovalue2, self.btnShowLaps, self.tableConfig) - self.drawareaheartrate = HeartRateGraph(self.heartrate_vbox, self.window1, self.heartrate_vbox2) + self.drawareaheartrate = HeartRateGraph(self.heartrate_vbox, self.window1, self.heartrate_vbox2, pytrainer_main=self.pytrainer_main) #self.drawareaday = DayGraph(self.day_vbox, self.day_combovalue) self.day_vbox.hide() self.drawareaweek = WeekGraph(self.weekview, self.window1, self.week_combovalue, self.week_combovalue2) Modified: pytrainer/trunk/pytrainer/heartrategraph.py =================================================================== --- pytrainer/trunk/pytrainer/heartrategraph.py 2010-04-14 10:59:25 UTC (rev 563) +++ pytrainer/trunk/pytrainer/heartrategraph.py 2010-04-14 11:11:42 UTC (rev 564) @@ -23,15 +23,16 @@ import logging class HeartRateGraph: - def __init__(self, vbox = None, window = None, vbox2 = None): + def __init__(self, vbox = None, window = None, vbox2 = None, pytrainer_main = None): logging.debug('>>') self.drawarea = DrawArea(vbox, window) self.drawarea2 = DrawArea(vbox2, window) + self.pytrainer_main = pytrainer_main logging.debug('<<') def drawgraph(self,values): logging.debug('>>') - zones = getZones() + zones = getZones(self.pytrainer_main) #TODO from lib/heartrate.py import - can this file be consolidated? xvalues, yvalues = self.get_values(values) #logging.debug('xvalues: '+str(xvalues)) #logging.debug('yvalues: '+str(yvalues)) Modified: pytrainer/trunk/pytrainer/lib/heartrate.py =================================================================== --- pytrainer/trunk/pytrainer/lib/heartrate.py 2010-04-14 10:59:25 UTC (rev 563) +++ pytrainer/trunk/pytrainer/lib/heartrate.py 2010-04-14 11:11:42 UTC (rev 564) @@ -18,14 +18,14 @@ from xmlUtils import XMLParser -def getZones(): - conf = checkConf() - filename = conf.getValue("conffile") - configuration = XMLParser(filename) - maxhr = int(configuration.getValue("pytraining","prf_maxhr")) - resthr = int(configuration.getValue("pytraining","prf_minhr")) +def getZones(pytrainer_main=None): + #conf = checkConf() + #filename = conf.getValue("conffile") + #configuration = XMLParser(filename) + maxhr = int(pytrainer_main.profile.getValue("pytraining","prf_maxhr")) + resthr = int(pytrainer_main.profile.getValue("pytraining","prf_minhr")) - if configuration.getValue("pytraining","prf_hrzones_karvonen")=="True": + if pytrainer_main.profile.getValue("pytraining","prf_hrzones_karvonen")=="True": #if karvonen method targethr1 = ((maxhr - resthr) * 0.50) + resthr targethr2 = ((maxhr - resthr) * 0.60) + resthr Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-04-14 10:59:25 UTC (rev 563) +++ pytrainer/trunk/pytrainer/main.py 2010-04-14 11:11:42 UTC (rev 564) @@ -59,7 +59,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#563" + self.version ="1.7.2_svn#564" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -307,8 +307,8 @@ gpx = Gpx(self.data_path,gpxfile) gpx_tracklist = gpx.getTrackList() self.windowmain.actualize_heartrategraph(gpx_tracklist) - zones = getZones() #TODO Huh, what is supposed to happen here??? - karvonen_method = self.profile.configuration.getValue("pytraining","prf_hrzones_karvonen") + zones = getZones(self) #TODO from lib/heartrate.py import - can this file be consolidated? + karvonen_method = self.profile.getValue("pytraining","prf_hrzones_karvonen") self.windowmain.actualize_hrview(record_list,zones,karvonen_method) logging.debug('<<') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |