From: <jb...@us...> - 2010-07-07 09:56:47
|
Revision: 606 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=606&view=rev Author: jblance Date: 2010-07-07 09:56:40 +0000 (Wed, 07 Jul 2010) Log Message: ----------- Some initial GUI work for displaying athlete data (e.g. weight) Modified Paths: -------------- pytrainer/trunk/glade/pytrainer.glade pytrainer/trunk/pytrainer/gui/windowmain.py pytrainer/trunk/pytrainer/lib/activity.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/glade/pytrainer.glade =================================================================== --- pytrainer/trunk/glade/pytrainer.glade 2010-07-07 08:14:34 UTC (rev 605) +++ pytrainer/trunk/glade/pytrainer.glade 2010-07-07 09:56:40 UTC (rev 606) @@ -135,6 +135,17 @@ </widget> </child> <child> + <widget class="GtkRadioMenuItem" id="athleteview_item"> + <property name="visible">True</property> + <property name="label" translatable="yes"> _Athlete Data</property> + <property name="use_underline">True</property> + <property name="draw_as_radio">True</property> + <property name="group">classicview_item</property> + <signal name="activate" handler="on_athleteview_activate"/> + <accelerator key="a" signal="activate" modifiers="GDK_CONTROL_MASK"/> + </widget> + </child> + <child> <widget class="GtkRadioMenuItem" id="waipointsview_item"> <property name="visible">True</property> <property name="label" translatable="yes"> _Waypoints Editor</property> @@ -5070,7 +5081,6 @@ <child> <widget class="GtkVBox" id="equipview"> <property name="visible">True</property> - <property name="sensitive">True</property> <child> <widget class="GtkHBox" id="hbox6"> <property name="visible">True</property> @@ -5090,7 +5100,6 @@ <child> <widget class="GtkComboBoxEntry" id="record_combovalue1"> <property name="visible">True</property> - <property name="sensitive">True</property> <property name="items" translatable="yes">Running shoes GPS watch T-shirts @@ -5162,12 +5171,8 @@ </widget> </child> <child> - <widget class="GtkLabel" id="label154"> - <property name="visible">True</property> - <property name="label">label154</property> - </widget> + <placeholder/> <packing> - <property name="tab_fill">False</property> <property name="type">tab</property> </packing> </child> @@ -5287,13 +5292,8 @@ </packing> </child> <child> - <widget class="GtkLabel" id="llllll"> - <property name="visible">True</property> - <property name="label">label155</property> - </widget> + <placeholder/> <packing> - <property name="position">1</property> - <property name="tab_fill">False</property> <property name="type">tab</property> </packing> </child> @@ -5570,13 +5570,227 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label-46"> + <placeholder/> + <packing> + <property name="type">tab</property> + </packing> + </child> + <child> + <widget class="GtkHBox" id="athletearea"> <property name="visible">True</property> - <property name="label">label-2147483648</property> + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <child> + <widget class="GtkFrame" id="frame3"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment9"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkTable" id="table2"> + <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">4</property> + <child> + <widget class="GtkLabel" id="label21"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Name:</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label22"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Date of birth:</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label23"> + <property name="visible">True</property> + <property name="label" translatable="yes">Height:</property> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelName"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">4</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">10</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelDOB"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">10</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="labelHeight"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="xpad">5</property> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="x_padding">10</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Athlete Details</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="padding">6</property> + <property name="position">0</property> + </packing> + </child> + <child> + <widget class="GtkFrame" id="frame6"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment13"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkHBox" id="hbox7"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + <child> + <widget class="GtkHBox" id="boxAthleteGraph"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label25"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Detail</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">5</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkFrame" id="frame5"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <child> + <widget class="GtkAlignment" id="alignment12"> + <property name="visible">True</property> + <property name="left_padding">12</property> + <child> + <widget class="GtkVBox" id="boxAthleteHistory"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label24"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>History</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">5</property> + <property name="position">2</property> + </packing> + </child> + </widget> + <packing> + <property name="position">0</property> + </packing> + </child> </widget> <packing> - <property name="position">2</property> - <property name="tab_fill">False</property> + <property name="position">3</property> + </packing> + </child> + <child> + <placeholder/> + <packing> <property name="type">tab</property> </packing> </child> @@ -5733,7 +5947,7 @@ <property name="use_stock">False</property> <signal name="activate" handler="on_multiple_merge_ToDo"/> <child internal-child="image"> - <widget class="GtkImage" id="image2"> + <widget class="GtkImage" id="image3"> <property name="visible">True</property> <property name="icon_name">document-properties</property> </widget> Modified: pytrainer/trunk/pytrainer/gui/windowmain.py =================================================================== --- pytrainer/trunk/pytrainer/gui/windowmain.py 2010-07-07 08:14:34 UTC (rev 605) +++ pytrainer/trunk/pytrainer/gui/windowmain.py 2010-07-07 09:56:40 UTC (rev 606) @@ -44,6 +44,8 @@ from pytrainer.extensions.mapviewer import MapViewer from pytrainer.extensions.waypointeditor import WaypointEditor +from pytrainer.gui.drawGraph import DrawGraph + class Main(SimpleGladeApp): def __init__(self, data_path = None, parent = None, version = None, gpxDir = None): def url_hook(dialog, url): @@ -633,6 +635,23 @@ self.drawareayear.drawgraph(record_list) logging.debug("<<") + def actualize_athleteview(self, athletedata): + logging.debug(">>") + self.labelName.set_text(athletedata["prf_name"]) + self.labelDOB.set_text(athletedata["prf_age"]) + self.labelHeight.set_text(athletedata["prf_height"]+" cm") + #TODO + self.grapher = DrawGraph(self, self.pytrainer_main) + from pytrainer.lib.graphdata import GraphData + datalist = GraphData(title="Weight", xlabel="Date", ylabel="kg") + datalist.addPoints(x=1, y=67) + datalist.addPoints(x=2, y=92) + datalist.addPoints(x=3, y=90) + datalist.addPoints(x=4, y=76) + self.grapher.drawPlot(datalist=datalist, box=self.boxAthleteGraph) + #TODO + logging.debug("<<") + def actualize_listview(self,record_list): logging.debug(">>") #recod list tiene: @@ -851,7 +870,7 @@ #Hide options self.hpaned1.set_position(0) self.buttonShowOptions.set_tooltip_text(_('Show graph display options') ) - logging.debug('Position: %d' % self.hpaned1.get_position() ) + #logging.debug('Position: %d' % self.hpaned1.get_position() ) logging.debug('Position set: %s' % self.hpaned1.get_property('position-set') ) def on_buttonRedrawMap_clicked(self, widget): @@ -1013,19 +1032,29 @@ def on_classicview_activate(self,widget): self.waypointarea.hide() self.listarea.hide() + self.athletearea.hide() self.selected_view = "record" self.classicarea.show() def on_listview_activate(self,widget): self.waypointarea.hide() self.classicarea.hide() + self.athletearea.hide() self.selected_view = "listview" self.parent.refreshListView() self.listarea.show() + def on_athleteview_activate(self,widget): + self.waypointarea.hide() + self.classicarea.hide() + self.listarea.hide() + self.parent.refreshAthleteView() + self.athletearea.show() + def on_waypointsview_activate(self,widget): self.listarea.hide() self.classicarea.hide() + self.athletearea.hide() self.parent.refreshWaypointView() self.waypointarea.show() Modified: pytrainer/trunk/pytrainer/lib/activity.py =================================================================== --- pytrainer/trunk/pytrainer/lib/activity.py 2010-07-07 08:14:34 UTC (rev 605) +++ pytrainer/trunk/pytrainer/lib/activity.py 2010-07-07 09:56:40 UTC (rev 606) @@ -245,6 +245,7 @@ for track in self.tracklist: try: pace = 60/track['velocity'] + #pace = 0 if pace > 90 else pace except: pace = 0 if self.us_system: Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2010-07-07 08:14:34 UTC (rev 605) +++ pytrainer/trunk/pytrainer/main.py 2010-07-07 09:56:40 UTC (rev 606) @@ -49,7 +49,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.7.2_svn#603" + self.version ="1.7.2_svn#606" self.DB_version = 3 #Process command line options self.startup_options = self.get_options() @@ -304,6 +304,15 @@ self.windowmain.actualize_calendar(record_list) logging.debug('<<') + def refreshAthleteView(self): + logging.debug('>>') + athletedata = {} + athletedata['prf_name'] = self.profile.getValue("pytraining","prf_name") + athletedata['prf_age'] = self.profile.getValue("pytraining","prf_age") + athletedata['prf_height'] = self.profile.getValue("pytraining","prf_height") + self.windowmain.actualize_athleteview(athletedata) + logging.debug('<<') + def refreshListView(self): logging.debug('>>') record_list = self.record.getAllRecordList() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |