fix bug related to GET-INTERNAL-REAL-TIME, which in ECL is now micro-seconds (was: milli-seconds)

This commit is contained in:
pls.153 2024-03-26 19:57:04 +01:00
parent cc96a2c2df
commit d17fea07d8
3 changed files with 3 additions and 3 deletions

View file

@ -241,7 +241,7 @@
(setf start (get-internal-real-time)) (setf start (get-internal-real-time))
(qsingle-shot 100 'force-repaint)) (qsingle-shot 100 'force-repaint))
(when (> (- (get-internal-real-time) start) (when (> (- (get-internal-real-time) start)
300) (* 300 1000))
(setf start nil))))) (setf start nil)))))
(defun force-repaint () (defun force-repaint ()

View file

@ -35,7 +35,7 @@
(defun filter (lat lon accuracy speed) (defun filter (lat lon accuracy speed)
(when (and lat lon accuracy speed) (when (and lat lon accuracy speed)
(setf accuracy (max 1 accuracy)) (setf accuracy (max 1 accuracy))
(let ((timestamp (get-internal-real-time))) (let ((timestamp (/ (get-internal-real-time) 1000.0)))
(if *variance* (if *variance*
(let ((time-inc (- timestamp *timestamp*))) (let ((time-inc (- timestamp *timestamp*)))
(incf *variance* (/ (* time-inc (expt speed 2)) 1000)) (incf *variance* (/ (* time-inc (expt speed 2)) 1000))

View file

@ -8,7 +8,7 @@
"After *DISTANCE-SAMPLES* samples, calculate average speed and update on "After *DISTANCE-SAMPLES* samples, calculate average speed and update on
every new distance sample." every new distance sample."
(push (cons (distance) (push (cons (distance)
(get-internal-real-time)) (/ (get-internal-real-time) 1000.0))
samples) samples)
(when (> (length samples) *distance-samples*) (when (> (length samples) *distance-samples*)
(setf samples (butlast samples)) (setf samples (butlast samples))