Skip to content

Commit

Permalink
feat: increase max sim cycle to 10k and adjusted scrollbar thumb posi…
Browse files Browse the repository at this point in the history
…tioning
  • Loading branch information
samuelpswang authored and tomcl committed Aug 5, 2024
1 parent 1064c1f commit 100315c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Renderer/UI/ModelHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ open Optics.Operators

module Constants =
/// TODO: Remove this limit, after making simulation interruptable This stops the waveform simulator moving past 1000 clock cycles.
let maxLastClk = 2000
let maxLastClk = 10000
/// Needed to prevent possible overrun of simulation arrays
let maxStepsOverflow = 3

Expand Down
6 changes: 2 additions & 4 deletions src/Renderer/UI/WaveSim/WaveSim.fs
Original file line number Diff line number Diff line change
Expand Up @@ -942,17 +942,15 @@ let generateScrollbarInfo (wsm: WaveSimModel): {| tbWidth: float; tbPos: float;
let tbWidth = max tbCalcWidth WaveSimStyle.Constants.scrollbarThumbMinWidth

let tbMoveWidth = bkgWidth - tbWidth
let tbPos =
if tbWidth > WaveSimStyle.Constants.scrollbarThumbMinWidth
then (float wsm.StartCycle) / (float newBkgRep - float wsm.ShownCycles) * tbMoveWidth
else (float wsm.CurrClkCycle) / (float newBkgRep-1.) * tbMoveWidth
let tbPos = (float wsm.StartCycle) / (float newBkgRep - float wsm.ShownCycles) * tbMoveWidth

// debug statements:
// printfn "DEBUG:generateScrollbarInfo: Input -"
// printfn "DEBUG:generateScrollbarInfo: wsm.CurrClkCycle = %d cycles" wsm.CurrClkCycle
// printfn "DEBUG:generateScrollbarInfo: wsm.StartCycle = %d cycles" wsm.StartCycle
// printfn "DEBUG:generateScrollbarInfo: wsm.ShownCycles = %d cycles" wsm.ShownCycles
// printfn "DEBUG:generateScrollbarInfo: wsm.ScrollbarBkgRepCycs = %d cycles" wsm.ScrollbarBkgRepCycs
// printfn "DEBUG:generateScrollbarInfo: bkgWidth = %.1f cycles" bkgWidth
// printfn "DEBUG:generateScrollbarInfo: Output -"
// printfn "DEBUG:generateScrollbarInfo: tbWidth = %.1fpx" tbWidth
// printfn "DEBUG:generateScrollbarInfo: tbPos = %.1fpx" tbPos
Expand Down

0 comments on commit 100315c

Please sign in to comment.