\chapter{Waveform Views}

A waveform view is a 2D graph of a signal or protocol decode within a waveform group.

\section{Navigation}

Scrolling with the mouse wheel adjusts the horizontal scale of the current waveform group, zooming in or out centered
on the position of the mouse cursor.

Pressing SHIFT while scrolling moves the view left and right without adjusting zoom. If your mouse has a horizontal
scroll feature, this may also be used to pan without zooming.

\section{Plot Area}

The plot area shows the waveform being displayed. The background has a subtle gradient from light at top to dark at
bottom, in order to visually separate adjacent waveform view within the same group.

The horizontal grid lines line up with the voltage scale markings on the Y axis. If the plot area includes Y=0, the
grid line for zero is slightly brighter.

\begin{figure}[H]
\centering
\includegraphics[width=10cm]{images/waveform-graph.png}
\caption{Waveform plot area}
\label{waveform-graph}
\end{figure}

The waveform is drawn as a semi-transparent line so that when zoomed out, the density of voltage at various points in
the graph may be seen as lighter or darker areas. This is referred to as ``intensity grading".

\begin{figure}[H]
\centering
\includegraphics[width=10cm]{images/graded-waveform.png}
\caption{Intensity-graded waveform}
\label{graded-waveform2}
\end{figure}

\section{Y Axis Scale}

Each waveform view has its own Y axis scale, which is locked to the ADC range of the instrument.

If the waveform view is connected to a physical channel of an instrument, the gain may be configured by scrolling with
the mouse wheel, and the offset may be adjusted by dragging with the left mouse button. If the view is displaying the
output of a filter block, gain and offset are set by the filter and generally not adjustable, although some (such as
FFTs) do allow adjustment.

If a left-pointing arrow (as seen in Fig. \ref{y-axis}) is visible, the current channel is selected as a trigger
source. Click on the arrow and drag up or down to select the trigger level. Some trigger types, such as window triggers,
have two arrows for upper and lower levels.

\begin{figure}[H]
\centering
\includegraphics[height=3cm]{images/y-axis.png}
\caption{Y axis of a waveform view showing trigger arrow}
\label{y-axis}
\end{figure}

\section{Channel Information Box}

The channel information box is displayed in the lower left corner of each waveform view. It contains summary
information about the channel. Currently this is the display name of the channel, the sample rate, and the record
length of the acquisition. Other information, such as probe coupling, may be displayed there in the future.

\begin{figure}[H]
\centering
\includegraphics[width=2cm]{images/channel-infobox.png}
\caption{Channel information box}
\label{channel-infobox}
\end{figure}

The information box may be dragged with the left mouse button to move the entire waveform view to a new location.

Double-clicking the information box opens the channel properties dialog (Fig. \ref{channel-properties}). This dialog
allows changing of the channel's nickname or color. The ``hardware name" of the channel is also displayed, so that a
renamed channel can be easily traced back to a physical instrument input.

\begin{figure}[H]
\centering
\includegraphics[width=8cm]{images/channel-properties.png}
\caption{Channel properties dialog}
\label{channel-properties}
\end{figure}

\section{Overlays}

Waveforms may have additional information overlaid on top of them, such as protocol decodes. Each overlay has its own
information box, which may be double-clicked to open the properties dialog and configure it just like any other
channel.

Fig. \ref{overlays} shows
an example of an analog waveform with three overlays: thresholding it to NRZ digital, recovering a sampling
clock with a CDR PLL, and finally decoding the serial NRZ data stream to TMDS protocol data and control events.

\begin{figure}[H]
\centering
\includegraphics[width=14cm]{images/overlays.png}
\caption{Waveform showing two digital overlays and a data decode overlay}
\label{overlays}
\end{figure}

Overlays can be deleted by means of the right-click context menu. Dragging the information box with the left mouse
button allows overlays to be reordered, however they cannot currently be moved to another waveform view.

\section{Statistics}

Statistics may be shown for any waveform by checking the ``statistics" box in the context menu. The default statistics
are minimum, average, and maximum although more may be added in the future.
