by neilv · 1y ago · 0 comments
(define (time-to-move from-pos to-pos)
;; Calculates the total time to move between two positions,
;; assuming rotation and ascension can occur simultaneously.
(max (time-to-rotate (position-azimuth from-pos)
(position-azimuth to-pos))
(time-to-ascend (position-elevation from-pos)
(position-elevation to-pos)))) (defun time-to-move (from-pos to-pos)
it's like the author didn't understand accessors? They don't need the with-accessors. They also might not need with-slots, had they had an accessor for last-duration. (with-slots (last-duration) antenna
(setf last-duration total-time)
=> (setf (last-duration antenna) total-time) ;; given last-duration is an accessor: both a getter and a setter. (defun run-scan (antenna scan)
"Perform a scan on this antenna. Return a scan log."
(let* ((slew-time (move-to antenna (scan-position scan)))
(on-source-time (delay antenna (scan-length scan))))
(setf (antenna-last-duration antenna) (+ on-source-time slew-time))
(make-scan-log scan slew-time on-source-time)))