Commit 145f603f authored by CD's avatar CD
Browse files

small changes to physiological variable output helper functions

parent f7dd10c3
...@@ -248,9 +248,9 @@ ...@@ -248,9 +248,9 @@
;When physiology is enabled ;When physiology is enabled
(when (and (get-module physio) (phys-module-enabled phys)) (when (and (get-module physio) (phys-module-enabled phys))
(if test (if test
(if (probe-file (concatenate 'string "CEC-Arous" *START-TIME* ".txt")) (if (probe-file (concatenate 'string "Phys-data/CEC-Arous" (phys-module-pipeID phys) ".txt"))
(with-open-file (with-open-file
(msgStream (concatenate 'string "CEC-Arous" *START-TIME* ".txt") (msgStream (concatenate 'string "Phys-data/CEC-Arous" (phys-module-pipeID phys) ".txt")
:direction :output :if-exists :append :if-does-not-exist :create) :direction :output :if-exists :append :if-does-not-exist :create)
(format msgStream "~5$,~5$,~5$,~5$~&" (format msgStream "~5$,~5$,~5$,~5$~&"
(compute-cort test) (compute-epi-arousal test) (compute-crh-arousal test) (compute-cort test) (compute-epi-arousal test) (compute-crh-arousal test)
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
(compute-epi-arousal)) (compute-epi-arousal))
(* (AA-crh-arous-ratio aa) (compute-crh-arousal)))))) (* (AA-crh-arous-ratio aa) (compute-crh-arousal))))))
(with-open-file (with-open-file
(msgStream (concatenate 'string "CEC-Arous" *START-TIME* ".txt") (msgStream (concatenate 'string "Phys-data/CEC-Arous" (phys-module-pipeID phys) ".txt")
:direction :output :if-exists :supersede :if-does-not-exist :create) :direction :output :if-exists :supersede :if-does-not-exist :create)
(format msgStream "f(Cortisol),g(Epinephrine),h(CRH),Arousal~&")))) (format msgStream "f(Cortisol),g(Epinephrine),h(CRH),Arousal~&"))))
(* (compute-homeostatic-arousal-factor) (compute-cort) (* (compute-homeostatic-arousal-factor) (compute-cort)
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
(setf ret-arousal 1)) (setf ret-arousal 1))
(if test (if test
(with-open-file (with-open-file
(msgStream (concatenate 'string "Homeostatic-Arousal" *START-TIME* ".txt") (msgStream (concatenate 'string "Phys-data/Homeostatic-Arousal" (phys-module-pipeID phys) ".txt")
:direction :output :if-exists :append :if-does-not-exist :create) :direction :output :if-exists :append :if-does-not-exist :create)
(format msgStream "~5$~&" ret-arousal))) (format msgStream "~5$~&" ret-arousal)))
ret-arousal)) ret-arousal))
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
;;We need to use a seprate SolverPipeFileDir var on Linux systems because ModelSolver ;;We need to use a seprate SolverPipeFileDir var on Linux systems because ModelSolver
;; (unfortunately) does not use a platform specific directory separator... ;; (unfortunately) does not use a platform specific directory separator...
;; it uses \\ for outputting PipeID ;; it uses \\ for outputting PipeID
#+:windows (defvar *SolverPipeFileDir* *HumMoDir*) #+:windows (defvar *SolverPipeFileDir* *HumMoDir*)
#+:unix (defvar *SolverPipeFileDir* (substitute #\\ #\/ *HumModDir* :from-end t :count 1)) #+:unix (defvar *SolverPipeFileDir* (substitute #\\ #\/ *HumModDir* :from-end t :count 1))
#+:unix (setf *SolverPipeFileDir* (format nil "~a\\" *SolverPipeFileDir*)) #+:unix (setf *SolverPipeFileDir* (format nil "~a\\" *SolverPipeFileDir*))
...@@ -971,7 +971,7 @@ t) ...@@ -971,7 +971,7 @@ t)
;Write to output file if we are testing things ;Write to output file if we are testing things
(if test (if test
(with-open-file (with-open-file
(msgStream (concatenate 'string "CRH-Raw" *START-TIME* ".txt") (msgStream (concatenate 'string "Phys-data/CRH-Raw" (phys-module-pipeID phys) ".txt")
:direction :output :if-exists :append :if-does-not-exist :create) :direction :output :if-exists :append :if-does-not-exist :create)
(format msgStream "~S~T~10$~T~10$~&" crh-stress crh crh-base))) (format msgStream "~S~T~10$~T~10$~&" crh-stress crh crh-base)))
;Return the CRH factor or 0 if less than 0 ;Return the CRH factor or 0 if less than 0
...@@ -990,7 +990,7 @@ t) ...@@ -990,7 +990,7 @@ t)
;Write to output file if we are testing things ;Write to output file if we are testing things
(if test (if test
(with-open-file (with-open-file
(msgStream (concatenate 'string "EPI-RAW" *START-TIME* ".txt") (msgStream (concatenate 'string "Phys-data/EPI-RAW" (phys-module-pipeID phys) ".txt")
:direction :output :if-exists :append :if-does-not-exist :create) :direction :output :if-exists :append :if-does-not-exist :create)
(format msgStream "~10$~T~10$~&" epi epi-base))) (format msgStream "~10$~T~10$~&" epi epi-base)))
;Return the epi factor or 0 if less than 0 ;Return the epi factor or 0 if less than 0
...@@ -1057,7 +1057,7 @@ t) ...@@ -1057,7 +1057,7 @@ t)
;Write to output file if we are testing things ;Write to output file if we are testing things
(if test (if test
(with-open-file (with-open-file
(msgStream (concatenate 'string "CORT-RAW" *START-TIME* ".txt") (msgStream (concatenate 'string "Phys-data/CORT-RAW" (phys-module-pipeID phys) ".txt")
:direction :output :if-exists :append :if-does-not-exist :create) :direction :output :if-exists :append :if-does-not-exist :create)
(format msgStream "~5$~T~5$~T~5$~T~5$~&" cort cort-base cort-ratio cort-ratio-base))) (format msgStream "~5$~T~5$~T~5$~T~5$~&" cort cort-base cort-ratio cort-ratio-base)))
;Return the cort factor or 0 if less than 0 ;Return the cort factor or 0 if less than 0
......
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