Skip to content

Commit

Permalink
simulation: added --slowdown option to viz
Browse files Browse the repository at this point in the history
  • Loading branch information
Saizan committed Dec 19, 2024
1 parent ba09d21 commit 3aa1cf1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions simulation/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ parserOptions =

runVizCommand :: VizCommand -> IO ()
runVizCommand opt@VizCommandWithOptions{..} = do
viz <- vizOptionsToViz opt
viz0 <- vizOptionsToViz opt
let viz = maybe viz0 ((`slowmoVisualization` viz0) . secondsToDiffTime) vizSlowDown
case vizOutputFramesDir of
Nothing ->
let gtkVizConfig =
Expand All @@ -115,6 +116,7 @@ data VizCommand = VizCommandWithOptions
, vizOutputStartTime :: Maybe Int
, vizCpuRendering :: Bool
, vizSize :: Maybe VizSize
, vizSlowDown :: Maybe Double
}

parserVizCommand :: Parser VizCommand
Expand Down Expand Up @@ -149,7 +151,14 @@ parserVizCommand =
<> help "Use CPU-based client side Cairo rendering"
)
<*> optional vizSizeOptions

<*> optional
( option
auto
( long "slowdown"
<> metavar "R"
<> help "Simulation time speed multiplier, applied on top of predefined speed."
)
)
data VizSubCommand
= VizTCP1
| VizTCP2
Expand Down

0 comments on commit 3aa1cf1

Please sign in to comment.