]> git.earman.xyz Git - lisp/workenv.git/commitdiff
Better names and formatting
authorrearman <rearman@r717.net>
Wed, 10 Sep 2025 20:27:14 +0000 (16:27 -0400)
committerrearman <rearman@r717.net>
Wed, 10 Sep 2025 20:27:14 +0000 (16:27 -0400)
plc.lisp
refrigeration.lisp

index 277ea5f4f26e00da7fafe27b73d3f79137eccd28..344b44ecae4c5d5ce45c7202a3e348e8dde13906 100644 (file)
--- a/plc.lisp
+++ b/plc.lisp
@@ -2,13 +2,13 @@
 (defparameter *resolution* 16)
 (defparameter *impedance* 249)
 
-(defun 13B () (setq *resolution* 13 *volt-max* 10.0))
-(defun 16B () (setq *resolution* 16 *volt-max* 10.0))
+(defun 13-bit! () (setq *resolution* 13 *volt-max* 10.0))
+(defun 16-bit! () (setq *resolution* 16 *volt-max* 10.0))
 
-(defalias P3K 16B)
-(defalias SLC 16B)
-(defalias P1K 13B)
-(defalias DL4 13B)
+(defalias p3k! 16-bit!)
+(defalias slc! 16-bit!)
+(defalias p1k! 13-bit!)
+(defalias dl4! 13-bit!)
 
 (defun max-counts (resolution) (- (^ 2 resolution) 1))
 
index c5cad7266011b93a60be5cfdc277ac44d15c61fd..ac025e2eb542cdd488f5b0c019a06b7352ed62a7 100644 (file)
@@ -1,20 +1,21 @@
 (defun cfm-circ (fpm radius) (float (* pi fpm (square (/ radius 12)))))
 
-(defun cfm-rect (fpm width height) (float (* fpm (/ width 12) (/ height 12))))
+(defun cfm-rect (fpm width height)
+  (float (* fpm (/ width 12) (/ height 12))))
 
 (defun sat-water-press (temp)
-       (+ 0.0182795
-               (* temp 0.001029904)
-               (* (square temp) 2.579408e-05)
-               (* (cube temp) 2.400493e-07)
-               (* (^ temp 4) 8.100939e-10)
-               (* (^ temp 5) 3.256805e-11)
-               (* (^ temp 6) -1.001922e-13)
-               (* (^ temp 7) 2.44161e-16)))
+  (+ 0.0182795
+     (* temp 0.001029904)
+     (* (square temp) 2.579408e-05)
+     (* (cube temp) 2.400493e-07)
+     (* (^ temp 4) 8.100939e-10)
+     (* (^ temp 5) 3.256805e-11)
+     (* (^ temp 6) -1.001922e-13)
+     (* (^ temp 7) 2.44161e-16)))
 
 (defun hum-ratio (humidity swp)
-       (let ((hum-press (* (/ humidity 100.0) swp)))
-               (/ (* hum-press 0.62198) (- 14.7 hum-press))))
+  (let ((hum-press (* (/ humidity 100.0) swp)))
+    (/ (* hum-press 0.62198) (- 14.7 hum-press))))
 
 (defun gn-water-per-lb (humidity temp)
-       (* 7000 (hum-ratio humidity (sat-water-press temp))))
+  (* 7000 (hum-ratio humidity (sat-water-press temp))))