Changeset 175

Show
Ignore:
Timestamp:
02/02/08 00:41:52 (1 year ago)
Author:
vud1
Message:

"new fields in the record "

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pytrainer/trunk/glade/pytrainer.glade

    r173 r175  
    66486648 
    66496649                          <child> 
    6650                             <widget class="GtkEntry" id="entry335"> 
     6650                            <widget class="GtkEntry" id="rcd_maxpace"> 
    66516651                              <property name="visible">True</property> 
    66526652                              <property name="can_focus">True</property> 
  • pytrainer/trunk/pytrainer/gui/windowrecord.py

    r174 r175  
    4242                        "rcd_gpxfile", 
    4343                        "rcd_upositive", 
    44                         "rcd_unegative" 
     44                        "rcd_unegative", 
     45                        "rcd_maxbeats", 
     46                        "rcd_pace", 
     47                        "rcd_maxpace", 
     48                        "rcd_maxvel" 
    4549                        ] 
    4650                count = 0 
     
    125129         
    126130        def setValues(self,values): 
    127                 #(50, u'2006-10-13', 1, 25.0, u'5625', 0.0, 16.0, 0, u'', gpsfile, title,upositive,unegative ) 
     131                #(50, u'2006-10-13', 1, 25.0, u'5625', 0.0, 16.0, 0, u'', gpsfile, title,upositive,unegative,maxspeed|maxpace|pace|maxbeats 
    128132                self.id_record = values[0] 
    129133                self.setTime(values[4]) 
     
    135139                self.setValue("rcd_upositive",values[11]) 
    136140                self.setValue("rcd_unegative",values[12]) 
     141                self.setValue("rcd_maxspeed",values[13]) 
     142                self.setValue("rcd_maxpace",values[14]) 
     143                self.setValue("rcd_pace",values[15]) 
     144                self.setValue("rcd_maxbeats",values[16]) 
    137145                self.rcd_title.set_text("%s"%values[10]) 
    138146                self.rcd_sport.set_active(int(values[2])-1) 
  • pytrainer/trunk/pytrainer/lib/ddbb.py

    r155 r175  
    126126                sql = "alter table sports add met float" 
    127127                self.ddbbObject.freeExec(sql) 
    128                  
     128                         
     129        def checkmettable(self): 
     130                try: 
     131                        sql = "alter table sports add met float" 
     132                        self.ddbbObject.freeExec(sql) 
     133                except:  
     134                        pass 
     135        def addpaceandmax2ddbb(self): 
     136                sql = "alter table records add maxspeed float" 
     137                self.ddbbObject.freeExec(sql) 
     138                sql = "alter table records add maxpace float" 
     139                self.ddbbObject.freeExec(sql) 
     140                sql = "alter table records add pace float" 
     141                self.ddbbObject.freeExec(sql) 
     142                sql = "alter table records add maxbeats float" 
     143                self.ddbbObject.freeExec(sql) 
     144 
  • pytrainer/trunk/pytrainer/lib/mysqlUtils.py

    r155 r175  
    8181                        `upositive` FLOAT NOT NULL , 
    8282                        `unegative` FLOAT NOT NULL , 
     83                        `maxspeed` FLOAT, NOT NULL, 
     84                        maxpace FLOAT NOT NULL, 
     85                        pace FLOAT NOT NULL, 
     86                        maxbeats FLOAT NOT NULL, 
    8387                        INDEX ( `id_record` ) 
    8488                        ) ENGINE = MYISAM ;""") 
  • pytrainer/trunk/pytrainer/lib/sqliteUtils.py

    r155 r175  
    7272                        title varchar(200), 
    7373                        upositive float, 
    74                         unegative float 
     74                        unegative float, 
     75                        maxspeed float, 
     76                        maxpace float, 
     77                        pace float, 
     78                        maxbeats float 
    7579                        ) ;""" 
    7680                cur.execute(sql) 
  • pytrainer/trunk/pytrainer/main.py

    r161 r175  
    5252                self.data_path = data_path 
    5353                #configuration 
    54                 self.version ="1.5.0.1
     54                self.version ="1.5.0.3
    5555                self.conf = checkConf() 
    5656                #preparamos la ventana principal 
  • pytrainer/trunk/pytrainer/record.py

    r174 r175  
    5656                if self.configuration.getOption("version")<="1.5.0": 
    5757                        self.ddbb.addweightandmet2ddbb() 
     58                if self.configuration.getOption("version")<="1.5.0.1": 
     59                        self.ddbb.checkmettable() 
     60                if self.configuration.getOption("version")<="1.5.0.2": 
     61                        self.ddbb.addpaceandmax2ddbb() 
    5862                if self.configuration.getOption("version")<version: 
    5963                        self.configuration.setVersion(version) 
     
    8185                time = self.date.time2second(list_options["rcd_time"]) 
    8286                average = self.parseFloatRecord(list_options["rcd_average"]) 
    83                 cells= "date,sport,distance,time,beats,comments,average,calories,title,upositive,unegative
     87                cells= "date,sport,distance,time,beats,comments,average,calories,title,upositive,unegative,maxspeed,maxpace,pace,maxbeats
    8488                if (list_options["rcd_beats"] == ""): 
    8589                        list_options["rcd_beats"] = 0 
     
    99103                        list_options["rcd_title"], 
    100104                        self.parseFloatRecord(list_options["rcd_upositive"]), 
    101                         self.parseFloatRecord(list_options["rcd_unegative"]) 
     105                        self.parseFloatRecord(list_options["rcd_unegative"]), 
     106                        self.parseFloatRecord(list_options["rcd_maxvel"]), 
     107                        self.parseFloatRecord(list_options["rcd_maxpace"]), 
     108                        self.parseFloatRecord(list_options["rcd_pace"]), 
     109                        self.parseFloatRecord(list_options["rcd_maxbeats"]) 
    102110 
    103111                        ) 
     
    220228                self.recordwindow.on_calcpace_clicked(None) 
    221229                self.recordwindow.on_calccalories_clicked(None) 
     230                self.recordwindow.rcd_maxpace.set_text("%0.2f" %(60/maxspeed)) 
    222231         
    223232        def __actualize_fromgpx(self, gpxfile, name=None):