Add simple scroll of long waveform

This commit is contained in:
Nikolay Puzanov 2022-12-08 19:06:08 +03:00
parent 664b7b1f5c
commit d04282e1c7
2 changed files with 20 additions and 5 deletions

View File

@ -119,6 +119,11 @@
width: 50%; width: 50%;
height: 100%; height: 100%;
} }
#logdiv pre {
position: absolute;
height: 100%;
}
} }
</style> </style>
</head> </head>

View File

@ -744,12 +744,22 @@
;;; ;;;
;;; Make log HTML ;;; Make log HTML
;;; ;;;
(define (make-log-html log vcd canvas-width) (define* (make-log-html log vcd canvas-width #:key
(minimum-sample-width 10)
(maximum-canvas-width 20000))
(if vcd (if vcd
(let ((need-width
(* minimum-sample-width
(length (vcd-timestamps vcd)))))
(format "~a<br/>\n<pre id=\"log\">~a</pre>\n" (format "~a<br/>\n<pre id=\"log\">~a</pre>\n"
(string-concatenate (string-concatenate
(vcd->svg vcd canvas-width)) (vcd->svg vcd
log) (if (< need-width canvas-width)
canvas-width
(if (> need-width maximum-canvas-width)
maximum-canvas-width
need-width))))
log))
(format "<pre>~a</pre>\n" log))) (format "<pre>~a</pre>\n" log)))
;;; ;;;