Header menu logo issie

WaveSimNavigation Module

All the code that determines which clock cycles are viewed in the simulator. basic functions are zooming and panning (moving + or - in time). Additional function is a sample-based zoom for viewing very long waveforms.. Also implement cursor control.

Functions and values

Function or value Description

changeMultiplier newMultiplier ws

Full Usage: changeMultiplier newMultiplier ws

Parameters:
Returns: WaveSimModel
newMultiplier : int
ws : WaveSimModel
Returns: WaveSimModel

changeZoom wsModel zoomIn dispatch

Full Usage: changeZoom wsModel zoomIn dispatch

Parameters:

If zoomIn, then increase width of clock cycles (i.e.reduce number of visible cycles). otherwise reduce width. GenerateWaveforms message will reconstitute SVGs after the change.

wsModel : WaveSimModel
zoomIn : bool
dispatch : Msg -> unit

clkCycleButtons wsModel dispatch

Full Usage: clkCycleButtons wsModel dispatch

Parameters:
Returns: ReactElement

Click on these to change the highlighted clock cycle.

wsModel : WaveSimModel
dispatch : Msg -> unit
Returns: ReactElement

generateScrollbarInfo wsm

Full Usage: generateScrollbarInfo wsm

Parameters:
Returns: (type) Anonymous record contaning the information to be updated: thumb width, thumb position, and number of cycles the background represents.

Generate scrollbar SVG info based on current WaveSimModel. Called in refreshWaveSim after WaveSimModel has been changed.

Note: bkg = background; tb = thumb.

wsm : WaveSimModel

Target WaveSimModel.

Returns: (type)

Anonymous record contaning the information to be updated: thumb width, thumb position, and number of cycles the background represents.

makeScrollbar wsm dispatch

Full Usage: makeScrollbar wsm dispatch

Parameters:
    wsm : WaveSimModel - Target WaveSimModel.
    dispatch : Msg -> unit - Dispatch function to send messages with. Not used directly, but passed to tbMouseMoveOp.

Returns: ReactElement React element to be placed in to DOM.

Make scrollbar element based on information in WaveSimModel. Called in viewWaveSim, presumably after refreshWaveSim was called.

wsm : WaveSimModel

Target WaveSimModel.

dispatch : Msg -> unit

Dispatch function to send messages with. Not used directly, but passed to tbMouseMoveOp.

Returns: ReactElement

React element to be placed in to DOM.

multiplierMenuButton wsModel dispatch

Full Usage: multiplierMenuButton wsModel dispatch

Parameters:
Returns: ReactElement
wsModel : WaveSimModel
dispatch : Msg -> unit
Returns: ReactElement

setClkCycle wsModel dispatch newRealClkCycle

Full Usage: setClkCycle wsModel dispatch newRealClkCycle

Parameters:
wsModel : WaveSimModel
dispatch : Msg -> unit
newRealClkCycle : int

setClkCycleMsg wsModel newRealClkCycle

Full Usage: setClkCycleMsg wsModel newRealClkCycle

Parameters:
Returns: Msg

Return a Msg that will set highlighted clock cycle number

wsModel : WaveSimModel
newRealClkCycle : int
Returns: Msg

setScrollbarLastX wsm dispatch isEmpty

Full Usage: setScrollbarLastX wsm dispatch isEmpty

Parameters:
    wsm : WaveSimModel - Target WaveSimModel.
    dispatch : Msg -> unit - Dispatch function to send messages with.
    isEmpty : bool - Bool to be written to WaveSimModel.ScrollbarQueueIsEmpty.

Update WaveSimModel with new ScrollbarQueueIsEmpty. Used to update is-empty counter to coalesce scrollbar mouse events together. Update is achieved by dispatching a UpdateWSModel message, so as to not clog the queue with GenerateWaveforms messages.

wsm : WaveSimModel

Target WaveSimModel.

dispatch : Msg -> unit

Dispatch function to send messages with.

