summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-06-07 19:10:21 +0200
committerThomas White <taw@physics.org>2020-06-07 19:10:21 +0200
commit99ef3632a99b26cd92ea142c4b51f16e88253599 (patch)
tree6f242129291fabb5853ca79fad728adeefc45af9
parentfde532557f4b42d8ea24404543156291ddbce147 (diff)
Set all attributes to home values at the start
-rw-r--r--guile/nanolight/fixture.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guile/nanolight/fixture.scm b/guile/nanolight/fixture.scm
index b532e8b..ff45c22 100644
--- a/guile/nanolight/fixture.scm
+++ b/guile/nanolight/fixture.scm
@@ -104,12 +104,24 @@
(fixture-address-string fix)))
+(define (home-attribute attr)
+ (let ((attr-home-value (home-value attr)))
+ (set-value-func! attr (lambda () attr-home-value))))
+
+
+(define (home-all-attributes fix)
+ (for-each
+ home-attribute
+ (attributes fix)))
+
+
(define (patch-fixture output attributes universe start-addr friendly-name)
(let ((new-fixture (make <fixture>
#:attributes (copy-tree attributes)
#:uni universe
#:sa start-addr
#:friendly-name friendly-name)))
+ (home-all-attributes new-fixture)
(output 'add-fixture new-fixture)
new-fixture))