-angular.module("logbuch").factory "Track", (StorageService, Log) ->
+angular.module("logbuch").factory "Track", (StorageService, Log, DebugLog) ->
   class Track
     @attributes = ['lat', 'long', 'waypoints', 'distanceKm', 'distanceNm', 'speedKmh', 'speedKn']
 

    updateCurrentPosition: (position) ->
      @lat      = position.latLng.lat
      @long     = position.latLng.lng

      @calculateTotalDistance()
      @calculateCurrentDistance()
      @calculateCurrentSpeed()

      true



    @convertKmtoNm = (km) ->
      parseFloat(km) * 0.539956803456

    @convertMsToKmh = (speed) ->
      (speed > 0 && speed * 3.6) || 0

    @fromStorage = ->
      stored = StorageService.getObject('currentTrack')
