Commit 363580ca authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Remove, reorder files in modules, add stream argument to time-interval-format

In date-time.asd, remove duplicate file convert-timescale from
connected system datime-pqd, and load convert-timescale at the end of
date-time. Add stream argument to time-interval-format. The systems
date-time, physical-dimension, and lisp-unit can be simultaneously
loaded, and the :antik tests pass.
parent c8fab667
;; Physical dimension system definition
;; Liam Healy
;; Time-stamp: <2014-01-13 23:07:00EST date-time.asd>
;; Time-stamp: <2014-01-14 21:10:05EST date-time.asd>
;; Copyright 2014 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -36,9 +36,9 @@
(:file "iso8601")
(:file "dtspec")
(:file "formats")
(:file "convert-timescale")
(:file "timepoint")
(:file "read-time")))))
(:file "read-time")
(:file "convert-timescale")))))
(asdf:defsystem-connection #:datime-pqd
:serial t
......@@ -49,8 +49,7 @@
((:file "time-interval")
(:file "relative-time")
(:file "linear-timepoint")
(:file "dtmath")
(:file "convert-timescale")))))
(:file "dtmath")))))
(asdf:defsystem-connection #:remote-phys-dim-data
:serial t
......
;; Tests for date-time
;; Liam Healy 2014-01-13 22:00:52EST tests.lisp
;; Time-stamp: <2014-01-13 22:27:07EST time-interval-tests.lisp>
;; Time-stamp: <2014-01-14 21:16:56EST time-interval-tests.lisp>
;; Copyright 2011, 2013, 2014 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -64,10 +64,10 @@
#dPT22.000s
(piti "T22S")) ; 22 seconds
(lisp-unit:assert-numerical-equal
#dPT14h22m
#dPT14m22s
(piti "T14M22S")) ; 14 minutes, 22 seconds
(lisp-unit:assert-numerical-equal
#dPT6h14m22.000s
#dPT14h22m
(piti "T14:22")) ; 14 hours, 22 minutes
(lisp-unit:assert-numerical-equal
#dPT6h14m22.000s
......
;; Time interval parsing and generating.
;; Liam Healy Thu May 2 2002 - 16:34
;; Time-stamp: <2014-01-13 22:58:47EST time-interval.lisp>
;; Time-stamp: <2014-01-14 21:21:06EST time-interval.lisp>
;; Copyright 2011, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -100,7 +100,7 @@
nil = with the unit for time given by :system-of-units
(like #_36443.72697908581_S.")
(defun time-interval-format (pq)
(defun time-interval-format (pq &optional (stream t))
"Format the time interval ISO8601."
(when (and (nf-option :time)
(not (grid:gridp (pq-magnitude pq)))
......
;; Objects that represent physical measurements.
;; Liam Healy Wed Mar 6 2002 - 09:04
;; Time-stamp: <2014-01-13 22:55:09EST physical-quantities.lisp>
;; Time-stamp: <2014-01-14 21:20:38EST physical-quantities.lisp>
;; Copyright 2011, 2012, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -160,7 +160,7 @@
;; dimensions, call the T method of nf, so that it will call
;; nf-grid.
(call-next-method)
(or (funcall *time-interval-format-function* pq)
(or (funcall *time-interval-format-function* pq stream)
(multiple-value-bind (val units)
(pqval pq)
(if (nf-option :system-of-units)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment