Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions forge/server/modelToXML.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@
; Possibly annotate the XML with instructions on where to find visualization info.
; The option supports a _list_ of files, so Racket needs to disambiguate.
(define (sterling-viz-to-xml run-options)
(define rs-opt (hash-ref run-options 'run_sterling))
; The dedicated 'sterling_viz option holds the viz file(s); it applies regardless of the
; Sterling open mode (browser/headless/webview). For backward compatibility, fall back to a
; legacy viz path/list left in 'run_sterling (its string/list form).
(define sv-opt (and run-options (hash-ref run-options 'sterling_viz #f)))
(define rs-opt (and run-options (hash-ref run-options 'run_sterling #f)))
(define viz-opt (or sv-opt
(and (or (string? rs-opt) (list? rs-opt)) rs-opt)))
(define (single-path-to-xml p)
(cond [(and (string? p) (file-exists? p))
; the forge expander makes this an absolute path (see OptionDecl)
Expand All @@ -100,14 +106,14 @@
""])]
[(string? p)
; provided a path string, but there is no such file; show a warning but continue to load Sterling
(printf "A visualizer file in option run_sterling could not be found. Ignoring: ~a~n" p)
(printf "A visualizer file (option sterling_viz / run_sterling) could not be found. Ignoring: ~a~n" p)
""]
[else
""]))
(cond
[(not run-options) ""]
[(string? rs-opt) (single-path-to-xml rs-opt)]
[(list? rs-opt) (apply string-append (map single-path-to-xml rs-opt))]
[(string? viz-opt) (single-path-to-xml viz-opt)]
[(list? viz-opt) (apply string-append (map single-path-to-xml viz-opt))]
[else ""]))

(define (clean ele)
Expand Down
11 changes: 10 additions & 1 deletion forge/sigs-functional.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,16 @@
[(and (list? value) original-path)
(map translate-single-path value)]
[else value]))]
[else
; sterling_viz holds a viz-script path (or list of paths) to auto-load in Sterling.
; Translate it relative to the model file, exactly like run_sterling's legacy path form.
[(equal? option 'sterling_viz)
(hash-set options 'sterling_viz (cond
[(and (string? value) original-path)
(translate-single-path value)]
[(and (list? value) original-path)
(map translate-single-path value)]
[else value]))]
[else
(hash-set options option value)]))

(struct-copy State state
Expand Down
6 changes: 6 additions & 0 deletions forge/sigs-structs.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
'skolem_depth 0
'local_necessity 'off
'run_sterling 'on
'sterling_viz #f
'sterling_port 0
'sterling_static_port 0
'engine_verbosity 1
Expand Down Expand Up @@ -315,6 +316,10 @@
(string? x)
(and (list? x)
(andmap (lambda (ele) (string? ele)) x))))
'sterling_viz (lambda (x) (or (not x)
(string? x)
(and (list? x)
(andmap (lambda (ele) (string? ele)) x))))
'sterling_port exact-nonnegative-integer?
'sterling_static_port exact-nonnegative-integer?
'engine_verbosity exact-nonnegative-integer?
Expand All @@ -337,6 +342,7 @@
'skolem_depth "integer"
'local_necessity "symbol"
'run_sterling "symbol, string, or sequence of strings"
'sterling_viz "string, sequence of strings, or #f"
'sterling_port "non-negative integer"
'sterling_static_port "non-negative integer"
'engine_verbosity "non-negative integer"
Expand Down
Binary file removed forge/sterling/build/04d1e2761f9f35056f4d.woff2
Binary file not shown.
2 changes: 0 additions & 2 deletions forge/sterling/build/1065.bundle.js

This file was deleted.

6 changes: 0 additions & 6 deletions forge/sterling/build/1065.bundle.js.LICENSE.txt

This file was deleted.

2 changes: 0 additions & 2 deletions forge/sterling/build/1134.bundle.js

This file was deleted.

6 changes: 0 additions & 6 deletions forge/sterling/build/1134.bundle.js.LICENSE.txt

This file was deleted.

2 changes: 0 additions & 2 deletions forge/sterling/build/1147.bundle.js

This file was deleted.

6 changes: 0 additions & 6 deletions forge/sterling/build/1147.bundle.js.LICENSE.txt

This file was deleted.

2 changes: 0 additions & 2 deletions forge/sterling/build/1156.bundle.js

This file was deleted.

6 changes: 0 additions & 6 deletions forge/sterling/build/1156.bundle.js.LICENSE.txt

This file was deleted.

Loading
Loading