isEmpty : bool

Bool to be written to WaveSimModel.ScrollbarQueueIsEmpty.

setScrollbarOffset wsm dispatch offset

Full Usage: setScrollbarOffset wsm dispatch offset

Parameters:
    wsm : WaveSimModel - Target WaveSimModel.
    dispatch : Msg -> unit - Dispatch function to send messages with.
    offset : float option - Offset option to be written to WaveSimModel.ScrollbarTbOffset.

Update WaveSimModel with new ScrollbarTbOffset. Used when starting or clearing scrollbar drag mode. Update is achieved by dispatching a GenerateWaveforms message.

wsm : WaveSimModel

Target WaveSimModel.

dispatch : Msg -> unit

Dispatch function to send messages with.

offset : float option

Offset option to be written to WaveSimModel.ScrollbarTbOffset.

setScrollbarTbByCycs wsm dispatch moveByCycs

Full Usage: setScrollbarTbByCycs wsm dispatch moveByCycs

Parameters:
    wsm : WaveSimModel - Target WaveSimModel.
    dispatch : Msg -> unit - Dispatch function to send messages with.
    moveByCycs : float - Number of non-integer cycles to move by.

Move waveform view window by closest integer number of cycles. Current clock cycle (WaveSimModel.CurrClkCycle) is set to beginning or end depending on direction of movement. Update is achieved by dispatching a GenerateWaveforms message. Note the side-effect of clearing the ScrollbarQueueIsEmpty counter.

wsm : WaveSimModel

Target WaveSimModel.

dispatch : Msg -> unit

Dispatch function to send messages with.

moveByCycs : float

Number of non-integer cycles to move by.

setViewerWidthInWaveSim w dispatch

Full Usage: setViewerWidthInWaveSim w dispatch

Parameters:
    w : int
    dispatch : Msg -> unit

Modifiers: inline
w : int
dispatch : Msg -> unit

updateScrollbar wsm dispatch cursor action

Full Usage: updateScrollbar wsm dispatch cursor action

Parameters:
    wsm : WaveSimModel - Target WaveSimModel.
    dispatch : Msg -> unit - Dispatch function to send messages with, not used directly.
    cursor : float - Cursor postion in relation to the screen, i.e. event.clientX.
    action : ScrollbarMouseAction - Scrollbar action to do, see choices for more info, in type of ScrollbarMouseAction.

Update waveform view information based on mouse postion in the X direction. Called in update when ScrollbarMouseMsg is dispatched.

Note that screenX does NOT scale with web zoom and will cause weird results!

wsm : WaveSimModel

Target WaveSimModel.

dispatch : Msg -> unit

Dispatch function to send messages with, not used directly.

cursor : float

Cursor postion in relation to the screen, i.e. event.clientX.

action : ScrollbarMouseAction

Scrollbar action to do, see choices for more info, in type of ScrollbarMouseAction.

updateViewerWidthInWaveSim w model

Full Usage: updateViewerWidthInWaveSim w model

Parameters:
Returns: Model
Modifiers: inline
w : int
model : Model
Returns: Model

validateScrollBarInfo wsm

Full Usage: validateScrollBarInfo wsm

Parameters:
Returns: WaveSimModel

Make scrollbar parameters consistent with changed zoom. This assumes the scrollbar width has not changed, because that can only be calculated from the viewer width in model.

wsm : WaveSimModel
Returns: WaveSimModel

validateSimParas ws

Full Usage: validateSimParas ws

Parameters:
Returns: WaveSimModel

Must be called after any of the wavesim parameters are changed and before they are used to generate waveforms.

ws : WaveSimModel
Returns: WaveSimModel

zoomButtons wsModel dispatch

Full Usage: zoomButtons wsModel dispatch

Parameters:
Returns: ReactElement

Click on these buttons to change the number of visible clock cycles.

wsModel : WaveSimModel
dispatch : Msg -> unit
Returns: ReactElement

Type something to start searching.