コード例 #1
0
 def setup(self, file_name, scope):
     self.db = tilt_logger_database()
     values = file_reader.get_lines(file_name)
     if values:
         self.db.save_events(values, scope)
         #self.db.log()
     else:
         print('failure no values!')
コード例 #2
0
ファイル: graphs.py プロジェクト: mitikkak/KayakLogger
 def setup(self, file_name, scope):
     self.db = tilt_logger_database()
     values = file_reader.get_lines(file_name)
     if values:
         self.db.save_events(values, scope)
         #self.db.log()
     else:
         print('failure no values!')
コード例 #3
0
ファイル: gps_database.py プロジェクト: mitikkak/KayakLogger
 def __init__(self, file_name, scope=None):
     lines = file_reader.get_lines(file_name, "HDOP")
     valid_lines = self.get_valid_lines(lines)
     print "number of GPS entries: %d, valid: %d" % (len(lines), len(valid_lines))
     self.create_entries(valid_lines, scope)
     print "Pauses:"
     pauses, pause_entries = self.pauses()
     for pause in pauses:
         print pause
     print len(pause_entries)
     travel_entries = self.remove_entries(pause_entries)
     print len(travel_entries)
     travel_speed = self.average("speed", travel_entries)
     average_speed = self.average("speed", self.entries)
     highest_speed, highest_speed_location = self.highest("speed")
     # lowest_speed_limit = 0.1
     # number_of_slow = self.below(lowest_speed_limit, 'speed')
     print (
         "Speed:: highest: %s at %s, average: %f, travel: %f"
         % (highest_speed, highest_speed_location, average_speed, travel_speed)
     )
     print ("Total distance: %f" % self.distance())
コード例 #4
0
 def __init__(self, file_name, scope=None):
     lines = file_reader.get_lines(file_name, 'HDOP')
     valid_lines = self.get_valid_lines(lines)
     print 'number of GPS entries: %d, valid: %d' % (len(lines),
                                                     len(valid_lines))
     self.create_entries(valid_lines, scope)
     print 'Pauses:'
     pauses, pause_entries = self.pauses()
     for pause in pauses:
         print pause
     print len(pause_entries)
     travel_entries = self.remove_entries(pause_entries)
     print len(travel_entries)
     travel_speed = self.average('speed', travel_entries)
     average_speed = self.average('speed', self.entries)
     highest_speed, highest_speed_location = self.highest('speed')
     #lowest_speed_limit = 0.1
     #number_of_slow = self.below(lowest_speed_limit, 'speed')
     print('Speed:: highest: %s at %s, average: %f, travel: %f' %
           (highest_speed, highest_speed_location, average_speed,
            travel_speed))
     print('Total distance: %f' % self.distance())