package hardcaml_waveterm
A terminal based digital waveform viewer for Hardcaml
Install
Dune Dependency
Authors
Maintainers
Sources
hardcaml_waveterm-v0.14.0.tar.gz
sha256=6651b37191cfb0f7744be383a79f5906415cb9ca77b6809c4fce075964bfda6d
md5=f43ed06620989b92f4a5a4a2024c1866
doc/src/hardcaml_waveterm/waves.ml.html
Source file waves.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
open! Import module Config = struct type t = { mutable wave_width : int ; mutable wave_height : int ; mutable start_cycle : int ; mutable start_signal : int ; mutable wave_cursor : int ; mutable signal_cursor : int ; mutable signal_scroll : int ; mutable value_scroll : int } [@@deriving sexp_of] let default = { wave_width = 3 ; wave_height = 1 ; start_cycle = 0 ; start_signal = 0 ; wave_cursor = -1 ; signal_cursor = -1 ; signal_scroll = 0 ; value_scroll = 0 } ;; end type t = { cfg : Config.t ; waves : Wave.t array } [@@deriving sexp_of] let write ch w = let w = { w with waves = Array.map ~f:(fun (d : Wave.t) -> (match d with | Empty _ | Clock _ -> d | Binary (n, d) -> Binary (n, { d with Data.data = Array.init d.length ~f:(Array.get d.data) }) | Data (n, d, ts, alignment) -> let ts = match ts with | Custom _ -> Wave_format.Binary | _ -> ts in (* cant marshal functions *) Data ( n , { d with data = Array.init d.length ~f:(Array.get d.data) } , ts , alignment ) : Wave.t)) w.waves } in Caml.Marshal.to_channel ch w [] ;; let read ch : t = Caml.Marshal.from_channel ch
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>